MeshLib
 
Loading...
Searching...
No Matches
DecimateParameters Struct Reference

#include <MRMeshDecimate.h>

Public Attributes

DecimateStrategy strategy = DecimateStrategy::MinimizeError
 
float maxError = 0.001f
 
float maxEdgeLen = FLT_MAX
 Maximal possible edge length created during decimation.
 
float maxBdShift = FLT_MAX
 Maximal shift of a boundary during one edge collapse.
 
float maxTriangleAspectRatio = 20.0f
 Maximal possible aspect ratio of a triangle introduced during decimation.
 
float criticalTriAspectRatio = FLT_MAX
 
float tinyEdgeLength = -1
 edges not longer than this value will be collapsed even if it results in appearance of a triangle with high aspect ratio
 
float stabilizer = 0.001f
 
bool optimizeVertexPos = true
 
int maxDeletedVertices = INT_MAX
 Limit on the number of deleted vertices.
 
int maxDeletedFaces = INT_MAX
 Limit on the number of deleted faces.
 
FaceBitSet region = nullptr
 Region on mesh to be decimated, it is updated during the operation. If null then whole mesh is decimated.
 
bool collapseNearNotFlippable = false
 which can move vertices of notFlippable edges unless they are fixed
 
bool touchNearBdEdges = true
 Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.
 
bool touchBdVerts = true
 
float maxAngleChange = -1
 
bool packMesh = false
 whether to pack mesh at the end
 
int subdivideParts = 1
 
bool decimateBetweenParts = true
 
int minFacesInPart = 0
 minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode
 

Member Data Documentation

◆ collapseNearNotFlippable

bool DecimateParameters::collapseNearNotFlippable = false

which can move vertices of notFlippable edges unless they are fixed

Whether to allow collapse of edges incident to notFlippable edges,

◆ criticalTriAspectRatio

float DecimateParameters::criticalTriAspectRatio = FLT_MAX

the algorithm will ignore dihedral angle check if one of triangles had aspect ratio equal or more than this value; and the algorithm will permit temporary increase in aspect ratio after collapse, if before collapse one of the triangles had larger aspect ratio

◆ decimateBetweenParts

bool DecimateParameters::decimateBetweenParts = true

After parallel decimation of all mesh parts is done, whether to perform final decimation of whole mesh region to eliminate small edges near the border of individual parts

◆ maxAngleChange

float DecimateParameters::maxAngleChange = -1

Permit edge flips (in addition to collapsing) to improve Delone quality of the mesh if it does not change dihedral angle more than on this value (negative value prohibits any edge flips)

◆ maxBdShift

float DecimateParameters::maxBdShift = FLT_MAX

Maximal shift of a boundary during one edge collapse.

◆ maxDeletedFaces

int DecimateParameters::maxDeletedFaces = INT_MAX

Limit on the number of deleted faces.

◆ maxDeletedVertices

int DecimateParameters::maxDeletedVertices = INT_MAX

Limit on the number of deleted vertices.

◆ maxEdgeLen

float DecimateParameters::maxEdgeLen = FLT_MAX

Maximal possible edge length created during decimation.

◆ maxError

float DecimateParameters::maxError = 0.001f

for DecimateStrategy::MinimizeError: stop the decimation as soon as the estimated distance deviation from the original mesh is more than this value for DecimateStrategy::ShortestEdgeFirst only: stop the decimation as soon as the shortest edge in the mesh is greater than this value

◆ maxTriangleAspectRatio

float DecimateParameters::maxTriangleAspectRatio = 20.0f

Maximal possible aspect ratio of a triangle introduced during decimation.

◆ minFacesInPart

int DecimateParameters::minFacesInPart = 0

minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode

◆ optimizeVertexPos

bool DecimateParameters::optimizeVertexPos = true

if true then after each edge collapse the position of remaining vertex is optimized to minimize local shape change, if false then the edge is collapsed in one of its vertices, which keeps its position

◆ packMesh

bool DecimateParameters::packMesh = false

whether to pack mesh at the end

◆ region

FaceBitSet DecimateParameters::region = nullptr

Region on mesh to be decimated, it is updated during the operation. If null then whole mesh is decimated.

◆ stabilizer

float DecimateParameters::stabilizer = 0.001f

Small stabilizer is important to achieve good results on completely planar mesh parts, if your mesh is not-planer everywhere, then you can set it to zero

◆ strategy

DecimateStrategy DecimateParameters::strategy = DecimateStrategy::MinimizeError

◆ subdivideParts

int DecimateParameters::subdivideParts = 1

If this value is more than 1, then virtually subdivides the mesh on given number of parts to process them in parallel (using many threads); unlike mrDecimateParallelMesh it does not create copies of mesh regions, so may take less memory to operate; IMPORTANT: please call Mesh::PackOptimally before calling decimating with subdivideParts > 1, otherwise performance will be bad

◆ tinyEdgeLength

float DecimateParameters::tinyEdgeLength = -1

edges not longer than this value will be collapsed even if it results in appearance of a triangle with high aspect ratio

◆ touchBdVerts

bool DecimateParameters::touchBdVerts = true

touchBdVerts=true: allow moving and eliminating boundary vertices during edge collapses; touchBdVerts=false: allow only collapsing an edge having only one boundary vertex in that vertex, so position and count of boundary vertices do not change; this setting is ignored if touchNearBdEdges=false

◆ touchNearBdEdges

bool DecimateParameters::touchNearBdEdges = true

Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.


The documentation for this struct was generated from the following file: