Volume Cartographer 2.27.0
LaplacianSmooth.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6
8
9namespace volcart::meshing
10{
11
18{
19public:
21 void setInputMesh(const ITKMesh::Pointer& m);
22
24 void setIterations(std::size_t i);
26 void setRelaxationFactor(double f);
30 void setFeatureAngle(double a);
32 void setEdgeAngle(double a);
35
37 [[nodiscard]] auto iterations() const -> std::size_t;
39 [[nodiscard]] auto relaxationFactor() const -> double;
41 [[nodiscard]] auto featureEdgeSmoothing() const -> bool;
43 [[nodiscard]] auto featureAngle() const -> double;
45 [[nodiscard]] auto edgeAngle() const -> double;
47 [[nodiscard]] auto boundarySmoothing() const -> bool;
48
50 auto compute() -> ITKMesh::Pointer;
51
53 auto getOutputMesh() -> ITKMesh::Pointer;
54
55private:
57 ITKMesh::Pointer input_{nullptr};
59 ITKMesh::Pointer output_{nullptr};
61 std::size_t iters_{20};
63 double relax_{0.01};
65 bool edgeSmooth_{false};
67 double featureAngle_{45};
69 double edgeAngle_{15};
71 bool boundarySmooth_{true};
72};
73} // namespace volcart::meshing
Apply Laplacian smoothing to a mesh.
void setBoundarySmoothing(bool b)
Smoothing vertices on the mesh boundary.
void setFeatureAngle(double a)
Feature angle for sharp edge identification.
auto relaxationFactor() const -> double
Relaxation factor for Laplacian smoothing.
auto edgeAngle() const -> double
Edge angle for sharp edge identification.
auto compute() -> ITKMesh::Pointer
Compute the smoothed mesh.
auto featureEdgeSmoothing() const -> bool
Smoothing along sharp interior edges.
void setIterations(std::size_t i)
The number of smoothing interations.
void setFeatureEdgeSmoothing(bool b)
Smoothing along sharp interior edges.
void setEdgeAngle(double a)
Edge angle for sharp edge identification.
auto iterations() const -> std::size_t
The number of smoothing interations.
auto featureAngle() const -> double
Feature angle for sharp edge identification.
auto boundarySmoothing() const -> bool
Smoothing vertices on the mesh boundary.
void setInputMesh(const ITKMesh::Pointer &m)
Set the input mesh.
void setRelaxationFactor(double f)
Relaxation factor for Laplacian smoothing.
auto getOutputMesh() -> ITKMesh::Pointer
Return the smoothed mesh.
Mesh generation and modification library.
itk::Mesh< ITKPixel, 3, ITKMeshTraits > ITKMesh
Definition: ITKMesh.hpp:22