A class for computing Voronoi diagrams.
More...
#include <voronoi.hpp>
|
static std::tuple< VecXT< Vec3d >, VecXT< VecXT< Vec3i > > > | Solve (VecXT< Vec3d > const &vt_seeds, STLModel const &stl_model, bool use_cork=true) |
| Compute a Voronoi diagram from a set of seed points and an STL model.
|
|
static std::tuple< VecXT< Vec3d >, VecXT< VecXT< Vec3i > >, VecXT< Vec3d > > | Solve (STLModel const &stl_model, int num_seeds, int max_iter=1000, double tol=1.0e-3, bool use_cork=true) |
| Compute a centroidal Voronoi diagram from an STL model.
|
|
static void | SaveAsVTK (std::string const &file, VecXT< Vec3d > const &vt_nodes, VecXT< VecXT< Vec3i > > const &vt_cells, VecXT< Vec3d > const &vt_seeds) |
| Save a Voronoi diagram in VTK format.
|
|
A class for computing Voronoi diagrams.
This class provides methods for computing Voronoi diagrams using a variety of algorithms and input data types.
◆ SaveAsVTK()
Save a Voronoi diagram in VTK format.
This static method saves a given Voronoi diagram (represented by its nodes, cells, and seed points) to a file in VTK format.
- Parameters
-
file | The name of the file to save. |
vt_nodes | The Voronoi nodes to save. |
vt_cells | The Voronoi cells to save. |
vt_seeds | The seed points used to compute the Voronoi diagram. |
◆ Solve() [1/2]
Compute a centroidal Voronoi diagram from an STL model.
This static method computes a centroidal Voronoi diagram from a given STL model using Lloyd's algorithm. It returns the resulting Voronoi nodes, cells, and seed points as tuples.
- Parameters
-
stl_model | The STL model that defines the boundary of the Voronoi diagram. |
num_seeds | The number of seed points to use. |
max_iter | The maximum number of iterations to perform (default: 1000). |
tol | The convergence tolerance (default: 1.0e-3). |
use_cork | A boolean value indicating whether to use the Cork library for computation (default: true). |
- Returns
- A tuple containing the Voronoi nodes, cells, and seed points as vectors.
◆ Solve() [2/2]
Compute a Voronoi diagram from a set of seed points and an STL model.
This static method computes a Voronoi diagram from a given set of seed points and an STL model. It returns the resulting Voronoi nodes and cells as tuples.
- Parameters
-
vt_seeds | The seed points for the Voronoi diagram. |
stl_model | The STL model that defines the boundary of the Voronoi diagram. |
use_cork | A boolean value indicating whether to use the Cork library for computation (default: true). |
- Returns
- A tuple containing the Voronoi nodes and cells as vectors.
The documentation for this class was generated from the following files:
- /Users/lzhshou/Documents/Research/myProjects/apaam/repo/netdem/src/utils/voronoi.hpp
- /Users/lzhshou/Documents/Research/myProjects/apaam/repo/netdem/src/utils/voronoi.cpp