MeshLib
 
Loading...
Searching...
No Matches
MR::SubdivideSettings Struct Reference

#include <MRMeshSubdivide.h>

Public Attributes

float maxEdgeLen = 0
 Subdivision is stopped when all edges inside or on the boundary of the region are not longer than this value.
 
int maxEdgeSplits = 1000
 Maximum number of edge splits allowed.
 
float maxDeviationAfterFlip = 1
 Improves local mesh triangulation by doing edge flips if it does not make too big surface deviation.
 
float maxAngleChangeAfterFlip = FLT_MAX
 Improves local mesh triangulation by doing edge flips if it does not change dihedral angle more than on this value (in radians)
 
float criticalAspectRatioFlip = 1000.0f
 
FaceBitSetregion = nullptr
 Region on mesh to be subdivided, it is updated during the operation.
 
UndirectedEdgeBitSet * notFlippable = nullptr
 Edges specified by this bit-set will never be flipped, but they can be split so it is updated during the operation.
 
VertBitSetnewVerts = nullptr
 New vertices appeared during subdivision will be added here.
 
bool subdivideBorder = true
 
float maxTriAspectRatio = 0
 The subdivision stops as soon as all triangles (in the region) have aspect ratio below or equal to this value.
 
float maxSplittableTriAspectRatio = FLT_MAX
 
bool smoothMode = false
 
float minSharpDihedralAngle = PI_F / 6
 
bool projectOnOriginalMesh = false
 if true, then every new vertex will be projected on the original mesh (before smoothing)
 
std::function< void(VertId)> onVertCreated
 this function is called each time a new vertex has been created, but before the ring is made Delone
 
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
 
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 will be skipped
 
ProgressCallback progressCallback = {}
 callback to report algorithm progress and cancel it by user request
 

Member Data Documentation

◆ beforeEdgeSplit

std::function<bool(EdgeId e)> MR::SubdivideSettings::beforeEdgeSplit

this function is called each time edge (e) is going to split, if it returns false then this split will be skipped

◆ criticalAspectRatioFlip

float MR::SubdivideSettings::criticalAspectRatioFlip = 1000.0f

If this value is less than FLT_MAX then edge flips will ignore dihedral angle check if one of triangles has aspect ratio more than this value Unit: rad

◆ maxAngleChangeAfterFlip

float MR::SubdivideSettings::maxAngleChangeAfterFlip = FLT_MAX

Improves local mesh triangulation by doing edge flips if it does not change dihedral angle more than on this value (in radians)

◆ maxDeviationAfterFlip

float MR::SubdivideSettings::maxDeviationAfterFlip = 1

Improves local mesh triangulation by doing edge flips if it does not make too big surface deviation.

◆ maxEdgeLen

float MR::SubdivideSettings::maxEdgeLen = 0

Subdivision is stopped when all edges inside or on the boundary of the region are not longer than this value.

◆ maxEdgeSplits

int MR::SubdivideSettings::maxEdgeSplits = 1000

Maximum number of edge splits allowed.

◆ maxSplittableTriAspectRatio

float MR::SubdivideSettings::maxSplittableTriAspectRatio = FLT_MAX

An edge is subdivided only if both its left and right triangles have aspect ratio below or equal to this value. So this is a maximum aspect ratio of a triangle that can be split on two before Delone optimization. Please set it to a smaller value only if subdivideBorder==false, otherwise many narrow triangles can appear near border

◆ maxTriAspectRatio

float MR::SubdivideSettings::maxTriAspectRatio = 0

The subdivision stops as soon as all triangles (in the region) have aspect ratio below or equal to this value.

◆ minSharpDihedralAngle

float MR::SubdivideSettings::minSharpDihedralAngle = PI_F / 6

In case of activated smoothMode, the smoothness is locally deactivated at the edges having dihedral angle at least this value

◆ newVerts

VertBitSet* MR::SubdivideSettings::newVerts = nullptr

New vertices appeared during subdivision will be added here.

◆ notFlippable

UndirectedEdgeBitSet* MR::SubdivideSettings::notFlippable = nullptr

Edges specified by this bit-set will never be flipped, but they can be split so it is updated during the operation.

◆ onEdgeSplit

std::function<void(EdgeId e1, EdgeId e)> MR::SubdivideSettings::onEdgeSplit

this function is called each time edge (e) is split into (e1->e), but before the ring is made Delone

◆ onVertCreated

std::function<void(VertId)> MR::SubdivideSettings::onVertCreated

this function is called each time a new vertex has been created, but before the ring is made Delone

◆ progressCallback

ProgressCallback MR::SubdivideSettings::progressCallback = {}

callback to report algorithm progress and cancel it by user request

◆ projectOnOriginalMesh

bool MR::SubdivideSettings::projectOnOriginalMesh = false

if true, then every new vertex will be projected on the original mesh (before smoothing)

◆ region

FaceBitSet* MR::SubdivideSettings::region = nullptr

Region on mesh to be subdivided, it is updated during the operation.

◆ smoothMode

bool MR::SubdivideSettings::smoothMode = false

Puts new vertices so that they form a smooth surface together with existing vertices. This option works best for natural surfaces without sharp edges in between triangles

◆ subdivideBorder

bool MR::SubdivideSettings::subdivideBorder = true

If false do not touch border edges (cannot subdivide lone faces)
use MR::findRegionOuterFaces to find boundary faces


The documentation for this struct was generated from the following file: