MeshLib C Docs
Loading...
Searching...
No Matches
MROneMeshContours.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MREnums.h>
4#include <MRCMesh/MRVector3.h>
5#include <MRCMisc/common.h>
6#include <MRCMisc/exports.h>
7
8#include <stdbool.h>
9#include <stddef.h>
10#include <stdint.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
17typedef struct MR_CoordinateConverters MR_CoordinateConverters; // Defined in `#include <MRCMesh/MRPrecisePredicates3.h>`.
18typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
19typedef struct MR_MeshTriPoint MR_MeshTriPoint; // Defined in `#include <MRCMesh/MRMeshTriPoint.h>`.
20typedef struct MR_expected_MR_OneMeshContour_std_string MR_expected_MR_OneMeshContour_std_string; // Defined in `#include <MRCMisc/expected_MR_OneMeshContour_std_string.h>`.
21typedef struct MR_phmap_flat_hash_map_MR_FaceId_MR_FaceId MR_phmap_flat_hash_map_MR_FaceId_MR_FaceId; // Defined in `#include <MRCMisc/phmap_flat_hash_map_MR_FaceId_MR_FaceId.h>`.
22typedef struct MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref; // Defined in `#include <MRCMisc/std_function_MR_Vector3i_from_const_MR_Vector3f_ref.h>`.
23typedef struct MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId; // Defined in `#include <MRCMisc/std_variant_MR_FaceId_MR_EdgeId_MR_VertId.h>`.
24typedef struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_MR_EdgePoint.h>`.
25typedef struct MR_std_vector_MR_MeshTriPoint MR_std_vector_MR_MeshTriPoint; // Defined in `#include <MRCMisc/std_vector_MR_MeshTriPoint.h>`.
26typedef struct MR_std_vector_MR_OneMeshContour MR_std_vector_MR_OneMeshContour; // Defined in `#include <MRCMisc/std_vector_MR_OneMeshContour.h>`.
27typedef struct MR_std_vector_MR_OneMeshIntersection MR_std_vector_MR_OneMeshIntersection; // Defined in `#include <MRCMisc/std_vector_MR_OneMeshIntersection.h>`.
28typedef struct MR_std_vector_int32_t MR_std_vector_int32_t; // Defined in `#include <MRCMisc/std_vector_int32_t.h>`.
29typedef struct MR_std_vector_std_vector_MR_EdgePoint MR_std_vector_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_EdgePoint.h>`.
30typedef struct MR_std_vector_std_vector_MR_VarEdgeTri MR_std_vector_std_vector_MR_VarEdgeTri; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_VarEdgeTri.h>`.
31typedef 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>`.
32
33
34// Special data to sort intersections more accurate
37
38// Simple point on mesh, represented by primitive id and coordinate in mesh space
41
42// One contour on mesh
45
49
54
59
64
68
73
78
82
87
92
96
101
106
110
115
119
125
128
131
134
137
142
147
152
157
161
166
170
175
180
183
186
191
194
197
203
208
212
217
222
226
231
235
240
244
247
250
254
257
260
265
266// Divides faces that fully own contours into 3 parts with center in center mass of one of the face contours
267// if there is more than one contour on face it guarantee to subdivide at least one lone contour on this face
273
286MRC_API void MR_getOneMeshIntersectionContours(const MR_Mesh *meshA, const MR_Mesh *meshB, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, MR_std_vector_MR_OneMeshContour *outA, MR_std_vector_MR_OneMeshContour *outB, const MR_CoordinateConverters *converters, const MR_AffineXf3f *rigidB2A, MR_std_vector_std_vector_MR_Vector3f *outPtsA, const bool *addSelfyTerminalVerts);
287
288// Converts ordered continuous self contours of single meshes to OneMeshContours
289// converters are required for better precision in case of degenerations
297
298// Converts OneMeshContours contours representation to Contours3f: set of coordinates
303
309
314
320
326
331
337
341
346
350
353
356
361
364
367
373
389
405
431
442
443#ifdef __cplusplus
444} // extern "C"
445#endif
struct MR_std_vector_MR_MeshTriPoint MR_std_vector_MR_MeshTriPoint
Definition MRAggregateFlow.h:23
struct MR_MeshTriPoint MR_MeshTriPoint
Definition MRAggregateFlow.h:13
struct MR_phmap_flat_hash_map_MR_FaceId_MR_FaceId MR_phmap_flat_hash_map_MR_FaceId_MR_FaceId
Definition MRBitSet.h:43
struct MR_std_vector_std_vector_MR_Vector3f MR_std_vector_std_vector_MR_Vector3f
Definition MRContour.h:17
struct MR_std_vector_MR_OneMeshContour MR_std_vector_MR_OneMeshContour
Definition MRContoursCut.h:25
struct MR_SearchPathSettings MR_SearchPathSettings
Definition MRContoursCut.h:17
struct MR_SortIntersectionsData MR_SortIntersectionsData
Definition MRContoursCut.h:18
struct MR_Mesh MR_Mesh
Definition MRCtm.h:13
struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint
Definition MREdgePaths.h:28
char MR_GeodesicPathApprox
the algorithm to compute approximately geodesic path
Definition MREnums.h:90
struct MR_std_vector_std_vector_MR_EdgePoint MR_std_vector_std_vector_MR_EdgePoint
Definition MRExtractIsolines.h:27
struct MR_std_vector_std_vector_MR_VarEdgeTri MR_std_vector_std_vector_MR_VarEdgeTri
Definition MRIntersectionContour.h:16
struct MR_std_vector_int32_t MR_std_vector_int32_t
Definition MRIntersectionContour.h:15
struct MR_CoordinateConverters MR_CoordinateConverters
Definition MRMeshBoolean.h:16
struct MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref
Definition MRMeshCollidePrecise.h:19
MRC_API void MR_OneMeshIntersection_Set_primitiveId(MR_OneMeshIntersection *_this, const MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId *value)
MRC_API const int32_t * MR_SearchPathSettings_Get_maxReduceIters(const MR_SearchPathSettings *_this)
MRC_API const MR_SortIntersectionsData * MR_SortIntersectionsData_OffsetPtr(const MR_SortIntersectionsData *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 void MR_SortIntersectionsData_Destroy(const MR_SortIntersectionsData *_this)
Destroys a heap-allocated instance of MR_SortIntersectionsData. Does nothing if the pointer is null.
MRC_API const bool * MR_SortIntersectionsData_Get_isOtherA(const MR_SortIntersectionsData *_this)
MRC_API int32_t * MR_SearchPathSettings_GetMutable_maxReduceIters(MR_SearchPathSettings *_this)
MRC_API const MR_Mesh * MR_SortIntersectionsData_Get_otherMesh(const MR_SortIntersectionsData *_this)
MRC_API MR_SortIntersectionsData * MR_SortIntersectionsData_ConstructFromAnother(MR_PassBy _other_pass_by, MR_SortIntersectionsData *_other)
MRC_API void MR_OneMeshContour_Set_intersections(MR_OneMeshContour *_this, MR_PassBy value_pass_by, MR_std_vector_MR_OneMeshIntersection *value)
MRC_API void MR_OneMeshIntersection_DestroyArray(const MR_OneMeshIntersection *_this)
Destroys a heap-allocated array of MR_OneMeshIntersection. Does nothing if the pointer is null.
MRC_API MR_OneMeshContour * MR_OneMeshContour_AssignFromAnother(MR_OneMeshContour *_this, MR_PassBy _other_pass_by, MR_OneMeshContour *_other)
MRC_API MR_std_vector_MR_OneMeshContour * MR_convertSurfacePathsToMeshContours(const MR_Mesh *mesh, const MR_std_vector_std_vector_MR_EdgePoint *surfacePaths)
Converts SurfacePaths to OneMeshContours.
MRC_API MR_SortIntersectionsData * MR_SortIntersectionsData_ConstructFrom(const MR_Mesh *otherMesh, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, MR_PassBy converter_pass_by, MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref *converter, const MR_AffineXf3f *rigidB2A, MR_uint64_t meshAVertsNum, bool isOtherA)
MRC_API MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId * MR_OneMeshIntersection_GetMutable_primitiveId(MR_OneMeshIntersection *_this)
MRC_API MR_GeodesicPathApprox * MR_SearchPathSettings_GetMutable_geodesicPathApprox(MR_SearchPathSettings *_this)
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_AssignFromAnother(MR_OneMeshIntersection *_this, const MR_OneMeshIntersection *_other)
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_DefaultConstruct(void)
MRC_API MR_expected_MR_OneMeshContour_std_string * MR_convertMeshTriPointsToMeshContour(const MR_Mesh *mesh, const MR_std_vector_MR_MeshTriPoint *surfaceLine, const MR_SearchPathSettings *searchSettings, MR_std_vector_int32_t *pivotIndices)
Makes continuous contour by mesh tri points, if first and last meshTriPoint is the same,...
MRC_API void MR_OneMeshContour_Destroy(const MR_OneMeshContour *_this)
Destroys a heap-allocated instance of MR_OneMeshContour. Does nothing if the pointer is null.
MRC_API const MR_uint64_t * MR_SortIntersectionsData_Get_meshAVertsNum(const MR_SortIntersectionsData *_this)
MRC_API void MR_SearchPathSettings_Set_geodesicPathApprox(MR_SearchPathSettings *_this, MR_GeodesicPathApprox value)
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_ConstructFromAnother(const MR_OneMeshIntersection *_other)
MRC_API MR_expected_MR_OneMeshContour_std_string * MR_convertMeshTriPointsToClosedContour(const MR_Mesh *mesh, const MR_std_vector_MR_MeshTriPoint *surfaceLine, const MR_SearchPathSettings *searchSettings, MR_std_vector_int32_t *pivotIndices)
Makes closed continuous contour by mesh tri points, note that first and last meshTriPoint should not ...
MRC_API bool * MR_SortIntersectionsData_GetMutable_isOtherA(MR_SortIntersectionsData *_this)
MRC_API const MR_OneMeshContour * MR_OneMeshContour_OffsetPtr(const MR_OneMeshContour *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_SortIntersectionsData * MR_SortIntersectionsData_OffsetMutablePtr(MR_SortIntersectionsData *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_expected_MR_OneMeshContour_std_string MR_expected_MR_OneMeshContour_std_string
Definition MROneMeshContours.h:20
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_ConstructFrom(MR_GeodesicPathApprox geodesicPathApprox, int32_t maxReduceIters)
struct MR_std_vector_MR_OneMeshIntersection MR_std_vector_MR_OneMeshIntersection
Definition MROneMeshContours.h:27
MRC_API void MR_SearchPathSettings_DestroyArray(const MR_SearchPathSettings *_this)
Destroys a heap-allocated array of MR_SearchPathSettings. Does nothing if the pointer is null.
MRC_API void MR_SortIntersectionsData_Set_meshAVertsNum(MR_SortIntersectionsData *_this, MR_uint64_t value)
struct MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId
Definition MROneMeshContours.h:23
MRC_API void MR_SortIntersectionsData_Set_isOtherA(MR_SortIntersectionsData *_this, bool value)
MRC_API MR_OneMeshContour * MR_convertSurfacePathWithEndsToMeshContour(const MR_Mesh *mesh, const MR_MeshTriPoint *start, const MR_std_vector_MR_EdgePoint *surfacePath, const MR_MeshTriPoint *end)
Converts SurfacePath to OneMeshContours.
MRC_API MR_uint64_t * MR_SortIntersectionsData_GetMutable_meshAVertsNum(MR_SortIntersectionsData *_this)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_OffsetMutablePtr(MR_SearchPathSettings *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_std_vector_std_vector_MR_Vector3f * MR_extractMeshContours(const MR_std_vector_MR_OneMeshContour *meshContours)
MRC_API MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref * MR_SortIntersectionsData_GetMutable_converter(MR_SortIntersectionsData *_this)
MRC_API const MR_std_vector_std_vector_MR_VarEdgeTri * MR_SortIntersectionsData_Get_contours(const MR_SortIntersectionsData *_this)
MRC_API const MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref * MR_SortIntersectionsData_Get_converter(const MR_SortIntersectionsData *_this)
MRC_API void MR_SearchPathSettings_Destroy(const MR_SearchPathSettings *_this)
Destroys a heap-allocated instance of MR_SearchPathSettings. Does nothing if the pointer is null.
MRC_API MR_OneMeshContour * MR_OneMeshContour_DefaultConstructArray(size_t num_elems)
MRC_API const MR_AffineXf3f ** MR_SortIntersectionsData_GetMutable_rigidB2A(MR_SortIntersectionsData *_this)
MRC_API MR_std_vector_MR_OneMeshContour * MR_getOneMeshSelfIntersectionContours(const MR_Mesh *mesh, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, const MR_CoordinateConverters *converters, const MR_AffineXf3f *rigidB2A)
MRC_API const MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId * MR_OneMeshIntersection_Get_primitiveId(const MR_OneMeshIntersection *_this)
MRC_API MR_OneMeshContour * MR_OneMeshContour_ConstructFrom(MR_PassBy intersections_pass_by, MR_std_vector_MR_OneMeshIntersection *intersections, bool closed)
MRC_API void MR_SortIntersectionsData_DestroyArray(const MR_SortIntersectionsData *_this)
Destroys a heap-allocated array of MR_SortIntersectionsData. Does nothing if the pointer is null.
MRC_API const MR_std_vector_MR_OneMeshIntersection * MR_OneMeshContour_Get_intersections(const MR_OneMeshContour *_this)
MRC_API bool * MR_OneMeshContour_GetMutable_closed(MR_OneMeshContour *_this)
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_OffsetMutablePtr(MR_OneMeshIntersection *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_std_vector_MR_OneMeshIntersection * MR_OneMeshContour_GetMutable_intersections(MR_OneMeshContour *_this)
MRC_API const bool * MR_OneMeshContour_Get_closed(const MR_OneMeshContour *_this)
MRC_API MR_OneMeshContour * MR_OneMeshContour_ConstructFromAnother(MR_PassBy _other_pass_by, MR_OneMeshContour *_other)
MRC_API void MR_getOneMeshIntersectionContours(const MR_Mesh *meshA, const MR_Mesh *meshB, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, MR_std_vector_MR_OneMeshContour *outA, MR_std_vector_MR_OneMeshContour *outB, const MR_CoordinateConverters *converters, const MR_AffineXf3f *rigidB2A, MR_std_vector_std_vector_MR_Vector3f *outPtsA, const bool *addSelfyTerminalVerts)
MRC_API void MR_OneMeshIntersection_Set_coordinate(MR_OneMeshIntersection *_this, MR_Vector3f value)
MRC_API MR_Vector3f * MR_OneMeshIntersection_GetMutable_coordinate(MR_OneMeshIntersection *_this)
MRC_API void MR_OneMeshContour_Set_closed(MR_OneMeshContour *_this, bool value)
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_ConstructFrom(const MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId *primitiveId, MR_Vector3f coordinate)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_DefaultConstruct(void)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_ConstructFromAnother(const MR_SearchPathSettings *_other)
MRC_API const MR_GeodesicPathApprox * MR_SearchPathSettings_Get_geodesicPathApprox(const MR_SearchPathSettings *_this)
struct MR_OneMeshIntersection MR_OneMeshIntersection
Generated from class MR::OneMeshIntersection.
Definition MROneMeshContours.h:40
struct MR_OneMeshContour MR_OneMeshContour
Generated from class MR::OneMeshContour.
Definition MROneMeshContours.h:44
MRC_API void MR_OneMeshContour_DestroyArray(const MR_OneMeshContour *_this)
Destroys a heap-allocated array of MR_OneMeshContour. Does nothing if the pointer is null.
MRC_API MR_OneMeshIntersection * MR_OneMeshIntersection_DefaultConstructArray(size_t num_elems)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_DefaultConstructArray(size_t num_elems)
MRC_API void MR_OneMeshIntersection_Destroy(const MR_OneMeshIntersection *_this)
Destroys a heap-allocated instance of MR_OneMeshIntersection. Does nothing if the pointer is null.
MRC_API void MR_subdivideLoneContours(MR_Mesh *mesh, const MR_std_vector_MR_OneMeshContour *contours, MR_phmap_flat_hash_map_MR_FaceId_MR_FaceId *new2oldMap)
MRC_API const MR_Vector3f * MR_OneMeshIntersection_Get_coordinate(const MR_OneMeshIntersection *_this)
MRC_API MR_OneMeshContour * MR_OneMeshContour_OffsetMutablePtr(MR_OneMeshContour *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 void MR_SortIntersectionsData_Set_rigidB2A(MR_SortIntersectionsData *_this, const MR_AffineXf3f *value)
MRC_API void MR_SortIntersectionsData_Set_converter(MR_SortIntersectionsData *_this, MR_PassBy value_pass_by, MR_std_function_MR_Vector3i_from_const_MR_Vector3f_ref *value)
MRC_API const MR_AffineXf3f *const * MR_SortIntersectionsData_Get_rigidB2A(const MR_SortIntersectionsData *_this)
MRC_API MR_OneMeshContour * MR_OneMeshContour_DefaultConstruct(void)
MRC_API void MR_SearchPathSettings_Set_maxReduceIters(MR_SearchPathSettings *_this, int32_t value)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_AssignFromAnother(MR_SearchPathSettings *_this, const MR_SearchPathSettings *_other)
MRC_API const MR_SearchPathSettings * MR_SearchPathSettings_OffsetPtr(const MR_SearchPathSettings *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_OneMeshIntersection * MR_OneMeshIntersection_OffsetPtr(const MR_OneMeshIntersection *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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:36
Definition MRVector3.h:51