MeshLib
 
Loading...
Searching...
No Matches
MRMeshC/MRMeshDecimate.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4
6
15
17typedef struct MRDecimateSettings
18{
24 float maxError;
48 // TODO: notFlippable
52 // TODO: edgesToCollapse
53 // TODO: twinMap
60 // TODO: bdVerts
64 // TODO: preCollapse
65 // TODO: adjustCollapse
66 // TODO: onEdgeDel
67 // TODO: vertForms
79 // TODO: partFaces
83
86
102
105
124
127
132
134typedef struct MRRemeshSettings
135{
155 // TODO: notFlippable
161 // TODO: onEdgeSplit
162 // TODO: onEdgeDel
163 // TODO: preCollapse
167
170
172MRMESHC_API bool mrRemesh( MRMesh* mesh, const MRRemeshSettings* settings );
173
MRDecimateStrategy
Defines the order of edge collapses inside Decimate algorithm.
Definition MRMeshC/MRMeshDecimate.h:9
@ MRDecimateStrategyShortestEdgeFirst
the next edge to collapse will be the shortest one
Definition MRMeshC/MRMeshDecimate.h:13
@ MRDecimateStrategyMinimizeError
the next edge to collapse will be the one that introduced minimal error to the surface
Definition MRMeshC/MRMeshDecimate.h:11
struct MRResolveMeshDegenSettings MRResolveMeshDegenSettings
parameters for mrResolveMeshDegenerations
struct MRDecimateResult MRDecimateResult
results of mrDecimateMesh
struct MRRemeshSettings MRRemeshSettings
parameters for mrRemesh
MRMESHC_API bool mrRemesh(MRMesh *mesh, const MRRemeshSettings *settings)
Splits too long and eliminates too short edges from the mesh.
struct MRDecimateSettings MRDecimateSettings
parameters for mrDecimateMesh
MRMESHC_API MRRemeshSettings mrRemeshSettingsNew(void)
initializes a default instance
MRMESHC_API bool mrResolveMeshDegenerations(MRMesh *mesh, const MRResolveMeshDegenSettings *settings)
MRMESHC_API MRDecimateSettings mrDecimateSettingsNew(void)
initializes a default instance
MRMESHC_API MRResolveMeshDegenSettings mrResolveMeshDegenSettingsNew(void)
initializes a default instance
MRMESHC_API MRDecimateResult mrDecimateMesh(MRMesh *mesh, const MRDecimateSettings *settings)
Collapse edges in mesh region according to the settings.
#define MR_EXTERN_C_BEGIN
Definition MRMeshC/MRMeshFwd.h:26
bool(* MRProgressCallback)(float)
Definition MRMeshC/MRMeshFwd.h:51
#define MR_EXTERN_C_END
Definition MRMeshC/MRMeshFwd.h:27
struct MRMesh MRMesh
Definition MRMeshC/MRMeshFwd.h:42
MRBitSet MRFaceBitSet
Definition MRMeshC/MRMeshFwd.h:36
#define MRMESHC_API
Definition MRMeshC/MRMeshFwd.h:19
results of mrDecimateMesh
Definition MRMeshC/MRMeshDecimate.h:89
int vertsDeleted
Number deleted verts. Same as the number of performed collapses.
Definition MRMeshC/MRMeshDecimate.h:91
float errorIntroduced
Definition MRMeshC/MRMeshDecimate.h:98
int facesDeleted
Number deleted faces.
Definition MRMeshC/MRMeshDecimate.h:93
bool cancelled
whether the algorithm was cancelled by the callback
Definition MRMeshC/MRMeshDecimate.h:100
parameters for mrDecimateMesh
Definition MRMeshC/MRMeshDecimate.h:18
float maxError
Definition MRMeshC/MRMeshDecimate.h:24
bool collapseNearNotFlippable
Definition MRMeshC/MRMeshDecimate.h:51
int maxDeletedVertices
Limit on the number of deleted vertices.
Definition MRMeshC/MRMeshDecimate.h:43
float maxEdgeLen
Maximal possible edge length created during decimation.
Definition MRMeshC/MRMeshDecimate.h:26
bool decimateBetweenParts
Definition MRMeshC/MRMeshDecimate.h:78
int maxDeletedFaces
Limit on the number of deleted faces.
Definition MRMeshC/MRMeshDecimate.h:45
bool packMesh
whether to pack mesh at the end
Definition MRMeshC/MRMeshDecimate.h:69
float maxTriangleAspectRatio
Maximal possible aspect ratio of a triangle introduced during decimation.
Definition MRMeshC/MRMeshDecimate.h:30
MRDecimateStrategy strategy
Definition MRMeshC/MRMeshDecimate.h:19
float tinyEdgeLength
edges not longer than this value will be collapsed even if it results in appearance of a triangle wit...
Definition MRMeshC/MRMeshDecimate.h:35
float maxAngleChange
Definition MRMeshC/MRMeshDecimate.h:63
int minFacesInPart
minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode
Definition MRMeshC/MRMeshDecimate.h:81
float criticalTriAspectRatio
Definition MRMeshC/MRMeshDecimate.h:33
bool touchBdVerts
Definition MRMeshC/MRMeshDecimate.h:59
float maxBdShift
Maximal shift of a boundary during one edge collapse.
Definition MRMeshC/MRMeshDecimate.h:28
bool optimizeVertexPos
Definition MRMeshC/MRMeshDecimate.h:41
MRFaceBitSet * region
Region on mesh to be decimated, it is updated during the operation.
Definition MRMeshC/MRMeshDecimate.h:47
bool touchNearBdEdges
Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.
Definition MRMeshC/MRMeshDecimate.h:55
float stabilizer
Definition MRMeshC/MRMeshDecimate.h:38
int subdivideParts
Definition MRMeshC/MRMeshDecimate.h:75
MRProgressCallback progressCallback
callback to report algorithm progress and cancel it by user request
Definition MRMeshC/MRMeshDecimate.h:71
parameters for mrRemesh
Definition MRMeshC/MRMeshDecimate.h:135
bool projectOnOriginalMesh
Definition MRMeshC/MRMeshDecimate.h:160
MRProgressCallback progressCallback
callback to report algorithm progress and cancel it by user request
Definition MRMeshC/MRMeshDecimate.h:165
int maxEdgeSplits
Maximum number of edge splits allowed during subdivision.
Definition MRMeshC/MRMeshDecimate.h:140
float maxBdShift
Maximal shift of a boundary during one edge collapse.
Definition MRMeshC/MRMeshDecimate.h:144
float targetEdgeLen
Definition MRMeshC/MRMeshDecimate.h:138
bool finalRelaxNoShrinkage
if true prevents the surface from shrinkage after many iterations
Definition MRMeshC/MRMeshDecimate.h:152
bool useCurvature
Definition MRMeshC/MRMeshDecimate.h:147
MRFaceBitSet * region
Region on mesh to be changed, it is updated during the operation.
Definition MRMeshC/MRMeshDecimate.h:154
bool packMesh
whether to pack mesh at the end
Definition MRMeshC/MRMeshDecimate.h:157
float maxAngleChangeAfterFlip
Improves local mesh triangulation by doing edge flips if it does not change dihedral angle more than ...
Definition MRMeshC/MRMeshDecimate.h:142
int finalRelaxIters
Definition MRMeshC/MRMeshDecimate.h:150
parameters for mrResolveMeshDegenerations
Definition MRMeshC/MRMeshDecimate.h:108
float stabilizer
Definition MRMeshC/MRMeshDecimate.h:120
float criticalAspectRatio
Definition MRMeshC/MRMeshDecimate.h:117
float maxAngleChange
Permit edge flips if it does not change dihedral angle more than on this value.
Definition MRMeshC/MRMeshDecimate.h:114
float maxDeviation
maximum permitted deviation from the original surface
Definition MRMeshC/MRMeshDecimate.h:110
MRFaceBitSet * region
degenerations will be fixed only in given region, which is updated during the processing
Definition MRMeshC/MRMeshDecimate.h:122
float tinyEdgeLength
edges not longer than this value will be collapsed ignoring normals and aspect ratio checks
Definition MRMeshC/MRMeshDecimate.h:112