prime-voronoi
Voronoi and Delaunay geometry — nearest-cell queries, F1/F2 distances, Lloyd relaxation, and Bowyer-Watson triangulation.
Part of the prime math ecosystem.
What's inside
voronoi_nearest_2d— find nearest seed and distance for a query pointvoronoi_f1_f2_2d— F1 (nearest) and F2 (second-nearest) distances for cellular noiselloyd_relax_step_2d— one step of Lloyd relaxation (centroidal Voronoi)delaunay_2d— Delaunay triangulation, returns triangle indices
Usage
use ;
let seeds = vec!;
// Nearest cell
let = voronoi_nearest_2d.unwrap;
// Delaunay triangulation
let triangles = delaunay_2d; // Vec<(usize, usize, usize)>
// Centroidal relaxation
let samples: = /* dense point set */;
let relaxed = lloyd_relax_step_2d;
License
MIT