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

Public Member Functions

None __init__ (self)
None __init__ (self, ConstMeshTopology arg0)
FaceId addFaceId (self)
None addPackedPart (self, ConstMeshTopology from_, ConstEdgeId toEdgeId, ConstFaceMap fmap, ConstVertMap vmap, int shiftFaceId=0)
None addPart (self, ConstMeshTopology from_, ConstPartMapping map=..., bool rearrangeTriangles=False)
None addPart (self, ConstMeshTopology from_, FaceMap outFmap=None, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
None addPartByMask (self, ConstMeshTopology from_, ConstFaceBitSet fromFaces, ConstPartMapping map=..., VacantElements vacant='{}')
bool addPartByMask (self, ConstMeshTopology from_, ConstFaceBitSet fromFaces, bool flipOrientation=False, Const_std_vector_std_vector_Id_EdgeTag thisContours=..., Const_std_vector_std_vector_Id_EdgeTag fromContours=..., ConstPartMapping map=..., VacantElements vacant='{}')
VertId addVertId (self)
MeshTopology assign (self, ConstMeshTopology other)
bool buildFromManifoldTriangles (self, ConstTriangulation t, MeshBuilder.ConstBuildSettings settings, bool_output nonManifoldVertsOnly=None)
bool buildGridMesh (self, ConstGridSettings settings, Const_func_bool_from_float cb='{}')
None clear (self)
EdgeId collapseEdge (self, ConstEdgeId e, Const_func_void_from_Id_EdgeTag_Id_EdgeTag onEdgeDel)
bool computeValidsFromEdges (self, Const_func_bool_from_float cb='{}')
None deleteFace (self, ConstFaceId f, ConstUndirectedEdgeBitSet keepEdges=None)
None deleteFaces (self, ConstFaceBitSet fs, ConstUndirectedEdgeBitSet keepEdges=None)
VacantElements deleteFacesFindVacant (self, ConstFaceBitSet fs, ConstUndirectedEdgeBitSet keepEdges=None)
None deleteFacesKeepEdges (self, ConstFaceBitSet fs)
None edgeReserve (self, int newCapacity)
None faceReserve (self, int newCapacity)
None faceResize (self, int newSize)
None faceResizeWithReserve (self, int newSize)
None flipEdge (self, ConstEdgeId e)
None flipOrientation (self, ConstUndirectedEdgeBitSet fullComponents=None)
EdgeId makeEdge (self)
EdgeId makeEdges (self, int num)
None pack (self, FaceMap outFmap=None, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
None pack (self, ConstPackMapping map)
None packMinMem (self, ConstPackMapping map)
None preferEdges (self, ConstUndirectedEdgeBitSet stableEdges)
None read (self, typing.Any s, Const_func_bool_from_float callback='{}')
None resizeBeforeParallelAdd (self, int edgeSize, int vertSize, int faceSize)
None rotateTriangles (self)
None setLeft (self, ConstEdgeId a, ConstFaceId f)
None setOrg (self, ConstEdgeId a, ConstVertId v)
None shrinkToFit (self)
None splice (self, ConstEdgeId a, ConstEdgeId b)
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, 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 stopUpdatingValids (self)
None vertReserve (self, int newCapacity)
None vertResize (self, int newSize)
None vertResizeWithReserve (self, int newSize)
Public Member Functions inherited from mrmeshpy.ConstMeshTopology
bool __eq__ (self, ConstMeshTopology b)
 __init__ (self, *args, **kwargs)
bool __ne__ (self, ConstMeshTopology b)
EdgeId bdEdgeSameLeft (self, ConstEdgeId e, ConstFaceBitSet region=None)
EdgeId bdEdgeSameOrigin (self, ConstEdgeId e, ConstFaceBitSet region=None)
EdgeId bdEdgeWithLeft (self, ConstFaceId f, ConstFaceBitSet region=None)
EdgeId bdEdgeWithOrigin (self, ConstVertId v, ConstFaceBitSet region=None)
bool checkValidity (self, Const_func_bool_from_float cb='{}', bool allVerts=True)
int computeNotLoneUndirectedEdges (self)
VertId dest (self, ConstEdgeId he)
int edgeCapacity (self)
ConstVector_EdgeId_FaceId edgePerFace (self)
ConstVector_EdgeId_VertId edgePerVertex (self)
int edgeSize (self)
EdgeId edgeWithLeft (self, ConstFaceId a)
EdgeId edgeWithOrg (self, ConstVertId a)
None excludeLoneEdges (self, UndirectedEdgeBitSet edges)
int faceCapacity (self)
int faceSize (self)
FaceBitSet findBdFaces (self, ConstFaceBitSet region=None)
VertBitSet findBdVerts (self, ConstFaceBitSet region=None, ConstVertBitSet test=None)
EdgeId findEdge (self, ConstVertId o, ConstVertId d)
std_vector_Id_EdgeTag findHoleRepresentiveEdges (self, ConstFaceBitSet region=None)
EdgeBitSet findLeftBdEdges (self, ConstFaceBitSet region=None, ConstEdgeBitSet test=None)
UndirectedEdgeBitSet findNotLoneUndirectedEdges (self)
int findNumHoles (self, EdgeBitSet holeRepresentativeEdges=None)
None flip (self, VertBitSet vs)
None flip (self, FaceBitSet fs)
bool fromSameLeftRing (self, ConstEdgeId a, ConstEdgeId b)
bool fromSameOriginRing (self, ConstEdgeId a, ConstEdgeId b)
Vector_ThreeVertIds getAllTriVerts (self)
int getFaceDegree (self, ConstFaceId f)
ConstFaceBitSet getFaceIds (self, ConstFaceBitSet region)
int getLeftDegree (self, ConstEdgeId a)
std_vector_Id_EdgeTag getLeftRing (self, ConstEdgeId e)
std_vector_std_vector_Id_EdgeTag getLeftRings (self, Const_std_vector_Id_EdgeTag es)
None getLeftTriEdges (self, ConstEdgeId e0, EdgeId e1, EdgeId e2)
None getLeftTriVerts (self, ConstEdgeId a, VertId v0, VertId v1, VertId v2)
None getLeftTriVerts (self, ConstEdgeId a, ThreeVertIds v)
ThreeVertIds getLeftTriVerts (self, ConstEdgeId a)
int getOrgDegree (self, ConstEdgeId a)
FaceBitSet getPathLeftFaces (self, Const_std_vector_Id_EdgeTag path)
FaceBitSet getPathRightFaces (self, Const_std_vector_Id_EdgeTag path)
VertBitSet getPathVertices (self, Const_std_vector_Id_EdgeTag path)
None getTriEdges (self, ConstFaceId f, EdgeId e0, EdgeId e1, EdgeId e2)
None getTriVerts (self, ConstFaceId f, VertId v0, VertId v1, VertId v2)
None getTriVerts (self, ConstFaceId f, ThreeVertIds v)
ThreeVertIds getTriVerts (self, ConstFaceId f)
Triangulation getTriangulation (self)
ConstFaceBitSet getValidFaces (self)
ConstVertBitSet getValidVerts (self)
int getVertDegree (self, ConstVertId v)
ConstVertBitSet getVertIds (self, ConstVertBitSet region)
bool hasEdge (self, ConstEdgeId e)
bool hasFace (self, ConstFaceId a)
bool hasVert (self, ConstVertId a)
int heapBytes (self)
bool isBdEdge (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isBdFace (self, ConstFaceId f, ConstFaceBitSet region=None)
bool isBdVertex (self, ConstVertId v, ConstFaceBitSet region=None)
bool isBdVertexInOrg (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isClosed (self, ConstFaceBitSet region=None)
bool isInnerEdge (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isInnerOrBdEdge (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isInnerOrBdVertex (self, ConstVertId v, ConstFaceBitSet region=None)
bool isLeftBdEdge (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isLeftBdFace (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isLeftInRegion (self, ConstEdgeId e, ConstFaceBitSet region=None)
bool isLeftQuad (self, ConstEdgeId a)
bool isLeftTri (self, ConstEdgeId a)
bool isLoneEdge (self, ConstEdgeId a)
bool isOrgInnerAndHasDegree (self, ConstEdgeId a, int d)
bool isTriVert (self, ConstFaceId f, ConstVertId v)
bool isVertInnerAndHasDegree (self, ConstVertId v, int d)
EdgeId lastNotLoneEdge (self)
UndirectedEdgeId lastNotLoneUndirectedEdge (self)
FaceId lastValidFace (self)
VertId lastValidVert (self)
FaceId left (self, ConstEdgeId he)
EdgeId next (self, ConstEdgeId he)
EdgeId nextLeftBd (self, ConstEdgeId e, ConstFaceBitSet region=None, Turn turn='MR::Turn::Rightmost')
int numValidFaces (self)
int numValidVerts (self)
VertId org (self, ConstEdgeId he)
EdgeId prev (self, ConstEdgeId he)
EdgeId prevLeftBd (self, ConstEdgeId e, ConstFaceBitSet region=None, Turn turn='MR::Turn::Rightmost')
FaceId right (self, ConstEdgeId he)
EdgeId sharedEdge (self, ConstFaceId l, ConstFaceId r)
FaceId sharedFace (self, ConstEdgeId a, ConstEdgeId b)
EdgeId sharedVertInOrg (self, ConstEdgeId a, ConstEdgeId b)
EdgeId sharedVertInOrg (self, ConstFaceId l, ConstFaceId r)
int undirectedEdgeCapacity (self)
int undirectedEdgeSize (self)
bool updatingValids (self)
int vertCapacity (self)
int vertSize (self)
None write (self, typing.Any s)

Static Public Member Functions

None __init__ (*args, **kwargs)

Detailed Description

Generated from:  MR::MeshTopology

Mesh Topology

Constructor & Destructor Documentation

◆ __init__() [1/3]

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

◆ __init__() [2/3]

None mrmeshpy.MeshTopology.__init__ ( self)

◆ __init__() [3/3]

None mrmeshpy.MeshTopology.__init__ ( self,
ConstMeshTopology arg0 )
Implicit copy constructor.

Member Function Documentation

◆ addFaceId()

FaceId mrmeshpy.MeshTopology.addFaceId ( self)
creates new face-id not associated with any edge yet

◆ addPackedPart()

None mrmeshpy.MeshTopology.addPackedPart ( self,
ConstMeshTopology from_,
ConstEdgeId toEdgeId,
ConstFaceMap fmap,
ConstVertMap vmap,
int shiftFaceId = 0 )
copies topology (from) into this;
\\param from edges must be tightly packes without any lone edges, and they are mapped [0, from.edges.size()) -> [toEdgeId, toEdgeId + from.edges.size());
\\param fmap,vmap mapping of vertices and faces if it is given ( from.id -> this.id )
\\param shiftFaceId is added to all face ids from fmap

◆ addPart() [1/2]

None mrmeshpy.MeshTopology.addPart ( self,
ConstMeshTopology from_,
ConstPartMapping map = ...,
bool rearrangeTriangles = False )
appends mesh topology (from) in addition to the current topology: creates new edges, faces, verts;
\\param rearrangeTriangles if true then the order of triangles is selected according to the order of their vertices,
please call rotateTriangles() first

◆ addPart() [2/2]

None mrmeshpy.MeshTopology.addPart ( self,
ConstMeshTopology from_,
FaceMap outFmap = None,
VertMap outVmap = None,
WholeEdgeMap outEmap = None,
bool rearrangeTriangles = False )

◆ addPartByMask() [1/2]

bool mrmeshpy.MeshTopology.addPartByMask ( self,
ConstMeshTopology from_,
ConstFaceBitSet fromFaces,
bool flipOrientation = False,
Const_std_vector_std_vector_Id_EdgeTag thisContours = ...,
Const_std_vector_std_vector_Id_EdgeTag fromContours = ...,
ConstPartMapping map = ...,
VacantElements vacant = '{}' )
this version has more parameters
\\param flipOrientation if true then every from triangle is inverted before adding
\\param thisContours contours on this mesh (no left face) that have to be stitched with
\\param fromContours contours on from mesh during addition (no left face if flipOrientation otherwise no right face)
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 (see the conditions on them above), and this topology is left unmodified then
        (the src2tgt mappings in (map) argument can be partially filled nevertheless)

◆ addPartByMask() [2/2]

None mrmeshpy.MeshTopology.addPartByMask ( self,
ConstMeshTopology from_,
ConstFaceBitSet fromFaces,
ConstPartMapping map = ...,
VacantElements vacant = '{}' )
appends the portion of (from) specified by fromFaces in addition to the current topology: creates new edges, faces, verts;
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

◆ addVertId()

VertId mrmeshpy.MeshTopology.addVertId ( self)
creates new vert-id not associated with any edge yet

◆ assign()

MeshTopology mrmeshpy.MeshTopology.assign ( self,
ConstMeshTopology other )

◆ buildFromManifoldTriangles()

bool mrmeshpy.MeshTopology.buildFromManifoldTriangles ( self,
ConstTriangulation t,
MeshBuilder.ConstBuildSettings settings,
bool_output nonManifoldVertsOnly = None )
constructs topology from given triangles in parallel, if every edge has at most two triangles with opposite directions on it,
and the triangles around every vertex form either one closed fan or at most two open fans; returns false and leaves this and settings.region unchanged otherwise;
triangles with invalid or repeated vertices are not added, as in MeshBuilder::fromTriangles with the same settings;
\\param nonManifoldVertsOnly if given, set to whether it failed only on vertices having several fans of triangles around, but not just one or two open fans

◆ buildGridMesh()

bool mrmeshpy.MeshTopology.buildGridMesh ( self,
ConstGridSettings settings,
Const_func_bool_from_float cb = '{}' )
constructs triangular grid mesh topology in parallel

◆ clear()

None mrmeshpy.MeshTopology.clear ( self)
resets to the default-constructed state (including resuming valids updating), keeping the buffers' capacity for reuse

◆ collapseEdge()

EdgeId mrmeshpy.MeshTopology.collapseEdge ( self,
ConstEdgeId e,
Const_func_void_from_Id_EdgeTag_Id_EdgeTag onEdgeDel )
collapses given edge in a vertex and deletes
1) faces: left( e ) and right( e );
2) edges: e, next( e.sym() ), prev( e.sym() ), and optionally next( e ), prev( e ) if their left and right triangles are deleted;
3) all vertices that lost their last edge;
calls onEdgeDel for every deleted edge (del) including given (e);
if valid (rem) is given then dest( del ) = dest( rem ) and their origins are in different ends of collapsing edge, (rem) shall take the place of (del)
\\return prev( e ) if it is still valid

◆ computeValidsFromEdges()

bool mrmeshpy.MeshTopology.computeValidsFromEdges ( self,
Const_func_bool_from_float cb = '{}' )
compute
1) numValidVerts_ and validVerts_ from edgePerVertex_
2) numValidFaces_ and validFaces_ from edgePerFace_
and activates their auto-update

◆ deleteFace()

None mrmeshpy.MeshTopology.deleteFace ( self,
ConstFaceId f,
ConstUndirectedEdgeBitSet keepEdges = None )
deletes the face, also deletes its edges and vertices if they were not shared by other faces and not in \\p keepEdges

◆ deleteFaces()

None mrmeshpy.MeshTopology.deleteFaces ( self,
ConstFaceBitSet fs,
ConstUndirectedEdgeBitSet keepEdges = None )
deletes the given faces, also deletes their edges and vertices if they were not shared by other faces and not in \\p keepEdges;
unlike \\ref deleteFacesFindVacant, the edges that had no left and no right face before the call are not touched;
few faces (up to 64 or 1/128 of all faces, whichever is larger) are deleted one by one, without a pass over all mesh elements

◆ deleteFacesFindVacant()

VacantElements mrmeshpy.MeshTopology.deleteFacesFindVacant ( self,
ConstFaceBitSet fs,
ConstUndirectedEdgeBitSet keepEdges = None )
deletes from this topology:
1) all the given faces,
2) all the vertices, which had incident only deleted faces and no edges from \\p keepEdges,
3) make lone all the edges, which had to the left/right only deleted faces or no faces at all (unlike \\ref deleteFaces), except for the edges from \\p keepEdges;
return bit sets of all vacant elements in this topology after deletion; it takes a pass over the whole mesh for any number of faces

