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

Public Member Functions

None __init__ (self)
 
None __init__ (self, std_vector_std_vector_Vector2_float contours)
 
None __init__ (self, std_vector_std_vector_Vector3_float contours)
 
None __init__ (self, std_vector_Id_VertTag comp2firstVert, VertCoords ps)
 
None __init__ (self, Polyline3 arg0)
 
Id_EdgeTag addFromEdgePath (self, Mesh mesh, std_vector_Id_EdgeTag path)
 
Id_EdgeTag addFromGeneralSurfacePath (self, Mesh mesh, MeshTriPoint start, std_vector_EdgePoint path, MeshTriPoint end)
 
Id_EdgeTag addFromPoints (self, Vector3f vs, int num, bool closed)
 
Id_EdgeTag addFromPoints (self, Vector3f vs, int num)
 
Id_EdgeTag addFromSurfacePath (self, Mesh mesh, std_vector_EdgePoint path)
 
None addPart (self, Polyline3 from_, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
None addPartByMask (self, Polyline3 from_, UndirectedEdgeBitSet mask, VertMap outVmap=None, EdgeMap outEmap=None)
 
Box3f computeBoundingBox (self, AffineXf3f toWorld=None)
 
std_vector_std_vector_Vector3_float contours (self, std_vector_std_vector_Id_VertTag vertMap=None)
 
std_vector_std_vector_Vector2_float contours2 (self, std_vector_std_vector_Id_VertTag vertMap=None)
 
Vector3f destPnt (self, Id_EdgeTag e)
 
Vector3f edgeCenter (self, Id_EdgeTag e)
 
float edgeLength (self, Id_EdgeTag e)
 
float edgeLengthSq (self, Id_EdgeTag e)
 
Vector3f edgePoint (self, Id_EdgeTag e, float f)
 
Vector3f edgePoint (self, EdgePoint ep)
 
LineSegm3f edgeSegment (self, Id_EdgeTag e)
 
Vector3f edgeVector (self, Id_EdgeTag e)
 
Vector3f findCenterFromPoints (self)
 
AABBTreePolyline3 getAABBTree (self)
 
AABBTreePolyline3 getAABBTreeNotCreate (self)
 
Box3f getBoundingBox (self)
 
int heapBytes (self)
 
None invalidateCaches (self)
 
Vector3f loopDirArea (self, Id_EdgeTag e)
 
Vector3f orgPnt (self, Id_EdgeTag e)
 
None pack (self, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e, Vector3f newVertPos)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e)
 
EdgePoint toEdgePoint (self, VertId v)
 
EdgePoint toEdgePoint (self, Id_EdgeTag e, Vector3f p)
 
float totalLength (self)
 
None transform (self, AffineXf3f xf)
 

Detailed Description

Generated from:  MR::Polyline3
Aliases:  Polyline_Vector3f, PolylineTraits_Vector3f.Polyline, PolylineTraits_Vector3f.Polyline, Polyline_Vector3f

polyline that stores points of type V
\\ingroup PolylineGroup

Constructor & Destructor Documentation

◆ __init__() [1/5]

None meshlib.mrmeshpy.Polyline3.__init__ ( self)

◆ __init__() [2/5]

None meshlib.mrmeshpy.Polyline3.__init__ ( self,
std_vector_std_vector_Vector2_float contours )
creates polyline from 2D contours, 3D polyline will get zero z-component

◆ __init__() [3/5]

None meshlib.mrmeshpy.Polyline3.__init__ ( self,
std_vector_std_vector_Vector3_float contours )
creates polyline from 3D contours, 2D polyline will lose z-component

◆ __init__() [4/5]

None meshlib.mrmeshpy.Polyline3.__init__ ( self,
std_vector_Id_VertTag comp2firstVert,
VertCoords ps )
creates comp2firstVert.size()-1 not-closed polylines
each pair (a,b) of indices in \\param comp2firstVert defines vertex range of a polyline [a,b)
\\param ps point coordinates

◆ __init__() [5/5]

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

Member Function Documentation

◆ addFromEdgePath()

Id_EdgeTag meshlib.mrmeshpy.Polyline3.addFromEdgePath ( self,
Mesh mesh,
std_vector_Id_EdgeTag path )
adds path to this polyline
\\return the edge from first new to second new vertex

◆ addFromGeneralSurfacePath()

Id_EdgeTag meshlib.mrmeshpy.Polyline3.addFromGeneralSurfacePath ( self,
Mesh mesh,
MeshTriPoint start,
std_vector_EdgePoint path,
MeshTriPoint end )
adds general path = start-path-end (where both start and end are optional) to this polyline
\\return the edge from first new to second new vertex

◆ addFromPoints() [1/2]

Id_EdgeTag meshlib.mrmeshpy.Polyline3.addFromPoints ( self,
Vector3f vs,
int num )
adds connected line in this, passing progressively via points *[vs, vs+num)
\\details if vs[0] == vs[num-1] then a closed line is created
\\return the edge from first new to second new vertex

◆ addFromPoints() [2/2]

Id_EdgeTag meshlib.mrmeshpy.Polyline3.addFromPoints ( self,
Vector3f vs,
int num,
bool closed )
adds connected line in this, passing progressively via points *[vs, vs+num)
\\details if closed argument is true then the last and the first points will be additionally connected
\\return the edge from first new to second new vertex    

◆ addFromSurfacePath()

Id_EdgeTag meshlib.mrmeshpy.Polyline3.addFromSurfacePath ( self,
Mesh mesh,
std_vector_EdgePoint path )
adds path to this polyline
\\return the edge from first new to second new vertex

◆ addPart()

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

◆ addPartByMask()

None meshlib.mrmeshpy.Polyline3.addPartByMask ( self,
Polyline3 from_,
UndirectedEdgeBitSet mask,
VertMap outVmap = None,
EdgeMap outEmap = None )
appends polyline (from) in addition to this polyline: creates new edges, verts and points

◆ computeBoundingBox()

Box3f meshlib.mrmeshpy.Polyline3.computeBoundingBox ( self,
AffineXf3f toWorld = None )
passes through all valid points and finds the minimal bounding box containing all of them
\\details if toWorld transformation is given then returns minimal bounding box in world space

◆ contours()

std_vector_std_vector_Vector3_float meshlib.mrmeshpy.Polyline3.contours ( self,
std_vector_std_vector_Id_VertTag vertMap = None )
convert Polyline to simple contour structures with vector of points inside
\\details if all even edges are consistently oriented, then the output contours will be oriented the same
\\param vertMap optional output map for for each contour point to corresponding VertId

◆ contours2()

std_vector_std_vector_Vector2_float meshlib.mrmeshpy.Polyline3.contours2 ( self,
std_vector_std_vector_Id_VertTag vertMap = None )
convert Polyline to simple 2D contour structures with vector of points inside
\\details if all even edges are consistently oriented, then the output contours will be oriented the same
\\param vertMap optional output map for for each contour point to corresponding VertId

◆ destPnt()

Vector3f meshlib.mrmeshpy.Polyline3.destPnt ( self,
Id_EdgeTag e )
returns coordinates of the edge destination

◆ edgeCenter()

Vector3f meshlib.mrmeshpy.Polyline3.edgeCenter ( self,
Id_EdgeTag e )
returns edge's centroid

◆ edgeLength()

float meshlib.mrmeshpy.Polyline3.edgeLength ( self,
Id_EdgeTag e )
returns Euclidean length of the edge

◆ edgeLengthSq()

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

◆ edgePoint() [1/2]

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

◆ edgePoint() [2/2]

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

◆ edgeSegment()

LineSegm3f meshlib.mrmeshpy.Polyline3.edgeSegment ( self,
Id_EdgeTag e )
returns line segment of given edge

◆ edgeVector()

Vector3f meshlib.mrmeshpy.Polyline3.edgeVector ( self,
Id_EdgeTag e )
returns vector equal to edge destination point minus edge origin point

◆ findCenterFromPoints()

Vector3f meshlib.mrmeshpy.Polyline3.findCenterFromPoints ( self)
computes average position of all valid polyline vertices

◆ getAABBTree()

AABBTreePolyline3 meshlib.mrmeshpy.Polyline3.getAABBTree ( self)
returns cached aabb-tree for this polyline, creating it if it did not exist in a thread-safe manner

◆ getAABBTreeNotCreate()

AABBTreePolyline3 meshlib.mrmeshpy.Polyline3.getAABBTreeNotCreate ( self)
returns cached aabb-tree for this polyline, but does not create it if it did not exist

◆ getBoundingBox()

Box3f meshlib.mrmeshpy.Polyline3.getBoundingBox ( self)
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree())

◆ heapBytes()

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

◆ invalidateCaches()

None meshlib.mrmeshpy.Polyline3.invalidateCaches ( self)
Invalidates caches (e.g. aabb-tree) after a change in polyline

◆ loopDirArea()

Vector3f meshlib.mrmeshpy.Polyline3.loopDirArea ( self,
Id_EdgeTag e )
calculates directed loop area if iterating in `e` direction
.z = FLT_MAX if `e` does not represent a loop

◆ orgPnt()

Vector3f meshlib.mrmeshpy.Polyline3.orgPnt ( self,
Id_EdgeTag e )
returns coordinates of the edge origin

◆ pack()

None meshlib.mrmeshpy.Polyline3.pack ( self,
VertMap outVmap = None,
WholeEdgeMap outEmap = None )
tightly packs all arrays eliminating lone edges and invalid verts and points,
optionally returns mappings: old.id -> new.id

◆ splitEdge() [1/2]

Id_EdgeTag meshlib.mrmeshpy.Polyline3.splitEdge ( self,
Id_EdgeTag e )
same, but split given edge on two equal parts

◆ splitEdge() [2/2]

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

◆ toEdgePoint() [1/2]

EdgePoint meshlib.mrmeshpy.Polyline3.toEdgePoint ( self,
Id_EdgeTag e,
Vector3f p )
converts edge and point's coordinates into edge-point representation

◆ toEdgePoint() [2/2]

EdgePoint meshlib.mrmeshpy.Polyline3.toEdgePoint ( self,
VertId v )
converts vertex into edge-point representation

◆ totalLength()

float meshlib.mrmeshpy.Polyline3.totalLength ( self)
returns total length of the polyline

◆ transform()

None meshlib.mrmeshpy.Polyline3.transform ( self,
AffineXf3f xf )
applies given transformation to all valid polyline vertices

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