MeshLib Python Docs
Loading...
Searching...
No Matches
Inheritance diagram for mrmeshpy.ConstMesh:

Public Member Functions

bool __eq__ (self, ConstMesh b)
 __init__ (self, *args, **kwargs)
bool __ne__ (self, ConstMesh b)
float area (self, ConstFaceId f)
float area (self, ConstFaceBitSet fs=None)
float averageEdgeLength (self)
float calcFastWindingNumber (self, ConstVector3f pt, float beta=2)
float circumcircleDiameter (self, ConstFaceId f)
float circumcircleDiameterSq (self, ConstFaceId f)
Mesh cloneRegion (self, ConstFaceBitSet region, bool flipOrientation=False, ConstPartMapping map=...)
Box3f computeBoundingBox (self, ConstAffineXf3f toWorld=None)
Box3f computeBoundingBox (self, ConstFaceBitSet region, ConstAffineXf3f toWorld=None)
float cotan (self, ConstUndirectedEdgeId ue)
float dblArea (self, ConstFaceId f)
float dblArea (self, ConstVertId v)
Vector3f destPnt (self, ConstEdgeId e)
float dihedralAngle (self, ConstUndirectedEdgeId e)
float dihedralAngleCos (self, ConstUndirectedEdgeId e)
float dihedralAngleSin (self, ConstUndirectedEdgeId e)
Vector3d dirArea (self, ConstFaceBitSet fs=None)
Vector3f dirDblArea (self, ConstFaceId f)
Vector3f dirDblArea (self, ConstVertId v)
float discreteGaussianCurvature (self, ConstVertId v, bool_output outBoundaryVert=None)
VertScalars discreteGaussianCurvatures (self, ConstVertBitSet region=None)
float discreteMeanCurvature (self, ConstVertId v)
float discreteMeanCurvature (self, ConstUndirectedEdgeId e)
VertScalars discreteMeanCurvatures (self, ConstVertBitSet region=None)
Vector3f edgeCenter (self, ConstUndirectedEdgeId e)
float edgeLength (self, ConstUndirectedEdgeId e)
float edgeLengthSq (self, ConstUndirectedEdgeId e)
UndirectedEdgeScalars edgeLengths (self)
Vector3f edgePoint (self, ConstEdgeId e, float f)
Vector3f edgePoint (self, ConstEdgePoint ep)
LineSegm3f edgeSegment (self, ConstEdgeId e)
Vector3f edgeVector (self, ConstEdgeId e)
Vector3f findCenterFromBBox (self)
Vector3f findCenterFromFaces (self)
Vector3f findCenterFromPoints (self)
bool findClosestPoint (self, ConstVector3f point, MeshProjectionResult res, float maxDistSq=3.4028234663852886e+38, ConstFaceBitSet region=None, ConstAffineXf3f xf=None)
MeshProjectionResult findClosestPoint (self, ConstVector3f point, float maxDistSq=3.4028234663852886e+38, ConstFaceBitSet region=None, ConstAffineXf3f xf=None)
UndirectedEdgeBitSet findCreaseEdges (self, float angleFromPlanar)
UndirectedEdgeBitSet findSharpEdges (self, float minSharpCos, float maxSharpCos)
VertBitSet findSpikeVertices (self, float minSumAngle, ConstVertBitSet region=None, Const_func_bool_from_float cb='{}')
ConstAABBTree getAABBTree (self)
ConstAABBTree getAABBTreeNotCreate (self)
ConstAABBTreePoints getAABBTreePoints (self)
ConstAABBTreePoints getAABBTreePointsNotCreate (self)
Box3f getBoundingBox (self)
UndirectedEdgeId getClosestEdge (self, ConstPointOnFace p)
UndirectedEdgeId getClosestEdge (self, ConstMeshTriPoint p)
VertId getClosestVertex (self, ConstPointOnFace p)
VertId getClosestVertex (self, ConstMeshTriPoint p)
ConstDipoles getDipoles (self)
ConstDipoles getDipolesNotCreate (self)
None getLeftTriPoints (self, ConstEdgeId e, Vector3f v0, Vector3f v1, Vector3f v2)
std_array_Vector3_float_3 getLeftTriPoints (self, ConstEdgeId e)
Plane3d getPlane3d (self, ConstFaceId f)
Plane3f getPlane3f (self, ConstFaceId f)
None getTriPoints (self, ConstFaceId f, Vector3f v0, Vector3f v1, Vector3f v2)
std_array_Vector3_float_3 getTriPoints (self, ConstFaceId f)
int heapBytes (self)
Vector3d holeDirArea (self, ConstEdgeId e)
float holePerimeter (self, ConstEdgeId e)
bool isOutside (self, ConstVector3f pt, float windingNumberThreshold=0.5, float beta=2)
bool isOutsideByProjNorm (self, ConstVector3f pt, ConstMeshProjectionResult proj, ConstFaceBitSet region=None)
float leftCotan (self, ConstEdgeId e)
Vector3f leftDirDblArea (self, ConstEdgeId e)
Vector3f leftNormal (self, ConstEdgeId e)
Vector3f leftTangent (self, ConstEdgeId e)
Vector3f normal (self, ConstFaceId f)
Vector3f normal (self, ConstVertId v)
Vector3f normal (self, ConstMeshTriPoint p)
Vector3f orgPnt (self, ConstEdgeId e)
float projArea (self, ConstVector3f dir, ConstFaceBitSet fs=None)
bool projectPoint (self, ConstVector3f point, PointOnFace res, float maxDistSq=3.4028234663852886e+38, ConstFaceBitSet region=None, ConstAffineXf3f xf=None)
bool projectPoint (self, ConstVector3f point, MeshProjectionResult res, float maxDistSq=3.4028234663852886e+38, ConstFaceBitSet region=None, ConstAffineXf3f xf=None)
MeshProjectionResult projectPoint (self, ConstVector3f point, float maxDistSq=3.4028234663852886e+38, ConstFaceBitSet region=None, ConstAffineXf3f xf=None)
Vector3f pseudonormal (self, ConstVertId v, ConstFaceBitSet region=None)
Vector3f pseudonormal (self, ConstUndirectedEdgeId e, ConstFaceBitSet region=None)
Vector3f pseudonormal (self, ConstMeshTriPoint p, ConstFaceBitSet region=None)
QuadraticForm3f quadraticForm (self, ConstVertId v, bool angleWeigted, ConstFaceBitSet region=None, ConstUndirectedEdgeBitSet creases=None)
float signedDistance (self, ConstVector3f pt, ConstMeshProjectionResult proj, ConstFaceBitSet region=None)
float signedDistance (self, ConstVector3f pt)
float signedDistance (self, ConstVector3f pt, float maxDistSq, ConstFaceBitSet region=None)
float sumAngles (self, ConstVertId v, bool_output outBoundaryVert=None)
EdgePoint toEdgePoint (self, ConstVertId v)
EdgePoint toEdgePoint (self, ConstEdgeId e, ConstVector3f p)
MeshTriPoint toTriPoint (self, ConstVertId v)
MeshTriPoint toTriPoint (self, ConstFaceId f, ConstVector3f p)
MeshTriPoint toTriPoint (self, ConstPointOnFace p)
Vector3f triCenter (self, ConstFaceId f)
Vector3f triPoint (self, ConstMeshTriPoint p)
float triangleAspectRatio (self, ConstFaceId f)
float volume (self, ConstFaceBitSet region=None)
ConstVertCoords points (self)
ConstMeshTopology topology (self)

