Portfolio / Computational Design

Voronoi in 3D

The Voronoi force-directed hypergraph, lifted into space. Every node still carries a like charge and every hyperedge is still a spring — but now they relax in three dimensions, settling into a balanced cloud you can turn in your hands. Drag to orbit, scroll to zoom; a slow turntable keeps it rotating so the depth reads even when you're not touching it.

The accompanying partition comes along too, and this is where 3D earns its keep. The dual of the Voronoi diagram — the Delaunay tetrahedralization — becomes a lattice of struts threading the whole cloud, and it's the default view because in space the tetrahedral mesh reads far more clearly than the cells do. Flip on Voronoi and you get the real thing: each node's cell as a convex polyhedron, the region of space nearer to it than to any other node, drawn as a faint foam of faces. Both are recomputed live as the layout breathes, then cached so orbiting stays smooth.

The edges are directed hyperedges as before — a hub joining a set of tails to a set of heads, arrowheads marking the flow — now depth-shaded so near connectors read as nearer. Tune the spring, repulsion, gravity, connectedness, and per-element variation; shuffle for a fresh random graph.

Plain HTML5 canvas + JS, no libraries — the same hand-rolled orthographic-orbit projection as the other 3D demos, with the geometry done from scratch too: a Bowyer–Watson tetrahedralization (Shewchuk's orientation and in-sphere predicates) for the Delaunay lattice, and half-space clipping of a bounding cube for the Voronoi polyhedra. Light or dark to match the page. Source on GitHub.