MeshLib C Docs
Loading...
Searching...
No Matches
MRMeshDecimate.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRId.h>
4#include <MRCMisc/common.h>
5#include <MRCMisc/exports.h>
6
7#include <stdbool.h>
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_FaceBitSet MR_FaceBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
15typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
16typedef struct MR_MeshPart MR_MeshPart; // Defined in `#include <MRCMesh/MRMeshPart.h>`.
17typedef struct MR_ObjectMesh MR_ObjectMesh; // Defined in `#include <MRCMesh/MRObjectMesh.h>`.
18typedef struct MR_ObjectMeshData MR_ObjectMeshData; // Defined in `#include <MRCMesh/MRObjectMeshData.h>`.
19typedef struct MR_QuadraticForm3f MR_QuadraticForm3f; // Defined in `#include <MRCMesh/MRQuadraticForm.h>`.
20typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
21typedef struct MR_Vector_MR_QuadraticForm3f_MR_VertId MR_Vector_MR_QuadraticForm3f_MR_VertId; // Defined in `#include <MRCMesh/MRVector.h>`.
22typedef struct MR_VertBitSet MR_VertBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
23typedef struct MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId; // Defined in `#include <MRCMisc/phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId.h>`.
24typedef struct MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref; // Defined in `#include <MRCMisc/std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref.h>`.
25typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float; // Defined in `#include <MRCMisc/std_function_bool_from_float.h>`.
26typedef struct MR_std_function_void_from_MR_EdgeId_MR_EdgeId MR_std_function_void_from_MR_EdgeId_MR_EdgeId; // Defined in `#include <MRCMisc/std_function_void_from_MR_EdgeId_MR_EdgeId.h>`.
27typedef struct MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref; // Defined in `#include <MRCMisc/std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref.h>`.
28typedef struct MR_std_optional_MR_ObjectMeshData MR_std_optional_MR_ObjectMeshData; // Defined in `#include <MRCMisc/std_optional_MR_ObjectMeshData.h>`.
29typedef struct MR_std_vector_MR_FaceBitSet MR_std_vector_MR_FaceBitSet; // Defined in `#include <MRCMisc/std_vector_MR_FaceBitSet.h>`.
30
31
34{
35 // the next edge to collapse will be the one that introduced minimal error to the surface
37 // the next edge to collapse will be the shortest one
40
51
64
68
72
77
83
88
97
106
115
121
127
133
139
145
151
157
163
169
176
183
190
196
202
208
215
222
229
236
243
250
257
264
271
277
283
289
295
301
307
313
320
326
332
339
345
352
359
366
373
381
388
395
403
410
416
422
428
436
444
452
460
469
477
484
491
498
509
521
532
545
559
572
579
587
594
604
615
625
631
637
643
649
656
662
669
676
683
690
697
704
712
721
729
735
741
747
751
756
772MRC_API MR_DecimateSettings *MR_DecimateSettings_ConstructFrom(MR_DecimateStrategy strategy, float maxError, float maxEdgeLen, float maxBdShift, float maxTriangleAspectRatio, float criticalTriAspectRatio, float tinyEdgeLength, float stabilizer, bool angleWeightedDistToPlane, bool optimizeVertexPos, int maxDeletedVertices, int maxDeletedFaces, MR_FaceBitSet *region, MR_UndirectedEdgeBitSet *notFlippable, bool collapseNearNotFlippable, MR_UndirectedEdgeBitSet *edgesToCollapse, MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId *twinMap, bool touchNearBdEdges, bool touchBdVerts, MR_VertBitSet *bdVerts, float maxAngleChange, MR_PassBy preCollapse_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *preCollapse, MR_PassBy adjustCollapse_pass_by, MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref *adjustCollapse, MR_PassBy onEdgeDel_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeDel, MR_Vector_MR_QuadraticForm3f_MR_VertId *vertForms, bool packMesh, MR_PassBy progressCallback_pass_by, MR_std_function_bool_from_float *progressCallback, int subdivideParts, bool decimateBetweenParts, MR_std_vector_MR_FaceBitSet *partFaces, int minFacesInPart);
773
777
781
786
789
792
799
805
811
817
823
829
835
844
853
862
868
874
880
884
889
893MRC_API MR_DecimateResult *MR_DecimateResult_ConstructFrom(int vertsDeleted, int facesDeleted, float errorIntroduced, bool cancelled);
894
898
902
908
911
914
922
937
945
953
962MRC_API MR_QuadraticForm3f *MR_computeFormAtVertex(const MR_MeshPart *mp, MR_VertId v, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases);
963
973
983
989
995
1001
1007
1013
1019
1025
1031
1037
1044
1051
1058
1065
1072
1079
1085
1092
1098
1102
1107
1112MRC_API MR_ResolveMeshDegenSettings *MR_ResolveMeshDegenSettings_ConstructFrom(float maxDeviation, float tinyEdgeLength, float maxAngleChange, float criticalAspectRatio, float stabilizer, MR_FaceBitSet *region);
1113
1117
1121
1127
1130
1133
1141
1155
1162
1169
1176
1182
1188
1194
1200
1206
1212
1219
1226
1233
1240
1247
1254
1261
1268
1275
1283
1291
1299
1306
1313
1320
1326
1332
1338
1344
1351
1357
1364
1372
1379
1385
1391
1397
1404
1411
1418
1424
1431
1437
1443
1450
1456
1467
1479
1490
1496
1503
1509
1513
1518
1528MRC_API MR_RemeshSettings *MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int maxEdgeSplits, float maxAngleChangeAfterFlip, bool frozenBoundary, float maxBdShift, bool useCurvature, float maxSplittableTriAspectRatio, int finalRelaxIters, bool finalRelaxNoShrinkage, MR_FaceBitSet *region, MR_UndirectedEdgeBitSet *notFlippable, bool packMesh, bool projectOnOriginalMesh, MR_PassBy onEdgeSplit_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeSplit, MR_PassBy onEdgeDel_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeDel, MR_PassBy preCollapse_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *preCollapse, MR_PassBy progressCallback_pass_by, MR_std_function_bool_from_float *progressCallback);
1529
1533
1537
1542
1545
1548
1555
1556// Splits too long and eliminates too short edges from the mesh
1560MRC_API bool MR_remesh(MR_Mesh *mesh, const MR_RemeshSettings *settings);
1561
1562#ifdef __cplusplus
1563} // extern "C"
1564#endif
struct MR_std_function_bool_from_float MR_std_function_bool_from_float
Definition MR3mf.h:10
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:28
struct MR_VertBitSet MR_VertBitSet
Definition MRAABBTree.h:22
struct MR_FaceBitSet MR_FaceBitSet
Definition MRAABBTree.h:17
struct MR_MeshPart MR_MeshPart
Definition MRAABBTree.h:19
struct MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId
Definition MRBitSet.h:51
struct MR_ObjectMeshData MR_ObjectMeshData
Definition MRChangeMeshDataAction.h:15
struct MR_std_vector_MR_FaceBitSet MR_std_vector_MR_FaceBitSet
Definition MRContoursSeparation.h:11
struct MR_Mesh MR_Mesh
Definition MRCtm.h:16
struct MR_std_function_void_from_MR_EdgeId_MR_EdgeId MR_std_function_void_from_MR_EdgeId_MR_EdgeId
Definition MRFillHoleNicely.h:23
struct MR_ObjectMesh MR_ObjectMesh
Definition MRMeshBooleanFacade.h:14
MRC_API const MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_OffsetPtr(const MR_ResolveMeshDegenSettings *ptr, ptrdiff_t i)
MRC_API void MR_RemeshSettings_Set_frozenBoundary(MR_RemeshSettings *_this, bool value)
MRC_API void MR_DecimateSettings_Set_maxError(MR_DecimateSettings *_this, float value)
MRC_API MR_UndirectedEdgeBitSet *const * MR_DecimateSettings_Get_notFlippable(const MR_DecimateSettings *_this)
MRC_API const float * MR_DecimateSettings_Get_maxEdgeLen(const MR_DecimateSettings *_this)
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_OffsetMutablePtr(MR_ResolveMeshDegenSettings *ptr, ptrdiff_t i)
MRC_API const MR_RemeshSettings * MR_RemeshSettings_OffsetPtr(const MR_RemeshSettings *ptr, ptrdiff_t i)
MRC_API float * MR_DecimateResult_GetMutable_errorIntroduced(MR_DecimateResult *_this)
MRC_API const int * MR_DecimateResult_Get_facesDeleted(const MR_DecimateResult *_this)
MRC_API void MR_DecimateSettings_Set_angleWeightedDistToPlane(MR_DecimateSettings *_this, bool value)
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_DefaultConstruct(void)
MRC_API MR_DecimateSettings * MR_DecimateSettings_OffsetMutablePtr(MR_DecimateSettings *ptr, ptrdiff_t i)
MRC_API void MR_DecimateSettings_Set_decimateBetweenParts(MR_DecimateSettings *_this, bool value)
MRC_API const float * MR_ResolveMeshDegenSettings_Get_maxDeviation(const MR_ResolveMeshDegenSettings *_this)
MRC_API MR_DecimateSettings * MR_DecimateSettings_ConstructFromAnother(MR_PassBy _other_pass_by, MR_DecimateSettings *_other)
MRC_API MR_DecimateSettings * MR_DecimateSettings_DefaultConstruct(void)
MRC_API int * MR_RemeshSettings_GetMutable_finalRelaxIters(MR_RemeshSettings *_this)
MRC_API void MR_DecimateSettings_Set_maxEdgeLen(MR_DecimateSettings *_this, float value)
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_ConstructFrom(float maxDeviation, float tinyEdgeLength, float maxAngleChange, float criticalAspectRatio, float stabilizer, MR_FaceBitSet *region)
MRC_API void MR_DecimateSettings_Set_touchNearBdEdges(MR_DecimateSettings *_this, bool value)
MRC_API MR_DecimateResult * MR_DecimateResult_DefaultConstructArray(size_t num_elems)
MRC_API MR_RemeshSettings * MR_RemeshSettings_OffsetMutablePtr(MR_RemeshSettings *ptr, ptrdiff_t i)
MRC_API void MR_RemeshSettings_Set_useCurvature(MR_RemeshSettings *_this, bool value)
MRC_API const int * MR_DecimateSettings_Get_minFacesInPart(const MR_DecimateSettings *_this)
MRC_API float * MR_DecimateSettings_GetMutable_maxBdShift(MR_DecimateSettings *_this)
struct MR_DecimateResult MR_DecimateResult
Definition MRMeshDecimate.h:63
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_AssignFromAnother(MR_ResolveMeshDegenSettings *_this, const MR_ResolveMeshDegenSettings *_other)
MRC_API const float * MR_RemeshSettings_Get_targetEdgeLen(const MR_RemeshSettings *_this)
struct MR_std_optional_MR_ObjectMeshData MR_std_optional_MR_ObjectMeshData
Definition MRMeshDecimate.h:28
MRC_API MR_UndirectedEdgeBitSet ** MR_DecimateSettings_GetMutable_notFlippable(MR_DecimateSettings *_this)
MRC_API int * MR_DecimateSettings_GetMutable_minFacesInPart(MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_edgesToCollapse(MR_DecimateSettings *_this, MR_UndirectedEdgeBitSet *value)
MRC_API const bool * MR_RemeshSettings_Get_projectOnOriginalMesh(const MR_RemeshSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_touchNearBdEdges(MR_DecimateSettings *_this)
MRC_API const bool * MR_RemeshSettings_Get_frozenBoundary(const MR_RemeshSettings *_this)
MRC_API MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_RemeshSettings_GetMutable_onEdgeDel(MR_RemeshSettings *_this)
MRC_API void MR_DecimateSettings_Set_maxAngleChange(MR_DecimateSettings *_this, float value)
MRC_API void MR_DecimateSettings_Set_touchBdVerts(MR_DecimateSettings *_this, bool value)
MRC_API void MR_RemeshSettings_Set_maxEdgeSplits(MR_RemeshSettings *_this, int value)
MRC_API MR_FaceBitSet *const * MR_DecimateSettings_Get_region(const MR_DecimateSettings *_this)
MRC_API MR_DecimateResult * MR_DecimateResult_OffsetMutablePtr(MR_DecimateResult *ptr, ptrdiff_t i)
MRC_API MR_std_optional_MR_ObjectMeshData * MR_makeDecimatedObjectMeshData(const MR_ObjectMesh *obj, const MR_DecimateSettings *settings, MR_DecimateResult *outRes)
MRC_API const float * MR_RemeshSettings_Get_maxBdShift(const MR_RemeshSettings *_this)
MRC_API int * MR_DecimateSettings_GetMutable_maxDeletedFaces(MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_DestroyArray(const MR_DecimateSettings *_this)
Destroys a heap-allocated array of MR_DecimateSettings. Does nothing if the pointer is null.
MRC_API void MR_DecimateSettings_Set_subdivideParts(MR_DecimateSettings *_this, int value)
MRC_API void MR_DecimateSettings_Set_collapseNearNotFlippable(MR_DecimateSettings *_this, bool value)
MRC_API const int * MR_DecimateSettings_Get_subdivideParts(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_stabilizer(MR_DecimateSettings *_this, float value)
MRC_API MR_DecimateResult * MR_DecimateResult_DefaultConstruct(void)
MRC_API MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_RemeshSettings_GetMutable_onEdgeSplit(MR_RemeshSettings *_this)
MRC_API MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_DecimateSettings_GetMutable_onEdgeDel(MR_DecimateSettings *_this)
MRC_API const int * MR_DecimateSettings_Get_maxDeletedFaces(const MR_DecimateSettings *_this)
MRC_API const float * MR_RemeshSettings_Get_maxSplittableTriAspectRatio(const MR_RemeshSettings *_this)
MRC_API MR_std_function_bool_from_float * MR_DecimateSettings_GetMutable_progressCallback(MR_DecimateSettings *_this)
MRC_API MR_std_function_bool_from_float * MR_RemeshSettings_GetMutable_progressCallback(MR_RemeshSettings *_this)
MRC_API MR_Vector_MR_QuadraticForm3f_MR_VertId * MR_computeFormsAtVertices(const MR_MeshPart *mp, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases)
Computes quadratic forms at every vertex of mesh part before decimation.
MRC_API void MR_DecimateSettings_Set_adjustCollapse(MR_DecimateSettings *_this, MR_PassBy value_pass_by, MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref *value)
The user can provide this optional callback for adjusting error introduced by this edge collapse and ...
MRC_API void MR_DecimateSettings_Set_tinyEdgeLength(MR_DecimateSettings *_this, float value)
MRC_API float * MR_DecimateSettings_GetMutable_maxTriangleAspectRatio(MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_region(MR_DecimateSettings *_this, MR_FaceBitSet *value)
MRC_API float * MR_ResolveMeshDegenSettings_GetMutable_maxAngleChange(MR_ResolveMeshDegenSettings *_this)
MRC_API const int * MR_DecimateSettings_Get_maxDeletedVertices(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_maxDeletedFaces(MR_DecimateSettings *_this, int value)
MR_DecimateStrategy
Defines the order of edge collapses inside Decimate algorithm.
Definition MRMeshDecimate.h:34
@ MR_DecimateStrategy_MinimizeError
Definition MRMeshDecimate.h:36
@ MR_DecimateStrategy_ShortestEdgeFirst
Definition MRMeshDecimate.h:38
MRC_API MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId ** MR_DecimateSettings_GetMutable_twinMap(MR_DecimateSettings *_this)
struct MR_Vector_MR_QuadraticForm3f_MR_VertId MR_Vector_MR_QuadraticForm3f_MR_VertId
Definition MRMeshDecimate.h:21
MRC_API void MR_RemeshSettings_Destroy(const MR_RemeshSettings *_this)
Destroys a heap-allocated instance of MR_RemeshSettings. Does nothing if the pointer is null.
MRC_API MR_DecimateSettings * MR_DecimateSettings_ConstructFrom(MR_DecimateStrategy strategy, float maxError, float maxEdgeLen, float maxBdShift, float maxTriangleAspectRatio, float criticalTriAspectRatio, float tinyEdgeLength, float stabilizer, bool angleWeightedDistToPlane, bool optimizeVertexPos, int maxDeletedVertices, int maxDeletedFaces, MR_FaceBitSet *region, MR_UndirectedEdgeBitSet *notFlippable, bool collapseNearNotFlippable, MR_UndirectedEdgeBitSet *edgesToCollapse, MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId *twinMap, bool touchNearBdEdges, bool touchBdVerts, MR_VertBitSet *bdVerts, float maxAngleChange, MR_PassBy preCollapse_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *preCollapse, MR_PassBy adjustCollapse_pass_by, MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref *adjustCollapse, MR_PassBy onEdgeDel_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeDel, MR_Vector_MR_QuadraticForm3f_MR_VertId *vertForms, bool packMesh, MR_PassBy progressCallback_pass_by, MR_std_function_bool_from_float *progressCallback, int subdivideParts, bool decimateBetweenParts, MR_std_vector_MR_FaceBitSet *partFaces, int minFacesInPart)
MRC_API int * MR_DecimateResult_GetMutable_facesDeleted(MR_DecimateResult *_this)
MRC_API bool * MR_RemeshSettings_GetMutable_packMesh(MR_RemeshSettings *_this)
MRC_API const MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref * MR_DecimateSettings_Get_preCollapse(const MR_DecimateSettings *_this)
The user can provide this optional callback that is invoked immediately before edge collapse;.
struct MR_RemeshSettings MR_RemeshSettings
Definition MRMeshDecimate.h:71
MRC_API bool * MR_DecimateSettings_GetMutable_optimizeVertexPos(MR_DecimateSettings *_this)
MRC_API float * MR_ResolveMeshDegenSettings_GetMutable_criticalAspectRatio(MR_ResolveMeshDegenSettings *_this)
MRC_API void MR_ResolveMeshDegenSettings_Destroy(const MR_ResolveMeshDegenSettings *_this)
Destroys a heap-allocated instance of MR_ResolveMeshDegenSettings. Does nothing if the pointer is nul...
MRC_API const float * MR_DecimateResult_Get_errorIntroduced(const MR_DecimateResult *_this)
MRC_API float * MR_ResolveMeshDegenSettings_GetMutable_tinyEdgeLength(MR_ResolveMeshDegenSettings *_this)
MRC_API const MR_std_function_bool_from_float * MR_DecimateSettings_Get_progressCallback(const MR_DecimateSettings *_this)
MRC_API MR_FaceBitSet ** MR_RemeshSettings_GetMutable_region(MR_RemeshSettings *_this)
MRC_API int * MR_RemeshSettings_GetMutable_maxEdgeSplits(MR_RemeshSettings *_this)
MRC_API const MR_DecimateResult * MR_DecimateResult_OffsetPtr(const MR_DecimateResult *ptr, ptrdiff_t i)
MRC_API void MR_DecimateSettings_Set_optimizeVertexPos(MR_DecimateSettings *_this, bool value)
MRC_API const float * MR_RemeshSettings_Get_maxAngleChangeAfterFlip(const MR_RemeshSettings *_this)
MRC_API void MR_RemeshSettings_Set_region(MR_RemeshSettings *_this, MR_FaceBitSet *value)
MRC_API MR_FaceBitSet *const * MR_RemeshSettings_Get_region(const MR_RemeshSettings *_this)
MRC_API MR_DecimateResult * MR_DecimateResult_AssignFromAnother(MR_DecimateResult *_this, const MR_DecimateResult *_other)
MRC_API void MR_RemeshSettings_Set_maxBdShift(MR_RemeshSettings *_this, float value)
MRC_API void MR_DecimateSettings_Set_progressCallback(MR_DecimateSettings *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_float *value)
MRC_API float * MR_DecimateSettings_GetMutable_tinyEdgeLength(MR_DecimateSettings *_this)
MRC_API bool MR_remesh(MR_Mesh *mesh, const MR_RemeshSettings *settings)
struct MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref
Definition MRMeshDecimate.h:27
MRC_API void MR_ResolveMeshDegenSettings_Set_maxDeviation(MR_ResolveMeshDegenSettings *_this, float value)
MRC_API MR_FaceBitSet ** MR_DecimateSettings_GetMutable_region(MR_DecimateSettings *_this)
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_DefaultConstructArray(size_t num_elems)
MRC_API void MR_DecimateResult_Set_facesDeleted(MR_DecimateResult *_this, int value)
MRC_API const MR_DecimateSettings * MR_DecimateSettings_OffsetPtr(const MR_DecimateSettings *ptr, ptrdiff_t i)
MRC_API MR_DecimateResult * MR_DecimateResult_ConstructFromAnother(const MR_DecimateResult *_other)
struct MR_DecimateSettings MR_DecimateSettings
Definition MRMeshDecimate.h:50
MRC_API bool * MR_DecimateResult_GetMutable_cancelled(MR_DecimateResult *_this)
MRC_API MR_std_vector_MR_FaceBitSet *const * MR_DecimateSettings_Get_partFaces(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_minFacesInPart(MR_DecimateSettings *_this, int value)
MRC_API void MR_RemeshSettings_Set_notFlippable(MR_RemeshSettings *_this, MR_UndirectedEdgeBitSet *value)
MRC_API MR_DecimateResult * MR_decimateObjectMeshData(MR_ObjectMeshData *data, const MR_DecimateSettings *settings)
MRC_API MR_DecimateSettings * MR_DecimateSettings_DefaultConstructArray(size_t num_elems)
MRC_API const bool * MR_RemeshSettings_Get_finalRelaxNoShrinkage(const MR_RemeshSettings *_this)
MRC_API float * MR_DecimateSettings_GetMutable_criticalTriAspectRatio(MR_DecimateSettings *_this)
MRC_API int * MR_DecimateResult_GetMutable_vertsDeleted(MR_DecimateResult *_this)
MRC_API bool * MR_RemeshSettings_GetMutable_frozenBoundary(MR_RemeshSettings *_this)
MRC_API int * MR_DecimateSettings_GetMutable_maxDeletedVertices(MR_DecimateSettings *_this)
MRC_API void MR_RemeshSettings_Set_finalRelaxNoShrinkage(MR_RemeshSettings *_this, bool value)
MRC_API float * MR_DecimateSettings_GetMutable_maxAngleChange(MR_DecimateSettings *_this)
MRC_API void MR_DecimateResult_Set_vertsDeleted(MR_DecimateResult *_this, int value)
MRC_API void MR_DecimateSettings_Set_packMesh(MR_DecimateSettings *_this, bool value)
MRC_API void MR_DecimateSettings_Set_strategy(MR_DecimateSettings *_this, MR_DecimateStrategy value)
MRC_API float * MR_RemeshSettings_GetMutable_maxSplittableTriAspectRatio(MR_RemeshSettings *_this)
MRC_API void MR_RemeshSettings_Set_finalRelaxIters(MR_RemeshSettings *_this, int value)
MRC_API const float * MR_ResolveMeshDegenSettings_Get_stabilizer(const MR_ResolveMeshDegenSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_angleWeightedDistToPlane(MR_DecimateSettings *_this)
MRC_API const float * MR_ResolveMeshDegenSettings_Get_criticalAspectRatio(const MR_ResolveMeshDegenSettings *_this)
MRC_API const MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref * MR_DecimateSettings_Get_adjustCollapse(const MR_DecimateSettings *_this)
The user can provide this optional callback for adjusting error introduced by this edge collapse and ...
MRC_API float * MR_RemeshSettings_GetMutable_targetEdgeLen(MR_RemeshSettings *_this)
MRC_API void MR_ResolveMeshDegenSettings_Set_region(MR_ResolveMeshDegenSettings *_this, MR_FaceBitSet *value)
MRC_API void MR_DecimateResult_Set_cancelled(MR_DecimateResult *_this, bool value)
MRC_API void MR_RemeshSettings_Set_projectOnOriginalMesh(MR_RemeshSettings *_this, bool value)
MRC_API void MR_RemeshSettings_Set_targetEdgeLen(MR_RemeshSettings *_this, float value)
MRC_API const int * MR_RemeshSettings_Get_finalRelaxIters(const MR_RemeshSettings *_this)
MRC_API int * MR_DecimateSettings_GetMutable_subdivideParts(MR_DecimateSettings *_this)
MRC_API MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId *const * MR_DecimateSettings_Get_twinMap(const MR_DecimateSettings *_this)
MRC_API bool * MR_RemeshSettings_GetMutable_useCurvature(MR_RemeshSettings *_this)
MRC_API const float * MR_ResolveMeshDegenSettings_Get_maxAngleChange(const MR_ResolveMeshDegenSettings *_this)
MRC_API MR_RemeshSettings * MR_RemeshSettings_AssignFromAnother(MR_RemeshSettings *_this, MR_PassBy _other_pass_by, MR_RemeshSettings *_other)
MRC_API void MR_DecimateSettings_Set_onEdgeDel(MR_DecimateSettings *_this, MR_PassBy value_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *value)
MRC_API bool * MR_RemeshSettings_GetMutable_finalRelaxNoShrinkage(MR_RemeshSettings *_this)
MRC_API MR_DecimateSettings * MR_DecimateSettings_AssignFromAnother(MR_DecimateSettings *_this, MR_PassBy _other_pass_by, MR_DecimateSettings *_other)
MRC_API const MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_DecimateSettings_Get_onEdgeDel(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_partFaces(MR_DecimateSettings *_this, MR_std_vector_MR_FaceBitSet *value)
MRC_API const bool * MR_DecimateSettings_Get_collapseNearNotFlippable(const MR_DecimateSettings *_this)
MRC_API void MR_RemeshSettings_Set_maxSplittableTriAspectRatio(MR_RemeshSettings *_this, float value)
MRC_API void MR_RemeshSettings_Set_packMesh(MR_RemeshSettings *_this, bool value)
struct MR_ResolveMeshDegenSettings MR_ResolveMeshDegenSettings
Definition MRMeshDecimate.h:67
MRC_API const float * MR_DecimateSettings_Get_stabilizer(const MR_DecimateSettings *_this)
MRC_API void MR_RemeshSettings_Set_progressCallback(MR_RemeshSettings *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_float *value)
MRC_API MR_FaceBitSet ** MR_ResolveMeshDegenSettings_GetMutable_region(MR_ResolveMeshDegenSettings *_this)
MRC_API MR_FaceBitSet * MR_getSubdividePart(const MR_FaceBitSet *valids, MR_uint64_t subdivideParts, MR_uint64_t myPart)
returns given subdivision part of all valid faces; parallel threads shall be able to safely modify th...
MRC_API void MR_RemeshSettings_DestroyArray(const MR_RemeshSettings *_this)
Destroys a heap-allocated array of MR_RemeshSettings. Does nothing if the pointer is null.
MRC_API const bool * MR_DecimateSettings_Get_touchBdVerts(const MR_DecimateSettings *_this)
MRC_API MR_QuadraticForm3f * MR_computeFormAtVertex(const MR_MeshPart *mp, MR_VertId v, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases)
Computes quadratic form at given vertex of the initial surface before decimation.
MRC_API MR_UndirectedEdgeBitSet ** MR_DecimateSettings_GetMutable_edgesToCollapse(MR_DecimateSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_decimateBetweenParts(MR_DecimateSettings *_this)
MRC_API const float * MR_DecimateSettings_Get_maxBdShift(const MR_DecimateSettings *_this)
MRC_API MR_VertBitSet *const * MR_DecimateSettings_Get_bdVerts(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateResult_Destroy(const MR_DecimateResult *_this)
Destroys a heap-allocated instance of MR_DecimateResult. Does nothing if the pointer is null.
MRC_API const MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_RemeshSettings_Get_onEdgeDel(const MR_RemeshSettings *_this)
MRC_API float * MR_RemeshSettings_GetMutable_maxBdShift(MR_RemeshSettings *_this)
MRC_API void MR_ResolveMeshDegenSettings_Set_criticalAspectRatio(MR_ResolveMeshDegenSettings *_this, float value)
MRC_API void MR_ResolveMeshDegenSettings_Set_stabilizer(MR_ResolveMeshDegenSettings *_this, float value)
MRC_API void MR_DecimateResult_DestroyArray(const MR_DecimateResult *_this)
Destroys a heap-allocated array of MR_DecimateResult. Does nothing if the pointer is null.
MRC_API void MR_DecimateResult_Set_errorIntroduced(MR_DecimateResult *_this, float value)
MRC_API MR_UndirectedEdgeBitSet *const * MR_RemeshSettings_Get_notFlippable(const MR_RemeshSettings *_this)
struct MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref
Definition MRMeshDecimate.h:24
MRC_API const float * MR_DecimateSettings_Get_maxAngleChange(const MR_DecimateSettings *_this)
MRC_API MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_ConstructFromAnother(const MR_ResolveMeshDegenSettings *_other)
MRC_API const int * MR_DecimateResult_Get_vertsDeleted(const MR_DecimateResult *_this)
MRC_API const float * MR_DecimateSettings_Get_criticalTriAspectRatio(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_criticalTriAspectRatio(MR_DecimateSettings *_this, float value)
MRC_API bool * MR_DecimateSettings_GetMutable_touchBdVerts(MR_DecimateSettings *_this)
MRC_API const bool * MR_RemeshSettings_Get_packMesh(const MR_RemeshSettings *_this)
MRC_API MR_DecimateStrategy * MR_DecimateSettings_GetMutable_strategy(MR_DecimateSettings *_this)
MRC_API MR_VertBitSet ** MR_DecimateSettings_GetMutable_bdVerts(MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Destroy(const MR_DecimateSettings *_this)
Destroys a heap-allocated instance of MR_DecimateSettings. Does nothing if the pointer is null.
MRC_API const float * MR_DecimateSettings_Get_tinyEdgeLength(const MR_DecimateSettings *_this)
MRC_API MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref * MR_DecimateSettings_GetMutable_preCollapse(MR_DecimateSettings *_this)
The user can provide this optional callback that is invoked immediately before edge collapse;.
MRC_API void MR_ResolveMeshDegenSettings_Set_tinyEdgeLength(MR_ResolveMeshDegenSettings *_this, float value)
MRC_API MR_Vector_MR_QuadraticForm3f_MR_VertId *const * MR_DecimateSettings_Get_vertForms(const MR_DecimateSettings *_this)
If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then i...
MRC_API MR_UndirectedEdgeBitSet ** MR_RemeshSettings_GetMutable_notFlippable(MR_RemeshSettings *_this)
MRC_API void MR_RemeshSettings_Set_onEdgeSplit(MR_RemeshSettings *_this, MR_PassBy value_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *value)
MRC_API void MR_DecimateSettings_Set_bdVerts(MR_DecimateSettings *_this, MR_VertBitSet *value)
MRC_API const MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref * MR_RemeshSettings_Get_preCollapse(const MR_RemeshSettings *_this)
The user can provide this optional callback that is invoked immediately before edge collapse;.
MRC_API void MR_DecimateSettings_Set_notFlippable(MR_DecimateSettings *_this, MR_UndirectedEdgeBitSet *value)
MRC_API void MR_RemeshSettings_Set_onEdgeDel(MR_RemeshSettings *_this, MR_PassBy value_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *value)
MRC_API void MR_DecimateSettings_Set_maxBdShift(MR_DecimateSettings *_this, float value)
MRC_API void MR_RemeshSettings_Set_maxAngleChangeAfterFlip(MR_RemeshSettings *_this, float value)
MRC_API const MR_std_function_void_from_MR_EdgeId_MR_EdgeId * MR_RemeshSettings_Get_onEdgeSplit(const MR_RemeshSettings *_this)
MRC_API void MR_DecimateSettings_Set_twinMap(MR_DecimateSettings *_this, MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId *value)
MRC_API const bool * MR_DecimateSettings_Get_packMesh(const MR_DecimateSettings *_this)
MRC_API const float * MR_DecimateSettings_Get_maxError(const MR_DecimateSettings *_this)
MRC_API const bool * MR_DecimateSettings_Get_touchNearBdEdges(const MR_DecimateSettings *_this)
MRC_API const MR_DecimateStrategy * MR_DecimateSettings_Get_strategy(const MR_DecimateSettings *_this)
MRC_API MR_FaceBitSet *const * MR_ResolveMeshDegenSettings_Get_region(const MR_ResolveMeshDegenSettings *_this)
MRC_API float * MR_RemeshSettings_GetMutable_maxAngleChangeAfterFlip(MR_RemeshSettings *_this)
MRC_API void MR_ResolveMeshDegenSettings_DestroyArray(const MR_ResolveMeshDegenSettings *_this)
Destroys a heap-allocated array of MR_ResolveMeshDegenSettings. Does nothing if the pointer is null.
MRC_API const MR_std_function_bool_from_float * MR_RemeshSettings_Get_progressCallback(const MR_RemeshSettings *_this)
MRC_API MR_RemeshSettings * MR_RemeshSettings_ConstructFromAnother(MR_PassBy _other_pass_by, MR_RemeshSettings *_other)
MRC_API const bool * MR_RemeshSettings_Get_useCurvature(const MR_RemeshSettings *_this)
MRC_API MR_Vector_MR_QuadraticForm3f_MR_VertId ** MR_DecimateSettings_GetMutable_vertForms(MR_DecimateSettings *_this)
If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then i...
MRC_API void MR_DecimateSettings_Set_vertForms(MR_DecimateSettings *_this, MR_Vector_MR_QuadraticForm3f_MR_VertId *value)
If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then i...
MRC_API MR_std_function_void_from_MR_UndirectedEdgeId_float_ref_MR_Vector3f_ref * MR_DecimateSettings_GetMutable_adjustCollapse(MR_DecimateSettings *_this)
The user can provide this optional callback for adjusting error introduced by this edge collapse and ...
MRC_API float * MR_ResolveMeshDegenSettings_GetMutable_maxDeviation(MR_ResolveMeshDegenSettings *_this)
MRC_API const bool * MR_DecimateSettings_Get_angleWeightedDistToPlane(const MR_DecimateSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_collapseNearNotFlippable(MR_DecimateSettings *_this)
MRC_API MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref * MR_RemeshSettings_GetMutable_preCollapse(MR_RemeshSettings *_this)
The user can provide this optional callback that is invoked immediately before edge collapse;.
MRC_API MR_std_vector_MR_FaceBitSet ** MR_DecimateSettings_GetMutable_partFaces(MR_DecimateSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_packMesh(MR_DecimateSettings *_this)
MRC_API const bool * MR_DecimateSettings_Get_optimizeVertexPos(const MR_DecimateSettings *_this)
MRC_API MR_RemeshSettings * MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int maxEdgeSplits, float maxAngleChangeAfterFlip, bool frozenBoundary, float maxBdShift, bool useCurvature, float maxSplittableTriAspectRatio, int finalRelaxIters, bool finalRelaxNoShrinkage, MR_FaceBitSet *region, MR_UndirectedEdgeBitSet *notFlippable, bool packMesh, bool projectOnOriginalMesh, MR_PassBy onEdgeSplit_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeSplit, MR_PassBy onEdgeDel_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId *onEdgeDel, MR_PassBy preCollapse_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *preCollapse, MR_PassBy progressCallback_pass_by, MR_std_function_bool_from_float *progressCallback)
MRC_API MR_UndirectedEdgeBitSet *const * MR_DecimateSettings_Get_edgesToCollapse(const MR_DecimateSettings *_this)
MRC_API float * MR_DecimateSettings_GetMutable_maxError(MR_DecimateSettings *_this)
MRC_API const float * MR_ResolveMeshDegenSettings_Get_tinyEdgeLength(const MR_ResolveMeshDegenSettings *_this)
MRC_API const float * MR_DecimateSettings_Get_maxTriangleAspectRatio(const MR_DecimateSettings *_this)
MRC_API MR_RemeshSettings * MR_RemeshSettings_DefaultConstruct(void)
MRC_API void MR_DecimateSettings_Set_maxTriangleAspectRatio(MR_DecimateSettings *_this, float value)
MRC_API bool MR_resolveMeshDegenerations(MR_Mesh *mesh, const MR_ResolveMeshDegenSettings *settings)
Removes degenerate triangles in a mesh by calling decimateMesh function with appropriate settings.
MRC_API float * MR_DecimateSettings_GetMutable_maxEdgeLen(MR_DecimateSettings *_this)
MRC_API bool * MR_RemeshSettings_GetMutable_projectOnOriginalMesh(MR_RemeshSettings *_this)
MRC_API MR_DecimateResult * MR_DecimateResult_ConstructFrom(int vertsDeleted, int facesDeleted, float errorIntroduced, bool cancelled)
MRC_API void MR_ResolveMeshDegenSettings_Set_maxAngleChange(MR_ResolveMeshDegenSettings *_this, float value)
MRC_API float * MR_DecimateSettings_GetMutable_stabilizer(MR_DecimateSettings *_this)
MRC_API const bool * MR_DecimateResult_Get_cancelled(const MR_DecimateResult *_this)
MRC_API void MR_DecimateSettings_Set_maxDeletedVertices(MR_DecimateSettings *_this, int value)
MRC_API float * MR_ResolveMeshDegenSettings_GetMutable_stabilizer(MR_ResolveMeshDegenSettings *_this)
MRC_API void MR_RemeshSettings_Set_preCollapse(MR_RemeshSettings *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *value)
The user can provide this optional callback that is invoked immediately before edge collapse;.
MRC_API void MR_DecimateSettings_Set_preCollapse(MR_DecimateSettings *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_MR_EdgeId_const_MR_Vector3f_ref *value)
The user can provide this optional callback that is invoked immediately before edge collapse;.
MRC_API const bool * MR_DecimateSettings_Get_decimateBetweenParts(const MR_DecimateSettings *_this)
MRC_API const int * MR_RemeshSettings_Get_maxEdgeSplits(const MR_RemeshSettings *_this)
MRC_API MR_RemeshSettings * MR_RemeshSettings_DefaultConstructArray(size_t num_elems)
MRC_API MR_DecimateResult * MR_decimateMesh(MR_Mesh *mesh, const MR_DecimateSettings *settings)
Performs mesh simplification in mesh region according to the settings.
struct MR_QuadraticForm3f MR_QuadraticForm3f
Definition MRMesh.h:35
MR_PassBy
Definition common.h:23
uint64_t MR_uint64_t
Definition common.h:18
#define MRC_API
Definition exports.h:11
Definition MRId.h:55