Skip to content

Function: voronoiCells() ​

ts
function voronoiCells(sites, box): Polygon[];

Voronoi cells of sites within box: each cell is the box clipped by the perpendicular bisectors towards nearby sites. Neighbors are visited ring by ring through a bucket grid, stopping once no further site can cut the cell.

Parameters ​

ParameterType
sitesVec[]
boxRect

Returns ​

Polygon[]

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).