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

Public Member Functions

None __init__ (self)
None __init__ (self, ConstMesh arg0)
None addMesh (self, ConstMesh from_, ConstPartMapping map=..., bool rearrangeTriangles=False)
None addMesh (self, ConstMesh from_, FaceMap outFmap, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
None addMeshPart (self, ConstMeshPart from_, ConstPartMapping map, VacantElements vacant='{}')
bool addMeshPart (self, ConstMeshPart from_, bool flipOrientation=False, Const_std_vector_std_vector_Id_EdgeTag thisContours=..., Const_std_vector_std_vector_Id_EdgeTag fromContours=..., ConstPartMapping map=..., VacantElements vacant='{}')
VertId addPoint (self, ConstVector3f pos)
EdgeId addSeparateContours (self, Const_std_vector_std_vector_Vector3_float contours, ConstAffineXf3f xf=None)
EdgeId addSeparateEdgeLoop (self, Const_std_vector_Vector3_float contourPoints)
Mesh assign (self, ConstMesh other)
None attachEdgeLoopPart (self, ConstEdgeId first, ConstEdgeId last, Const_std_vector_Vector3_float contourPoints)
None deleteFaces (self, ConstFaceBitSet fs, ConstUndirectedEdgeBitSet keepEdges=None)
VacantElements deleteFacesFindVacant (self, ConstFaceBitSet fs, ConstUndirectedEdgeBitSet keepEdges=None)
None flipOrientation (self, ConstUndirectedEdgeBitSet fullComponents=None)
None invalidateCaches (self, bool pointsChanged=True)
None mirror (self, ConstPlane3f plane)
None pack (self, ConstPartMapping map=..., bool rearrangeTriangles=False)
None pack (self, FaceMap outFmap, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
None pack (self, ConstPackMapping map, Const_func_bool_from_float cb='{}')
PackMapping packOptimally (self, bool preserveAABBTree=True)
PackMapping packOptimally (self, bool preserveAABBTree, Const_func_bool_from_float cb)
None shrinkToFit (self)
EdgeId splitEdge (self, ConstEdgeId e, ConstVector3f newVertPos, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old=None)
EdgeId splitEdge (self, ConstEdgeId e, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old=None)
VertId splitFace (self, ConstFaceId f, ConstVector3f newVertPos, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old=None)
VertId splitFace (self, ConstFaceId f, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old=None)
None transform (self, ConstAffineXf3f xf, ConstVertBitSet region=None)
None updateCaches (self, ConstVertBitSet changedVerts)
None updateCachesAfterSplits (self, Const_phmap_flat_hash_map_Id_FaceTag_Id_FaceTag_phmap_Hash_Id_FaceTag_phmap_EqualTo_Id_FaceTag_Allocator_std_pair_Id_FaceTag_const_Id_FaceTag new2Old)
None zeroUnusedPoints (self)
VertCoords points (self)
None points (self, ConstVertCoords arg1)
MeshTopology topology (self)
None topology (self, ConstMeshTopology arg1)
Public Member Functions inherited from mrmeshpy.ConstMesh
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)

Static Public Member Functions

None __init__ (*args, **kwargs)
Static Public Member Functions inherited from mrmeshpy.ConstMesh
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='{}')

Additional Inherited Members

Static Protected Attributes inherited from mrmeshpy.ConstMesh
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__() [1/3]

None mrmeshpy.Mesh.__init__ ( * args,
** kwargs )
static

◆ __init__() [2/3]

None mrmeshpy.Mesh.__init__ ( self)

◆ __init__() [3/3]

None mrmeshpy.Mesh.__init__ ( self,
ConstMesh arg0 )
Implicit copy constructor.

Member Function Documentation

◆ addMesh() [1/2]

None mrmeshpy.Mesh.addMesh ( self,
ConstMesh from_,
ConstPartMapping map = ...,
bool rearrangeTriangles = False )
appends another mesh as separate connected component(s) to this

◆ addMesh() [2/2]

None mrmeshpy.Mesh.addMesh ( self,
ConstMesh from_,
FaceMap outFmap,
VertMap outVmap = None,
WholeEdgeMap outEmap = None,
bool rearrangeTriangles = False )

