NetDEM v1.0
Loading...
Searching...
No Matches
voronoi.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "igl_wrapper.hpp"
4#include "sdf_calculator.hpp"
5#include "stl_model.hpp"
6
7namespace netdem {
8
16class Voronoi {
17public:
33 static std::tuple<VecXT<Vec3d>, VecXT<VecXT<Vec3i>>>
34 Solve(VecXT<Vec3d> const &vt_seeds, STLModel const &stl_model,
35 bool use_cork = true);
36
55 static std::tuple<VecXT<Vec3d>, VecXT<VecXT<Vec3i>>, VecXT<Vec3d>>
56 Solve(STLModel const &stl_model, int num_seeds, int max_iter = 1000,
57 double tol = 1.0e-3, bool use_cork = true);
58
70 static void SaveAsVTK(std::string const &file, VecXT<Vec3d> const &vt_nodes,
71 VecXT<VecXT<Vec3i>> const &vt_cells,
72 VecXT<Vec3d> const &vt_seeds);
73
74private:
92 static std::tuple<VecXT<Vec3d>, VecXT<VecXT<Vec3i>>>
93 Solve(VecXT<Vec3d> const &vt_seeds, STLModel const &stl_model,
94 SDFCalculator const &sdf_calculator, bool use_cork = true);
95};
96
97} // namespace netdem
Class for computing signed distance fields from triangle meshes.
Definition sdf_calculator.hpp:20
Class for working with STL models.
Definition stl_model.hpp:17
A class for computing Voronoi diagrams.
Definition voronoi.hpp:16
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.
Definition voronoi.cpp:13
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.
Definition voronoi.cpp:128
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31