MeshLib
 
Loading...
Searching...
No Matches
MRPositionVertsSmoothly.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MREnums.h"
5
6namespace MR
7{
8
13 EdgeWeights edgeWeightsType = EdgeWeights::Cotan,
14 const VertBitSet * fixedSharpVertices = nullptr );
15
21 const Vector<Vector3f, VertId>* vertShifts = nullptr,
22 const VertScalars* vertStabilizers = nullptr );
23
25{
27 const VertBitSet* region = nullptr;
28
30 UndirectedEdgeMetric dist; // must be defined by the caller
31
33 int numIters = 10;
34
36 float stabilizer = 3;
37
39 float maxSumNegW = 0.1f;
40
43};
44
47
49{
53 float pressure = 0;
56 int iterations = 3;
59 bool preSmooth = true;
62};
63
67MRMESH_API void inflate( Mesh& mesh, const VertBitSet& verts, const InflateSettings & settings );
68
69} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
Definition MRCameraOrientationPlugin.h:7
MRMESH_API void positionVertsSmoothly(Mesh &mesh, const VertBitSet &verts, EdgeWeights edgeWeightsType=EdgeWeights::Cotan, const VertBitSet *fixedSharpVertices=nullptr)
MRMESH_API void positionVertsWithSpacing(Mesh &mesh, const SpacingSettings &settings)
Moves given vertices to make the distances between them as specified.
std::function< bool(FaceId)> FacePredicate
Definition MRMesh/MRMeshFwd.h:413
MRMESH_API void inflate(Mesh &mesh, const VertBitSet &verts, const InflateSettings &settings)
MRMESH_API void positionVertsSmoothlySharpBd(Mesh &mesh, const VertBitSet &verts, const Vector< Vector3f, VertId > *vertShifts=nullptr, const VertScalars *vertStabilizers=nullptr)
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:8
@ Cotan
edge weight depends on local geometry and uses cotangent values
std::function< float(UndirectedEdgeId)> UndirectedEdgeMetric
Definition MRMesh/MRMeshFwd.h:429
Definition MRPositionVertsSmoothly.h:49
bool gradualPressureGrowth
whether to increase the pressure gradually during the iterations (recommended for best quality)
Definition MRPositionVertsSmoothly.h:61
bool preSmooth
Definition MRPositionVertsSmoothly.h:59
float pressure
Definition MRPositionVertsSmoothly.h:53
int iterations
Definition MRPositionVertsSmoothly.h:56
Definition MRMesh/MRMesh.h:23
Definition MRPositionVertsSmoothly.h:25
UndirectedEdgeMetric dist
target distance of each edge in the mesh (for at least one edge's vertex in the region)
Definition MRPositionVertsSmoothly.h:30
float maxSumNegW
maximum sum of minus negative weights, if it is exceeded then stabilizer is increased automatically
Definition MRPositionVertsSmoothly.h:39
float stabilizer
too small number here can lead to instability, too large - to slow convergence
Definition MRPositionVertsSmoothly.h:36
FacePredicate isInverted
if this predicated is given, then all inverted faces will be converted in degenerate faces at the end...
Definition MRPositionVertsSmoothly.h:42
const VertBitSet * region
vertices to be moved by the algorithm, nullptr means all valid vertices
Definition MRPositionVertsSmoothly.h:27
int numIters
the algorithm is iterative, the more iterations the closer result to exact solution
Definition MRPositionVertsSmoothly.h:33