3#include "MRPch/MRBindingMacros.h"
33struct DecimateSettings
35 DecimateStrategy
strategy = DecimateStrategy::MinimizeError;
93 UndirectedEdgeHashMap *
twinMap =
nullptr;
286 FaceBitSet *
region =
nullptr;
296 std::function<void(EdgeId e1, EdgeId e)>
onEdgeSplit;
298 std::function<void(EdgeId e, EdgeId e1)>
onEdgeDel;
305 std::function<bool( EdgeId edgeToCollapse,
const Vector3f& newEdgeOrgPos )>
preCollapse;
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMesh/MRMesh.h:23
Definition MRObjectMeshData.h:14
Definition MRObjectMesh.h:11
Definition MRMesh/MRMeshDecimate.h:259
new unsafe ref bool frozenBoundary
new unsafe ref bool finalRelaxNoShrinkage
new unsafe ref bool useCurvature
new unsafe MR.? FaceBitSet region
new unsafe ref float targetEdgeLen
new unsafe MR.Std.Function_VoidFuncFromMREdgeIdMREdgeId onEdgeSplit
new unsafe ref bool projectOnOriginalMesh
new unsafe ref float maxBdShift
new unsafe MR.Std.Function_BoolFuncFromMREdgeIdConstMRVector3fRef preCollapse
new unsafe ref float maxSplittableTriAspectRatio
new unsafe ref float maxAngleChangeAfterFlip
new unsafe ref int finalRelaxIters
new unsafe MR.Std.Function_BoolFuncFromFloat progressCallback
new unsafe ref bool packMesh
new unsafe MR.Std.Function_VoidFuncFromMREdgeIdMREdgeId onEdgeDel
new unsafe ref int maxEdgeSplits
new unsafe MR.? UndirectedEdgeBitSet notFlippable
Definition MRMesh/MRMeshDecimate.h:225
new unsafe ref float stabilizer
new unsafe ref float maxAngleChange
new unsafe ref float criticalAspectRatio
new unsafe ref float maxDeviation
new unsafe ref float tinyEdgeLength
new unsafe MR.? FaceBitSet region
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:19
MRMESH_API DecimateResult decimateMesh(Mesh &mesh, const DecimateSettings &settings={})
Performs mesh simplification in mesh region according to the settings.
MRMESH_API FaceBitSet getSubdividePart(const FaceBitSet &valids, size_t subdivideParts, size_t myPart)
returns given subdivision part of all valid faces; parallel threads shall be able to safely modify th...
MRMESH_API bool resolveMeshDegenerations(Mesh &mesh, const ResolveMeshDegenSettings &settings={})
Removes degenerate triangles in a mesh by calling decimateMesh function with appropriate settings.
MRMESH_API QuadraticForm3f computeFormAtVertex(const MeshPart &mp, VertId v, float stabilizer, bool angleWeigted, const UndirectedEdgeBitSet *creases=nullptr)
Computes quadratic form at given vertex of the initial surface before decimation.
MRMESH_API Vector< QuadraticForm3f, VertId > computeFormsAtVertices(const MeshPart &mp, float stabilizer, bool angleWeigted, const UndirectedEdgeBitSet *creases=nullptr)
Computes quadratic forms at every vertex of mesh part before decimation.
Definition MRCameraOrientationPlugin.h:8
MRMESH_API bool remesh(Mesh &mesh, const RemeshSettings &settings)
MRMESH_API DecimateResult decimateObjectMeshData(ObjectMeshData &data, const DecimateSettings &settings)
MRMESH_API std::optional< ObjectMeshData > makeDecimatedObjectMeshData(const ObjectMesh &obj, const DecimateSettings &settings, DecimateResult *outRes=nullptr)
returns the data of decimated mesh given ObjectMesh (which remains unchanged) and decimation paramete...
Results of MR::decimateMesh.
int vertsDeleted
Number deleted verts. Same as the number of performed collapses.
Definition MRMesh/MRMeshDecimate.h:175
int facesDeleted
Definition MRMesh/MRMeshDecimate.h:176
float errorIntroduced
Definition MRMesh/MRMeshDecimate.h:181
bool cancelled
whether the algorithm was cancelled by the callback
Definition MRMesh/MRMeshDecimate.h:183
Parameters structure for MR::decimateMesh.
UndirectedEdgeBitSet * notFlippable
Edges specified by this bit-set will never be flipped, but they can be collapsed or replaced during c...
Definition MRMesh/MRMeshDecimate.h:81
bool collapseNearNotFlippable
Definition MRMesh/MRMeshDecimate.h:85
std::function< void(UndirectedEdgeId ue, float &collapseErrorSq, Vector3f &collapsePos)> adjustCollapse
The user can provide this optional callback for adjusting error introduced by this edge collapse and ...
Definition MRMesh/MRMeshDecimate.h:128
bool angleWeightedDistToPlane
Definition MRMesh/MRMeshDecimate.h:65
bool packMesh
whether to pack mesh at the end
Definition MRMesh/MRMeshDecimate.h:142
int maxDeletedFaces
Limit on the number of deleted faces.
Definition MRMesh/MRMeshDecimate.h:75
PreCollapseCallback preCollapse
The user can provide this optional callback that is invoked immediately before edge collapse;.
Definition MRMesh/MRMeshDecimate.h:118
UndirectedEdgeHashMap * twinMap
Definition MRMesh/MRMeshDecimate.h:93
float maxBdShift
Maximal shift of a boundary during one edge collapse.
Definition MRMesh/MRMeshDecimate.h:47
float criticalTriAspectRatio
Definition MRMesh/MRMeshDecimate.h:54
bool decimateBetweenParts
Definition MRMesh/MRMeshDecimate.h:153
DecimateStrategy strategy
Definition MRMesh/MRMeshDecimate.h:35
int minFacesInPart
minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode
Definition MRMesh/MRMeshDecimate.h:161
std::vector< FaceBitSet > * partFaces
Definition MRMesh/MRMeshDecimate.h:158
Vector< QuadraticForm3f, VertId > * vertForms
If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then i...
Definition MRMesh/MRMeshDecimate.h:139
int subdivideParts
Definition MRMesh/MRMeshDecimate.h:149
FaceBitSet * region
Region on mesh to be decimated, it is updated during the operation.
Definition MRMesh/MRMeshDecimate.h:78
ProgressCallback progressCallback
callback to report algorithm progress and cancel it by user request
Definition MRMesh/MRMeshDecimate.h:145
float stabilizer
Definition MRMesh/MRMeshDecimate.h:61
float maxError
Definition MRMesh/MRMeshDecimate.h:41
int maxDeletedVertices
Limit on the number of deleted vertices.
Definition MRMesh/MRMeshDecimate.h:72
VertBitSet * bdVerts
Definition MRMesh/MRMeshDecimate.h:106
float tinyEdgeLength
edges not longer than this value will be collapsed even if it results in appearance of a triangle wit...
Definition MRMesh/MRMeshDecimate.h:57
bool optimizeVertexPos
Definition MRMesh/MRMeshDecimate.h:69
float maxEdgeLen
Maximal possible edge length created during decimation.
Definition MRMesh/MRMeshDecimate.h:44
UndirectedEdgeBitSet * edgesToCollapse
Definition MRMesh/MRMeshDecimate.h:89
bool touchNearBdEdges
Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.
Definition MRMesh/MRMeshDecimate.h:96
float maxAngleChange
Definition MRMesh/MRMeshDecimate.h:110
bool touchBdVerts
Definition MRMesh/MRMeshDecimate.h:101
float maxTriangleAspectRatio
Maximal possible aspect ratio of a triangle introduced during decimation.
Definition MRMesh/MRMeshDecimate.h:50
std::function< void(EdgeId del, EdgeId rem)> onEdgeDel
Definition MRMesh/MRMeshDecimate.h:132