◆ deleteFacesKeepEdges()

None mrmeshpy.MeshTopology.deleteFacesKeepEdges ( self,
ConstFaceBitSet fs )
deletes the given valid faces (in parallel), keeping all their edges and vertices, which get no face on that side

◆ edgeReserve()

None mrmeshpy.MeshTopology.edgeReserve ( self,
int newCapacity )
sets the capacity of half-edges vector

◆ faceReserve()

None mrmeshpy.MeshTopology.faceReserve ( self,
int newCapacity )
sets the capacity of faces vector

◆ faceResize()

None mrmeshpy.MeshTopology.faceResize ( self,
int newSize )
explicitly increases the size of faces vector

◆ faceResizeWithReserve()

None mrmeshpy.MeshTopology.faceResizeWithReserve ( self,
int newSize )
explicitly increases the size of faces vector, doubling the current capacity if it was not enough

◆ flipEdge()

None mrmeshpy.MeshTopology.flipEdge ( self,
ConstEdgeId e )
given the edge with left and right triangular faces, which form together a quadrangle,
rotates the edge counter-clockwise inside the quadrangle

◆ flipOrientation()

None mrmeshpy.MeshTopology.flipOrientation ( self,
ConstUndirectedEdgeBitSet fullComponents = None )
flip orientation (normals) of
* all mesh elements if \\p fullComponents is nullptr, or
* given mesh components in \\p fullComponents.
The behavior is undefined if fullComponents is given but there are connected components with some edges included and not-included there.

