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
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
16typedef struct MR_CoordinateConverters MR_CoordinateConverters; // Defined in `#include <MRCMesh/MRPrecisePredicates3.h>`.
17typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
18typedef struct MR_MeshTriPoint MR_MeshTriPoint; // Defined in `#include <MRCMesh/MRMeshTriPoint.h>`.
19typedef struct MR_expected_MR_OneMeshContour_std_string MR_expected_MR_OneMeshContour_std_string; // Defined in `#include <MRCMisc/expected_MR_OneMeshContour_std_string.h>`.
20typedef 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>`.
21typedef 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>`.
22typedef 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>`.
23typedef struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_MR_EdgePoint.h>`.
24typedef struct MR_std_vector_MR_MeshTriPoint MR_std_vector_MR_MeshTriPoint; // Defined in `#include <MRCMisc/std_vector_MR_MeshTriPoint.h>`.
25typedef struct MR_std_vector_MR_OneMeshContour MR_std_vector_MR_OneMeshContour; // Defined in `#include <MRCMisc/std_vector_MR_OneMeshContour.h>`.
26typedef struct MR_std_vector_MR_OneMeshIntersection MR_std_vector_MR_OneMeshIntersection; // Defined in `#include <MRCMisc/std_vector_MR_OneMeshIntersection.h>`.
27typedef struct MR_std_vector_int MR_std_vector_int; // Defined in `#include <MRCMisc/std_vector_int.h>`.
28typedef 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>`.
29typedef 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>`.
30typedef 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>`.
31
32
33// Special data to sort intersections more accurate
36
37// Simple point on mesh, represented by primitive id and coordinate in mesh space
40
41// One contour on mesh
44
48
53
58
63
67
72
77
81
86
91
95
100
105
109
114
118
124
127
130
133
136
141
146
151
156
160
165
169
174
179
182
185
190
193
196
202
207
211
216
221
225
230
234
239
243
246
249
253
256
259
264
265// Divides faces that fully own contours into 3 parts with center in center mass of one of the face contours
266// if there is more than one contour on face it guarantee to subdivide at least one lone contour on this face
272
285MRC_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);
286
287// Converts ordered continuous self contours of single meshes to OneMeshContours
288// converters are required for better precision in case of degenerations
296
297// Converts OneMeshContours contours representation to Contours3f: set of coordinates
302
308
313
319
325
330
336
340
345
349
352
355
360
363
366
372
388
404
430
441
442#ifdef __cplusplus
443} // extern "C"
444#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:42
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:26
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:12
struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint
Definition MREdgePaths.h:27
char MR_GeodesicPathApprox
the algorithm to compute approximately geodesic path
Definition MREnums.h:84
struct MR_std_vector_std_vector_MR_EdgePoint MR_std_vector_std_vector_MR_EdgePoint
Definition MRExtractIsolines.h:27
struct MR_std_vector_int MR_std_vector_int
Definition MRIntersectionContour.h:15
struct MR_std_vector_std_vector_MR_VarEdgeTri MR_std_vector_std_vector_MR_VarEdgeTri
Definition MRIntersectionContour.h:16
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:18
MRC_API void MR_OneMeshIntersection_Set_primitiveId(MR_OneMeshIntersection *_this, const MR_std_variant_MR_FaceId_MR_EdgeId_MR_VertId *value)
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 int * 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 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 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:19
struct MR_std_vector_MR_OneMeshIntersection MR_std_vector_MR_OneMeshIntersection
Definition MROneMeshContours.h:26
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 MR_SearchPathSettings * MR_SearchPathSettings_ConstructFrom(MR_GeodesicPathApprox geodesicPathApprox, int maxReduceIters)
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:22
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 void MR_SearchPathSettings_Set_maxReduceIters(MR_SearchPathSettings *_this, int value)
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_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_int *pivotIndices)
Makes closed continuous contour by mesh tri points, note that first and last meshTriPoint should not ...
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:39
struct MR_OneMeshContour MR_OneMeshContour
Generated from class MR::OneMeshContour.
Definition MROneMeshContours.h:43
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 const int * MR_SearchPathSettings_Get_maxReduceIters(const MR_SearchPathSettings *_this)
MRC_API MR_SearchPathSettings * MR_SearchPathSettings_DefaultConstructArray(size_t num_elems)
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_int *pivotIndices)
Makes continuous contour by mesh tri points, if first and last meshTriPoint is the same,...
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 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:50