49 VertMap * outVmap =
nullptr, WholeEdgeMap * outEmap =
nullptr );
53 VertMap* outVmap =
nullptr, EdgeMap* outEmap =
nullptr );
57 MRMESH_API void pack( VertMap * outVmap =
nullptr, WholeEdgeMap * outEmap =
nullptr );
157 template <
class Q = V>
158 [[nodiscard]]
typename std::enable_if_t< std::is_same_v<Q, Vector3f> >
mirror(
const Plane3f& plane )
162 p += 2.0f * ( plane.project( p ) - p );
179 for (
size_t i = 0; i <
points.size(); i++ )
#define MRMESH_API
Definition MRMeshFwd.h:80
bounding volume hierarchy for line segments
Definition MRAABBTreePolyline.h:30
Definition MRPolylineTopology.h:18
Definition MRSharedThreadSafeOwner.h:19
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
Contour
Definition MRObjectLabel.h:20
void push_back(const T &t MR_LIFETIME_CAPTURE_BY_NESTED(this))
Definition MRVector.h:132
Plane3f
Definition MRMeshFwd.h:393
void reserve(size_t capacity)
Definition MRVector.h:65
std::vector< MeshEdgePoint > SurfacePath
Definition MRMeshFwd.h:481
LineSegm
Definition MRMeshFwd.h:346
std::vector< EdgeId > EdgePath
Definition MRMeshFwd.h:147
SegmPointf a
a in [0,1], a=0 => point is in org( e ), a=1 => point is in dest( e )
Definition MREdgePoint.h:16
EdgeId e
Definition MREdgePoint.h:15
std::vector< Contour< V > > Contours
Definition MRMeshFwd.h:384
auto end(ViewportMask)
Definition MRViewportId.h:124
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRAffineXf.h:26
Box given by its min- and max- corners.
Definition MRBox.h:27
encodes a point on an edge of mesh or of polyline
Definition MREdgePoint.h:14
a segment of straight dimensional line
Definition MRLineSegm.h:15
Definition MRMeshTriPoint.h:26
V edgePoint(const EdgePoint &ep) const
computes coordinates of point given as edge and relative position on it
Definition MRPolyline.h:69
void addPartByMask(const Polyline< V > &from, const UndirectedEdgeBitSet &mask, VertMap *outVmap=nullptr, EdgeMap *outEmap=nullptr)
appends polyline (from) in addition to this polyline: creates new edges, verts and points
V edgePoint(EdgeId e, float f) const
returns a point on the edge: origin point for f=0 and destination point for f=1
Definition MRPolyline.h:66
void addPart(const Polyline< V > &from, VertMap *outVmap=nullptr, WholeEdgeMap *outEmap=nullptr)
V destPnt(EdgeId e) const
returns coordinates of the edge destination
Definition MRPolyline.h:63
float edgeLength(EdgeId e) const
returns Euclidean length of the edge
Definition MRPolyline.h:87
void invalidateCaches()
Invalidates caches (e.g. aabb-tree) after a change in polyline.
Definition MRPolyline.h:131
EdgeId splitEdge(EdgeId e, const V &newVertPos)
const AABBTreePolyline< V > * getAABBTreeNotCreate() const
returns cached aabb-tree for this polyline, but does not create it if it did not exist
Definition MRPolyline.h:106
V orgPnt(EdgeId e) const
returns coordinates of the edge origin
Definition MRPolyline.h:60
Polyline< U > toPolyline() const
convert Polyline3 to Polyline2 or vice versa
Definition MRPolyline.h:174
Polyline(const Contour< V > &contour)
creates polyline from one contour (open or closed)
EdgeId addFromPoints(const V *vs, size_t num)
EdgeId addFromEdgePath(const Mesh &mesh, const EdgePath &path)
float averageEdgeLength() const
returns average edge length in the polyline
Definition MRPolyline.h:100
void transform(const AffineXf< V > &xf)
applies given transformation to all valid polyline vertices
float totalLength() const
returns total length of the polyline
Vector< V, VertId > points
Definition MRPolyline.h:21
EdgeId addFromPoints(const V *vs, size_t num, bool closed)
PolylineTopology topology
Definition MRPolyline.h:20
EdgeId addFromSurfacePath(const Mesh &mesh, const SurfacePath &path)
Definition MRPolyline.h:148
EdgeId addFromGeneralSurfacePath(const Mesh &mesh, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end)
Box< V > computeBoundingBox(const AffineXf< V > *toWorld=nullptr) const
Polyline(const Contours< V > &contours)
creates polyline from several contours (each can be open or closed)
float edgeLengthSq(EdgeId e) const
returns squared Euclidean length of the edge (faster to compute than length)
Definition MRPolyline.h:90
Polyline(const std::vector< VertId > &comp2firstVert, Vector< V, VertId > ps)
V findCenterFromPoints() const
computes average position of all valid polyline vertices
V edgeVector(EdgeId e) const
returns vector equal to edge destination point minus edge origin point
Definition MRPolyline.h:75
Contours< V > contours(std::vector< std::vector< VertId > > *vertMap=nullptr) const
Box< V > getBoundingBox() const
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree())
EdgePoint toEdgePoint(EdgeId e, const V &p) const
converts edge and point's coordinates into edge-point representation
V edgeCenter(EdgeId e) const
returns edge's centroid
Definition MRPolyline.h:72
Vector3f loopDirArea(EdgeId e) const
EdgePoint toEdgePoint(VertId v) const
converts vertex into edge-point representation
Definition MRPolyline.h:81
const AABBTreePolyline< V > & getAABBTree() const
returns cached aabb-tree for this polyline, creating it if it did not exist in a thread-safe manner
size_t heapBytes() const
returns the amount of memory this object occupies on heap
LineSegm< V > edgeSegment(EdgeId e) const
returns line segment of given edge
Definition MRPolyline.h:78
std::enable_if_t< std::is_same_v< Q, Vector3f > > mirror(const Plane3f &plane)
reflects the polyline from a given plane. Enabled only for Polyline3f
Definition MRPolyline.h:158
EdgeId splitEdge(EdgeId e)
same, but split given edge on two equal parts
Definition MRPolyline.h:128
void pack(VertMap *outVmap=nullptr, WholeEdgeMap *outEmap=nullptr)