Static Public Member Functions

Mesh fromFaceSoup (ConstVertCoords vertexCoordinates, Const_std_vector_Id_VertTag verts, ConstVector_MeshBuilder_VertSpan_FaceId faces, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_float cb='{}')
Mesh fromPointTriples (Const_std_vector_std_array_Vector3_float_3ul posTriples, bool duplicateNonManifoldVertices)
Mesh fromTriMesh (TriMesh triMesh, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_float cb='{}')
Mesh fromTriangles (ConstVertCoords vertexCoordinates, ConstTriangulation t, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_float cb='{}')
Mesh fromTrianglesDuplicatingNonManifoldVertices (ConstVertCoords vertexCoordinates, Triangulation t, std_vector_MeshBuilder_VertDuplication dups=None, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont='{}')

Static Protected Attributes

typing _offsetof_points = 152
typing _offsetof_topology = 0

Detailed Description

Generated from:  MR::Mesh
Aliases:  std_shared_ptr_Mesh, std_shared_ptr_const_Mesh

This class represents a mesh, including topology (connectivity) information and point coordinates,
as well as some caches to accelerate search algorithms

Constructor & Destructor Documentation

◆ __init__()

mrmeshpy.ConstMesh.__init__ ( self,
* args,
** kwargs )
__init__(*args, **kwargs)
Overloaded function.

