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.