MeshLib Documentation
Loading...
Searching...
No Matches
MRNormalDenoising.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRExpected.h"
6
7namespace MR
8{
9
16MRMESH_API void denoiseNormals( const Mesh & mesh, FaceNormals & normals, const Vector<float, UndirectedEdgeId> & v, float gamma );
17
24MRMESH_API void updateIndicator( const Mesh & mesh, Vector<float, UndirectedEdgeId> & v, const FaceNormals & normals, float beta, float gamma );
25
31MRMESH_API void updateIndicatorFast( const MeshTopology & topology, Vector<float, UndirectedEdgeId> & v, const FaceNormals & normals, float beta, float gamma );
32
34{
37
39 float beta = 0.01f;
40
42 float gamma = 5.f;
43
45 int normalIters = 10;
46
48 int pointIters = 20;
49
51 float guideWeight = 1;
52
54 bool limitNearInitial = false;
55
57 float maxInitialDist = 0;
58
60 UndirectedEdgeBitSet * outCreases = nullptr;
61
64};
65
69
70} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRMesh/MRMeshTopology.h:18
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
MRMESH_API void updateIndicatorFast(const MeshTopology &topology, Vector< float, UndirectedEdgeId > &v, const FaceNormals &normals, float beta, float gamma)
MRMESH_API void denoiseNormals(const Mesh &mesh, FaceNormals &normals, const Vector< float, UndirectedEdgeId > &v, float gamma)
MRMESH_API Expected< void > meshDenoiseViaNormals(Mesh &mesh, const DenoiseViaNormalsSettings &settings={})
tl::expected< T, E > Expected
Definition MRExpected.h:58
MRMESH_API void updateIndicator(const Mesh &mesh, Vector< float, UndirectedEdgeId > &v, const FaceNormals &normals, float beta, float gamma)
Definition MRNormalDenoising.h:34
int normalIters
the number of iterations to smooth normals and find creases; the more the better quality,...
Definition MRNormalDenoising.h:45
ProgressCallback cb
to get the progress and optionally cancel
Definition MRNormalDenoising.h:63
float guideWeight
how much resulting points must be attracted to initial points (e.g. to avoid general shrinkage),...
Definition MRNormalDenoising.h:51
int pointIters
the number of iterations to update vertex coordinates from found normals; the more the better quality...
Definition MRNormalDenoising.h:48
float beta
0.001 - sharp edges, 0.01 - moderate edges, 0.1 - smooth edges
Definition MRNormalDenoising.h:39
float maxInitialDist
maximum distance between a point and its position before relaxation, ignored if limitNearInitial = fa...
Definition MRNormalDenoising.h:57
float gamma
the amount of smoothing: 0 - no smoothing, 1 - average smoothing, ...
Definition MRNormalDenoising.h:42
bool fastIndicatorComputation
use approximated computation, which is much faster than precise solution
Definition MRNormalDenoising.h:36
UndirectedEdgeBitSet * outCreases
optionally returns creases found during smoothing
Definition MRNormalDenoising.h:60
bool limitNearInitial
if true then maximal displacement of each point during denoising will be limited
Definition MRNormalDenoising.h:54
Definition MRMesh/MRMesh.h:23