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{
10
11
15MRMESH_API void positionVertsSmoothly( Mesh& mesh, const VertBitSet& verts,
17 const VertBitSet * fixedSharpVertices = nullptr );
18MRMESH_API void positionVertsSmoothly( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts,
20 const VertBitSet * fixedSharpVertices = nullptr );
21
23{
26 const VertBitSet* region = nullptr;
27
30
32 float stabilizer = 0;
33
35 VertMetric vertStabilizers;
36
38 UndirectedEdgeMetric edgeWeights;
39};
40
42MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const PositionVertsSmoothlyParams& params );
43MRMESH_API void positionVertsSmoothlySharpBd( const MeshTopology& topology, VertCoords& points, const PositionVertsSmoothlyParams& params );
44[[deprecated]] MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const VertBitSet& verts );
45
47{
49 const VertBitSet* region = nullptr;
50
52 UndirectedEdgeMetric dist;
53
55 int numIters = 10;
56
58 float stabilizer = 3;
59
61 float maxSumNegW = 0.1f;
62
64 FacePredicate isInverted;
65};
66
68MRMESH_API void positionVertsWithSpacing( Mesh& mesh, const SpacingSettings & settings );
69MRMESH_API void positionVertsWithSpacing( const MeshTopology& topology, VertCoords& points, const SpacingSettings & settings );
70
72{
76 float pressure = 0;
79 int iterations = 3;
82 bool preSmooth = true;
85};
86
90MRMESH_API void inflate( Mesh& mesh, const VertBitSet& verts, const InflateSettings & settings );
91MRMESH_API void inflate( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, const InflateSettings & settings );
92
96MRMESH_API void inflate1( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, float pressure );
97
98}
Definition MRMeshTopology.h:22
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
bool gradualPressureGrowth
whether to increase the pressure gradually during the iterations (recommended for best quality)
Definition MRPositionVertsSmoothly.h:84
bool preSmooth
Definition MRPositionVertsSmoothly.h:82
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.
float pressure
Definition MRPositionVertsSmoothly.h:76
const VertBitSet * region
Definition MRPositionVertsSmoothly.h:26
MRMESH_API void inflate(Mesh &mesh, const VertBitSet &verts, const InflateSettings &settings)
UndirectedEdgeMetric dist
target distance of each edge in the mesh (for at least one edge's vertex in the region)
Definition MRPositionVertsSmoothly.h:52
float maxSumNegW
maximum sum of minus negative weights, if it is exceeded then stabilizer is increased automatically
Definition MRPositionVertsSmoothly.h:61
float stabilizer
the more the value, the bigger attraction of each vertex to its original position
Definition MRPositionVertsSmoothly.h:32
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:44
float stabilizer
too small number here can lead to instability, too large - to slow convergence
Definition MRPositionVertsSmoothly.h:58
FacePredicate isInverted
if this predicated is given, then all inverted faces will be converted in degenerate faces at the end...
Definition MRPositionVertsSmoothly.h:64
VertMetric vertStabilizers
if specified then it is used instead of stabilizer
Definition MRPositionVertsSmoothly.h:35
UndirectedEdgeMetric edgeWeights
if specified then it is used for edge weights instead of default 1
Definition MRPositionVertsSmoothly.h:38
int iterations
Definition MRPositionVertsSmoothly.h:79
const Vector< Vector3f, VertId > * vertShifts
optional additional shifts of each vertex relative to smooth position
Definition MRPositionVertsSmoothly.h:29
const VertBitSet * region
vertices to be moved by the algorithm, nullptr means all valid vertices
Definition MRPositionVertsSmoothly.h:49
int numIters
must be defined by the caller
Definition MRPositionVertsSmoothly.h:55
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:34
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...
@ Cotan
edge weight depends on local geometry and uses cotangent values
@ Unit
all vertices have same mass=1
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRPositionVertsSmoothly.h:72
Definition MRMesh.h:23
Definition MRPositionVertsSmoothly.h:23
Definition MRPositionVertsSmoothly.h:47