MeshLib C++ Docs
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
12MRMESH_API void positionVertsSmoothly( Mesh& mesh, const VertBitSet& verts,
14 const VertBitSet * fixedSharpVertices = nullptr );
15MRMESH_API void positionVertsSmoothly( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts,
17 const VertBitSet * fixedSharpVertices = nullptr );
18
23MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const VertBitSet& verts,
24 const Vector<Vector3f, VertId>* vertShifts = nullptr,
25 const VertScalars* vertStabilizers = nullptr );
26MRMESH_API void positionVertsSmoothlySharpBd( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts,
27 const Vector<Vector3f, VertId>* vertShifts = nullptr,
28 const VertScalars* vertStabilizers = nullptr );
29
31{
33 const VertBitSet* region = nullptr;
34
36 UndirectedEdgeMetric dist; // must be defined by the caller
37
39 int numIters = 10;
40
42 float stabilizer = 3;
43
45 float maxSumNegW = 0.1f;
46
49};
50
53MRMESH_API void positionVertsWithSpacing( const MeshTopology& topology, VertCoords& points, const SpacingSettings & settings );
54
56{
60 float pressure = 0;
63 int iterations = 3;
66 bool preSmooth = true;
69};
70
74MRMESH_API void inflate( Mesh& mesh, const VertBitSet& verts, const InflateSettings & settings );
75MRMESH_API void inflate( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, const InflateSettings & settings );
76
80MRMESH_API void inflate1( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, float pressure );
81
82} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
Definition MRMesh/MRMeshTopology.h:18
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
MRMESH_API void inflate1(const MeshTopology &topology, VertCoords &points, const VertBitSet &verts, float pressure)
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:479
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:18
@ Cotan
edge weight depends on local geometry and uses cotangent values
std::function< float(UndirectedEdgeId)> UndirectedEdgeMetric
Definition MRMesh/MRMeshFwd.h:495
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:8
@ Unit
all vertices have same mass=1
MRMESH_API void positionVertsSmoothly(Mesh &mesh, const VertBitSet &verts, EdgeWeights edgeWeights=EdgeWeights::Cotan, VertexMass vmass=VertexMass::Unit, const VertBitSet *fixedSharpVertices=nullptr)
Definition MRPositionVertsSmoothly.h:56
bool gradualPressureGrowth
whether to increase the pressure gradually during the iterations (recommended for best quality)
Definition MRPositionVertsSmoothly.h:68
bool preSmooth
Definition MRPositionVertsSmoothly.h:66
float pressure
Definition MRPositionVertsSmoothly.h:60
int iterations
Definition MRPositionVertsSmoothly.h:63
Definition MRMesh/MRMesh.h:22
Definition MRPositionVertsSmoothly.h:31
UndirectedEdgeMetric dist
target distance of each edge in the mesh (for at least one edge's vertex in the region)
Definition MRPositionVertsSmoothly.h:36
float maxSumNegW
maximum sum of minus negative weights, if it is exceeded then stabilizer is increased automatically
Definition MRPositionVertsSmoothly.h:45
float stabilizer
too small number here can lead to instability, too large - to slow convergence
Definition MRPositionVertsSmoothly.h:42
FacePredicate isInverted
if this predicated is given, then all inverted faces will be converted in degenerate faces at the end...
Definition MRPositionVertsSmoothly.h:48
const VertBitSet * region
vertices to be moved by the algorithm, nullptr means all valid vertices
Definition MRPositionVertsSmoothly.h:33
int numIters
the algorithm is iterative, the more iterations the closer result to exact solution
Definition MRPositionVertsSmoothly.h:39