Volume Cartographer 2.27.0
|
Mesh resampling using Approximated Centroidal Voronoi Diagrams. More...
#include <vc/meshing/ACVD.hpp>
Public Types | |
enum class | Mode { Isotropic , Anisotropic } |
Isotropy modes. More... | |
Public Member Functions | |
ACVD ()=default | |
void | setInputMesh (ITKMesh::Pointer input) |
Set the input mesh. | |
void | setMode (Mode m) |
Isotropy mode. | |
auto | mode () const -> Mode |
Isotropy mode. More... | |
void | setNumberOfClusters (std::size_t n) |
The number of voronoi clusters to use for remeshing. More... | |
auto | numberOfClusters () const -> std::size_t |
The number of voronoi clusters to use for remeshing. More... | |
void | setGradation (double g) |
The gradation (curvature) constraint. More... | |
auto | gradation () const -> double |
The gradation (curvature) constraint. More... | |
void | setSubsampleThreshold (std::size_t t) |
The subsampling threshold. More... | |
auto | subsampleThreshold () const -> std::size_t |
The subsampling threshold. More... | |
void | setQuadricsOptimizationLevel (std::size_t l) |
Quadrics optimization level. More... | |
auto | quadricsOptimizationLevel () const -> std::size_t |
Quadrics optimization level. More... | |
auto | compute () -> ITKMesh::Pointer |
Compute the resampled mesh. | |
auto | getOutputMesh () const -> ITKMesh::Pointer |
Get the output mesh. | |
Private Member Functions | |
void | compute_isotropic_ () |
void | compute_anisotropic_ () |
Private Attributes | |
ITKMesh::Pointer | inputMesh_ |
ITKMesh::Pointer | outputMesh_ |
Mode | mode_ {Mode::Isotropic} |
std::size_t | clusters_ {0} |
double | gradation_ {0} |
std::size_t | subsampleThreshold_ {10} |
std::size_t | quadricsOptLevel_ {1} |
Mesh resampling using Approximated Centroidal Voronoi Diagrams.
This is a wrapper around the ACVD implementation found in the ACVD.cxx example of ACVD. This implements the iterative process discussed in: Valette, Sebastien, and Jean-Marc Chassery. "Approximated centroidal voronoi diagrams for uniform polygonal mesh coarsening." Computer Graphics Forum. Vol. 23. No. 3. Blackwell Publishing, Inc, 2004.
Iteratively loops over the mesh until the approximated centroidal voronoi diagrams for the mesh are approximately equivalent in area. It then takes the point on the mesh that is nearest to the centroid of each diagram as a new vertex in the resampled output mesh.
This class provides both the isotropic and anisotropic versions of the algorithm.
|
strong |
|
default |
Default constructor
|
private |
Compute ACVD anisotropic
|
private |
Compute ACVD isotropic
auto volcart::meshing::ACVD::gradation | ( | ) | const -> double |
The gradation (curvature) constraint.
If set to 0 (default), uniform clustering will be performed. Higher values will produce a clustering which favors regions of high curvature.
auto volcart::meshing::ACVD::mode | ( | ) | const -> Mode |
Isotropy mode.
auto volcart::meshing::ACVD::numberOfClusters | ( | ) | const -> std::size_t |
The number of voronoi clusters to use for remeshing.
Because this algorithm uses the center of voronoi clusters as the vertices of the output mesh, this parameter sets the approximate number of vertices desired in the output mesh.
If set to 0 (default), the number of vertices in the input mesh will be used.
auto volcart::meshing::ACVD::quadricsOptimizationLevel | ( | ) | const -> std::size_t |
Quadrics optimization level.
For values greater than 0, refine the resampled vertices to minimize the quadric error between the input and output mesh. Only use if mode is Mode::Isotropic
. Default value: 1
void volcart::meshing::ACVD::setGradation | ( | double | g | ) |
The gradation (curvature) constraint.
If set to 0 (default), uniform clustering will be performed. Higher values will produce a clustering which favors regions of high curvature.
void volcart::meshing::ACVD::setNumberOfClusters | ( | std::size_t | n | ) |
The number of voronoi clusters to use for remeshing.
Because this algorithm uses the center of voronoi clusters as the vertices of the output mesh, this parameter sets the approximate number of vertices desired in the output mesh.
If set to 0 (default), the number of vertices in the input mesh will be used.
void volcart::meshing::ACVD::setQuadricsOptimizationLevel | ( | std::size_t | l | ) |
Quadrics optimization level.
For values greater than 0, refine the resampled vertices to minimize the quadric error between the input and output mesh. Only use if mode is Mode::Isotropic
. Default value: 1
void volcart::meshing::ACVD::setSubsampleThreshold | ( | std::size_t | t | ) |
The subsampling threshold.
Input mesh will be iteratively divided until the subsample ratio is above the subsampling threshold. In practice, higher values produce better results, but require more subdivision.
auto volcart::meshing::ACVD::subsampleThreshold | ( | ) | const -> std::size_t |
The subsampling threshold.
Input mesh will be iteratively divided until the subsample ratio is above the subsampling threshold. In practice, higher values produce better results, but require more subdivision.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |