Volume Cartographer 2.27.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
volcart::meshing::ACVD Class Reference

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}
 

Detailed Description

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.

Definition at line 31 of file ACVD.hpp.

Member Enumeration Documentation

◆ Mode

enum class volcart::meshing::ACVD::Mode
strong

Isotropy modes.

Definition at line 35 of file ACVD.hpp.

Constructor & Destructor Documentation

◆ ACVD()

volcart::meshing::ACVD::ACVD ( )
default

Default constructor

Member Function Documentation

◆ compute_anisotropic_()

void volcart::meshing::ACVD::compute_anisotropic_ ( )
private

Compute ACVD anisotropic

◆ compute_isotropic_()

void volcart::meshing::ACVD::compute_isotropic_ ( )
private

Compute ACVD isotropic

◆ gradation()

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.

◆ mode()

auto volcart::meshing::ACVD::mode ( ) const -> Mode

Isotropy mode.

◆ numberOfClusters()

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.

◆ quadricsOptimizationLevel()

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

◆ setGradation()

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.

◆ setNumberOfClusters()

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.

◆ setQuadricsOptimizationLevel()

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

◆ setSubsampleThreshold()

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.

◆ subsampleThreshold()

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.

Member Data Documentation

◆ clusters_

std::size_t volcart::meshing::ACVD::clusters_ {0}
private

Number of clusters

Definition at line 118 of file ACVD.hpp.

◆ gradation_

double volcart::meshing::ACVD::gradation_ {0}
private

Gradation

Definition at line 120 of file ACVD.hpp.

◆ inputMesh_

ITKMesh::Pointer volcart::meshing::ACVD::inputMesh_
private

Input mesh

Definition at line 107 of file ACVD.hpp.

◆ mode_

Mode volcart::meshing::ACVD::mode_ {Mode::Isotropic}
private

Isotropy mode

Definition at line 116 of file ACVD.hpp.

◆ outputMesh_

ITKMesh::Pointer volcart::meshing::ACVD::outputMesh_
private

Output mesh

Definition at line 109 of file ACVD.hpp.

◆ quadricsOptLevel_

std::size_t volcart::meshing::ACVD::quadricsOptLevel_ {1}
private

Quadrics optimization level

Definition at line 124 of file ACVD.hpp.

◆ subsampleThreshold_

std::size_t volcart::meshing::ACVD::subsampleThreshold_ {10}
private

Subsample Threshold

Definition at line 122 of file ACVD.hpp.


The documentation for this class was generated from the following file: