MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshSubdivide.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRConstants.h"
6#include <cfloat>
7#include <functional>
8
9namespace MR
10{
11
15
17{
19 float maxEdgeLen = 0;
21 int maxEdgeSplits = 1000;
25 float maxAngleChangeAfterFlip = FLT_MAX;
29 float criticalAspectRatioFlip = 1000.0f;
31 FaceBitSet * region = nullptr;
33 UndirectedEdgeBitSet* notFlippable = nullptr;
35 VertBitSet * newVerts = nullptr;
38 bool subdivideBorder = true;
47 bool smoothMode = false;
50 float minSharpDihedralAngle = PI_F / 6; // 30 degrees
54 std::function<void(VertId)> onVertCreated;
56 std::function<void(EdgeId e1, EdgeId e)> onEdgeSplit;
58 std::function<bool(EdgeId e)> beforeEdgeSplit;
61};
62
65MRMESH_API int subdivideMesh( Mesh & mesh, const SubdivideSettings & settings = {} );
66
68
69}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
MRMESH_API int subdivideMesh(Mesh &mesh, const SubdivideSettings &settings={})
Definition MRCameraOrientationPlugin.h:8
Definition MRMesh/MRMesh.h:23
Definition MRMeshSubdivide.h:17
float maxTriAspectRatio
The subdivision stops as soon as all triangles (in the region) have aspect ratio below or equal to th...
Definition MRMeshSubdivide.h:40
float maxEdgeLen
Subdivision is stopped when all edges inside or on the boundary of the region are not longer than thi...
Definition MRMeshSubdivide.h:19
std::function< bool(EdgeId e)> beforeEdgeSplit
this function is called each time edge (e) is going to split, if it returns false then this split wil...
Definition MRMeshSubdivide.h:58
bool projectOnOriginalMesh
if true, then every new vertex will be projected on the original mesh (before smoothing)
Definition MRMeshSubdivide.h:52
float minSharpDihedralAngle
Definition MRMeshSubdivide.h:50
FaceBitSet * region
Region on mesh to be subdivided, it is updated during the operation.
Definition MRMeshSubdivide.h:31
bool smoothMode
Definition MRMeshSubdivide.h:47
float criticalAspectRatioFlip
Definition MRMeshSubdivide.h:29
bool subdivideBorder
Definition MRMeshSubdivide.h:38
std::function< void(VertId)> onVertCreated
this function is called each time a new vertex has been created, but before the ring is made Delone
Definition MRMeshSubdivide.h:54
float maxAngleChangeAfterFlip
Improves local mesh triangulation by doing edge flips if it does not change dihedral angle more than ...
Definition MRMeshSubdivide.h:25
UndirectedEdgeBitSet * notFlippable
Edges specified by this bit-set will never be flipped, but they can be split so it is updated during ...
Definition MRMeshSubdivide.h:33
ProgressCallback progressCallback
callback to report algorithm progress and cancel it by user request
Definition MRMeshSubdivide.h:60
float maxSplittableTriAspectRatio
Definition MRMeshSubdivide.h:44
float maxDeviationAfterFlip
Improves local mesh triangulation by doing edge flips if it does not make too big surface deviation.
Definition MRMeshSubdivide.h:23
VertBitSet * newVerts
New vertices appeared during subdivision will be added here.
Definition MRMeshSubdivide.h:35
std::function< void(EdgeId e1, EdgeId e)> onEdgeSplit
this function is called each time edge (e) is split into (e1->e), but before the ring is made Delone
Definition MRMeshSubdivide.h:56
int maxEdgeSplits
Maximum number of edge splits allowed.
Definition MRMeshSubdivide.h:21