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
37
40MRMESH_API void positionVertsSmoothlySharpBd( const MeshTopology& topology, VertCoords& points, const PositionVertsSmoothlyParams& params );
41[[deprecated]] MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const VertBitSet& verts );
42
44{
46 const VertBitSet* region = nullptr;
47
49 UndirectedEdgeMetric dist; // must be defined by the caller
50
52 int numIters = 10;
53
55 float stabilizer = 3;
56
58 float maxSumNegW = 0.1f;
59
62};
63
66MRMESH_API void positionVertsWithSpacing( const MeshTopology& topology, VertCoords& points, const SpacingSettings & settings );
67
69{
73 float pressure = 0;
76 int iterations = 3;
79 bool preSmooth = true;
82};
83
87MRMESH_API void inflate( Mesh& mesh, const VertBitSet& verts, const InflateSettings & settings );
88MRMESH_API void inflate( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, const InflateSettings & settings );
89
93MRMESH_API void inflate1( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, float pressure );
94
95} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
Definition MRMesh/MRMeshTopology.h:19
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
Definition MRCameraOrientationPlugin.h:8
std::function< float(VertId)> VertMetric
Definition MRMesh/MRMeshFwd.h:568
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:555
MRMESH_API void inflate(Mesh &mesh, const VertBitSet &verts, const InflateSettings &settings)
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:20
@ Cotan
edge weight depends on local geometry and uses cotangent values
std::function< float(UndirectedEdgeId)> UndirectedEdgeMetric
Definition MRMesh/MRMeshFwd.h:571
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:10
@ 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)
MRMESH_API void positionVertsSmoothlySharpBd(Mesh &mesh, const PositionVertsSmoothlyParams &params)
Puts given vertices in such positions to make smooth surface inside verts-region, but sharp on its bo...
Definition MRPositionVertsSmoothly.h:69
bool gradualPressureGrowth
whether to increase the pressure gradually during the iterations (recommended for best quality)
Definition MRPositionVertsSmoothly.h:81
bool preSmooth
Definition MRPositionVertsSmoothly.h:79
float pressure
Definition MRPositionVertsSmoothly.h:73
int iterations
Definition MRPositionVertsSmoothly.h:76
Definition MRMesh/MRMesh.h:23
Definition MRPositionVertsSmoothly.h:20
const VertBitSet * region
Definition MRPositionVertsSmoothly.h:23
float stabilizer
the more the value, the bigger attraction of each vertex to its original position
Definition MRPositionVertsSmoothly.h:29
VertMetric vertStabilizers
if specified then it is used instead of stabilizer
Definition MRPositionVertsSmoothly.h:32
UndirectedEdgeMetric edgeWeights
if specified then it is used for edge weights instead of default 1
Definition MRPositionVertsSmoothly.h:35
const Vector< Vector3f, VertId > * vertShifts
optional additional shifts of each vertex relative to smooth position
Definition MRPositionVertsSmoothly.h:26
Definition MRPositionVertsSmoothly.h:44
UndirectedEdgeMetric dist
target distance of each edge in the mesh (for at least one edge's vertex in the region)
Definition MRPositionVertsSmoothly.h:49
float maxSumNegW
maximum sum of minus negative weights, if it is exceeded then stabilizer is increased automatically
Definition MRPositionVertsSmoothly.h:58
float stabilizer
too small number here can lead to instability, too large - to slow convergence
Definition MRPositionVertsSmoothly.h:55
FacePredicate isInverted
if this predicated is given, then all inverted faces will be converted in degenerate faces at the end...
Definition MRPositionVertsSmoothly.h:61
const VertBitSet * region
vertices to be moved by the algorithm, nullptr means all valid vertices
Definition MRPositionVertsSmoothly.h:46
int numIters
the algorithm is iterative, the more iterations the closer result to exact solution
Definition MRPositionVertsSmoothly.h:52