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
78
84
90
99MRC_API const float *MR_DecimateSettings_Get_maxError(const MR_DecimateSettings *_this);
100
109
119
126
132
139
146
152
159
166
172
179
187
194
202
209
215
222
230
237
245
253
260
268
276
283
291
298
304
311
318
324
331
338
345
352
359
366
373
381
388
396
404
412
420
428
436
444
451
457
464
473
481
490
499
508
517
525
532
540
552
564
576
590
604
618
626
634
642
653
664
675
682
688
695
702
709
716
724
731
739
747
754
762
771
780
789
796
802
809
813
818
834MRC_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);
835
839
843
848
851
854
861
868
874
881
888
894
901
911
920
930
936MRC_API const bool *MR_DecimateResult_Get_cancelled(const MR_DecimateResult *_this);
937
942MRC_API void MR_DecimateResult_Set_cancelled(MR_DecimateResult *_this, bool value);
943
950
954
959
963MRC_API MR_DecimateResult *MR_DecimateResult_ConstructFrom(int vertsDeleted, int facesDeleted, float errorIntroduced, bool cancelled);
964
968
972
978
981
984
992
1007
1015
1023
1032MRC_API MR_QuadraticForm3f *MR_computeFormAtVertex(const MR_MeshPart *mp, MR_VertId v, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases);
1033
1042MRC_API MR_Vector_MR_QuadraticForm3f_MR_VertId *MR_computeFormsAtVertices(const MR_MeshPart *mp, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases);
1043
1052MRC_API MR_FaceBitSet *MR_getSubdividePart(const MR_FaceBitSet *valids, MR_uint64_t subdivideParts, MR_uint64_t myPart);
1053
1060
1066
1073
1080
1086
1093
1100
1106
1113
1121
1128
1136
1144
1151
1159
1166
1173
1180
1184
1189
1194MRC_API MR_ResolveMeshDegenSettings *MR_ResolveMeshDegenSettings_ConstructFrom(float maxDeviation, float tinyEdgeLength, float maxAngleChange, float criticalAspectRatio, float stabilizer, MR_FaceBitSet *region);
1195
1199
1203
1209
1212
1215
1223
1237
1245
1252
1260
1267
1273
1280
1287
1293
1300
1308
1315
1323
1330MRC_API const float *MR_RemeshSettings_Get_maxBdShift(const MR_RemeshSettings *_this);
1331
1337MRC_API void MR_RemeshSettings_Set_maxBdShift(MR_RemeshSettings *_this, float value);
1338
1346
1354
1361
1369
1378
1386
1395
1403
1410
1418
1425
1431
1438
1445
1452
1459
1467
1475
1483
1489MRC_API const bool *MR_RemeshSettings_Get_packMesh(const MR_RemeshSettings *_this);
1490
1495MRC_API void MR_RemeshSettings_Set_packMesh(MR_RemeshSettings *_this, bool value);
1496
1503
1511
1518
1526
1533
1540
1547
1554
1561
1568
1580
1592
1604
1611
1618
1625
1629
1634
1644MRC_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);
1645
1649
1653
1658
1661
1664
1671
1672// Splits too long and eliminates too short edges from the mesh
1676MRC_API bool MR_remesh(MR_Mesh *mesh, const MR_RemeshSettings *settings);
1677
1678#ifdef __cplusplus
1679} // extern "C"
1680#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
Definition MRId.h:55