1. __init__(self: meshlib.mrmeshpy.ConstMesh) -> None

2. __init__(self: meshlib.mrmeshpy.ConstMesh, arg0: meshlib.mrmeshpy.ConstMesh) -> None

Implicit copy constructor.

3. __init__(self: meshlib.mrmeshpy.ConstMesh, : meshlib.mrmeshpy.ConstMesh) -> None

Member Function Documentation

◆ __eq__()

bool mrmeshpy.ConstMesh.__eq__ ( self,
ConstMesh b )
compare that two meshes are exactly the same

◆ __ne__()

bool mrmeshpy.ConstMesh.__ne__ ( self,
ConstMesh b )
compare that two meshes are exactly the same

◆ area() [1/2]

float mrmeshpy.ConstMesh.area ( self,
ConstFaceBitSet fs = None )
computes the area of given face-region (or whole mesh)

◆ area() [2/2]

float mrmeshpy.ConstMesh.area ( self,
ConstFaceId f )
returns the area of given face

◆ averageEdgeLength()

float mrmeshpy.ConstMesh.averageEdgeLength ( self)
computes average length of an edge in this mesh

◆ calcFastWindingNumber()

float mrmeshpy.ConstMesh.calcFastWindingNumber ( self,
ConstVector3f pt,
float beta = 2 )
computes generalized winding number in a point (pt), which is
* for closed mesh with normals outside: 1 inside, 0 outside;
* for planar mesh: 0.5 inside, -0.5 outside;
and in general is equal to (portion of solid angle where inside part of mesh is observable) minus (portion of solid angle where outside part of mesh is observable)
\\param beta determines the precision of fast approximation: the more the better, recommended value 2 or more

◆ circumcircleDiameter()

float mrmeshpy.ConstMesh.circumcircleDiameter ( self,
ConstFaceId f )
returns circumcircle diameter of given mesh triangle

◆ circumcircleDiameterSq()

float mrmeshpy.ConstMesh.circumcircleDiameterSq ( self,
ConstFaceId f )
returns squared circumcircle diameter of given mesh triangle

◆ cloneRegion()

Mesh mrmeshpy.ConstMesh.cloneRegion ( self,
ConstFaceBitSet region,
bool flipOrientation = False,
ConstPartMapping map = ... )
creates new mesh from given triangles of this mesh

◆ computeBoundingBox() [1/2]

Box3f mrmeshpy.ConstMesh.computeBoundingBox ( self,
ConstAffineXf3f toWorld = None )
passes through all valid vertices and finds the minimal bounding box containing all of them;
if toWorld transformation is given then returns minimal bounding box in world space

◆ computeBoundingBox() [2/2]

Box3f mrmeshpy.ConstMesh.computeBoundingBox ( self,
ConstFaceBitSet region,
ConstAffineXf3f toWorld = None )
passes through all given faces (or whole mesh if region == null) and finds the minimal bounding box containing all of them
if toWorld transformation is given then returns minimal bounding box in world space

◆ cotan()

float mrmeshpy.ConstMesh.cotan ( self,
ConstUndirectedEdgeId ue )
computes sum of cotangents of the angle in the left and right triangles opposite to given edge,
consider cotangents zero for not existing triangles

◆ dblArea() [1/2]

float mrmeshpy.ConstMesh.dblArea ( self,
ConstFaceId f )
returns twice the area of given face

◆ dblArea() [2/2]

float mrmeshpy.ConstMesh.dblArea ( self,
ConstVertId v )
computes the length of summed directed double areas of all triangles around given vertex

◆ destPnt()

Vector3f mrmeshpy.ConstMesh.destPnt ( self,
ConstEdgeId e )
returns coordinates of the edge destination

◆ dihedralAngle()

float mrmeshpy.ConstMesh.dihedralAngle ( self,
ConstUndirectedEdgeId e )
given an edge between two triangular faces, computes the dihedral angle between them:
0 if both faces are in the same plane,
positive if the faces form convex surface,
negative if the faces form concave surface;
please consider the usage of faster dihedralAngleSin(e) and dihedralAngleCos(e)

◆ dihedralAngleCos()

