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_ConvertToIntVector MR_ConvertToIntVector; // Defined in `#include <MRCMesh/MRPrecisePredicates3.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_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
37
38// Simple point on mesh, represented by primitive id and coordinate in mesh space
42
43// One contour on mesh
47
52
58
64
70
77
83
89
95
101
107
113
119
125
130
136
142
154MRC_API MR_SortIntersectionsData *MR_SortIntersectionsData_ConstructFrom(const MR_Mesh *otherMesh, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, const MR_ConvertToIntVector *converter, const MR_AffineXf3f *rigidB2A, size_t meshAVertsNum, bool isOtherA);
155
159
163
166
169
175
182
188
194
200
206
210
215
223
227
231
237
240
243
251
257
263
269
275
280
286
290
295
301
305
309
314
317
320
327
328// Divides faces that fully own contours into 3 parts with center in center mass of one of the face contours
329// if there is more than one contour on face it guarantee to subdivide at least one lone contour on this face
335
348MRC_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);
349
350// Converts ordered continuous self contours of single meshes to OneMeshContours
351// converters are required for better precision in case of degenerations
359
360// Converts OneMeshContours contours representation to Contours3f: set of coordinates
365
372
379
386
393
399
406
410
415
421
425
429
435
438
441
449
465
481
507
518
519#ifdef __cplusplus
520} // extern "C"
521#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_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint
Definition MRAlignContoursToMesh.h:23
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:16
char MR_GeodesicPathApprox
the algorithm to compute approximately geodesic path
Definition MREnums.h:119
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_ConvertToIntVector MR_ConvertToIntVector
Definition MRMeshCollidePrecise.h:14
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)
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 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 void MR_SortIntersectionsData_Set_converter(MR_SortIntersectionsData *_this, const MR_ConvertToIntVector *value)
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_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 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)
MRC_API MR_SortIntersectionsData * MR_SortIntersectionsData_OffsetMutablePtr(MR_SortIntersectionsData *ptr, ptrdiff_t i)
struct MR_expected_MR_OneMeshContour_std_string MR_expected_MR_OneMeshContour_std_string
Definition MROneMeshContours.h:20
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)
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_SearchPathSettings * MR_SearchPathSettings_OffsetMutablePtr(MR_SearchPathSettings *ptr, ptrdiff_t i)
MRC_API const size_t * MR_SortIntersectionsData_Get_meshAVertsNum(const MR_SortIntersectionsData *_this)
MRC_API MR_std_vector_std_vector_MR_Vector3f * MR_extractMeshContours(const MR_std_vector_MR_OneMeshContour *meshContours)
MRC_API const MR_std_vector_std_vector_MR_VarEdgeTri * MR_SortIntersectionsData_Get_contours(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_SortIntersectionsData * MR_SortIntersectionsData_ConstructFromAnother(const MR_SortIntersectionsData *_other)
MRC_API MR_OneMeshContour * MR_OneMeshContour_ConstructFrom(MR_PassBy intersections_pass_by, MR_std_vector_MR_OneMeshIntersection *intersections, bool closed)
MRC_API MR_ConvertToIntVector * MR_SortIntersectionsData_GetMutable_converter(MR_SortIntersectionsData *_this)
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)
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
Definition MROneMeshContours.h:41
struct MR_OneMeshContour MR_OneMeshContour
Definition MROneMeshContours.h:46
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 const MR_ConvertToIntVector * MR_SortIntersectionsData_Get_converter(const MR_SortIntersectionsData *_this)
MRC_API MR_SortIntersectionsData * MR_SortIntersectionsData_ConstructFrom(const MR_Mesh *otherMesh, const MR_std_vector_std_vector_MR_VarEdgeTri *contours, const MR_ConvertToIntVector *converter, const MR_AffineXf3f *rigidB2A, size_t meshAVertsNum, bool isOtherA)
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 void MR_SortIntersectionsData_Set_meshAVertsNum(MR_SortIntersectionsData *_this, size_t value)
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 size_t * MR_SortIntersectionsData_GetMutable_meshAVertsNum(MR_SortIntersectionsData *_this)
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)
MRC_API void MR_SortIntersectionsData_Set_rigidB2A(MR_SortIntersectionsData *_this, const MR_AffineXf3f *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)
MRC_API const MR_OneMeshIntersection * MR_OneMeshIntersection_OffsetPtr(const MR_OneMeshIntersection *ptr, ptrdiff_t i)
MR_PassBy
Definition common.h:13
#define MRC_API
Definition include/MRCMisc/exports.h:11
Definition MRAffineXf.h:39
Generated from class MR::Vector3f.
Definition MRVector3.h:47