MeshLib Java Docs
Loading...
Searching...
No Matches
meshlib.Polyline2 Class Reference
Inheritance diagram for meshlib.Polyline2:

Public Member Functions

 Polyline2 (java.lang.foreign.MemorySegment ptr, boolean owned, java.lang.Object owner)
 Polyline2 ()
 Polyline2 (meshlib.Polyline2 _other)
 Polyline2 (meshlib.std_vector_MR_Vector2f contour)
 Polyline2 (meshlib.std_vector_std_vector_MR_Vector2f contours)
 Polyline2 (meshlib.std_vector_MR_VertId comp2firstVert, meshlib.VertCoords2 ps)
meshlib.Polyline2 assignFromAnother (meshlib.Polyline2 _other)
meshlib.EdgeId addFromPoints (meshlib.Vector2f vs, long num, boolean closed)
meshlib.EdgeId addFromPoints (meshlib.Vector2f vs, long num)
void addPart (meshlib.Polyline2 from, meshlib.VertMap outVmap, meshlib.WholeEdgeMap outEmap)
void addPartByMask (meshlib.Polyline2 from, meshlib.UndirectedEdgeBitSet mask, meshlib.VertMap outVmap, meshlib.EdgeMap outEmap)
void pack (meshlib.VertMap outVmap, meshlib.WholeEdgeMap outEmap)
meshlib.Vector2f orgPnt (meshlib.EdgeId e)
meshlib.Vector2f destPnt (meshlib.EdgeId e)
meshlib.Vector2f edgePoint (meshlib.EdgeId e, float f)
meshlib.Vector2f edgePoint (meshlib.EdgePoint ep)
meshlib.Vector2f edgeCenter (meshlib.EdgeId e)
meshlib.Vector2f edgeVector (meshlib.EdgeId e)
meshlib.LineSegm2f edgeSegment (meshlib.EdgeId e)
meshlib.EdgePoint toEdgePoint (meshlib.VertId v)
meshlib.EdgePoint toEdgePoint (meshlib.EdgeId e, meshlib.Vector2f p)
float edgeLength (meshlib.EdgeId e)
float edgeLengthSq (meshlib.EdgeId e)
meshlib.Vector3f loopDirArea (meshlib.EdgeId e)
float totalLength ()
float averageEdgeLength ()
meshlib.AABBTreePolyline2 getAABBTree ()
meshlib.AABBTreePolyline2 getAABBTreeNotCreate ()
meshlib.Box2f getBoundingBox ()
meshlib.Box2f computeBoundingBox (meshlib.AffineXf2f toWorld)
meshlib.Vector2f findCenterFromPoints ()
void transform (meshlib.AffineXf2f xf)
meshlib.EdgeId splitEdge (meshlib.EdgeId e, meshlib.Vector2f newVertPos)
meshlib.EdgeId splitEdge (meshlib.EdgeId e)
void invalidateCaches ()
meshlib.std_vector_std_vector_MR_Vector2f contours (meshlib.std_vector_std_vector_MR_VertId vertMap)
meshlib.EdgeId addFromEdgePath (meshlib.Mesh mesh, meshlib.std_vector_MR_EdgeId path)
meshlib.EdgeId addFromSurfacePath (meshlib.Mesh mesh, meshlib.std_vector_MR_EdgePoint path)
meshlib.EdgeId addFromGeneralSurfacePath (meshlib.Mesh mesh, meshlib.MeshTriPoint start, meshlib.std_vector_MR_EdgePoint path, meshlib.MeshTriPoint end)
long heapBytes ()
meshlib.PolylineTopology topology ()
void setTopology (meshlib.PolylineTopology value)
meshlib.VertCoords2 points ()
void setPoints (meshlib.VertCoords2 value)
Public Member Functions inherited from meshlib.CppObject
final java.lang.foreign.MemorySegment rawPointer ()
final boolean isOwned ()
final void close ()
final java.lang.foreign.MemorySegment release ()

Additional Inherited Members

Protected Member Functions inherited from meshlib.CppObject
 CppObject (java.lang.foreign.MemorySegment ptr, java.util.function.Consumer< java.lang.foreign.MemorySegment > destroy, java.lang.Object owner)

Detailed Description

polyline that stores points of type V Generated from class MR::Polyline2.

Instances created here own their C++ objects, see CppObject.

Constructor & Destructor Documentation

◆ Polyline2() [1/6]

meshlib.Polyline2.Polyline2 ( java.lang.foreign.MemorySegment ptr,
boolean owned,
java.lang.Object owner )