float mrmeshpy.ConstMesh.dihedralAngleCos ( self,
ConstUndirectedEdgeId e )
given an edge between two triangular faces, computes cosine of dihedral angle between them:
1 if both faces are in the same plane,
0 if the surface makes right angle turn at the edge,
-1 if the faces overlap one another

◆ dihedralAngleSin()

float mrmeshpy.ConstMesh.dihedralAngleSin ( self,
ConstUndirectedEdgeId e )
given an edge between two triangular faces, computes sine of dihedral angle between them:
0 if both faces are in the same plane,
positive if the faces form convex surface,
negative if the faces form concave surface

◆ dirArea()

Vector3d mrmeshpy.ConstMesh.dirArea ( self,
ConstFaceBitSet fs = None )
computes the sum of directed areas for faces from given region (or whole mesh)

◆ dirDblArea() [1/2]

Vector3f mrmeshpy.ConstMesh.dirDblArea ( self,
ConstFaceId f )
computes directed double area for a triangular face from its vertices

◆ dirDblArea() [2/2]

Vector3f mrmeshpy.ConstMesh.dirDblArea ( self,
ConstVertId v )
computes sum of directed double areas of all triangles around given vertex

◆ discreteGaussianCurvature()

float mrmeshpy.ConstMesh.discreteGaussianCurvature ( self,
ConstVertId v,
bool_output outBoundaryVert = None )
computes discrete Gaussian curvature (or angle defect) at given vertex,
which 0 in inner vertices on planar mesh parts and reaches 2*pi on needle's tip, see http://math.uchicago.edu/~may/REU2015/REUPapers/Upadhyay.pdf
optionally returns whether the vertex is on boundary

◆ discreteGaussianCurvatures()

VertScalars mrmeshpy.ConstMesh.discreteGaussianCurvatures ( self,
ConstVertBitSet region = None )
computes discrete Gaussian curvature (see discreteGaussianCurvature( v )) in the vertices of given region (or in all valid vertices if region is null),
and puts 0 in all other vertices

◆ discreteMeanCurvature() [1/2]

float mrmeshpy.ConstMesh.discreteMeanCurvature ( self,
ConstUndirectedEdgeId e )
computes discrete mean curvature in given edge, measures in length^-1;
0 for planar regions, positive for convex surface, negative for concave surface

◆ discreteMeanCurvature() [2/2]

float mrmeshpy.ConstMesh.discreteMeanCurvature ( self,
ConstVertId v )
computes discrete mean curvature in given vertex, measures in length^-1;
0 for planar regions, positive for convex surface, negative for concave surface

◆ discreteMeanCurvatures()

VertScalars mrmeshpy.ConstMesh.discreteMeanCurvatures ( self,
ConstVertBitSet region = None )
computes discrete mean curvature (see discreteMeanCurvature( v )) in the vertices of given region (or in all valid vertices if region is null),
and puts 0 in all other vertices

◆ edgeCenter()

Vector3f mrmeshpy.ConstMesh.edgeCenter ( self,
ConstUndirectedEdgeId e )
computes the center of given edge

◆ edgeLength()

float mrmeshpy.ConstMesh.edgeLength ( self,
ConstUndirectedEdgeId e )
returns Euclidean length of the edge

◆ edgeLengths()

UndirectedEdgeScalars mrmeshpy.ConstMesh.edgeLengths ( self)
computes and returns the lengths of all edges in the mesh

◆ edgeLengthSq()

float mrmeshpy.ConstMesh.edgeLengthSq ( self,
ConstUndirectedEdgeId e )
returns squared Euclidean length of the edge (faster to compute than length)

◆ edgePoint() [1/2]

Vector3f mrmeshpy.ConstMesh.edgePoint ( self,
ConstEdgeId e,
float f )
returns a point on the edge: origin point for f=0 and destination point for f=1

◆ edgePoint() [2/2]

Vector3f mrmeshpy.ConstMesh.edgePoint ( self,
ConstEdgePoint ep )
computes coordinates of point given as edge and relative position on it

◆ edgeSegment()

LineSegm3f mrmeshpy.ConstMesh.edgeSegment ( self,
ConstEdgeId e )
returns line segment of given edge

◆ edgeVector()

Vector3f mrmeshpy.ConstMesh.edgeVector ( self,
ConstEdgeId e )
returns vector equal to edge destination point minus edge origin point

◆ findCenterFromBBox()

Vector3f mrmeshpy.ConstMesh.findCenterFromBBox ( self)
computes bounding box and returns its center

