NetDEM v1.0
Loading...
Searching...
No Matches
netdem::SphericalVoronoi Class Reference

Class for computing Voronoi diagrams on a sphere. More...

#include <spherical_voronoi.hpp>

Static Public Member Functions

static std::tuple< VecXT< Vec3d >, VecXT< VecXT< int > > > Solve (VecXT< Vec3d > const &vt_seeds)
 Compute the Voronoi diagram for a set of seeds with uniform weights.
 
static std::tuple< VecXT< Vec3d >, VecXT< VecXT< int > > > Solve (VecXT< Vec3d > const &vt_seeds, VecXT< double > const &vt_weights)
 Compute the Voronoi diagram for a set of seeds with arbitrary weights.
 
static VecXT< Vec3dSolve (int num_seeds, int max_iter=10000, double tol=1.0e-4)
 Compute a centroidal Voronoi tessellation.
 
static VecXT< Vec3dSolve (int num_seeds, VecXT< double > const &weights_sh_coff, int max_iter, double tol)
 Compute a spherical harmonic weighted centroidal Voronoi tessellation.
 
static void SaveAsVTK (std::string const &file, VecXT< Vec3d > const &vt_nodes, VecXT< VecXT< int > > const &vt_cells, VecXT< Vec3d > const &vt_seeds)
 Save the Voronoi diagram as a VTK file.
 

Detailed Description

Class for computing Voronoi diagrams on a sphere.

This class provides methods for computing Voronoi diagrams on the surface of a sphere. It can solve basic, weighted, and centroidal Voronoi problems, and provides methods for saving the resulting Voronoi mesh as a VTK file for visualization.

Member Function Documentation

◆ SaveAsVTK()

void SphericalVoronoi::SaveAsVTK ( std::string const & file,
VecXT< Vec3d > const & vt_nodes,
VecXT< VecXT< int > > const & vt_cells,
VecXT< Vec3d > const & vt_seeds )
static

Save the Voronoi diagram as a VTK file.

This method saves the Voronoi diagram as a VTK file for visualization in ParaView or another software package.

Parameters
fileThe name of the output file.
vt_nodesThe Voronoi vertices.
vt_cellsThe Voronoi cells.
vt_seedsThe input seed points.

◆ Solve() [1/4]

VecXT< Vec3d > SphericalVoronoi::Solve ( int num_seeds,
int max_iter = 10000,
double tol = 1.0e-4 )
static

Compute a centroidal Voronoi tessellation.

This method computes a centroidal Voronoi tessellation (CVT) with the specified number of seed points. It returns the resulting seed points.

Parameters
num_seedsThe number of seed points to generate.
max_iterThe maximum number of iterations to perform.
tolThe convergence tolerance for the CVT algorithm.
Returns
The resulting seed points.

◆ Solve() [2/4]

VecXT< Vec3d > SphericalVoronoi::Solve ( int num_seeds,
VecXT< double > const & weights_sh_coff,
int max_iter,
double tol )
static

Compute a spherical harmonic weighted centroidal Voronoi tessellation.

assuming the weights are interplated from a spheircal harmonics function

This method computes a spherical harmonic weighted centroidal Voronoi tessellation (SHCVT) with the specified number of seed points and spherical harmonic coefficients. It returns the resulting seed points.

Parameters
num_seedsThe number of seed points to generate.
weights_sh_coffThe spherical harmonic coefficients for the weights.
max_iterThe maximum number of iterations to perform.
tolThe convergence tolerance for the SHCVT algorithm.
Returns
The resulting seed points.

◆ Solve() [3/4]

tuple< VecXT< Vec3d >, VecXT< VecXT< int > > > SphericalVoronoi::Solve ( VecXT< Vec3d > const & vt_seeds)
static

Compute the Voronoi diagram for a set of seeds with uniform weights.

This method computes the Voronoi diagram for a set of seed points with uniform weights. It returns the Voronoi vertices and cells as two arrays.

Parameters
vt_seedsThe input seed points.
Returns
A tuple containing the Voronoi vertices and cells.

◆ Solve() [4/4]

tuple< VecXT< Vec3d >, VecXT< VecXT< int > > > SphericalVoronoi::Solve ( VecXT< Vec3d > const & vt_seeds,
VecXT< double > const & vt_weights )
static

Compute the Voronoi diagram for a set of seeds with arbitrary weights.

This method computes the Voronoi diagram for a set of seed points with arbitrary weights. It returns the Voronoi vertices and cells as two arrays.

Parameters
vt_seedsThe input seed points.
vt_weightsThe input weights for each seed point.
Returns
A tuple containing the Voronoi vertices and cells.

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