MeshLib
 
Loading...
Searching...
No Matches
MR::DecimateParallelSettings Struct Reference

Parameters structure for MR::decimateParallelMesh. More...

#include <MRMeshDecimateParallel.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
 Maximal possible aspect ratio of a triangle introduced during decimation.
 
float criticalTriAspectRatio = FLT_MAX
 the algorithm will try to eliminate triangles with equal or larger aspect ratio, ignoring normal orientation checks
 
float stabilizer = 0.001f
 
bool optimizeVertexPos = true
 
FaceBitSetregion = nullptr
 Region on mesh to be decimated, it is updated during the operation.
 
bool touchNearBdEdges = true
 Whether to allow collapsing edges having at least one vertex on (region) boundary.
 
float maxAngleChange = -1
 
int subdivideParts = 32
 Subdivides mesh on given number of parts to process them in parallel.
 
std::function< bool(VertId v0, VertId v1, const Vector3f &newV0Pos)> preCollapse
 The user can provide this optional callback that is invoked immediately before edge collapse;.
 
std::function< void(VertId v0, VertId v1, float &collapseErrorSq, Vector3f &collapsePos)> adjustCollapse
 The user can provide this optional callback for adjusting error introduced by edge collapse between vertices v0 and v1 of the original mesh, and the collapse position.
 
ProgressCallback progressCallback = {}
 callback to report algorithm progress and cancel it by user request
 

Detailed Description

Parameters structure for MR::decimateParallelMesh.

See also
decimateParallelMesh

Member Data Documentation

◆ adjustCollapse

std::function<void( VertId v0, VertId v1, float & collapseErrorSq, Vector3f & collapsePos )> MR::DecimateParallelSettings::adjustCollapse

The user can provide this optional callback for adjusting error introduced by edge collapse between vertices v0 and v1 of the original mesh, and the collapse position.

On input the callback gets the squared error and position computed by standard means, and callback can modify any of them. The larger the error, the later this edge will be collapsed. This callback can be called from many threads in parallel and must be thread-safe. This callback can be called many times for each edge before real collapsing, and it is important to make the same adjustment.

◆ criticalTriAspectRatio

float MR::DecimateParallelSettings::criticalTriAspectRatio = FLT_MAX

the algorithm will try to eliminate triangles with equal or larger aspect ratio, ignoring normal orientation checks

◆ maxAngleChange

float MR::DecimateParallelSettings::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 MR::DecimateParallelSettings::maxBdShift = FLT_MAX

Maximal shift of a boundary during one edge collapse.

◆ maxEdgeLen

float MR::DecimateParallelSettings::maxEdgeLen = FLT_MAX

Maximal possible edge length created during decimation.

◆ maxError

float MR::DecimateParallelSettings::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 MR::DecimateParallelSettings::maxTriangleAspectRatio = 20

Maximal possible aspect ratio of a triangle introduced during decimation.

◆ optimizeVertexPos

bool MR::DecimateParallelSettings::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

◆ preCollapse

std::function<bool( VertId v0, VertId v1, const Vector3f & newV0Pos )> MR::DecimateParallelSettings::preCollapse

The user can provide this optional callback that is invoked immediately before edge collapse;.

It receives both vertices of the edge being collapsed: v1 will disappear, and v0 will get new position (provided as the third argument) after collapse; If the callback returns false, then the collapse is prohibited;

Note
This callback will be called from parallel threads when they process subparts

◆ progressCallback

ProgressCallback MR::DecimateParallelSettings::progressCallback = {}

callback to report algorithm progress and cancel it by user request

◆ region

FaceBitSet* MR::DecimateParallelSettings::region = nullptr

Region on mesh to be decimated, it is updated during the operation.

◆ stabilizer

float MR::DecimateParallelSettings::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 MR::DecimateParallelSettings::strategy = DecimateStrategy::MinimizeError

◆ subdivideParts

int MR::DecimateParallelSettings::subdivideParts = 32

Subdivides mesh on given number of parts to process them in parallel.

◆ touchNearBdEdges

bool MR::DecimateParallelSettings::touchNearBdEdges = true

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


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