◆ findCenterFromFaces()

Vector3f mrmeshpy.ConstMesh.findCenterFromFaces ( self)
computes center of mass considering that density of all triangles is the same

◆ findCenterFromPoints()

Vector3f mrmeshpy.ConstMesh.findCenterFromPoints ( self)
computes average position of all valid mesh vertices

◆ findClosestPoint() [1/2]

MeshProjectionResult mrmeshpy.ConstMesh.findClosestPoint ( self,
ConstVector3f point,
float maxDistSq = 3.4028234663852886e+38,
ConstFaceBitSet region = None,
ConstAffineXf3f xf = None )

◆ findClosestPoint() [2/2]

bool mrmeshpy.ConstMesh.findClosestPoint ( self,
ConstVector3f point,
MeshProjectionResult res,
float maxDistSq = 3.4028234663852886e+38,
ConstFaceBitSet region = None,
ConstAffineXf3f xf = None )

◆ findCreaseEdges()

UndirectedEdgeBitSet mrmeshpy.ConstMesh.findCreaseEdges ( self,
float angleFromPlanar )
finds all mesh edges where dihedral angle is distinct from planar PI angle on at least given value

◆ findSharpEdges()

UndirectedEdgeBitSet mrmeshpy.ConstMesh.findSharpEdges ( self,
float minSharpCos,
float maxSharpCos )
finds all mesh edges with the cosine of dihedral angle (see dihedralAngleCos) in [minSharpCos, maxSharpCos]

◆ findSpikeVertices()

VertBitSet mrmeshpy.ConstMesh.findSpikeVertices ( self,
float minSumAngle,
ConstVertBitSet region = None,
Const_func_bool_from_float cb = '{}' )
returns vertices where the sum of triangle angles is below given threshold

◆ fromFaceSoup()

Mesh mrmeshpy.ConstMesh.fromFaceSoup ( ConstVertCoords vertexCoordinates,
Const_std_vector_Id_VertTag verts,
ConstVector_MeshBuilder_VertSpan_FaceId faces,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_float cb = '{}' )
static
construct mesh from vertex coordinates and construct mesh topology from face soup,
where each face can have arbitrary degree (not only triangles);
all non-triangular faces will be automatically subdivided on triangles

◆ fromPointTriples()

Mesh mrmeshpy.ConstMesh.fromPointTriples ( Const_std_vector_std_array_Vector3_float_3ul posTriples,
bool duplicateNonManifoldVertices )
static
construct mesh from point triples;
\\param duplicateNonManifoldVertices = false, all coinciding points are given the same VertId in the result;
       duplicateNonManifoldVertices = true, it tries to avoid non-manifold vertices by creating duplicate vertices with same coordinates

◆ fromTriangles()

Mesh mrmeshpy.ConstMesh.fromTriangles ( ConstVertCoords vertexCoordinates,
ConstTriangulation t,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_float cb = '{}' )
static
construct mesh from vertex coordinates and a set of triangles with given ids

◆ fromTrianglesDuplicatingNonManifoldVertices()

Mesh mrmeshpy.ConstMesh.fromTrianglesDuplicatingNonManifoldVertices ( ConstVertCoords vertexCoordinates,
Triangulation t,
std_vector_MeshBuilder_VertDuplication dups = None,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont = '{}' )
static
construct mesh from vertex coordinates and a set of triangles with given ids;
unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices;
`betterCont` (if given) selects the best triangle among several possible continuations during the duplication

◆ fromTriMesh()

Mesh mrmeshpy.ConstMesh.fromTriMesh ( TriMesh triMesh,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_float cb = '{}' )
static
construct mesh from TriMesh representation

◆ getAABBTree()

ConstAABBTree mrmeshpy.ConstMesh.getAABBTree ( self)
returns cached aabb-tree of this mesh's triangles, creating it if it did not exist in a thread-safe manner

◆ getAABBTreeNotCreate()

ConstAABBTree mrmeshpy.ConstMesh.getAABBTreeNotCreate ( self)
returns cached aabb-tree of this mesh's triangles, but does not create it if it did not exist

◆ getAABBTreePoints()

ConstAABBTreePoints mrmeshpy.ConstMesh.getAABBTreePoints ( self)
returns cached aabb-tree for points of this mesh, creating it if it did not exist in a thread-safe manner

◆ getAABBTreePointsNotCreate()

