MeshLib
 
Loading...
Searching...
No Matches
MRMeshDecimateParallel.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshDecimate.h"
4
5namespace MR
6{
7
15struct DecimateParallelSettings
16{
22 float maxError = 0.001f;
24 float maxEdgeLen = FLT_MAX;
26 float maxBdShift = FLT_MAX;
30 float criticalTriAspectRatio = FLT_MAX;
33 float stabilizer = 0.001f;
36 bool optimizeVertexPos = true;
38 FaceBitSet * region = nullptr;
40 bool touchNearBdEdges = true;
43 float maxAngleChange = -1;
53 std::function<bool( VertId v0, VertId v1, const Vector3f & newV0Pos )> preCollapse;
62 std::function<void( VertId v0, VertId v1, float & collapseErrorSq, Vector3f & collapsePos )> adjustCollapse;
65};
66
78
79} //namespace MR
int VertId
Definition MRDotNet/MRMeshFwd.h:51
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
MRMESH_API DecimateResult decimateParallelMesh(Mesh &mesh, const DecimateParallelSettings &settings={})
Collapse edges in mesh region according to the settings.
Definition MRCameraOrientationPlugin.h:7
DecimateStrategy
Defines the order of edge collapses inside Decimate algorithm.
Definition MRMesh/MRMeshDecimate.h:19
@ MinimizeError
Definition MRMesh/MRMeshDecimate.h:20
Parameters structure for MR::decimateParallelMesh.
float maxAngleChange
Definition MRMeshDecimateParallel.h:43
DecimateStrategy strategy
Definition MRMeshDecimateParallel.h:17
ProgressCallback progressCallback
callback to report algorithm progress and cancel it by user request
Definition MRMeshDecimateParallel.h:64
float maxEdgeLen
Maximal possible edge length created during decimation.
Definition MRMeshDecimateParallel.h:24
float criticalTriAspectRatio
the algorithm will try to eliminate triangles with equal or larger aspect ratio, ignoring normal orie...
Definition MRMeshDecimateParallel.h:30
float maxTriangleAspectRatio
Maximal possible aspect ratio of a triangle introduced during decimation.
Definition MRMeshDecimateParallel.h:28
float maxBdShift
Maximal shift of a boundary during one edge collapse.
Definition MRMeshDecimateParallel.h:26
FaceBitSet * region
Region on mesh to be decimated, it is updated during the operation.
Definition MRMeshDecimateParallel.h:38
bool touchNearBdEdges
Whether to allow collapsing edges having at least one vertex on (region) boundary.
Definition MRMeshDecimateParallel.h:40
float stabilizer
Definition MRMeshDecimateParallel.h:33
bool optimizeVertexPos
Definition MRMeshDecimateParallel.h:36
int subdivideParts
Subdivides mesh on given number of parts to process them in parallel.
Definition MRMeshDecimateParallel.h:45
float maxError
Definition MRMeshDecimateParallel.h:22
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;.
Definition MRMeshDecimateParallel.h:53
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 v...
Definition MRMeshDecimateParallel.h:62
Results of MR::decimateMesh.
Definition MRMesh/MRMesh.h:23