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
50
62
65
68
73
77
82
91
99
108
114
119
125
131
136
142
148
153
159
166
172
179
185
190
196
203
209
216
223
229
236
243
249
256
262
267
273
279
284
290
296
301
307
313
318
324
331
337
344
351
357
364
371
377
384
390
395
401
409
416
424
432
439
447
454
460
467
478
488
499
512
524
537
544
550
557
567
576
586
592
597
603
609
614
620
627
633
640
647
653
660
668
675
683
689
694
700
704
709
712MRC_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);
713
716
719
723
726
729
734
740
745
751
757
762
768
777
785
794
800
805
811
815
820
823MRC_API MR_DecimateResult *MR_DecimateResult_ConstructFrom(int vertsDeleted, int facesDeleted, float errorIntroduced, bool cancelled);
824
827
830
835
838
841
847
862
870
878
887MRC_API MR_QuadraticForm3f *MR_computeFormAtVertex(const MR_MeshPart *mp, MR_VertId v, float stabilizer, bool angleWeigted, const MR_UndirectedEdgeBitSet *creases);
888
898
908
914
919
925
931
936
942
948
953
959
966
972
979
986
992
999
1005
1010
1016
1020
1025
1028MRC_API MR_ResolveMeshDegenSettings *MR_ResolveMeshDegenSettings_ConstructFrom(float maxDeviation, float tinyEdgeLength, float maxAngleChange, float criticalAspectRatio, float stabilizer, MR_FaceBitSet *region);
1029
1032
1035
1040
1043
1046
1052
1066
1073
1079
1086
1092
1097
1103
1109
1114
1120
1126
1131
1137
1144
1150
1157
1164
1170
1177
1183
1188
1194
1200
1205
1211
1218
1224
1231
1237
1242
1248
1255
1261
1268
1274
1279
1285
1291
1296
1302
1313
1323
1334
1340
1345
1351
1355
1360
1363MRC_API MR_RemeshSettings *MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int maxEdgeSplits, float maxAngleChangeAfterFlip, float maxBdShift, bool useCurvature, 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);
1364
1367
1370
1374
1377
1380
1385
1386// Splits too long and eliminates too short edges from the mesh
1390MRC_API bool MR_remesh(MR_Mesh *mesh, const MR_RemeshSettings *settings);
1391
1392#ifdef __cplusplus
1393} // extern "C"
1394#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:24
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:28
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: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:12
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)
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 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)
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 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)
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 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
Generated from class MR::DecimateResult.
Definition MRMeshDecimate.h:61
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 MR_RemeshSettings * MR_RemeshSettings_ConstructFrom(float targetEdgeLen, int maxEdgeSplits, float maxAngleChangeAfterFlip, float maxBdShift, bool useCurvature, 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 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 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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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 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
Generated from class MR::RemeshSettings.
Definition MRMeshDecimate.h:67
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)
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 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)
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:49
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 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 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_packMesh(MR_RemeshSettings *_this, bool value)
struct MR_ResolveMeshDegenSettings MR_ResolveMeshDegenSettings
Generated from class MR::ResolveMeshDegenSettings.
Definition MRMeshDecimate.h:64
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_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:19
uint64_t MR_uint64_t
Definition common.h:14
#define MRC_API
Definition exports.h:11
Definition MRId.h:55