MeshLib
 
Loading...
Searching...
No Matches
MRDotNet/MRMeshDecimate.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3
4#pragma managed( push, off )
5#include <climits>
6#include <cfloat>
7#pragma managed( pop )
8
10
12public enum class DecimateStrategy
13{
18};
19
20public ref struct DecimateParameters
21{
27 float maxError = 0.001f;
29 float maxEdgeLen = FLT_MAX;
31 float maxBdShift = FLT_MAX;
36 float criticalTriAspectRatio = FLT_MAX;
38 float tinyEdgeLength = -1;
41 float stabilizer = 0.001f;
44 bool optimizeVertexPos = true;
46 int maxDeletedVertices = INT_MAX;
48 int maxDeletedFaces = INT_MAX;
50 FaceBitSet^ region = nullptr;
54 // TODO: edgesToCollapse
55 // TODO: twinMap
57 bool touchNearBdEdges = true;
61 bool touchBdVerts = true;
62 // TODO: bdVerts
65 float maxAngleChange = -1;
67 bool packMesh = false;
75 // TODO: partFaces
78};
79
80public value struct DecimateResult
81{
91};
92
93public ref class MeshDecimate
94{
95public:
97 static DecimateResult Decimate( Mesh^ mesh, DecimateParameters^ parameters );
98};
99
DecimateStrategy
Defines the order of edge collapses inside Decimate algorithm.
Definition MRDotNet/MRMeshDecimate.h:13
@ MinimizeError
the next edge to collapse will be the one that introduced minimal error to the surface
@ ShortestEdgeFirst
the next edge to collapse will be the shortest one
#define MR_DOTNET_NAMESPACE_BEGIN
Definition MRDotNet/MRMeshFwd.h:42
#define MR_DOTNET_NAMESPACE_END
Definition MRDotNet/MRMeshFwd.h:43
Definition MRDotNet/MRBitSet.h:39
static DecimateResult Decimate(Mesh^ mesh, DecimateParameters^ parameters)
Collapse edges in mesh region according to the settings.
represents a mesh, including topology (connectivity) information and point coordinates,
Definition MRDotNet/MRMesh.h:30
Definition MeshDecimate.dox.py:1
Definition MRDotNet/MRMeshDecimate.h:21
float criticalTriAspectRatio
Definition MRDotNet/MRMeshDecimate.h:36
int maxDeletedFaces
Limit on the number of deleted faces.
Definition MRDotNet/MRMeshDecimate.h:48
bool decimateBetweenParts
Definition MRDotNet/MRMeshDecimate.h:74
float maxBdShift
Maximal shift of a boundary during one edge collapse.
Definition MRDotNet/MRMeshDecimate.h:31
float maxEdgeLen
Maximal possible edge length created during decimation.
Definition MRDotNet/MRMeshDecimate.h:29
bool touchNearBdEdges
Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.
Definition MRDotNet/MRMeshDecimate.h:57
float stabilizer
Definition MRDotNet/MRMeshDecimate.h:41
float tinyEdgeLength
edges not longer than this value will be collapsed even if it results in appearance of a triangle wit...
Definition MRDotNet/MRMeshDecimate.h:38
DecimateStrategy strategy
Definition MRDotNet/MRMeshDecimate.h:22
bool collapseNearNotFlippable
which can move vertices of notFlippable edges unless they are fixed
Definition MRDotNet/MRMeshDecimate.h:53
FaceBitSet region
Region on mesh to be decimated, it is updated during the operation. If null then whole mesh is decima...
Definition MRDotNet/MRMeshDecimate.h:50
int minFacesInPart
minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode
Definition MRDotNet/MRMeshDecimate.h:77
bool touchBdVerts
Definition MRDotNet/MRMeshDecimate.h:61
int maxDeletedVertices
Limit on the number of deleted vertices.
Definition MRDotNet/MRMeshDecimate.h:46
int subdivideParts
Definition MRDotNet/MRMeshDecimate.h:71
float maxAngleChange
Definition MRDotNet/MRMeshDecimate.h:65
float maxError
Definition MRDotNet/MRMeshDecimate.h:27
float maxTriangleAspectRatio
Maximal possible aspect ratio of a triangle introduced during decimation.
Definition MRDotNet/MRMeshDecimate.h:33
bool optimizeVertexPos
Definition MRDotNet/MRMeshDecimate.h:44
bool packMesh
whether to pack mesh at the end
Definition MRDotNet/MRMeshDecimate.h:67
Definition MRDotNet/MRMeshDecimate.h:81
int vertsDeleted
Number deleted verts. Same as the number of performed collapses.
Definition MRDotNet/MRMeshDecimate.h:83
float errorIntroduced
Definition MRDotNet/MRMeshDecimate.h:90
int facesDeleted
Number deleted faces.
Definition MRDotNet/MRMeshDecimate.h:85