◆ addMeshPart() [1/2]

bool mrmeshpy.Mesh.addMeshPart ( self,
ConstMeshPart from_,
bool flipOrientation = False,
Const_std_vector_std_vector_Id_EdgeTag thisContours = ...,
Const_std_vector_std_vector_Id_EdgeTag fromContours = ...,
ConstPartMapping map = ...,
VacantElements vacant = '{}' )
appends whole or part of another mesh to this joining added faces with existed ones along given contours
\\param flipOrientation true means that every (from) triangle is inverted before adding
optional \\param vacant can be passed to copy elements not at the end, but over given ones, which the user guaranties to be free/lone
\\return false if the given contours cannot be stitched, and this mesh is left unmodified then
        (the src2tgt mappings in (map) argument can be partially filled nevertheless)

◆ addMeshPart() [2/2]

None mrmeshpy.Mesh.addMeshPart ( self,
ConstMeshPart from_,
ConstPartMapping map,
VacantElements vacant = '{}' )
appends whole or part of another mesh as separate connected component(s) to this
optional \\param vacant can be passed to copy elements not at the end, but over given ones, which the user guaranties to be free/lone

◆ addPoint()

VertId mrmeshpy.Mesh.addPoint ( self,
ConstVector3f pos )
creates new point and assigns given position to it

◆ addSeparateContours()

EdgeId mrmeshpy.Mesh.addSeparateContours ( self,
Const_std_vector_std_vector_Vector3_float contours,
ConstAffineXf3f xf = None )
append points to mesh and connect them
returns first EdgeId of new edges

◆ addSeparateEdgeLoop()

EdgeId mrmeshpy.Mesh.addSeparateEdgeLoop ( self,
Const_std_vector_Vector3_float contourPoints )
append points to mesh and connect them as closed edge loop
returns first EdgeId of new edges

◆ assign()

Mesh mrmeshpy.Mesh.assign ( self,
ConstMesh other )

◆ attachEdgeLoopPart()

None mrmeshpy.Mesh.attachEdgeLoopPart ( self,
ConstEdgeId first,
ConstEdgeId last,
Const_std_vector_Vector3_float contourPoints )
append points to mesh and connect them to given edges making edge loop
first point connects with first edge dest
last point connects with last edge org
note that first and last edge should have no left face

◆ deleteFaces()

None mrmeshpy.Mesh.deleteFaces ( self,
ConstFaceBitSet fs,
ConstUndirectedEdgeBitSet keepEdges = None )
deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces and not in \\param keepEdges;
the edges that had no left and no right face before the call are not touched, see MeshTopology::deleteFaces

◆ deleteFacesFindVacant()

VacantElements mrmeshpy.Mesh.deleteFacesFindVacant ( self,
ConstFaceBitSet fs,
ConstUndirectedEdgeBitSet keepEdges = None )
same as \\ref deleteFaces, but also makes lone all edges without faces in this mesh,
and returns bit sets of all vacant elements in this mesh after deletion, see MeshTopology::deleteFacesFindVacant

◆ flipOrientation()

None mrmeshpy.Mesh.flipOrientation ( self,
ConstUndirectedEdgeBitSet fullComponents = None )
changes the orientation of all triangles, or only of the components with given edges as MeshTopology::flipOrientation() does,
and updates existing AABB tree instead of rebuilding it

◆ invalidateCaches()

None mrmeshpy.Mesh.invalidateCaches ( self,
bool pointsChanged = True )
invalidates caches (aabb-trees) after any change in mesh geometry or topology
\\param pointsChanged specifies whether points have changed (otherwise only topology has changed)

◆ mirror()

None mrmeshpy.Mesh.mirror ( self,
ConstPlane3f plane )
reflects the mesh from a given plane

◆ pack() [1/3]

None mrmeshpy.Mesh.pack ( self,
ConstPackMapping map,
Const_func_bool_from_float cb = '{}' )
tightly packs all arrays eliminating lone edges and invalid faces, vertices and points,
reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping

◆ pack() [2/3]

None mrmeshpy.Mesh.pack ( self,
ConstPartMapping map = ...,
bool rearrangeTriangles = False )
tightly packs all arrays eliminating lone edges and invalid faces, vertices and points

◆ pack() [3/3]

None mrmeshpy.Mesh.pack ( self,
FaceMap outFmap,
VertMap outVmap = None,
WholeEdgeMap outEmap = None,
bool rearrangeTriangles = False )

◆ packOptimally() [1/2]

PackMapping mrmeshpy.Mesh.packOptimally ( self,
bool preserveAABBTree,
Const_func_bool_from_float cb )

◆ packOptimally() [2/2]

PackMapping mrmeshpy.Mesh.packOptimally ( self,
bool preserveAABBTree = True )
packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices
\\param preserveAABBTree whether to keep valid mesh's AABB tree after return (it will take longer to compute and it will occupy more memory);
an already constructed tree is used for faster ordering of faces in any case

◆ points() [1/2]

VertCoords mrmeshpy.Mesh.points ( self)

Reimplemented from mrmeshpy.ConstMesh.

◆ points() [2/2]

None mrmeshpy.Mesh.points ( self,
ConstVertCoords arg1 )

Reimplemented from mrmeshpy.ConstMesh.

◆ shrinkToFit()

None mrmeshpy.Mesh.shrinkToFit ( self)
requests the removal of unused capacity

◆ splitEdge() [1/2]

split given edge on two parts:
dest(returned-edge) = org(e) - newly created vertex,
org(returned-edge) = org(e-before-split),
dest(e) = dest(e-before-split)
\\details left and right faces of given edge if valid are also subdivided on two parts each;
the split edge will keep both face IDs and their degrees, and the new edge will have new face IDs and new faces are triangular;
if left or right faces of the original edge were in the region, then include new parts of these faces in the region
\\param new2Old receive mapping from newly appeared triangle to its original triangle (part to full)

◆ splitEdge() [2/2]

same, but split given edge on two equal parts

◆ splitFace() [1/2]

split given triangle on three triangles, introducing new vertex with given coordinates and connecting it to original triangle vertices;
if region is given, then it must include (f) and new faces will be added there as well
\\param new2Old receive mapping from newly appeared triangle to its original triangle (part to full)

◆ splitFace() [2/2]

same, putting new vertex in the centroid of original triangle

◆ topology() [1/2]

MeshTopology mrmeshpy.Mesh.topology ( self)

Reimplemented from mrmeshpy.ConstMesh.

◆ topology() [2/2]

None mrmeshpy.Mesh.topology ( self,
ConstMeshTopology arg1 )

Reimplemented from mrmeshpy.ConstMesh.

◆ transform()

None mrmeshpy.Mesh.transform ( self,
ConstAffineXf3f xf,
ConstVertBitSet region = None )
applies given transformation to specified vertices
if region is nullptr, all valid mesh vertices are used
\\snippet cpp-examples/MeshModification.dox.cpp MeshTransform

◆ updateCaches()

None mrmeshpy.Mesh.updateCaches ( self,
ConstVertBitSet changedVerts )
updates existing caches in case of few vertices were changed insignificantly,
and topology remained unchanged;
it shall be considered as a faster alternative to invalidateCaches() and following rebuild of trees
\\param changedVerts vertices with modified coordinates, nullptr means all valid vertices

◆ updateCachesAfterSplits()

updates existing caches after some faces were split into parts (e.g. by splitFace() or splitEdge()) with no other changes in the mesh;
it shall be considered as a faster alternative to invalidateCaches() and following rebuild of AABB tree
\\param new2Old maps every face appeared after the splits to the face it was split from (as filled by splitFace() and splitEdge());
it must contain only the splits made since the AABB tree was built or last updated: a map accumulated over several updates
would add the earlier faces to the tree once more

◆ zeroUnusedPoints()

None mrmeshpy.Mesh.zeroUnusedPoints ( self)
for all points not in topology.getValidVerts() sets coordinates to (0,0,0)

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