◆ makeEdge()

EdgeId mrmeshpy.MeshTopology.makeEdge ( self)
creates an edge not associated with any vertex or face

◆ makeEdges()

EdgeId mrmeshpy.MeshTopology.makeEdges ( self,
int num )
creates given number of edges not associated with any vertex or face,
returns the first of them; edge i is the first + 2 * i, the same as from makeEdge() called num times

◆ pack() [1/2]

None mrmeshpy.MeshTopology.pack ( self,
ConstPackMapping map )
tightly packs all arrays eliminating lone edges and invalid faces and vertices;
reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping

◆ pack() [2/2]

None mrmeshpy.MeshTopology.pack ( self,
FaceMap outFmap = None,
VertMap outVmap = None,
WholeEdgeMap outEmap = None,
bool rearrangeTriangles = False )
tightly packs all arrays eliminating lone edges and invalid faces and vertices
\\param outFmap,outVmap,outEmap if given returns mappings: old.id -> new.id;
\\param rearrangeTriangles if true then calls rotateTriangles()
and selects the order of triangles according to the order of their vertices

◆ packMinMem()

None mrmeshpy.MeshTopology.packMinMem ( self,
ConstPackMapping map )
tightly packs all arrays eliminating lone edges and invalid faces and vertices;
reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping;
unlike \\ref pack method, this method allocates minimal amount of memory for its operation but works much slower

