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
13 EdgeWeights edgeWeights = EdgeWeights::Cotan, VertexMass vmass = VertexMass::Unit,
14 const VertBitSet * fixedSharpVertices = nullptr );
15MRMESH_API void positionVertsSmoothly( const MeshTopology& topology, VertCoords& points, const VertBitSet& verts,
16 EdgeWeights edgeWeights = EdgeWeights::Cotan, VertexMass vmass = VertexMass::Unit,
17 const VertBitSet * fixedSharpVertices = nullptr );
18
20{
23 const VertBitSet* region = nullptr;
24
26 const Vector<Vector3f, VertId>* vertShifts = nullptr;
27
29 float stabilizer = 0;
30
32 VertMetric vertStabilizers;
33
35 UndirectedEdgeMetric edgeWeights;
36};
37
41[[deprecated]] MRMESH_API void positionVertsSmoothlySharpBd( Mesh& mesh, const VertBitSet& verts );
42
43struct SpacingSettings
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
61 FacePredicate isInverted;
62};
63
66MRMESH_API void positionVertsWithSpacing( const MeshTopology& topology, VertCoords& points, const SpacingSettings & settings );
67
68struct InflateSettings
69{
73 float pressure = 0;
76 int iterations = 3;
79 bool preSmooth = true;
81 bool gradualPressureGrowth = 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 MRMeshFwd.h:80
Definition MRPositionVertsSmoothly.h:69
new unsafe ref bool preSmooth
new unsafe ref bool gradualPressureGrowth
new unsafe ref float pressure
new unsafe ref int iterations
Definition MRMesh/MRMeshTopology.h:19
Definition MRMesh/MRMesh.h:23
Definition MRPositionVertsSmoothly.h:20
new unsafe MR.? Const_VertCoords vertShifts
new unsafe MR.Std.Function_FloatFuncFromMRVertId vertStabilizers
new unsafe MR.Std.Function_FloatFuncFromMRUndirectedEdgeId edgeWeights
new unsafe MR.? Const_VertBitSet region
new unsafe ref float stabilizer
Definition MRPositionVertsSmoothly.h:44
new unsafe MR.? Const_VertBitSet region
new unsafe MR.Std.Function_BoolFuncFromMRFaceId isInverted
new unsafe ref float stabilizer
new unsafe ref int numIters
new unsafe ref float maxSumNegW
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:19
Definition MRCameraOrientationPlugin.h:8
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.
MRMESH_API void inflate(Mesh &mesh, const VertBitSet &verts, const InflateSettings &settings)
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...