Wraps a pointer from the C bindings. If owned, the object is destroyed when the wrapper dies. owner is kept alive as long as this wrapper is. Not for normal use.

◆ Polyline2() [2/6]

meshlib.Polyline2.Polyline2 ( )

Constructs an empty (default-constructed) instance.

Calls MR_Polyline2_DefaultConstruct().

◆ Polyline2() [3/6]

meshlib.Polyline2.Polyline2 ( meshlib.Polyline2 _other)

Generated from constructor MR::Polyline2::Polyline2. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.

Calls MR_Polyline2_ConstructFromAnother().

◆ Polyline2() [4/6]

meshlib.Polyline2.Polyline2 ( meshlib.std_vector_MR_Vector2f contour)

creates polyline from one contour (open or closed) Generated from constructor MR::Polyline2::Polyline2. The reference to the parameter contour might be preserved in the constructed object.

Calls MR_Polyline2_Construct_1_std_vector_MR_Vector2f().

◆ Polyline2() [5/6]

meshlib.Polyline2.Polyline2 ( meshlib.std_vector_std_vector_MR_Vector2f contours)

creates polyline from several contours (each can be open or closed) Generated from constructor MR::Polyline2::Polyline2. The reference to the parameter contours might be preserved in the constructed object.

Calls MR_Polyline2_Construct_1_std_vector_std_vector_MR_Vector2f().

◆ Polyline2() [6/6]

meshlib.Polyline2.Polyline2 ( meshlib.std_vector_MR_VertId comp2firstVert,
meshlib.VertCoords2 ps )

creates comp2firstVert.size()-1 not-closed polylines each pair (a,b) of indices in

Parameters
comp2firstVertdefines vertex range of a polyline [a,b)
pspoint coordinates Generated from constructor MR::Polyline2::Polyline2. The reference to the parameter comp2firstVert might be preserved in the constructed object. The reference to the parameter ps might be preserved in the constructed object.

Calls MR_Polyline2_Construct_2().

Member Function Documentation

◆ addFromEdgePath()

meshlib.EdgeId meshlib.Polyline2.addFromEdgePath ( meshlib.Mesh mesh,
meshlib.std_vector_MR_EdgeId path )

adds path to this polyline

Returns
the edge from first new to second new vertex Generated from method MR::Polyline2::addFromEdgePath.

Calls MR_Polyline2_addFromEdgePath().

◆ addFromGeneralSurfacePath()

meshlib.EdgeId meshlib.Polyline2.addFromGeneralSurfacePath ( meshlib.Mesh mesh,
meshlib.MeshTriPoint start,
meshlib.std_vector_MR_EdgePoint path,
meshlib.MeshTriPoint end )

adds general path = start-path-end (where both start and end are optional) to this polyline

Returns
the edge from first new to second new vertex Generated from method MR::Polyline2::addFromGeneralSurfacePath.

Calls MR_Polyline2_addFromGeneralSurfacePath().

◆ addFromPoints() [1/2]

meshlib.EdgeId meshlib.Polyline2.addFromPoints ( meshlib.Vector2f vs,
long num )

adds connected line in this, passing progressively via points *[vs, vs+num)

if num > 2 && vs[0] == vs[num-1] then a closed line is created

Returns
the edge from first new to second new vertex Generated from method MR::Polyline2::addFromPoints.

Calls MR_Polyline2_addFromPoints_2().

◆ addFromPoints() [2/2]

meshlib.EdgeId meshlib.Polyline2.addFromPoints ( meshlib.Vector2f vs,
long num,
boolean closed )

adds connected line in this, passing progressively via points *[vs, vs+num)

if closed argument is true then the last and the first points will be additionally connected

Returns
the edge from first new to second new vertex Generated from method MR::Polyline2::addFromPoints.

Calls MR_Polyline2_addFromPoints_3().

◆ addFromSurfacePath()

meshlib.EdgeId meshlib.Polyline2.addFromSurfacePath ( meshlib.Mesh mesh,
meshlib.std_vector_MR_EdgePoint path )

adds path to this polyline

Returns
the edge from first new to second new vertex Generated from method MR::Polyline2::addFromSurfacePath.

Calls MR_Polyline2_addFromSurfacePath().

◆ addPart()

void meshlib.Polyline2.addPart ( meshlib.Polyline2 from,
meshlib.VertMap outVmap,
meshlib.WholeEdgeMap outEmap )

appends polyline (from) in addition to this polyline: creates new edges, verts and points;

Parameters
outVmap,outEmap(optionally) returns mappings: from.id -> this.id Generated from method MR::Polyline2::addPart.

