MeshLib Python Docs
Loading...
Searching...
No Matches
meshlib.mrmeshpy.MeshTopology Class Reference

Public Member Functions

bool __eq__ (self, MeshTopology b)
 
None __init__ (self)
 
None __init__ (self, MeshTopology arg0)
 
FaceId addFaceId (self)
 
None addPackedPart (self, MeshTopology from_, Id_EdgeTag toEdgeId, FaceMap fmap, VertMap vmap)
 
None addPart (self, MeshTopology from_, FaceMap outFmap=None, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
 
None addPartByFaceMap (self, MeshTopology from_, FaceMap fromFaces, bool flipOrientation=False, std_vector_std_vector_Id_EdgeTag thisContours='std::vector< MR::EdgePath >{}', std_vector_std_vector_Id_EdgeTag fromContours='std::vector< MR::EdgePath >{}', PartMapping map='MR::PartMapping{}')
 
None addPartByMask (self, MeshTopology from_, FaceBitSet fromFaces, PartMapping map)
 
None addPartByMask (self, MeshTopology from_, FaceBitSet fromFaces, bool flipOrientation=False, std_vector_std_vector_Id_EdgeTag thisContours='std::vector< MR::EdgePath >{}', std_vector_std_vector_Id_EdgeTag fromContours='std::vector< MR::EdgePath >{}', PartMapping map='MR::PartMapping{}')
 
VertId addVertId (self)
 
Id_EdgeTag bdEdgeSameLeft (self, Id_EdgeTag e, FaceBitSet region=None)
 
Id_EdgeTag bdEdgeSameOrigin (self, Id_EdgeTag e, FaceBitSet region=None)
 
Id_EdgeTag bdEdgeWithLeft (self, FaceId f, FaceBitSet region=None)
 
Id_EdgeTag bdEdgeWithOrigin (self, VertId v, FaceBitSet region=None)
 
bool buildGridMesh (self, GridSettings settings, func_bool_from_float cb='MR::ProgressCallback{}')
 
bool checkValidity (self, func_bool_from_float cb='MR::ProgressCallback{}', bool allVerts=True)
 
Id_EdgeTag collapseEdge (self, Id_EdgeTag e, func_void_from_Id_EdgeTag_Id_EdgeTag onEdgeDel)
 
int computeNotLoneUndirectedEdges (self)
 
bool computeValidsFromEdges (self, func_bool_from_float cb='MR::ProgressCallback{}')
 
None deleteFace (self, FaceId f, UndirectedEdgeBitSet keepEdges=None)
 
None deleteFaces (self, FaceBitSet fs, UndirectedEdgeBitSet keepEdges=None)
 
VertId dest (self, Id_EdgeTag he)
 
int edgeCapacity (self)
 
Vector_Id_EdgeTag_FaceId edgePerFace (self)
 
Vector_Id_EdgeTag_VertId edgePerVertex (self)
 
None edgeReserve (self, int newCapacity)
 
int edgeSize (self)
 
Id_EdgeTag edgeWithLeft (self, FaceId a)
 
Id_EdgeTag edgeWithOrg (self, VertId a)
 
None excludeLoneEdges (self, UndirectedEdgeBitSet edges)
 
int faceCapacity (self)
 
None faceReserve (self, int newCapacity)
 
None faceResize (self, int newSize)
 
None faceResizeWithReserve (self, int newSize)
 
int faceSize (self)
 
EdgeBitSet findBoundaryEdges (self)
 
FaceBitSet findBoundaryFaces (self, FaceBitSet region=None)
 
VertBitSet findBoundaryVerts (self, VertBitSet region=None)
 
Id_EdgeTag findEdge (self, VertId o, VertId d)
 
std_vector_Id_EdgeTag findHoleRepresentiveEdges (self)
 
UndirectedEdgeBitSet findNotLoneUndirectedEdges (self)
 
int findNumHoles (self, EdgeBitSet holeRepresentativeEdges=None)
 
None flip (self, VertBitSet vs)
 
None flip (self, FaceBitSet fs)
 
None flipEdge (self, Id_EdgeTag e)
 
None flipOrientation (self, UndirectedEdgeBitSet fullComponents=None)
 
bool fromSameLeftRing (self, Id_EdgeTag a, Id_EdgeTag b)
 
bool fromSameOriginRing (self, Id_EdgeTag a, Id_EdgeTag b)
 
std_vector_std_array_Id_VertTag_3ul getAllTriVerts (self)
 
int getFaceDegree (self, FaceId f)
 
FaceBitSet getFaceIds (self, FaceBitSet region)
 
int getLeftDegree (self, Id_EdgeTag a)
 
std_vector_Id_EdgeTag getLeftRing (self, Id_EdgeTag e)
 
std_vector_std_vector_Id_EdgeTag getLeftRings (self, std_vector_Id_EdgeTag es)
 
None getLeftTriVerts (self, Id_EdgeTag a, VertId v0, VertId v1, VertId v2)
 
None getLeftTriVerts (self, Id_EdgeTag a, std_array_Id_VertTag_3 v)
 
std_array_Id_VertTag_3 getLeftTriVerts (self, Id_EdgeTag a)
 
int getOrgDegree (self, Id_EdgeTag a)
 
FaceBitSet getPathLeftFaces (self, std_vector_Id_EdgeTag path)
 
FaceBitSet getPathRightFaces (self, std_vector_Id_EdgeTag path)
 
VertBitSet getPathVertices (self, std_vector_Id_EdgeTag path)
 
None getTriEdges (self, FaceId f, Id_EdgeTag e0, Id_EdgeTag e1, Id_EdgeTag e2)
 
None getTriVerts (self, FaceId f, VertId v0, VertId v1, VertId v2)
 
None getTriVerts (self, FaceId f, std_array_Id_VertTag_3 v)
 
std_array_Id_VertTag_3 getTriVerts (self, FaceId f)
 
Triangulation getTriangulation (self)
 
FaceBitSet getValidFaces (self)
 
VertBitSet getValidVerts (self)
 
int getVertDegree (self, VertId v)
 
VertBitSet getVertIds (self, VertBitSet region)
 
bool hasEdge (self, Id_EdgeTag e)
 
bool hasFace (self, FaceId a)
 
bool hasVert (self, VertId a)
 
int heapBytes (self)
 
bool isBdEdge (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isBdFace (self, FaceId f, FaceBitSet region=None)
 
bool isBdVertex (self, VertId v, FaceBitSet region=None)
 
bool isBdVertexInLeft (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isBdVertexInOrg (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isClosed (self, FaceBitSet region=None)
 
bool isInnerEdge (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isInnerOrBdEdge (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isInnerOrBdVertex (self, VertId v, FaceBitSet region=None)
 
bool isLeftBdEdge (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isLeftInRegion (self, Id_EdgeTag e, FaceBitSet region=None)
 
bool isLeftQuad (self, Id_EdgeTag a)
 
bool isLeftTri (self, Id_EdgeTag a)
 
bool isLoneEdge (self, Id_EdgeTag a)
 
Id_EdgeTag lastNotLoneEdge (self)
 
FaceId lastValidFace (self)
 
VertId lastValidVert (self)
 
FaceId left (self, Id_EdgeTag he)
 
Id_EdgeTag makeEdge (self)
 
Id_EdgeTag next (self, Id_EdgeTag he)
 
Id_EdgeTag nextLeftBd (self, Id_EdgeTag e, FaceBitSet region=None)
 
int numValidFaces (self)
 
int numValidVerts (self)
 
VertId org (self, Id_EdgeTag he)
 
None pack (self, FaceMap outFmap=None, VertMap outVmap=None, WholeEdgeMap outEmap=None, bool rearrangeTriangles=False)
 
None pack (self, PackMapping map)
 
None packMinMem (self, PackMapping map)
 
None preferEdges (self, UndirectedEdgeBitSet stableEdges)
 
Id_EdgeTag prev (self, Id_EdgeTag he)
 
Id_EdgeTag prevLeftBd (self, Id_EdgeTag e, FaceBitSet region=None)
 
None read (self, typing.Any s, func_bool_from_float callback='MR::ProgressCallback{}')
 
None resizeBeforeParallelAdd (self, int edgeSize, int vertSize, int faceSize)
 
FaceId right (self, Id_EdgeTag he)
 
None rotateTriangles (self)
 
None setLeft (self, Id_EdgeTag a, FaceId f)
 
None setOrg (self, Id_EdgeTag a, VertId v)
 
Id_EdgeTag sharedEdge (self, FaceId l, FaceId r)
 
FaceId sharedFace (self, Id_EdgeTag a, Id_EdgeTag b)
 
Id_EdgeTag sharedVertInOrg (self, Id_EdgeTag a, Id_EdgeTag b)
 
Id_EdgeTag sharedVertInOrg (self, FaceId l, FaceId r)
 
None shrinkToFit (self)
 
None splice (self, Id_EdgeTag a, Id_EdgeTag b)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag new2Old=None)
 
VertId splitFace (self, FaceId f, FaceBitSet region=None, phmap_flat_hash_map_Id_FaceTag_Id_FaceTag new2Old=None)
 
None stopUpdatingValids (self)
 
int undirectedEdgeCapacity (self)
 
int undirectedEdgeSize (self)
 
bool updatingValids (self)
 
int vertCapacity (self)
 
None vertReserve (self, int newCapacity)
 
None vertResize (self, int newSize)
 
None vertResizeWithReserve (self, int newSize)
 
int vertSize (self)
 
None write (self, typing.Any s)
 

Detailed Description

Generated from:  MR::MeshTopology

Mesh Topology
\\ingroup MeshGroup

Constructor & Destructor Documentation

◆ __init__() [1/2]

None meshlib.mrmeshpy.MeshTopology.__init__ ( self)
Implicit default constructor.

◆ __init__() [2/2]

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

Member Function Documentation

◆ __eq__()

bool meshlib.mrmeshpy.MeshTopology.__eq__ ( self,
MeshTopology b )
compare that two topologies are exactly the same

◆ addFaceId()

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

◆ addPackedPart()

None meshlib.mrmeshpy.MeshTopology.addPackedPart ( self,
MeshTopology from_,
Id_EdgeTag toEdgeId,
FaceMap fmap,
VertMap vmap )
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 )

◆ addPart()

None meshlib.mrmeshpy.MeshTopology.addPart ( self,
MeshTopology from_,
FaceMap outFmap = None,
VertMap outVmap = None,
WholeEdgeMap outEmap = None,
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
\\param outFmap,outVmap,outEmap (optionally) returns mappings: from.id -> this.id

◆ addPartByFaceMap()

None meshlib.mrmeshpy.MeshTopology.addPartByFaceMap ( self,
MeshTopology from_,
FaceMap fromFaces,
bool flipOrientation = False,
std_vector_std_vector_Id_EdgeTag thisContours = 'std::vector<MR::EdgePath>{}',
std_vector_std_vector_Id_EdgeTag fromContours = 'std::vector<MR::EdgePath>{}',
PartMapping map = 'MR::PartMapping{}' )
fromFaces contains mapping from this-topology (considering it is empty) to from-topology

◆ addPartByMask() [1/2]

None meshlib.mrmeshpy.MeshTopology.addPartByMask ( self,
MeshTopology from_,
FaceBitSet fromFaces,
bool flipOrientation = False,
std_vector_std_vector_Id_EdgeTag thisContours = 'std::vector<MR::EdgePath>{}',
std_vector_std_vector_Id_EdgeTag fromContours = 'std::vector<MR::EdgePath>{}',
PartMapping map = 'MR::PartMapping{}' )
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)

◆ addPartByMask() [2/2]

None meshlib.mrmeshpy.MeshTopology.addPartByMask ( self,
MeshTopology from_,
FaceBitSet fromFaces,
PartMapping map )
the same but copies only portion of (from) specified by fromFaces,

◆ addVertId()

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

◆ bdEdgeSameLeft()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.bdEdgeSameLeft ( self,
Id_EdgeTag e,
FaceBitSet region = None )
returns the first boundary edge (for given region or for whole mesh if region is nullptr) in counter-clockwise order starting from given edge with the same left;
returns invalid edge if no boundary edge is found

◆ bdEdgeSameOrigin()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.bdEdgeSameOrigin ( self,
Id_EdgeTag e,
FaceBitSet region = None )
returns the first boundary edge (for given region or for whole mesh if region is nullptr) in counter-clockwise order starting from given edge with the same origin;
returns invalid edge if no boundary edge is found

◆ bdEdgeWithLeft()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.bdEdgeWithLeft ( self,
FaceId f,
FaceBitSet region = None )
returns a boundary edge with given left face considering boundary of given region (or for whole mesh if region is nullptr);
returns invalid edge if no boundary edge is found

◆ bdEdgeWithOrigin()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.bdEdgeWithOrigin ( self,
VertId v,
FaceBitSet region = None )
returns a boundary edge with given vertex in origin considering boundary of given region (or for whole mesh if region is nullptr);
returns invalid edge if no boundary edge is found

◆ buildGridMesh()

bool meshlib.mrmeshpy.MeshTopology.buildGridMesh ( self,
GridSettings settings,
func_bool_from_float cb = 'MR::ProgressCallback{}' )
constructs triangular grid mesh topology in parallel

◆ checkValidity()

bool meshlib.mrmeshpy.MeshTopology.checkValidity ( self,
func_bool_from_float cb = 'MR::ProgressCallback{}',
bool allVerts = True )
verifies that all internal data structures are valid;
if allVerts=true then checks in addition that all not-lone edges have valid vertices on both ends

◆ collapseEdge()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.collapseEdge ( self,
Id_EdgeTag e,
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

◆ computeNotLoneUndirectedEdges()

int meshlib.mrmeshpy.MeshTopology.computeNotLoneUndirectedEdges ( self)
computes the number of not-lone (valid) undirected edges

◆ computeValidsFromEdges()

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

◆ deleteFace()

None meshlib.mrmeshpy.MeshTopology.deleteFace ( self,
FaceId f,
UndirectedEdgeBitSet keepEdges = None )
deletes the face, also deletes its edges and vertices if they were not shared by other faces ant not in \\param keepFaces

◆ deleteFaces()

None meshlib.mrmeshpy.MeshTopology.deleteFaces ( self,
FaceBitSet fs,
UndirectedEdgeBitSet keepEdges = None )
deletes multiple given faces by calling \\ref deleteFace for each

◆ dest()

VertId meshlib.mrmeshpy.MeshTopology.dest ( self,
Id_EdgeTag he )
returns destination vertex of half-edge

◆ edgeCapacity()

int meshlib.mrmeshpy.MeshTopology.edgeCapacity ( self)
returns the number of allocated edge records

◆ edgePerFace()

Vector_Id_EdgeTag_FaceId meshlib.mrmeshpy.MeshTopology.edgePerFace ( self)
for all valid faces this vector contains an edge with that face at left

◆ edgePerVertex()

Vector_Id_EdgeTag_VertId meshlib.mrmeshpy.MeshTopology.edgePerVertex ( self)
for all valid vertices this vector contains an edge with the origin there

◆ edgeReserve()

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

◆ edgeSize()

int meshlib.mrmeshpy.MeshTopology.edgeSize ( self)
returns the number of half-edge records including lone ones

◆ edgeWithLeft()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.edgeWithLeft ( self,
FaceId a )
returns valid edge if given vertex is present in the mesh

◆ edgeWithOrg()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.edgeWithOrg ( self,
VertId a )
returns valid edge if given vertex is present in the mesh

◆ excludeLoneEdges()

None meshlib.mrmeshpy.MeshTopology.excludeLoneEdges ( self,
UndirectedEdgeBitSet edges )
remove all lone edges from given set

◆ faceCapacity()

int meshlib.mrmeshpy.MeshTopology.faceCapacity ( self)
returns the number of allocated face records

◆ faceReserve()

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

◆ faceResize()

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

◆ faceResizeWithReserve()

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

◆ faceSize()

int meshlib.mrmeshpy.MeshTopology.faceSize ( self)
returns the number of face records including invalid ones

◆ findBoundaryEdges()

EdgeBitSet meshlib.mrmeshpy.MeshTopology.findBoundaryEdges ( self)
returns all boundary edges, where each edge does not have valid left face

◆ findBoundaryFaces()

FaceBitSet meshlib.mrmeshpy.MeshTopology.findBoundaryFaces ( self,
FaceBitSet region = None )
returns all boundary faces, having at least one boundary edge;
\\param region if given then search among faces there otherwise among all valid faces

◆ findBoundaryVerts()

VertBitSet meshlib.mrmeshpy.MeshTopology.findBoundaryVerts ( self,
VertBitSet region = None )
returns all boundary vertices, incident to at least one boundary edge;
\\param region if given then search among vertices there otherwise among all valid vertices

◆ findEdge()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.findEdge ( self,
VertId o,
VertId d )
finds and returns edge from o to d in the mesh; returns invalid edge otherwise

◆ findHoleRepresentiveEdges()

std_vector_Id_EdgeTag meshlib.mrmeshpy.MeshTopology.findHoleRepresentiveEdges ( self)
returns one edge with no valid left face for every boundary in the mesh

◆ findNotLoneUndirectedEdges()

UndirectedEdgeBitSet meshlib.mrmeshpy.MeshTopology.findNotLoneUndirectedEdges ( self)
finds and returns all not-lone (valid) undirected edges

◆ findNumHoles()

int meshlib.mrmeshpy.MeshTopology.findNumHoles ( self,
EdgeBitSet holeRepresentativeEdges = None )
returns the number of hole loops in the mesh;
\\param holeRepresentativeEdges optional output of the smallest edge id with no valid left face in every hole

◆ flip() [1/2]

None meshlib.mrmeshpy.MeshTopology.flip ( self,
FaceBitSet fs )
sets in (fs) all valid faces that were not selected before the call, and resets other bits

◆ flip() [2/2]

None meshlib.mrmeshpy.MeshTopology.flip ( self,
VertBitSet vs )
sets in (vs) all valid vertices that were not selected before the call, and resets other bits

◆ flipEdge()

None meshlib.mrmeshpy.MeshTopology.flipEdge ( self,
Id_EdgeTag 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 meshlib.mrmeshpy.MeshTopology.flipOrientation ( self,
UndirectedEdgeBitSet fullComponents = None )
flip orientation (normals) of
* all mesh elements if \\param fullComponents is nullptr, or
* given mesh components in \\param fullComponents.
The behavior is undefined if fullComponents is given but there are connected components with some edges included and not-included there.

◆ fromSameLeftRing()

bool meshlib.mrmeshpy.MeshTopology.fromSameLeftRing ( self,
Id_EdgeTag a,
Id_EdgeTag b )
returns true if a and b are both from the same left face ring

◆ fromSameOriginRing()

bool meshlib.mrmeshpy.MeshTopology.fromSameOriginRing ( self,
Id_EdgeTag a,
Id_EdgeTag b )
returns true if a and b are both from the same origin ring

◆ getAllTriVerts()

std_vector_std_array_Id_VertTag_3ul meshlib.mrmeshpy.MeshTopology.getAllTriVerts ( self)
returns three vertex ids for valid triangles, invalid triangles are skipped

◆ getFaceDegree()

int meshlib.mrmeshpy.MeshTopology.getFaceDegree ( self,
FaceId f )
returns the number of edges around the given face: 3 for triangular faces, ...

◆ getFaceIds()

FaceBitSet meshlib.mrmeshpy.MeshTopology.getFaceIds ( self,
FaceBitSet region )
if region pointer is not null then converts it in reference, otherwise returns all valid faces in the mesh

◆ getLeftDegree()

int meshlib.mrmeshpy.MeshTopology.getLeftDegree ( self,
Id_EdgeTag a )
returns the number of edges around the left face: 3 for triangular faces, ...

◆ getLeftRing()

std_vector_Id_EdgeTag meshlib.mrmeshpy.MeshTopology.getLeftRing ( self,
Id_EdgeTag e )
returns full edge-loop of left face from (e) starting from (e) itself

◆ getLeftRings()

std_vector_std_vector_Id_EdgeTag meshlib.mrmeshpy.MeshTopology.getLeftRings ( self,
std_vector_Id_EdgeTag es )
returns full edge-loops of left faces from every edge in (es);
each edge-loop will be returned only once even if some faces are represented by more than one edge in (es)

◆ getLeftTriVerts() [1/3]

std_array_Id_VertTag_3 meshlib.mrmeshpy.MeshTopology.getLeftTriVerts ( self,
Id_EdgeTag a )

◆ getLeftTriVerts() [2/3]

None meshlib.mrmeshpy.MeshTopology.getLeftTriVerts ( self,
Id_EdgeTag a,
std_array_Id_VertTag_3 v )

◆ getLeftTriVerts() [3/3]

None meshlib.mrmeshpy.MeshTopology.getLeftTriVerts ( self,
Id_EdgeTag a,
VertId v0,
VertId v1,
VertId v2 )
gets 3 vertices of the left face ( face-id may not exist, but the shape must be triangular)
the vertices are returned in counter-clockwise order if look from mesh outside

◆ getOrgDegree()

int meshlib.mrmeshpy.MeshTopology.getOrgDegree ( self,
Id_EdgeTag a )
returns the number of edges around the origin vertex, returns 1 for lone edges

◆ getPathLeftFaces()

FaceBitSet meshlib.mrmeshpy.MeshTopology.getPathLeftFaces ( self,
std_vector_Id_EdgeTag path )
returns all valid left faces of path edges

◆ getPathRightFaces()

FaceBitSet meshlib.mrmeshpy.MeshTopology.getPathRightFaces ( self,
std_vector_Id_EdgeTag path )
returns all valid right faces of path edges

◆ getPathVertices()

VertBitSet meshlib.mrmeshpy.MeshTopology.getPathVertices ( self,
std_vector_Id_EdgeTag path )
returns all vertices incident to path edges

◆ getTriangulation()

Triangulation meshlib.mrmeshpy.MeshTopology.getTriangulation ( self)
returns three vertex ids for valid triangles (which can be accessed by FaceId),
vertex ids for invalid triangles are undefined, and shall not be read

◆ getTriEdges()

None meshlib.mrmeshpy.MeshTopology.getTriEdges ( self,
FaceId f,
Id_EdgeTag e0,
Id_EdgeTag e1,
Id_EdgeTag e2 )
gets 3 edges of given triangular face, oriented to have it on the left;
the edges are returned in counter-clockwise order if look from mesh outside

◆ getTriVerts() [1/3]

std_array_Id_VertTag_3 meshlib.mrmeshpy.MeshTopology.getTriVerts ( self,
FaceId f )

◆ getTriVerts() [2/3]

None meshlib.mrmeshpy.MeshTopology.getTriVerts ( self,
FaceId f,
std_array_Id_VertTag_3 v )

◆ getTriVerts() [3/3]

None meshlib.mrmeshpy.MeshTopology.getTriVerts ( self,
FaceId f,
VertId v0,
VertId v1,
VertId v2 )
gets 3 vertices of given triangular face;
the vertices are returned in counter-clockwise order if look from mesh outside

◆ getValidFaces()

FaceBitSet meshlib.mrmeshpy.MeshTopology.getValidFaces ( self)
returns cached set of all valid faces

◆ getValidVerts()

VertBitSet meshlib.mrmeshpy.MeshTopology.getValidVerts ( self)
returns cached set of all valid vertices

◆ getVertDegree()

int meshlib.mrmeshpy.MeshTopology.getVertDegree ( self,
VertId v )
returns the number of edges around the given vertex

◆ getVertIds()

VertBitSet meshlib.mrmeshpy.MeshTopology.getVertIds ( self,
VertBitSet region )
if region pointer is not null then converts it in reference, otherwise returns all valid vertices in the mesh

◆ hasEdge()

bool meshlib.mrmeshpy.MeshTopology.hasEdge ( self,
Id_EdgeTag e )
returns true if given edge is within valid range and not-lone

◆ hasFace()

bool meshlib.mrmeshpy.MeshTopology.hasFace ( self,
FaceId a )
returns true if given face is present in the mesh

◆ hasVert()

bool meshlib.mrmeshpy.MeshTopology.hasVert ( self,
VertId a )
returns true if given vertex is present in the mesh

◆ heapBytes()

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

◆ isBdEdge()

bool meshlib.mrmeshpy.MeshTopology.isBdEdge ( self,
Id_EdgeTag e,
FaceBitSet region = None )
return true if given edge is boundary for given region (or for whole mesh if region is nullptr)

◆ isBdFace()

bool meshlib.mrmeshpy.MeshTopology.isBdFace ( self,
FaceId f,
FaceBitSet region = None )
returns true if given face is on (region) boundary

◆ isBdVertex()

bool meshlib.mrmeshpy.MeshTopology.isBdVertex ( self,
VertId v,
FaceBitSet region = None )
returns true if given vertex is on (region) boundary

◆ isBdVertexInLeft()

bool meshlib.mrmeshpy.MeshTopology.isBdVertexInLeft ( self,
Id_EdgeTag e,
FaceBitSet region = None )
returns true if edge's left is on (region) boundary

◆ isBdVertexInOrg()

bool meshlib.mrmeshpy.MeshTopology.isBdVertexInOrg ( self,
Id_EdgeTag e,
FaceBitSet region = None )
returns true if edge's origin is on (region) boundary

◆ isClosed()

bool meshlib.mrmeshpy.MeshTopology.isClosed ( self,
FaceBitSet region = None )
returns true if the mesh (region) does not have any neighboring holes

◆ isInnerEdge()

bool meshlib.mrmeshpy.MeshTopology.isInnerEdge ( self,
Id_EdgeTag e,
FaceBitSet region = None )
return true if given edge is inner for given region (or for whole mesh if region is nullptr)

◆ isInnerOrBdEdge()

bool meshlib.mrmeshpy.MeshTopology.isInnerOrBdEdge ( self,
Id_EdgeTag e,
FaceBitSet region = None )
return true if given edge is inner or boundary for given region (or for whole mesh if region is nullptr), returns false for lone edges

◆ isInnerOrBdVertex()

bool meshlib.mrmeshpy.MeshTopology.isInnerOrBdVertex ( self,
VertId v,
FaceBitSet region = None )
returns true if one of incident faces of given vertex pertain to given region (or any such face exists if region is nullptr)

◆ isLeftBdEdge()

bool meshlib.mrmeshpy.MeshTopology.isLeftBdEdge ( self,
Id_EdgeTag e,
FaceBitSet region = None )
returns true if left face of given edge belongs to given region (if provided) and right face either does not exist or does not belong

◆ isLeftInRegion()

bool meshlib.mrmeshpy.MeshTopology.isLeftInRegion ( self,
Id_EdgeTag e,
FaceBitSet region = None )
return true if left face of given edge belongs to region (or just have valid id if region is nullptr)

◆ isLeftQuad()

bool meshlib.mrmeshpy.MeshTopology.isLeftQuad ( self,
Id_EdgeTag a )
returns true if the cell to the left of a is quadrangular

◆ isLeftTri()

bool meshlib.mrmeshpy.MeshTopology.isLeftTri ( self,
Id_EdgeTag a )
returns true if the cell to the left of a is triangular

◆ isLoneEdge()

bool meshlib.mrmeshpy.MeshTopology.isLoneEdge ( self,
Id_EdgeTag a )
checks whether the edge is disconnected from all other edges and disassociated from all vertices and faces (as if after makeEdge)

◆ lastNotLoneEdge()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.lastNotLoneEdge ( self)
returns last not lone edge id, or invalid id if no such edge exists

◆ lastValidFace()

FaceId meshlib.mrmeshpy.MeshTopology.lastValidFace ( self)
returns last valid face id, or invalid id if no single valid face exists

◆ lastValidVert()

VertId meshlib.mrmeshpy.MeshTopology.lastValidVert ( self)
returns last valid vertex id, or invalid id if no single valid vertex exists

◆ left()

FaceId meshlib.mrmeshpy.MeshTopology.left ( self,
Id_EdgeTag he )
returns left face of half-edge

◆ makeEdge()

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

◆ next()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.next ( self,
Id_EdgeTag he )
next (counter clock wise) half-edge in the origin ring

◆ nextLeftBd()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.nextLeftBd ( self,
Id_EdgeTag e,
FaceBitSet region = None )
given a (region) boundary edge with no right face in given region, returns next boundary edge for the same region: dest(e)==org(res)

◆ numValidFaces()

int meshlib.mrmeshpy.MeshTopology.numValidFaces ( self)
returns the number of valid faces

◆ numValidVerts()

int meshlib.mrmeshpy.MeshTopology.numValidVerts ( self)
returns the number of valid vertices

◆ org()

VertId meshlib.mrmeshpy.MeshTopology.org ( self,
Id_EdgeTag he )
returns origin vertex of half-edge

◆ pack() [1/2]

None meshlib.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

◆ pack() [2/2]

None meshlib.mrmeshpy.MeshTopology.pack ( self,
PackMapping 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

◆ packMinMem()

None meshlib.mrmeshpy.MeshTopology.packMinMem ( self,
PackMapping 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 meshlib.mrmeshpy.MeshTopology.preferEdges ( self,
UndirectedEdgeBitSet 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

◆ prev()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.prev ( self,
Id_EdgeTag he )
previous (clock wise) half-edge in the origin ring

◆ prevLeftBd()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.prevLeftBd ( self,
Id_EdgeTag e,
FaceBitSet region = None )
given a (region) boundary edge with no right face in given region, returns previous boundary edge for the same region; dest(res)==org(e)

◆ read()

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

◆ resizeBeforeParallelAdd()

None meshlib.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)

◆ right()

FaceId meshlib.mrmeshpy.MeshTopology.right ( self,
Id_EdgeTag he )
returns right face of half-edge

◆ rotateTriangles()

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

◆ setLeft()

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

◆ setOrg()

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

◆ sharedEdge()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.sharedEdge ( self,
FaceId l,
FaceId r )
if two valid faces share the same edge then it is found and returned

◆ sharedFace()

FaceId meshlib.mrmeshpy.MeshTopology.sharedFace ( self,
Id_EdgeTag a,
Id_EdgeTag b )
if two valid edges belong to same valid face then it is found and returned

◆ sharedVertInOrg() [1/2]

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.sharedVertInOrg ( self,
FaceId l,
FaceId r )
if two valid faces share the same vertex then it is found and returned as Edge with this vertex in origin

◆ sharedVertInOrg() [2/2]

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.sharedVertInOrg ( self,
Id_EdgeTag a,
Id_EdgeTag b )
if two valid edges share the same vertex then it is found and returned as Edge with this vertex in origin

◆ shrinkToFit()

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

◆ splice()

None meshlib.mrmeshpy.MeshTopology.splice ( self,
Id_EdgeTag a,
Id_EdgeTag 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()

Id_EdgeTag meshlib.mrmeshpy.MeshTopology.splitEdge ( self,
Id_EdgeTag e,
FaceBitSet region = None,
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag new2Old = None )
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 have the same face IDs, and the new edge will have new face IDs;
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()

VertId meshlib.mrmeshpy.MeshTopology.splitFace ( self,
FaceId f,
FaceBitSet region = None,
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag new2Old = None )
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 meshlib.mrmeshpy.MeshTopology.stopUpdatingValids ( self)
stops updating validVerts(), validFaces(), numValidVerts(), numValidFaces() for parallel processing of mesh parts

◆ undirectedEdgeCapacity()

int meshlib.mrmeshpy.MeshTopology.undirectedEdgeCapacity ( self)
returns the number of allocated undirected edges (pairs of half-edges)

◆ undirectedEdgeSize()

int meshlib.mrmeshpy.MeshTopology.undirectedEdgeSize ( self)
returns the number of undirected edges (pairs of half-edges) including lone ones

◆ updatingValids()

bool meshlib.mrmeshpy.MeshTopology.updatingValids ( self)
returns whether the methods validVerts(), validFaces(), numValidVerts(), numValidFaces() can be called

◆ vertCapacity()

int meshlib.mrmeshpy.MeshTopology.vertCapacity ( self)
returns the number of allocated vert records

◆ vertReserve()

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

◆ vertResize()

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

◆ vertResizeWithReserve()

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

◆ vertSize()

int meshlib.mrmeshpy.MeshTopology.vertSize ( self)
returns the number of vertex records including invalid ones

◆ write()

None meshlib.mrmeshpy.MeshTopology.write ( self,
typing.Any s )
saves in binary stream

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