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 |
FaceBitSet * | region = 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 | |
Parameters structure for MR::decimateParallelMesh.
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.
float MR::DecimateParallelSettings::criticalTriAspectRatio = FLT_MAX |
the algorithm will try to eliminate triangles with equal or larger aspect ratio, ignoring normal orientation checks
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)
float MR::DecimateParallelSettings::maxBdShift = FLT_MAX |
Maximal shift of a boundary during one edge collapse.
float MR::DecimateParallelSettings::maxEdgeLen = FLT_MAX |
Maximal possible edge length created during decimation.
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
float MR::DecimateParallelSettings::maxTriangleAspectRatio = 20 |
Maximal possible aspect ratio of a triangle introduced during decimation.
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
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;
ProgressCallback MR::DecimateParallelSettings::progressCallback = {} |
callback to report algorithm progress and cancel it by user request
FaceBitSet* MR::DecimateParallelSettings::region = nullptr |
Region on mesh to be decimated, it is updated during the operation.
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
DecimateStrategy MR::DecimateParallelSettings::strategy = DecimateStrategy::MinimizeError |
int MR::DecimateParallelSettings::subdivideParts = 32 |
Subdivides mesh on given number of parts to process them in parallel.
bool MR::DecimateParallelSettings::touchNearBdEdges = true |
Whether to allow collapsing edges having at least one vertex on (region) boundary.