MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.Polyline2 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, VertUVCoords ps)
 
None __init__ (self, Polyline2 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, Vector2f vs, int num, bool closed)
 
Id_EdgeTag addFromPoints (self, Vector2f vs, int num)
 
Id_EdgeTag addFromSurfacePath (self, Mesh mesh, std_vector_EdgePoint path)
 
None addPart (self, Polyline2 from_, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
None addPartByMask (self, Polyline2 from_, UndirectedEdgeBitSet mask, VertMap outVmap=None, EdgeMap outEmap=None)
 
Box2f computeBoundingBox (self, AffineXf2f toWorld=None)
 
std_vector_std_vector_Vector2_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)
 
Vector2f destPnt (self, Id_EdgeTag e)
 
Vector2f edgeCenter (self, Id_EdgeTag e)
 
float edgeLength (self, Id_EdgeTag e)
 
float edgeLengthSq (self, Id_EdgeTag e)
 
Vector2f edgePoint (self, Id_EdgeTag e, float f)
 
Vector2f edgePoint (self, EdgePoint ep)
 
LineSegm2f edgeSegment (self, Id_EdgeTag e)
 
Vector2f edgeVector (self, Id_EdgeTag e)
 
Vector2f findCenterFromPoints (self)
 
AABBTreePolyline2 getAABBTree (self)
 
AABBTreePolyline2 getAABBTreeNotCreate (self)
 
Box2f getBoundingBox (self)
 
int heapBytes (self)
 
None invalidateCaches (self)
 
Vector3f loopDirArea (self, Id_EdgeTag e)
 
Vector2f orgPnt (self, Id_EdgeTag e)
 
None pack (self, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e, Vector2f newVertPos)
 
Id_EdgeTag splitEdge (self, Id_EdgeTag e)
 
EdgePoint toEdgePoint (self, VertId v)
 
EdgePoint toEdgePoint (self, Id_EdgeTag e, Vector2f p)
 
float totalLength (self)
 
None transform (self, AffineXf2f xf)
 

Static Protected Member Functions

 _pybind11_conduit_v1_ (*args, **kwargs)
 

Detailed Description

Generated from:  MR::Polyline2
Aliases:  PolylineTraits_Vector2f.Polyline

polyline that stores points of type V
\\ingroup PolylineGroup

Constructor & Destructor Documentation

◆ __init__() [1/5]

None mrmeshpy.Polyline2.__init__ ( self)

◆ __init__() [2/5]

None mrmeshpy.Polyline2.__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 mrmeshpy.Polyline2.__init__ ( self,
std_vector_std_vector_Vector3_float contours )
creates polyline from 3D contours, 2D polyline will lose z-component

◆ __init__() [4/5]

None mrmeshpy.Polyline2.__init__ ( self,
std_vector_Id_VertTag comp2firstVert,
VertUVCoords 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 mrmeshpy.Polyline2.__init__ ( self,
Polyline2 arg0 )
Implicit copy constructor.

Member Function Documentation

◆ _pybind11_conduit_v1_()

mrmeshpy.Polyline2._pybind11_conduit_v1_ ( * args,
** kwargs )
staticprotected

◆ addFromEdgePath()

Id_EdgeTag mrmeshpy.Polyline2.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 mrmeshpy.Polyline2.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 mrmeshpy.Polyline2.addFromPoints ( self,
Vector2f 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 mrmeshpy.Polyline2.addFromPoints ( self,
Vector2f 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 mrmeshpy.Polyline2.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 mrmeshpy.Polyline2.addPart ( self,
Polyline2 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 mrmeshpy.Polyline2.addPartByMask ( self,
Polyline2 from_,
UndirectedEdgeBitSet mask,
VertMap outVmap = None,
EdgeMap outEmap = None )
appends polyline (from) in addition to this polyline: creates new edges, verts and points

◆ computeBoundingBox()

Box2f mrmeshpy.Polyline2.computeBoundingBox ( self,
AffineXf2f 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_Vector2_float mrmeshpy.Polyline2.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 mrmeshpy.Polyline2.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()

Vector2f mrmeshpy.Polyline2.destPnt ( self,
Id_EdgeTag e )
returns coordinates of the edge destination

◆ edgeCenter()

Vector2f mrmeshpy.Polyline2.edgeCenter ( self,
Id_EdgeTag e )
returns edge's centroid

◆ edgeLength()

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

◆ edgeLengthSq()

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

◆ edgePoint() [1/2]

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

◆ edgePoint() [2/2]

Vector2f mrmeshpy.Polyline2.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()

LineSegm2f mrmeshpy.Polyline2.edgeSegment ( self,
Id_EdgeTag e )
returns line segment of given edge

◆ edgeVector()

Vector2f mrmeshpy.Polyline2.edgeVector ( self,
Id_EdgeTag e )
returns vector equal to edge destination point minus edge origin point

◆ findCenterFromPoints()

Vector2f mrmeshpy.Polyline2.findCenterFromPoints ( self)
computes average position of all valid polyline vertices

◆ getAABBTree()

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

◆ getAABBTreeNotCreate()

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

◆ getBoundingBox()

Box2f mrmeshpy.Polyline2.getBoundingBox ( self)
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree())

◆ heapBytes()

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

◆ invalidateCaches()

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

◆ loopDirArea()

Vector3f mrmeshpy.Polyline2.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()

Vector2f mrmeshpy.Polyline2.orgPnt ( self,
Id_EdgeTag e )
returns coordinates of the edge origin

◆ pack()

None mrmeshpy.Polyline2.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 mrmeshpy.Polyline2.splitEdge ( self,
Id_EdgeTag e )
same, but split given edge on two equal parts

◆ splitEdge() [2/2]

Id_EdgeTag mrmeshpy.Polyline2.splitEdge ( self,
Id_EdgeTag e,
Vector2f 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 mrmeshpy.Polyline2.toEdgePoint ( self,
Id_EdgeTag e,
Vector2f p )
converts edge and point's coordinates into edge-point representation

◆ toEdgePoint() [2/2]

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

◆ totalLength()

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

◆ transform()

None mrmeshpy.Polyline2.transform ( self,
AffineXf2f xf )
applies given transformation to all valid polyline vertices

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