MeshLib C Docs
Loading...
Searching...
No Matches
MRPolyline.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRBox.h>
4#include <MRCMesh/MRId.h>
5#include <MRCMesh/MRVector2.h>
6#include <MRCMesh/MRVector3.h>
7#include <MRCMisc/common.h>
8#include <MRCMisc/exports.h>
9
10#include <stdbool.h>
11#include <stddef.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17typedef struct MR_AABBTreePolyline2 MR_AABBTreePolyline2; // Defined in `#include <MRCMesh/MRAABBTreePolyline.h>`.
18typedef struct MR_AABBTreePolyline3 MR_AABBTreePolyline3; // Defined in `#include <MRCMesh/MRAABBTreePolyline.h>`.
19typedef struct MR_AffineXf2f MR_AffineXf2f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
20typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
21typedef struct MR_EdgeMap MR_EdgeMap; // Defined in `#include <MRCMesh/MRVector.h>`.
22typedef struct MR_EdgePoint MR_EdgePoint; // Defined in `#include <MRCMesh/MREdgePoint.h>`.
23typedef struct MR_LineSegm2f MR_LineSegm2f; // Defined in `#include <MRCMesh/MRLineSegm.h>`.
24typedef struct MR_LineSegm3f MR_LineSegm3f; // Defined in `#include <MRCMesh/MRLineSegm.h>`.
25typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
26typedef struct MR_MeshTriPoint MR_MeshTriPoint; // Defined in `#include <MRCMesh/MRMeshTriPoint.h>`.
27typedef struct MR_Plane3f MR_Plane3f; // Defined in `#include <MRCMesh/MRPlane3.h>`.
28typedef struct MR_PolylineTopology MR_PolylineTopology; // Defined in `#include <MRCMesh/MRPolylineTopology.h>`.
29typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
30typedef struct MR_VertCoords MR_VertCoords; // Defined in `#include <MRCMesh/MRVector.h>`.
31typedef struct MR_VertCoords2 MR_VertCoords2; // Defined in `#include <MRCMesh/MRVector.h>`.
32typedef struct MR_VertMap MR_VertMap; // Defined in `#include <MRCMesh/MRVector.h>`.
33typedef struct MR_WholeEdgeMap MR_WholeEdgeMap; // Defined in `#include <MRCMesh/MRVector.h>`.
34typedef struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId; // Defined in `#include <MRCMisc/std_vector_MR_EdgeId.h>`.
35typedef struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_MR_EdgePoint.h>`.
36typedef struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_MR_Vector2f.h>`.
37typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
38typedef struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId; // Defined in `#include <MRCMisc/std_vector_MR_VertId.h>`.
39typedef struct MR_std_vector_std_vector_MR_Vector2f MR_std_vector_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_Vector2f.h>`.
40typedef struct MR_std_vector_std_vector_MR_Vector3f MR_std_vector_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_Vector3f.h>`.
41typedef struct MR_std_vector_std_vector_MR_VertId MR_std_vector_std_vector_MR_VertId; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_VertId.h>`.
42
43
47
51
56
60
65
70
74
79
83
88
91
94
98
104
110
118
121
124
129
136
143
152
161
169
174
179
184
190
195
200
206
212
219
224
229
235
240
245
251
256
261
268
269// computes average position of all valid polyline vertices
273
279
288
289// same, but split given edge on two equal parts
293
298
307
315
323
333
338
343
347
352
357
361
366
370
375
378
381
385
391
397
405
408
411
416
423
430
439
448
456
461
466
471
477
482
487
493
499
506
511
516
522
527
532
538
543
548
555
556// computes average position of all valid polyline vertices
560
566
575
576// same, but split given edge on two equal parts
580
585
594
602
610
620
625
631
632#ifdef __cplusplus
633} // extern "C"
634#endif
struct MR_std_vector_std_vector_MR_Vector2f MR_std_vector_std_vector_MR_Vector2f
Definition MR2DContoursTriangulation.h:22
struct MR_std_vector_std_vector_MR_VertId MR_std_vector_std_vector_MR_VertId
Definition MR2DContoursTriangulation.h:23
struct MR_AABBTreePolyline2 MR_AABBTreePolyline2
Definition MRAABBTreeBase.h:21
struct MR_AABBTreePolyline3 MR_AABBTreePolyline3
Definition MRAABBTreeBase.h:22
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:29
struct MR_VertCoords MR_VertCoords
Definition MRAABBTreePoints.h:22
struct MR_Polyline3 MR_Polyline3
Definition MRAABBTreePolyline.h:16
struct MR_Polyline2 MR_Polyline2
Definition MRAABBTreePolyline.h:15
struct MR_MeshTriPoint MR_MeshTriPoint
Definition MRAggregateFlow.h:13
struct MR_Plane3f MR_Plane3f
Definition MRBestFit.h:23
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:26
struct MR_VertMap MR_VertMap
Definition MRBitSet.h:41
struct MR_EdgeMap MR_EdgeMap
Definition MRBitSet.h:25
struct MR_WholeEdgeMap MR_WholeEdgeMap
Definition MRBooleanOperation.h:21
struct MR_VertCoords2 MR_VertCoords2
Definition MRChangeMeshAction.h:18
struct MR_std_vector_std_vector_MR_Vector3f MR_std_vector_std_vector_MR_Vector3f
Definition MRContour.h:17
struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f
Definition MRContour.h:11
struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId
Definition MRContoursStitch.h:11
struct MR_Mesh MR_Mesh
Definition MRCtm.h:13
struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint
Definition MREdgePaths.h:28
struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId
Definition MREdgePaths.h:30
struct MR_PolylineTopology MR_PolylineTopology
Definition MREdgePoint.h:15
struct MR_EdgePoint MR_EdgePoint
Definition MREdgePoint.h:21
struct MR_LineSegm3f MR_LineSegm3f
Definition MRFeatures.h:19
struct MR_LineSegm2f MR_LineSegm2f
Definition MRIntersection.h:9
MRC_API MR_EdgePoint * MR_Polyline2_toEdgePoint_1(const MR_Polyline2 *_this, MR_VertId v)
MRC_API const MR_Polyline3 * MR_Polyline3_OffsetPtr(const MR_Polyline3 *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const MR_Polyline2 * MR_Polyline2_OffsetPtr(const MR_Polyline2 *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Box3f MR_Polyline3_getBoundingBox(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline2_addFromGeneralSurfacePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_MeshTriPoint *start, const MR_std_vector_MR_EdgePoint *path, const MR_MeshTriPoint *end)
MRC_API MR_EdgePoint * MR_Polyline3_toEdgePoint_1(const MR_Polyline3 *_this, MR_VertId v)
MRC_API MR_Box2f MR_Polyline2_computeBoundingBox(const MR_Polyline2 *_this, const MR_AffineXf2f *toWorld)
MRC_API MR_Box3f MR_Polyline3_computeBoundingBox(const MR_Polyline3 *_this, const MR_AffineXf3f *toWorld)
MRC_API MR_EdgeId MR_Polyline2_splitEdge_1(MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_Vector3f MR_Polyline2_loopDirArea(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_addFromPoints_2(MR_Polyline3 *_this, const MR_Vector3f *vs, MR_uint64_t num)
MRC_API MR_Polyline2 * MR_Polyline2_OffsetMutablePtr(MR_Polyline2 *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Polyline2 * MR_Polyline2_Construct_2(const MR_std_vector_MR_VertId *comp2firstVert, MR_PassBy ps_pass_by, MR_VertCoords2 *ps)
MRC_API void MR_Polyline3_DestroyArray(const MR_Polyline3 *_this)
Destroys a heap-allocated array of MR_Polyline3. Does nothing if the pointer is null.
MRC_API void MR_Polyline2_transform(MR_Polyline2 *_this, const MR_AffineXf2f *xf)
MRC_API void MR_Polyline3_Set_topology(MR_Polyline3 *_this, MR_PassBy value_pass_by, MR_PolylineTopology *value)
MRC_API MR_EdgeId MR_Polyline3_addFromGeneralSurfacePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_MeshTriPoint *start, const MR_std_vector_MR_EdgePoint *path, const MR_MeshTriPoint *end)
MRC_API MR_std_vector_std_vector_MR_Vector2f * MR_Polyline2_contours(const MR_Polyline2 *_this, MR_std_vector_std_vector_MR_VertId *vertMap)
MRC_API const MR_AABBTreePolyline2 * MR_Polyline2_getAABBTreeNotCreate(const MR_Polyline2 *_this)
MRC_API MR_Polyline2 * MR_Polyline2_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Polyline2 *_other)
MRC_API void MR_Polyline3_mirror(MR_Polyline3 *_this, const MR_Plane3f *plane)
MRC_API MR_Vector2f MR_Polyline2_orgPnt(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_splitEdge_1(MR_Polyline3 *_this, MR_EdgeId e)
MRC_API float MR_Polyline2_totalLength(const MR_Polyline2 *_this)
MRC_API void MR_Polyline3_transform(MR_Polyline3 *_this, const MR_AffineXf3f *xf)
MRC_API void MR_Polyline3_pack(MR_Polyline3 *_this, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_Vector3f MR_Polyline3_edgePoint_1(const MR_Polyline3 *_this, const MR_EdgePoint *ep)
MRC_API MR_Polyline2 * MR_Polyline2_DefaultConstructArray(size_t num_elems)
MRC_API MR_Polyline3 * MR_Polyline3_DefaultConstructArray(size_t num_elems)
MRC_API MR_Polyline3 * MR_Polyline3_Construct_1_std_vector_MR_Vector3f(const MR_std_vector_MR_Vector3f *contour)
MRC_API void MR_Polyline2_DestroyArray(const MR_Polyline2 *_this)
Destroys a heap-allocated array of MR_Polyline2. Does nothing if the pointer is null.
MRC_API MR_EdgeId MR_Polyline3_addFromSurfacePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgePoint *path)
MRC_API MR_Vector2f MR_Polyline2_edgePoint_1(const MR_Polyline2 *_this, const MR_EdgePoint *ep)
MRC_API MR_LineSegm2f * MR_Polyline2_edgeSegment(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_addPart(MR_Polyline2 *_this, const MR_Polyline2 *from, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API void MR_Polyline2_pack(MR_Polyline2 *_this, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_Polyline2 * MR_Polyline2_Construct_1_std_vector_std_vector_MR_Vector2f(const MR_std_vector_std_vector_MR_Vector2f *contours)
MRC_API MR_Vector3f MR_Polyline3_edgePoint_2(const MR_Polyline3 *_this, MR_EdgeId e, float f)
MRC_API MR_EdgeId MR_Polyline2_addFromPoints_3(MR_Polyline2 *_this, const MR_Vector2f *vs, MR_uint64_t num, bool closed)
MRC_API const MR_VertCoords2 * MR_Polyline2_Get_points(const MR_Polyline2 *_this)
MRC_API MR_EdgePoint * MR_Polyline3_toEdgePoint_2(const MR_Polyline3 *_this, MR_EdgeId e, const MR_Vector3f *p)
MRC_API MR_Vector3f MR_Polyline3_loopDirArea(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector2f MR_Polyline2_edgeVector(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline2_splitEdge_2(MR_Polyline2 *_this, MR_EdgeId e, const MR_Vector2f *newVertPos)
MRC_API void MR_Polyline3_Destroy(const MR_Polyline3 *_this)
Destroys a heap-allocated instance of MR_Polyline3. Does nothing if the pointer is null.
MRC_API MR_Vector2f MR_Polyline2_edgeCenter(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API float MR_Polyline3_totalLength(const MR_Polyline3 *_this)
MRC_API float MR_Polyline2_averageEdgeLength(const MR_Polyline2 *_this)
MRC_API MR_Polyline2 * MR_Polyline2_Construct_1_std_vector_MR_Vector2f(const MR_std_vector_MR_Vector2f *contour)
MRC_API void MR_Polyline2_addPartByMask(MR_Polyline2 *_this, const MR_Polyline2 *from, const MR_UndirectedEdgeBitSet *mask, MR_VertMap *outVmap, MR_EdgeMap *outEmap)
MRC_API MR_std_vector_std_vector_MR_Vector3f * MR_Polyline3_contours(const MR_Polyline3 *_this, MR_std_vector_std_vector_MR_VertId *vertMap)
MRC_API const MR_AABBTreePolyline2 * MR_Polyline2_getAABBTree(const MR_Polyline2 *_this)
MRC_API MR_VertCoords2 * MR_Polyline2_GetMutable_points(MR_Polyline2 *_this)
MRC_API const MR_PolylineTopology * MR_Polyline2_Get_topology(const MR_Polyline2 *_this)
MRC_API float MR_Polyline3_averageEdgeLength(const MR_Polyline3 *_this)
MRC_API MR_Polyline3 * MR_Polyline3_DefaultConstruct(void)
MRC_API void MR_Polyline2_Destroy(const MR_Polyline2 *_this)
Destroys a heap-allocated instance of MR_Polyline2. Does nothing if the pointer is null.
MRC_API MR_Polyline3 * MR_Polyline3_Construct_1_std_vector_std_vector_MR_Vector3f(const MR_std_vector_std_vector_MR_Vector3f *contours)
MRC_API void MR_Polyline2_Set_topology(MR_Polyline2 *_this, MR_PassBy value_pass_by, MR_PolylineTopology *value)
MRC_API MR_Vector3f MR_Polyline3_findCenterFromPoints(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline3_splitEdge_2(MR_Polyline3 *_this, MR_EdgeId e, const MR_Vector3f *newVertPos)
MRC_API const MR_VertCoords * MR_Polyline3_Get_points(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline3_addFromEdgePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *path)
MRC_API void MR_Polyline3_Set_points(MR_Polyline3 *_this, MR_PassBy value_pass_by, MR_VertCoords *value)
MRC_API float MR_Polyline2_edgeLengthSq(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API float MR_Polyline2_edgeLength(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_invalidateCaches(MR_Polyline2 *_this)
MRC_API void MR_Polyline3_invalidateCaches(MR_Polyline3 *_this)
MRC_API MR_VertCoords * MR_Polyline3_GetMutable_points(MR_Polyline3 *_this)
MRC_API MR_PolylineTopology * MR_Polyline2_GetMutable_topology(MR_Polyline2 *_this)
MRC_API MR_uint64_t MR_Polyline3_heapBytes(const MR_Polyline3 *_this)
MRC_API MR_Polyline3 * MR_Polyline3_OffsetMutablePtr(MR_Polyline3 *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_PolylineTopology * MR_Polyline3_GetMutable_topology(MR_Polyline3 *_this)
MRC_API MR_uint64_t MR_Polyline2_heapBytes(const MR_Polyline2 *_this)
MRC_API MR_Vector3f MR_Polyline3_edgeCenter(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Polyline3 * MR_Polyline3_AssignFromAnother(MR_Polyline3 *_this, MR_PassBy _other_pass_by, MR_Polyline3 *_other)
MRC_API MR_EdgeId MR_Polyline2_addFromPoints_2(MR_Polyline2 *_this, const MR_Vector2f *vs, MR_uint64_t num)
MRC_API MR_Polyline2 * MR_Polyline2_DefaultConstruct(void)
MRC_API float MR_Polyline3_edgeLength(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Polyline3 * MR_Polyline3_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Polyline3 *_other)
MRC_API MR_Vector2f MR_Polyline2_edgePoint_2(const MR_Polyline2 *_this, MR_EdgeId e, float f)
MRC_API MR_Polyline2 * MR_Polyline2_AssignFromAnother(MR_Polyline2 *_this, MR_PassBy _other_pass_by, MR_Polyline2 *_other)
MRC_API MR_LineSegm3f * MR_Polyline3_edgeSegment(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector2f MR_Polyline2_findCenterFromPoints(const MR_Polyline2 *_this)
MRC_API MR_Vector3f MR_Polyline3_orgPnt(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector3f MR_Polyline3_edgeVector(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_addFromPoints_3(MR_Polyline3 *_this, const MR_Vector3f *vs, MR_uint64_t num, bool closed)
MRC_API float MR_Polyline3_edgeLengthSq(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_Set_points(MR_Polyline2 *_this, MR_PassBy value_pass_by, MR_VertCoords2 *value)
MRC_API const MR_AABBTreePolyline3 * MR_Polyline3_getAABBTreeNotCreate(const MR_Polyline3 *_this)
MRC_API const MR_PolylineTopology * MR_Polyline3_Get_topology(const MR_Polyline3 *_this)
MRC_API MR_Box2f MR_Polyline2_getBoundingBox(const MR_Polyline2 *_this)
MRC_API const MR_AABBTreePolyline3 * MR_Polyline3_getAABBTree(const MR_Polyline3 *_this)
MRC_API MR_EdgePoint * MR_Polyline2_toEdgePoint_2(const MR_Polyline2 *_this, MR_EdgeId e, const MR_Vector2f *p)
MRC_API void MR_Polyline3_addPart(MR_Polyline3 *_this, const MR_Polyline3 *from, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_EdgeId MR_Polyline2_addFromEdgePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *path)
MRC_API MR_EdgeId MR_Polyline2_addFromSurfacePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgePoint *path)
MRC_API MR_Vector3f MR_Polyline3_destPnt(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API void MR_Polyline3_addPartByMask(MR_Polyline3 *_this, const MR_Polyline3 *from, const MR_UndirectedEdgeBitSet *mask, MR_VertMap *outVmap, MR_EdgeMap *outEmap)
MRC_API MR_Polyline3 * MR_Polyline3_Construct_2(const MR_std_vector_MR_VertId *comp2firstVert, MR_PassBy ps_pass_by, MR_VertCoords *ps)
MRC_API MR_Vector2f MR_Polyline2_destPnt(const MR_Polyline2 *_this, MR_EdgeId e)
MR_PassBy
Definition common.h:19
uint64_t MR_uint64_t
Definition common.h:14
#define MRC_API
Definition exports.h:11
Definition MRAffineXf.h:20
Definition MRAffineXf.h:36
Definition MRBox.h:77
Definition MRBox.h:109
Definition MRId.h:152
Definition MRVector2.h:44
Definition MRVector3.h:51
Definition MRId.h:56