MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMesh/MRMeshRelax.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
4#include "MRRelaxParams.h"
5
6namespace MR
7{
8
12
14{
17
19 const VertScalars *weights = nullptr;
20};
21
24MRMESH_API bool relax( Mesh& mesh, const MeshRelaxParams& params = {}, const ProgressCallback& cb = {} );
25MRMESH_API bool relax( const MeshTopology& topology, VertCoords& points, const MeshRelaxParams& params = {}, const ProgressCallback& cb = {} );
26
29[[nodiscard]] MRMESH_API Vector3f vertexPosEqualNeiAreas( const Mesh& mesh, VertId v, bool noShrinkage );
30[[nodiscard]] MRMESH_API Vector3f vertexPosEqualNeiAreas( const MeshTopology& topology, const VertCoords& points, VertId v, bool noShrinkage );
31
38
41MRMESH_API bool equalizeTriAreas( Mesh& mesh, const MeshEqualizeTriAreasParams& params = {}, const ProgressCallback& cb = {} );
42MRMESH_API bool equalizeTriAreas( const MeshTopology& topology, VertCoords& points, const MeshEqualizeTriAreasParams& params = {}, const ProgressCallback& cb = {} );
43
47MRMESH_API bool relaxKeepVolume( Mesh& mesh, const MeshRelaxParams& params = {}, const ProgressCallback& cb = {} );
48MRMESH_API bool relaxKeepVolume( const MeshTopology& topology, VertCoords& points, const MeshRelaxParams& params = {}, const ProgressCallback& cb = {} );
49
57
61MRMESH_API bool relaxApprox( Mesh& mesh, const MeshApproxRelaxParams& params = {}, const ProgressCallback& cb = {} );
62MRMESH_API bool relaxApprox( const MeshTopology& topology, VertCoords& points, const MeshApproxRelaxParams& params = {}, const ProgressCallback& cb = {} );
63
65MRMESH_API void removeSpikes( Mesh & mesh, int maxIterations, float minSumAngle, const VertBitSet * region = nullptr );
66MRMESH_API void removeSpikes( const MeshTopology& topology, VertCoords& points, int maxIterations, float minSumAngle, const VertBitSet * region = nullptr );
67
72MRMESH_API void smoothRegionBoundary( Mesh & mesh, const FaceBitSet & regionFaces, int numIters = 4 );
73
75MRMESH_API void hardSmoothTetrahedrons( Mesh & mesh, const VertBitSet *region = nullptr );
76MRMESH_API void hardSmoothTetrahedrons( const MeshTopology& topology, VertCoords& points,const VertBitSet *region = nullptr );
77
79
80}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
Definition MRMesh/MRMeshTopology.h:18
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:641
MRMESH_API bool relaxApprox(Mesh &mesh, const MeshApproxRelaxParams &params={}, const ProgressCallback &cb={})
MRMESH_API void hardSmoothTetrahedrons(Mesh &mesh, const VertBitSet *region=nullptr)
move all region vertices with exactly three neighbor vertices in the center of the neighbors
MRMESH_API void smoothRegionBoundary(Mesh &mesh, const FaceBitSet &regionFaces, int numIters=4)
MRMESH_API bool equalizeTriAreas(Mesh &mesh, const MeshEqualizeTriAreasParams &params={}, const ProgressCallback &cb={})
MRMESH_API Vector3f vertexPosEqualNeiAreas(const Mesh &mesh, VertId v, bool noShrinkage)
MRMESH_API bool relaxKeepVolume(Mesh &mesh, const MeshRelaxParams &params={}, const ProgressCallback &cb={})
MRMESH_API bool relax(Mesh &mesh, const MeshRelaxParams &params={}, const ProgressCallback &cb={})
MRMESH_API void removeSpikes(Mesh &mesh, int maxIterations, float minSumAngle, const VertBitSet *region=nullptr)
applies at most given number of relaxation iterations the spikes detected by given threshold
RelaxApproxType
Definition MRMesh/MRRelaxParams.h:36
Definition MRMesh/MRMeshRelax.h:51
RelaxApproxType type
Definition MRMesh/MRMeshRelax.h:55
float surfaceDilateRadius
Definition MRMesh/MRMeshRelax.h:54
Definition MRMesh/MRMeshRelax.h:33
bool noShrinkage
Definition MRMesh/MRMeshRelax.h:36
Definition MRMesh/MRMeshRelax.h:14
const VertScalars * weights
weight for each vertex. By default, all the vertices have equal weights.
Definition MRMesh/MRMeshRelax.h:19
bool hardSmoothTetrahedrons
move all region vertices with exactly three neighbor vertices in the center of the neighbors
Definition MRMesh/MRMeshRelax.h:16
Definition MRMesh/MRMesh.h:22
Definition MRMesh/MRRelaxParams.h:12