◆ preferEdges()

None mrmeshpy.MeshTopology.preferEdges ( self,
ConstUndirectedEdgeBitSet stableEdges )
for incident vertices and faces of given edges, remember one of them as edgeWithOrg and edgeWithLeft;
this is important in parallel algorithms where other edges may change but stable ones will survive

◆ read()

None mrmeshpy.MeshTopology.read ( self,
typing.Any s,
Const_func_bool_from_float callback = '{}' )
loads from binary stream
\\return text of error if any

◆ resizeBeforeParallelAdd()

None mrmeshpy.MeshTopology.resizeBeforeParallelAdd ( self,
int edgeSize,
int vertSize,
int faceSize )
These function are for parallel mesh creation from different threads. If you are not sure, do not use them.
\\details resizes all internal vectors and sets the numbers of valid elements in preparation for addPackedPart;
edges are resized without initialization (so the user must initialize them using addPackedPart)

◆ rotateTriangles()

None mrmeshpy.MeshTopology.rotateTriangles ( self)
for each triangle selects edgeWithLeft with minimal origin vertex

◆ setLeft()

None mrmeshpy.MeshTopology.setLeft ( self,
ConstEdgeId a,
ConstFaceId f )
sets new left face to the full left ring including this edge;
edgePerFace_ table is updated accordingly

