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
40
43MRMESH_API void positionVertsSmoothlySharpBd( const MeshTopology& topology, VertCoords& points, const PositionVertsSmoothlyParams& params );
44[[deprecated]] MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const VertBitSet& verts );
45
67
71MRMESH_API void interpolateScalarsSmoothly( const Mesh& mesh, VertScalars& field, const InterpolateScalarsParams& params );
72MRMESH_API void interpolateScalarsSmoothly( const MeshTopology& topology, const VertCoords& points, VertScalars& field, const InterpolateScalarsParams& params );
74MRMESH_API void interpolateScalarsSmoothly( const MeshTopology& topology, VertScalars& field, const InterpolateScalarsParams& params );
75
77{
79 const VertBitSet* region = nullptr;
80
83
85 int numIters = 10;
86
88 float stabilizer = 3;
89
91 float maxSumNegW = 0.1f;
92
95};
96
99MRMESH_API void positionVertsWithSpacing( const MeshTopology& topology, VertCoords& points, const SpacingSettings & settings );
100
102{
106 float pressure = 0;
109 int iterations = 3;
112 bool preSmooth = true;
115};
116
120MRMESH_API void inflate( Mesh& mesh, const VertBitSet& verts, const InflateSettings & settings );
121MRMESH_API void inflate( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, const InflateSettings & settings );
122
126MRMESH_API void inflate1( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts, float pressure );
127
128}
#define MRMESH_API
Definition MRMeshFwd.h:85
Definition MRMeshTopology.h:30
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:114
std::function< float(VertId)> VertMetric
Definition MRMeshFwd.h:582
void positionVertsSmoothly(Mesh &mesh, const VertBitSet &verts, EdgeWeights edgeWeights=EdgeWeights::Cotan, VertexMass vmass=VertexMass::Unit, const VertBitSet *fixedSharpVertices=nullptr)
bool preSmooth
Definition MRPositionVertsSmoothly.h:112
const VertBitSet * region
Definition MRPositionVertsSmoothly.h:50
std::function< bool(FaceId)> FacePredicate
Definition MRMeshFwd.h:569
float pressure
Definition MRPositionVertsSmoothly.h:106
void inflate(Mesh &mesh, const VertBitSet &verts, const InflateSettings &settings)
const VertBitSet * region
Definition MRPositionVertsSmoothly.h:26
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...
UndirectedEdgeMetric dist
target distance of each edge in the mesh (for at least one edge's vertex in the region)
Definition MRPositionVertsSmoothly.h:82
VertMetric vertStabilizers
if specified then it is used instead of stabilizer
Definition MRPositionVertsSmoothly.h:62
float maxSumNegW
maximum sum of minus negative weights, if it is exceeded then stabilizer is increased automatically
Definition MRPositionVertsSmoothly.h:91
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:88
void inflate1(const MeshTopology &topology, VertCoords &points, const VertBitSet &verts, float pressure)
FacePredicate isInverted
if this predicated is given, then all inverted faces will be converted in degenerate faces at the end...
Definition MRPositionVertsSmoothly.h:94
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:109
VertexMass vmass
the stabilizer of each vertex is multiplied on the mass of that vertex
Definition MRPositionVertsSmoothly.h:56
const Vector< Vector3f, VertId > * vertShifts
optional additional shifts of each vertex relative to smooth position
Definition MRPositionVertsSmoothly.h:29
float stabilizer
the more the value, the bigger attraction of each vertex to its original value
Definition MRPositionVertsSmoothly.h:59
void interpolateScalarsSmoothly(const Mesh &mesh, VertScalars &field, const InterpolateScalarsParams &params)
std::function< float(UndirectedEdgeId)> UndirectedEdgeMetric
Definition MRMeshFwd.h:585
EdgeWeights edgeWeights
weights of edges in the equations, used unless edgeWeightsMetric is specified
Definition MRPositionVertsSmoothly.h:53
const VertBitSet * region
vertices to be moved by the algorithm, nullptr means all valid vertices
Definition MRPositionVertsSmoothly.h:79
int numIters
must be defined by the caller
Definition MRPositionVertsSmoothly.h:85
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:34
void positionVertsWithSpacing(Mesh &mesh, const SpacingSettings &settings)
Moves given vertices to make the distances between them as specified.
UndirectedEdgeMetric edgeWeightsMetric
if specified then it is used for edge weights instead of edgeWeights
Definition MRPositionVertsSmoothly.h:65
@ Unit
all edges have same weight=1
Definition MREnums.h:46
@ Cotan
edge weight depends on local geometry and uses cotangent values
Definition MREnums.h:49
@ Unit
all vertices have same mass=1
Definition MREnums.h:36
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRPositionVertsSmoothly.h:102
Definition MRPositionVertsSmoothly.h:47
Definition MRMesh.h:24
Definition MRPositionVertsSmoothly.h:23
Definition MRPositionVertsSmoothly.h:77