Calls MR_Polyline2_addPart().

◆ addPartByMask()

void meshlib.Polyline2.addPartByMask ( meshlib.Polyline2 from,
meshlib.UndirectedEdgeBitSet mask,
meshlib.VertMap outVmap,
meshlib.EdgeMap outEmap )

appends polyline (from) in addition to this polyline: creates new edges, verts and points Generated from method MR::Polyline2::addPartByMask.

Calls MR_Polyline2_addPartByMask().

◆ assignFromAnother()

meshlib.Polyline2 meshlib.Polyline2.assignFromAnother ( meshlib.Polyline2 _other)

Generated from method MR::Polyline2::operator=. The reference to things referred to by the parameter _other (if any) might be preserved in this object.

Calls MR_Polyline2_AssignFromAnother().

◆ averageEdgeLength()

float meshlib.Polyline2.averageEdgeLength ( )

returns average edge length in the polyline Generated from method MR::Polyline2::averageEdgeLength.

Calls MR_Polyline2_averageEdgeLength().

◆ computeBoundingBox()

meshlib.Box2f meshlib.Polyline2.computeBoundingBox ( meshlib.AffineXf2f toWorld)

passes through all valid points and finds the minimal bounding box containing all of them

if toWorld transformation is given then returns minimal bounding box in world space Generated from method MR::Polyline2::computeBoundingBox.

Calls MR_Polyline2_computeBoundingBox().

◆ contours()

convert Polyline to simple contour structures with vector of points inside

if all even edges are consistently oriented, then the output contours will be oriented the same

Parameters
vertMapoptional output map for for each contour point to corresponding VertId Generated from method MR::Polyline2::contours.

Calls MR_Polyline2_contours().

◆ destPnt()

meshlib.Vector2f meshlib.Polyline2.destPnt ( meshlib.EdgeId e)

returns coordinates of the edge destination Generated from method MR::Polyline2::destPnt.

Calls MR_Polyline2_destPnt().

◆ edgeCenter()

meshlib.Vector2f meshlib.Polyline2.edgeCenter ( meshlib.EdgeId e)

returns edge's centroid Generated from method MR::Polyline2::edgeCenter.

Calls MR_Polyline2_edgeCenter().

◆ edgeLength()

float meshlib.Polyline2.edgeLength ( meshlib.EdgeId e)

returns Euclidean length of the edge Generated from method MR::Polyline2::edgeLength.

Calls MR_Polyline2_edgeLength().

◆ edgeLengthSq()

float meshlib.Polyline2.edgeLengthSq ( meshlib.EdgeId e)

returns squared Euclidean length of the edge (faster to compute than length) Generated from method MR::Polyline2::edgeLengthSq.

Calls MR_Polyline2_edgeLengthSq().

◆ edgePoint() [1/2]

meshlib.Vector2f meshlib.Polyline2.edgePoint ( meshlib.EdgeId e,
float f )

returns a point on the edge: origin point for f=0 and destination point for f=1 Generated from method MR::Polyline2::edgePoint.

Calls MR_Polyline2_edgePoint_2().

◆ edgePoint() [2/2]

meshlib.Vector2f meshlib.Polyline2.edgePoint ( meshlib.EdgePoint ep)

computes coordinates of point given as edge and relative position on it Generated from method MR::Polyline2::edgePoint.

Calls MR_Polyline2_edgePoint_1().

◆ edgeSegment()

meshlib.LineSegm2f meshlib.Polyline2.edgeSegment ( meshlib.EdgeId e)

returns line segment of given edge Generated from method MR::Polyline2::edgeSegment.

Calls MR_Polyline2_edgeSegment().

◆ edgeVector()

meshlib.Vector2f meshlib.Polyline2.edgeVector ( meshlib.EdgeId e)

returns vector equal to edge destination point minus edge origin point Generated from method MR::Polyline2::edgeVector.

Calls MR_Polyline2_edgeVector().

◆ findCenterFromPoints()

meshlib.Vector2f meshlib.Polyline2.findCenterFromPoints ( )

computes average position of all valid polyline vertices Generated from method MR::Polyline2::findCenterFromPoints.

Calls MR_Polyline2_findCenterFromPoints().

◆ getAABBTree()

meshlib.AABBTreePolyline2 meshlib.Polyline2.getAABBTree ( )

returns cached aabb-tree for this polyline, creating it if it did not exist in a thread-safe manner Generated from method MR::Polyline2::getAABBTree.

Calls MR_Polyline2_getAABBTree().

◆ getAABBTreeNotCreate()

meshlib.AABBTreePolyline2 meshlib.Polyline2.getAABBTreeNotCreate ( )