◆ setOrg()

None mrmeshpy.MeshTopology.setOrg ( self,
ConstEdgeId a,
ConstVertId v )
sets new origin to the full origin ring including this edge;
edgePerVertex_ table is updated accordingly

◆ shrinkToFit()

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

◆ splice()

None mrmeshpy.MeshTopology.splice ( self,
ConstEdgeId a,
ConstEdgeId b )
given two half edges do either of two:
1) if a and b were from distinct rings, puts them in one ring;
2) if a and b were from the same ring, puts them in separate rings;
the cut in rings in both cases is made after a and b

◆ splitEdge()

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)

◆ splitFace()

split given triangle on three triangles, introducing new vertex (which is returned) inside original triangle and connecting it to its vertices
\\details 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)

◆ stopUpdatingValids()

None mrmeshpy.MeshTopology.stopUpdatingValids ( self)
stops updating validVerts(), validFaces(), numValidVerts(), numValidFaces() for parallel processing of mesh parts

◆ vertReserve()

None mrmeshpy.MeshTopology.vertReserve ( self,
int newCapacity )
sets the capacity of vertices vector

◆ vertResize()

None mrmeshpy.MeshTopology.vertResize ( self,
int newSize )
explicitly increases the size of vertices vector

◆ vertResizeWithReserve()

None mrmeshpy.MeshTopology.vertResizeWithReserve ( self,
int newSize )
explicitly increases the size of vertices vector, doubling the current capacity if it was not enough

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