ConstAABBTreePoints mrmeshpy.ConstMesh.getAABBTreePointsNotCreate ( self)
returns cached aabb-tree for points of this mesh, but does not create it if it did not exist

◆ getBoundingBox()

Box3f mrmeshpy.ConstMesh.getBoundingBox ( self)
returns the bounding box containing all valid vertices (the root box of AABBTree)
this bounding box is insignificantly bigger that minimal box due to AABB algorithms precision

◆ getClosestEdge() [1/2]

UndirectedEdgeId mrmeshpy.ConstMesh.getClosestEdge ( self,
ConstMeshTriPoint p )
returns one of three face edges, closest to given point

◆ getClosestEdge() [2/2]

UndirectedEdgeId mrmeshpy.ConstMesh.getClosestEdge ( self,
ConstPointOnFace p )
returns one of three face edges, closest to given point

◆ getClosestVertex() [1/2]

VertId mrmeshpy.ConstMesh.getClosestVertex ( self,
ConstMeshTriPoint p )
returns one of three face vertices, closest to given point

◆ getClosestVertex() [2/2]

VertId mrmeshpy.ConstMesh.getClosestVertex ( self,
ConstPointOnFace p )
returns one of three face vertices, closest to given point

◆ getDipoles()

ConstDipoles mrmeshpy.ConstMesh.getDipoles ( self)
returns cached dipoles of aabb-tree nodes for this mesh, creating it if it did not exist in a thread-safe manner

◆ getDipolesNotCreate()

ConstDipoles mrmeshpy.ConstMesh.getDipolesNotCreate ( self)
returns cached dipoles of aabb-tree nodes for this mesh, but does not create it if it did not exist

◆ getLeftTriPoints() [1/2]

std_array_Vector3_float_3 mrmeshpy.ConstMesh.getLeftTriPoints ( self,
ConstEdgeId e )
returns three points of left face of e: res[0] = orgPnt( e ), res[1] = destPnt( e )

◆ getLeftTriPoints() [2/2]

None mrmeshpy.ConstMesh.getLeftTriPoints ( self,
ConstEdgeId e,
Vector3f v0,
Vector3f v1,
Vector3f v2 )
returns three points of left face of e: v0 = orgPnt( e ), v1 = destPnt( e )

◆ getPlane3d()

Plane3d mrmeshpy.ConstMesh.getPlane3d ( self,
ConstFaceId f )

◆ getPlane3f()

Plane3f mrmeshpy.ConstMesh.getPlane3f ( self,
ConstFaceId f )
returns the plane containing given triangular face with normal looking outwards

◆ getTriPoints() [1/2]

std_array_Vector3_float_3 mrmeshpy.ConstMesh.getTriPoints ( self,
ConstFaceId f )
returns three points of given face

◆ getTriPoints() [2/2]

None mrmeshpy.ConstMesh.getTriPoints ( self,
ConstFaceId f,
Vector3f v0,
Vector3f v1,
Vector3f v2 )
returns three points of given face

◆ heapBytes()

int mrmeshpy.ConstMesh.heapBytes ( self)
returns the amount of memory this object occupies on heap

◆ holeDirArea()

Vector3d mrmeshpy.ConstMesh.holeDirArea ( self,
ConstEdgeId e )
computes directed area of the hole specified by one of its edges with no valid left face (left is hole);
if the hole is planar then returned vector is orthogonal to the plane pointing outside and its magnitude is equal to hole area

◆ holePerimeter()

float mrmeshpy.ConstMesh.holePerimeter ( self,
ConstEdgeId e )
computes the perimeter of the hole specified by one of its edges with no valid left face (left is hole)

◆ isOutside()

bool mrmeshpy.ConstMesh.isOutside ( self,
ConstVector3f pt,
float windingNumberThreshold = 0.5,
float beta = 2 )
computes whether a point (pt) is located outside the object surrounded by this mesh using generalized winding number
\\param beta determines the precision of winding number computation: the more the better, recommended value 2 or more

◆ isOutsideByProjNorm()

bool mrmeshpy.ConstMesh.isOutsideByProjNorm ( self,
ConstVector3f pt,
ConstMeshProjectionResult proj,
ConstFaceBitSet region = None )
computes whether a point (pt) is located outside the object surrounded by this mesh
using pseudonormal at the closest point to in on mesh (proj);
this method works much faster than \\ref isOutside but can return wrong sign if the closest point is located on self-intersecting part of the mesh

