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

Public Member Functions

bool __eq__ (self, PolylineTopology b)
 
None __init__ (self)
 
None __init__ (self, PolylineTopology arg0)
 
bool __ne__ (self, PolylineTopology b)
 
None addPart (self, PolylineTopology from_, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
None addPartByMask (self, PolylineTopology from_, UndirectedEdgeBitSet mask, VertMap outVmap=None, EdgeMap outEmap=None)
 
VertId addVertId (self)
 
None buildOpenLines (self, std_vector_Id_VertTag comp2firstVert)
 
bool checkValidity (self)
 
int computeNotLoneUndirectedEdges (self)
 
None computeValidsFromEdges (self)
 
None deleteEdge (self, UndirectedEdgeId ue)
 
None deleteEdges (self, UndirectedEdgeBitSet es)
 
VertId dest (self, Id_EdgeTag he)
 
Vector_Id_EdgeTag_VertId edgePerVertex (self)
 
None edgeReserve (self, int newCapacity)
 
int edgeSize (self)
 
Id_EdgeTag edgeWithOrg (self, VertId a)
 
Id_EdgeTag findEdge (self, VertId o, VertId d)
 
None flip (self)
 
VertBitSet getPathVertices (self, std_vector_Id_EdgeTag path)
 
VertBitSet getValidVerts (self)
 
int getVertDegree (self, VertId a)
 
VertBitSet getVertIds (self, VertBitSet region)
 
bool hasEdge (self, Id_EdgeTag e)
 
bool hasVert (self, VertId a)
 
int heapBytes (self)
 
bool isClosed (self)
 
bool isConsistentlyOriented (self)
 
bool isLoneEdge (self, Id_EdgeTag a)
 
Id_EdgeTag lastNotLoneEdge (self)
 
VertId lastValidVert (self)
 
Id_EdgeTag makeEdge (self)
 
Id_EdgeTag makeEdge (self, VertId a, VertId b)
 
Id_EdgeTag makePolyline (self, VertId vs, int num)
 
Id_EdgeTag next (self, Id_EdgeTag he)
 
int numValidVerts (self)
 
VertId org (self, Id_EdgeTag he)
 
None pack (self, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
bool read (self, typing.Any s)
 
None setOrg (self, Id_EdgeTag a, VertId v)
 
None splice (self, Id_EdgeTag a, Id_EdgeTag b)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e)
 
int undirectedEdgeSize (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::PolylineTopology

topology of one or several polylines (how line segments are connected in lines) common for 2D and 3D polylines
\\ingroup PolylineGroup

Constructor & Destructor Documentation

◆ __init__() [1/2]

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

◆ __init__() [2/2]

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

Member Function Documentation

◆ __eq__()

bool meshlib.mrmeshpy.PolylineTopology.__eq__ ( self,
PolylineTopology b )
comparison via edges (all other members are considered as not important caches)

◆ __ne__()

bool meshlib.mrmeshpy.PolylineTopology.__ne__ ( self,
PolylineTopology b )

◆ addPart()

None meshlib.mrmeshpy.PolylineTopology.addPart ( self,
PolylineTopology from_,
VertMap outVmap = None,
WholeEdgeMap outEmap = None )
appends polyline topology (from) in addition to the current topology: creates new edges, verts;
\\param outVmap,outEmap (optionally) returns mappings: from.id -> this.id

◆ addPartByMask()

None meshlib.mrmeshpy.PolylineTopology.addPartByMask ( self,
PolylineTopology from_,
UndirectedEdgeBitSet mask,
VertMap outVmap = None,
EdgeMap outEmap = None )
appends polyline topology (from) in addition to the current topology: creates new edges, verts;

◆ addVertId()

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

◆ buildOpenLines()

None meshlib.mrmeshpy.PolylineTopology.buildOpenLines ( self,
std_vector_Id_VertTag comp2firstVert )
build topology of comp2firstVert.size()-1 not-closed polylines
each pair (a,b) of indices in \\param comp2firstVert defines vertex range of a polyline [a,b)

◆ checkValidity()

bool meshlib.mrmeshpy.PolylineTopology.checkValidity ( self)
verifies that all internal data structures are valid

◆ computeNotLoneUndirectedEdges()

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

◆ computeValidsFromEdges()

None meshlib.mrmeshpy.PolylineTopology.computeValidsFromEdges ( self)
computes numValidVerts_ and validVerts_ from edgePerVertex_

◆ deleteEdge()

None meshlib.mrmeshpy.PolylineTopology.deleteEdge ( self,
UndirectedEdgeId ue )
given edge becomes lone after the call, so it is un-spliced from connected edges, and if it was not connected at origin or destination, then that vertex is deleted as well

◆ deleteEdges()

None meshlib.mrmeshpy.PolylineTopology.deleteEdges ( self,
UndirectedEdgeBitSet es )
calls deleteEdge for every set bit

◆ dest()

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

◆ edgePerVertex()

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

◆ edgeReserve()

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

◆ edgeSize()

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

◆ edgeWithOrg()

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

◆ findEdge()

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

◆ flip()

None meshlib.mrmeshpy.PolylineTopology.flip ( self)
changes the orientation of all edges: every edge e is replaced with e.sym()

◆ getPathVertices()

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

◆ getValidVerts()

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

◆ getVertDegree()

int meshlib.mrmeshpy.PolylineTopology.getVertDegree ( self,
VertId a )
returns 0 if given vertex does not exist, 1 if it has one incident edge, and 2 if it has two incident edges

◆ getVertIds()

VertBitSet meshlib.mrmeshpy.PolylineTopology.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.PolylineTopology.hasEdge ( self,
Id_EdgeTag e )
returns true if given edge is within valid range and not-lone

◆ hasVert()

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

◆ heapBytes()

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

◆ isClosed()

bool meshlib.mrmeshpy.PolylineTopology.isClosed ( self)
returns true if the polyline does not have any holes

◆ isConsistentlyOriented()

bool meshlib.mrmeshpy.PolylineTopology.isConsistentlyOriented ( self)
returns true if for each edge e: e == e.next() || e.odd() == next( e ).sym().odd()

◆ isLoneEdge()

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

◆ lastNotLoneEdge()

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

◆ lastValidVert()

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

◆ makeEdge() [1/2]

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

◆ makeEdge() [2/2]

Id_EdgeTag meshlib.mrmeshpy.PolylineTopology.makeEdge ( self,
VertId a,
VertId b )
makes an edge from vertex a to b (both must be within reserved capacity for vertices)
\\details if either of the vertices already has 2 incident edges, then makeEdge(a,b) fails and returns invalid edge

◆ makePolyline()

Id_EdgeTag meshlib.mrmeshpy.PolylineTopology.makePolyline ( self,
VertId vs,
int num )
adds polyline in this topology passing progressively via vertices *[vs, vs+num);
if vs[0] == vs[num-1] then a closed polyline is created;
return the edge from first to second vertex

◆ next()

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

◆ numValidVerts()

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

◆ org()

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

◆ pack()

None meshlib.mrmeshpy.PolylineTopology.pack ( self,
VertMap outVmap = None,
WholeEdgeMap outEmap = None )
tightly packs all arrays eliminating lone edges and invalid vertices
\\param outVmap,outEmap if given returns mappings: old.id -> new.id;

◆ read()

bool meshlib.mrmeshpy.PolylineTopology.read ( self,
typing.Any s )

◆ setOrg()

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

◆ splice()

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

◆ splitEdge()

Id_EdgeTag meshlib.mrmeshpy.PolylineTopology.splitEdge ( self,
Id_EdgeTag e )
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)

◆ undirectedEdgeSize()

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

◆ vertCapacity()

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

◆ vertReserve()

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

◆ vertResize()

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

◆ vertResizeWithReserve()

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

◆ vertSize()

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

◆ write()

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

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