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#include <stdint.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_FaceBitSet MR_FaceBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
16typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
17typedef struct MR_MeshPart MR_MeshPart; // Defined in `#include <MRCMesh/MRMeshPart.h>`.
18typedef struct MR_QuadraticForm3f MR_QuadraticForm3f; // Defined in `#include <MRCMesh/MRQuadraticForm.h>`.
19typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
20typedef struct MR_Vector_MR_QuadraticForm3f_MR_VertId MR_Vector_MR_QuadraticForm3f_MR_VertId; // Defined in `#include <MRCMesh/MRVector.h>`.
21typedef struct MR_VertBitSet MR_VertBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
22typedef 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>`.
23typedef 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>`.
24typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float; // Defined in `#include <MRCMisc/std_function_bool_from_float.h>`.
25typedef 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>`.
26typedef 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>`.
27typedef struct MR_std_vector_MR_FaceBitSet MR_std_vector_MR_FaceBitSet; // Defined in `#include <MRCMisc/std_vector_MR_FaceBitSet.h>`.
28
29
32{
33 // the next edge to collapse will be the one that introduced minimal error to the surface
35 // the next edge to collapse will be the shortest one
38
48
60
63
66
71
75
80
89
97
106
112
117
123
129
134
140
146
151
157
164
170
177
183
188
194
201
207
214
221
227
234
241
247
254
260
265
271
277
282
288
294
299
305
311
316
322
329
335
342
349
355
362
369
375
382
388
393
399
407
414
422
430
437
445
452
458
465
476
486
497
510
522
535
542
548
555
565
574
584
590
595
601
607
612
618
625
631
638
645
651
658
666
673
681
687
692
698
702
707
710MRC_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, int32_t maxDeletedVertices, int32_t 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, int32_t subdivideParts, bool decimateBetweenParts, MR_std_vector_MR_FaceBitSet *partFaces, int32_t minFacesInPart);
711
714
717
721
724
727
732
738
743
749
755
760
766
775
783
792
798
803
809
813
818
821MRC_API MR_DecimateResult *MR_DecimateResult_ConstructFrom(int32_t vertsDeleted, int32_t facesDeleted, float errorIntroduced, bool cancelled);
822
825
828
833
836
839
845
860
869MRC_API MR_QuadraticForm3f *MR_computeFormAtVertex(const MR_MeshPart *mp, MR_VertId v, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases);
870
880
890
896
901
907
913
918
924
930
935
941
948
954
961
968
974
981
987
992
998
1002
1007
1010MRC_API MR_ResolveMeshDegenSettings *MR_ResolveMeshDegenSettings_ConstructFrom(float maxDeviation, float tinyEdgeLength, float maxAngleChange, float criticalAspectRatio, float stabilizer, MR_FaceBitSet *region);
1011
1014
1017
1022
1025
1028
1034
1048
1055
1061
1068
1074
1079
1085
1091
1096
1102
1108
1113
1119
1126
1132
1139
1146
1152
1159
1165
1170
1176
1182
1187
1193
1200
1206
1213
1219
1224
1230
1237
1243
1250
1256
1261
1267
1273
1278
1284
1295
1305
1316
1322
1327
1333
1337
1342
1345MRC_API MR_RemeshSettings *MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int32_t maxEdgeSplits, float maxAngleChangeAfterFlip, float maxBdShift, bool useCurvature, int32_t 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);
1346
1349
1352
1356
1359
1362
1367
1368// Splits too long and eliminates too short edges from the mesh
1372MRC_API bool MR_remesh(MR_Mesh *mesh, const MR_RemeshSettings *settings);
1373
1374#ifdef __cplusplus
1375} // extern "C"
1376#endif
struct MR_std_function_bool_from_float MR_std_function_bool_from_float
Definition MR3mf.h:10
struct MR_FaceBitSet MR_FaceBitSet
Definition MRAABBTreeBase.h:25
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:29
struct MR_VertBitSet MR_VertBitSet
Definition MRAABBTree.h:15
struct MR_MeshPart MR_MeshPart
Definition MRAABBTree.h:14
struct MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId MR_phmap_flat_hash_map_MR_UndirectedEdgeId_MR_UndirectedEdgeId
Definition MRBitSet.h:52
struct MR_std_vector_MR_FaceBitSet MR_std_vector_MR_FaceBitSet
Definition MRContoursSeparation.h:11
struct MR_Mesh MR_Mesh
Definition MRCtm.h:13
struct MR_std_function_void_from_MR_EdgeId_MR_EdgeId MR_std_function_void_from_MR_EdgeId_MR_EdgeId
Definition MRFillHoleNicely.h:24
MRC_API const MR_ResolveMeshDegenSettings * MR_ResolveMeshDegenSettings_OffsetPtr(const MR_ResolveMeshDegenSettings *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_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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const MR_RemeshSettings * MR_RemeshSettings_OffsetPtr(const MR_RemeshSettings *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 float * MR_DecimateResult_GetMutable_errorIntroduced(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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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 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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_RemeshSettings_Set_useCurvature(MR_RemeshSettings *_this, bool value)
MRC_API float * MR_DecimateSettings_GetMutable_maxBdShift(MR_DecimateSettings *_this)
struct MR_DecimateResult MR_DecimateResult
Generated from class MR::DecimateResult.
Definition MRMeshDecimate.h:59
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)
MRC_API MR_UndirectedEdgeBitSet ** MR_DecimateSettings_GetMutable_notFlippable(MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_edgesToCollapse(MR_DecimateSettings *_this, MR_UndirectedEdgeBitSet *value)
MRC_API int32_t * MR_RemeshSettings_GetMutable_maxEdgeSplits(MR_RemeshSettings *_this)
MRC_API const bool * MR_RemeshSettings_Get_projectOnOriginalMesh(const MR_RemeshSettings *_this)
MRC_API bool * MR_DecimateSettings_GetMutable_touchNearBdEdges(MR_DecimateSettings *_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 MR_FaceBitSet *const * MR_DecimateSettings_Get_region(const MR_DecimateSettings *_this)
MRC_API MR_DecimateResult * MR_DecimateResult_OffsetMutablePtr(MR_DecimateResult *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 float * MR_RemeshSettings_Get_maxBdShift(const MR_RemeshSettings *_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_collapseNearNotFlippable(MR_DecimateSettings *_this, bool value)
MRC_API void MR_DecimateSettings_Set_stabilizer(MR_DecimateSettings *_this, float value)
MRC_API MR_DecimateResult * MR_DecimateResult_DefaultConstruct(void)
MRC_API void MR_RemeshSettings_Set_maxEdgeSplits(MR_RemeshSettings *_this, int32_t value)
MRC_API int32_t * MR_DecimateSettings_GetMutable_maxDeletedFaces(MR_DecimateSettings *_this)
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 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 const int32_t * MR_DecimateSettings_Get_minFacesInPart(const 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)
MR_DecimateStrategy
Defines the order of edge collapses inside Decimate algorithm.
Definition MRMeshDecimate.h:32
@ MR_DecimateStrategy_MinimizeError
Definition MRMeshDecimate.h:34
@ MR_DecimateStrategy_ShortestEdgeFirst
Definition MRMeshDecimate.h:36
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:20
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 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
Generated from class MR::RemeshSettings.
Definition MRMeshDecimate.h:65
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 MR_RemeshSettings * MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int32_t maxEdgeSplits, float maxAngleChangeAfterFlip, float maxBdShift, bool useCurvature, int32_t 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 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 const MR_DecimateResult * MR_DecimateResult_OffsetPtr(const MR_DecimateResult *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_DecimateSettings_Set_optimizeVertexPos(MR_DecimateSettings *_this, bool value)
MRC_API const int32_t * MR_DecimateSettings_Get_maxDeletedVertices(const MR_DecimateSettings *_this)
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:26
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 const MR_DecimateSettings * MR_DecimateSettings_OffsetPtr(const MR_DecimateSettings *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_DecimateResult * MR_DecimateResult_ConstructFromAnother(const MR_DecimateResult *_other)
struct MR_DecimateSettings MR_DecimateSettings
Generated from class MR::DecimateSettings.
Definition MRMeshDecimate.h:47
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_RemeshSettings_Set_notFlippable(MR_RemeshSettings *_this, MR_UndirectedEdgeBitSet *value)
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 int32_t * MR_DecimateSettings_GetMutable_subdivideParts(MR_DecimateSettings *_this)
MRC_API void MR_RemeshSettings_Set_finalRelaxNoShrinkage(MR_RemeshSettings *_this, bool value)
MRC_API int32_t * MR_DecimateSettings_GetMutable_minFacesInPart(MR_DecimateSettings *_this)
MRC_API const int32_t * MR_DecimateSettings_Get_subdivideParts(const MR_DecimateSettings *_this)
MRC_API float * MR_DecimateSettings_GetMutable_maxAngleChange(MR_DecimateSettings *_this)
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 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 int32_t * MR_DecimateResult_GetMutable_vertsDeleted(MR_DecimateResult *_this)
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 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 void MR_RemeshSettings_Set_finalRelaxIters(MR_RemeshSettings *_this, int32_t value)
MRC_API void MR_DecimateSettings_Set_maxDeletedFaces(MR_DecimateSettings *_this, int32_t value)
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 void MR_DecimateSettings_Set_maxDeletedVertices(MR_DecimateSettings *_this, int32_t 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_packMesh(MR_RemeshSettings *_this, bool value)
struct MR_ResolveMeshDegenSettings MR_ResolveMeshDegenSettings
Generated from class MR::ResolveMeshDegenSettings.
Definition MRMeshDecimate.h:62
MRC_API const float * MR_DecimateSettings_Get_stabilizer(const MR_DecimateSettings *_this)
MRC_API void MR_DecimateSettings_Set_minFacesInPart(MR_DecimateSettings *_this, int32_t value)
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 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, int32_t maxDeletedVertices, int32_t 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, int32_t subdivideParts, bool decimateBetweenParts, MR_std_vector_MR_FaceBitSet *partFaces, int32_t minFacesInPart)
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 int32_t * MR_DecimateSettings_GetMutable_maxDeletedVertices(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 int32_t * MR_DecimateResult_GetMutable_facesDeleted(MR_DecimateResult *_this)
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:23
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 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 void MR_DecimateSettings_Set_subdivideParts(MR_DecimateSettings *_this, int32_t value)
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 const int32_t * MR_RemeshSettings_Get_maxEdgeSplits(const MR_RemeshSettings *_this)
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 int32_t * MR_DecimateResult_Get_facesDeleted(const MR_DecimateResult *_this)
MRC_API void MR_DecimateResult_Set_vertsDeleted(MR_DecimateResult *_this, int32_t 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 int32_t * MR_RemeshSettings_GetMutable_finalRelaxIters(MR_RemeshSettings *_this)
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 void MR_DecimateResult_Set_facesDeleted(MR_DecimateResult *_this, int32_t value)
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 const int32_t * MR_DecimateSettings_Get_maxDeletedFaces(const 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 const int32_t * MR_DecimateResult_Get_vertsDeleted(const MR_DecimateResult *_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_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 const int32_t * MR_RemeshSettings_Get_finalRelaxIters(const MR_RemeshSettings *_this)
MRC_API MR_DecimateResult * MR_DecimateResult_ConstructFrom(int32_t vertsDeleted, int32_t facesDeleted, float errorIntroduced, bool cancelled)
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 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 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 MR_RemeshSettings * MR_RemeshSettings_DefaultConstructArray(size_t num_elems)
MRC_API MR_DecimateResult * MR_decimateMesh(MR_Mesh *mesh, const MR_DecimateSettings *settings)
Collapse edges in mesh region according to the settings.
struct MR_QuadraticForm3f MR_QuadraticForm3f
Definition MRMesh.h:35
MR_PassBy
Definition common.h:19
uint64_t MR_uint64_t
Definition common.h:14
#define MRC_API
Definition exports.h:11
Definition MRId.h:56