MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMesh/MRMeshSubdivide.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRExpected.h"
6#include "MRConstants.h"
7#include <cfloat>
8#include <functional>
9
10namespace MR
11{
12
16
17struct SubdivideSettings
18{
20 float maxEdgeLen = 0;
21
23 int maxEdgeSplits = 1000;
24
26 float maxDeviationAfterFlip = 1;
27
29 float maxAngleChangeAfterFlip = FLT_MAX;
30
34 float criticalAspectRatioFlip = 1000.0f;
35
37 FaceBitSet * region = nullptr;
38
41 FaceBitSet * maintainRegion = nullptr;
42
44 UndirectedEdgeBitSet* notFlippable = nullptr;
45
47 VertBitSet * newVerts = nullptr;
48
51 bool subdivideBorder = true;
52
54 float maxTriAspectRatio = 0;
55
59 float maxSplittableTriAspectRatio = FLT_MAX;
60
63 bool smoothMode = false;
64
67 float minSharpDihedralAngle = PI_F / 6; // 30 degrees
68
70 bool projectOnOriginalMesh = false;
71
73 std::function<bool(EdgeId e)> beforeEdgeSplit;
74
76 std::function<void(VertId)> onVertCreated;
77
79 std::function<void(EdgeId e1, EdgeId e)> onEdgeSplit;
80
82 ProgressCallback progressCallback;
83};
84
87MRMESH_API int subdivideMesh( Mesh & mesh, const SubdivideSettings & settings = {} );
88
93
96[[nodiscard]] MRMESH_API Expected<Mesh> copySubdividePackMesh( const MeshPart & mp, float voxelSize, const ProgressCallback & cb = {} );
97
100
102
103} //namespace MR
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMesh/MRMesh.h:23
Definition MRObjectMeshData.h:14
Definition MRObjectMesh.h:11
Definition MRMesh/MRMeshSubdivide.h:18
new unsafe MR.? UndirectedEdgeBitSet notFlippable
new unsafe ref float criticalAspectRatioFlip
new unsafe MR.Std.Function_BoolFuncFromFloat progressCallback
new unsafe MR.? VertBitSet newVerts
new unsafe ref bool projectOnOriginalMesh
new unsafe ref float maxDeviationAfterFlip
new unsafe ref float maxAngleChangeAfterFlip
new unsafe MR.Std.Function_BoolFuncFromMREdgeId beforeEdgeSplit
new unsafe MR.? FaceBitSet region
new unsafe ref float maxEdgeLen
new unsafe MR.Std.Function_VoidFuncFromMREdgeIdMREdgeId onEdgeSplit
new unsafe ref int maxEdgeSplits
new unsafe ref float maxTriAspectRatio
new unsafe ref bool subdivideBorder
new unsafe ref float maxSplittableTriAspectRatio
new unsafe MR.Std.Function_VoidFuncFromMRVertId onVertCreated
new unsafe ref bool smoothMode
new unsafe MR.? FaceBitSet maintainRegion
MRMESH_API Expected< Mesh > copySubdividePackMesh(const MeshPart &mp, float voxelSize, const ProgressCallback &cb={})
MRMESH_API int subdivideMesh(Mesh &mesh, const SubdivideSettings &settings={})
MRMESH_API ObjectMeshData makeSubdividedObjectMeshData(const ObjectMesh &obj, const SubdivideSettings &settings)
returns the data of subdivided mesh given ObjectMesh (which remains unchanged) and subdivision parame...
Definition MRCameraOrientationPlugin.h:8