returns cached aabb-tree for this polyline, but does not create it if it did not exist Generated from method MR::Polyline2::getAABBTreeNotCreate.

Calls MR_Polyline2_getAABBTreeNotCreate().

◆ getBoundingBox()

meshlib.Box2f meshlib.Polyline2.getBoundingBox ( )

returns the minimal bounding box containing all valid vertices (implemented via getAABBTree()) Generated from method MR::Polyline2::getBoundingBox.

Calls MR_Polyline2_getBoundingBox().

◆ heapBytes()

long meshlib.Polyline2.heapBytes ( )

returns the amount of memory this object occupies on heap Generated from method MR::Polyline2::heapBytes.

Calls MR_Polyline2_heapBytes().

◆ invalidateCaches()

void meshlib.Polyline2.invalidateCaches ( )

Invalidates caches (e.g. aabb-tree) after a change in polyline Generated from method MR::Polyline2::invalidateCaches.

Calls MR_Polyline2_invalidateCaches().

◆ loopDirArea()

meshlib.Vector3f meshlib.Polyline2.loopDirArea ( meshlib.EdgeId e)

calculates directed loop area if iterating in e direction .z = FLT_MAX if e does not represent a loop Generated from method MR::Polyline2::loopDirArea.

Calls MR_Polyline2_loopDirArea().

◆ orgPnt()

meshlib.Vector2f meshlib.Polyline2.orgPnt ( meshlib.EdgeId e)

returns coordinates of the edge origin Generated from method MR::Polyline2::orgPnt.

Calls MR_Polyline2_orgPnt().

◆ pack()

void meshlib.Polyline2.pack ( meshlib.VertMap outVmap,
meshlib.WholeEdgeMap outEmap )

tightly packs all arrays eliminating lone edges and invalid verts and points, optionally returns mappings: old.id -> new.id Generated from method MR::Polyline2::pack.

Calls MR_Polyline2_pack().

◆ points()

meshlib.VertCoords2 meshlib.Polyline2.points ( )

Returns a pointer to a member variable of class MR::Polyline2 named points. The reference to this object might be preserved as the return value.

Calls MR_Polyline2_Get_points().

◆ setPoints()

void meshlib.Polyline2.setPoints ( meshlib.VertCoords2 value)

Modifies a member variable of class MR::Polyline2 named points. The reference to the parameter value might be preserved in this object in element points.

Calls MR_Polyline2_Set_points().

◆ setTopology()

void meshlib.Polyline2.setTopology ( meshlib.PolylineTopology value)

Modifies a member variable of class MR::Polyline2 named topology. The reference to the parameter value might be preserved in this object in element topology.

Calls MR_Polyline2_Set_topology().

◆ splitEdge() [1/2]

meshlib.EdgeId meshlib.Polyline2.splitEdge ( meshlib.EdgeId e)

same, but split given edge on two equal parts Generated from method MR::Polyline2::splitEdge.

Calls MR_Polyline2_splitEdge_1().

◆ splitEdge() [2/2]

meshlib.EdgeId meshlib.Polyline2.splitEdge ( meshlib.EdgeId e,
meshlib.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) Generated from method MR::Polyline2::splitEdge.

Calls MR_Polyline2_splitEdge_2().

◆ toEdgePoint() [1/2]

meshlib.EdgePoint meshlib.Polyline2.toEdgePoint ( meshlib.EdgeId e,
meshlib.Vector2f p )

converts edge and point's coordinates into edge-point representation Generated from method MR::Polyline2::toEdgePoint.

Calls MR_Polyline2_toEdgePoint_2().

◆ toEdgePoint() [2/2]

meshlib.EdgePoint meshlib.Polyline2.toEdgePoint ( meshlib.VertId v)

converts vertex into edge-point representation Generated from method MR::Polyline2::toEdgePoint.

Calls MR_Polyline2_toEdgePoint_1().

◆ topology()

meshlib.PolylineTopology meshlib.Polyline2.topology ( )

Returns a pointer to a member variable of class MR::Polyline2 named topology. The reference to this object might be preserved as the return value.

Calls MR_Polyline2_Get_topology().

◆ totalLength()

float meshlib.Polyline2.totalLength ( )

returns total length of the polyline Generated from method MR::Polyline2::totalLength.

Calls MR_Polyline2_totalLength().

◆ transform()

void meshlib.Polyline2.transform ( meshlib.AffineXf2f xf)

applies given transformation to all valid polyline vertices Generated from method MR::Polyline2::transform.

Calls MR_Polyline2_transform().


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