◆ leftCotan()

float mrmeshpy.ConstMesh.leftCotan ( self,
ConstEdgeId e )
computes cotangent of the angle in the left( e ) triangle opposite to e,
and returns 0 if left face does not exist

◆ leftDirDblArea()

Vector3f mrmeshpy.ConstMesh.leftDirDblArea ( self,
ConstEdgeId e )
computes directed double area of left triangular face of given edge

◆ leftNormal()

Vector3f mrmeshpy.ConstMesh.leftNormal ( self,
ConstEdgeId e )
computes triangular face normal from its vertices

◆ leftTangent()

Vector3f mrmeshpy.ConstMesh.leftTangent ( self,
ConstEdgeId e )
computes unit vector that is both orthogonal to given edge and to the normal of its left triangle, the vector is directed inside left triangle

◆ normal() [1/3]

Vector3f mrmeshpy.ConstMesh.normal ( self,
ConstFaceId f )
computes triangular face normal from its vertices

◆ normal() [2/3]

Vector3f mrmeshpy.ConstMesh.normal ( self,
ConstMeshTriPoint p )
computes normal in three vertices of p's triangle, then interpolates them using barycentric coordinates and normalizes again;
this is the same normal as in rendering with smooth shading

◆ normal() [3/3]

Vector3f mrmeshpy.ConstMesh.normal ( self,
ConstVertId v )
computes normal in a vertex using sum of directed areas of neighboring triangles

◆ orgPnt()

Vector3f mrmeshpy.ConstMesh.orgPnt ( self,
ConstEdgeId e )
returns coordinates of the edge origin

◆ points()

ConstVertCoords mrmeshpy.ConstMesh.points ( self)

Reimplemented in mrmeshpy.Mesh, and mrmeshpy.Mesh.

◆ projArea()

float mrmeshpy.ConstMesh.projArea ( self,
ConstVector3f dir,
ConstFaceBitSet fs = None )
computes the sum of absolute projected area of faces from given region (or whole mesh) as visible if look from given direction

◆ projectPoint() [1/3]

MeshProjectionResult mrmeshpy.ConstMesh.projectPoint ( self,
ConstVector3f point,
float maxDistSq = 3.4028234663852886e+38,
ConstFaceBitSet region = None,
ConstAffineXf3f xf = None )
finds the closest mesh point on this mesh (or its region) to given point;
\\param point source location to look the closest to
\\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
\\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
\\return found closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point
        or std::nullopt if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point

◆ projectPoint() [2/3]

bool mrmeshpy.ConstMesh.projectPoint ( self,
ConstVector3f point,
MeshProjectionResult res,
float maxDistSq = 3.4028234663852886e+38,
ConstFaceBitSet region = None,
ConstAffineXf3f xf = None )
finds the closest mesh point on this mesh (or its region) to given point;
\\param point source location to look the closest to
\\param res found closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point
\\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
\\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
\\return false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point

◆ projectPoint() [3/3]

bool mrmeshpy.ConstMesh.projectPoint ( self,
ConstVector3f point,
PointOnFace res,
float maxDistSq = 3.4028234663852886e+38,
ConstFaceBitSet region = None,
ConstAffineXf3f xf = None )
finds the closest mesh point on this mesh (or its region) to given point;
\\param point source location to look the closest to
\\param res found closest point including Euclidean coordinates and FaceId
\\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
\\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
\\return false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point

◆ pseudonormal() [1/3]

Vector3f mrmeshpy.ConstMesh.pseudonormal ( self,
ConstMeshTriPoint p,
ConstFaceBitSet region = None )
returns pseudonormal in corresponding face/edge/vertex for signed distance calculation
as suggested in the article "Signed Distance Computation Using the Angle Weighted Pseudonormal" by J. Andreas Baerentzen and Henrik Aanaes,
https://backend.orbit.dtu.dk/ws/portalfiles/portal/3977815/B_rentzen.pdf
unlike normal( const MeshTriPoint & p ), this is not a smooth function

◆ pseudonormal() [2/3]

Vector3f mrmeshpy.ConstMesh.pseudonormal ( self,
ConstUndirectedEdgeId e,
ConstFaceBitSet region = None )
computes normalized half sum of face normals sharing given edge (only (region) faces will be considered);

◆ pseudonormal() [3/3]

