Skip to main content

Crate prime_voronoi

Crate prime_voronoi 

Source
Expand description

prime-voronoi — Voronoi diagrams and Lloyd relaxation.

All public functions are pure (LOAD + COMPUTE only). No &mut, no side effects, no hidden state.

§Temporal Assembly Model

  • LOAD — read parameters (query point, seed points, sample points)
  • COMPUTE — pure geometry (distance comparisons, centroid sums)
  • APPEND — return new state as owned value

STORE and JUMP do not exist here.

§Included

  • voronoi_nearest_2d — find nearest seed index and F1 distance

  • voronoi_f1_f2_2d — F1 (nearest) and F2 (second-nearest) distances

  • lloyd_relax_step_2d — one Lloyd relaxation step (sample-based)

  • delaunay_2d — Delaunay triangulation via Bowyer-Watson

Functions§

delaunay_2d
Delaunay triangulation via Bowyer-Watson. Returns list of triangle index triples.
lloyd_relax_step_2d
One step of sample-based Lloyd relaxation in 2-D.
voronoi_f1_f2_2d
Compute F1 (nearest) and F2 (second-nearest) Euclidean distances from query.
voronoi_nearest_2d
Find the nearest seed and its distance from query.