Vector3f mrmeshpy.ConstMesh.pseudonormal ( self,
ConstVertId v,
ConstFaceBitSet region = None )
computes angle-weighted sum of normals of incident faces of given vertex (only (region) faces will be considered);
the sum is normalized before returning

◆ quadraticForm()

QuadraticForm3f mrmeshpy.ConstMesh.quadraticForm ( self,
ConstVertId v,
bool angleWeigted,
ConstFaceBitSet region = None,
ConstUndirectedEdgeBitSet creases = None )
computes quadratic form in the vertex as the sum of squared distances from
1) planes of adjacent triangles, with the weight equal to the angle of adjacent triangle at this vertex divided on PI in case of angleWeigted=true;
2) lines of adjacent boundary and crease edges

◆ signedDistance() [1/3]

float mrmeshpy.ConstMesh.signedDistance ( self,
ConstVector3f pt )
given a point (pt) in 3D, computes the closest point on mesh, and
\\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh;
this method can return wrong sign if the closest point is located on self-intersecting part of the mesh

◆ signedDistance() [2/3]

float mrmeshpy.ConstMesh.signedDistance ( self,
ConstVector3f pt,
ConstMeshProjectionResult proj,
ConstFaceBitSet region = None )
given a point (pt) in 3D and the closest point to in on mesh (proj),
\\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh;
this method can return wrong sign if the closest point is located on self-intersecting part of the mesh

◆ signedDistance() [3/3]

float mrmeshpy.ConstMesh.signedDistance ( self,
ConstVector3f pt,
float maxDistSq,
ConstFaceBitSet region = None )
given a point (pt) in 3D, computes the closest point on mesh, and
\\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh;
  or std::nullopt if the projection point is not within maxDist;
this method can return wrong sign if the closest point is located on self-intersecting part of the mesh

◆ sumAngles()

float mrmeshpy.ConstMesh.sumAngles ( self,
ConstVertId v,
bool_output outBoundaryVert = None )
computes the sum of triangle angles at given vertex; optionally returns whether the vertex is on boundary

◆ toEdgePoint() [1/2]

EdgePoint mrmeshpy.ConstMesh.toEdgePoint ( self,
ConstEdgeId e,
ConstVector3f p )
converts edge and 3d point into edge-point representation

◆ toEdgePoint() [2/2]

EdgePoint mrmeshpy.ConstMesh.toEdgePoint ( self,
ConstVertId v )
converts vertex into edge-point representation

◆ topology()

ConstMeshTopology mrmeshpy.ConstMesh.topology ( self)

Reimplemented in mrmeshpy.Mesh, and mrmeshpy.Mesh.

◆ toTriPoint() [1/3]

MeshTriPoint mrmeshpy.ConstMesh.toTriPoint ( self,
ConstFaceId f,
ConstVector3f p )
converts face id and 3d point into barycentric representation

◆ toTriPoint() [2/3]

MeshTriPoint mrmeshpy.ConstMesh.toTriPoint ( self,
ConstPointOnFace p )
converts face id and 3d point into barycentric representation

◆ toTriPoint() [3/3]

MeshTriPoint mrmeshpy.ConstMesh.toTriPoint ( self,
ConstVertId v )
converts vertex into barycentric representation

◆ triangleAspectRatio()

float mrmeshpy.ConstMesh.triangleAspectRatio ( self,
ConstFaceId f )
returns aspect ratio of given mesh triangle equal to the ratio of the circum-radius to twice its in-radius

◆ triCenter()

Vector3f mrmeshpy.ConstMesh.triCenter ( self,
ConstFaceId f )
returns the centroid of given triangle

◆ triPoint()

Vector3f mrmeshpy.ConstMesh.triPoint ( self,
ConstMeshTriPoint p )
computes coordinates of point given as face and barycentric representation

◆ volume()

float mrmeshpy.ConstMesh.volume ( self,
ConstFaceBitSet region = None )
returns volume of the object surrounded by given region (or whole mesh if (region) is nullptr);
if the region has holes then each hole will be virtually filled by adding triangles for each edge and the hole's geometrical center

Member Data Documentation

◆ _offsetof_points

typing mrmeshpy.ConstMesh._offsetof_points = 152
staticprotected

◆ _offsetof_topology

typing mrmeshpy.ConstMesh._offsetof_topology = 0
staticprotected

The documentation for this class was generated from the following file: