Voronoi
Computes the Voronoi cells of a set of points inside an area.
Node id tessellation/voronoi
The Voronoi node computes the Voronoi cells of a collection of points inside an area. For each input point, its Voronoi cell is the region of the area closer to that point than to any other. Output cells are returned as Polygons, so they can be drawn, transformed, and styled like any shape.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| points | Array<Point> | — | |
| area | BoundingBox | — |
Outputs
Behaviour
- Centroids and positions. Each returned cell is a Polygon whose
position(transform) is set to the cell's area centroid, and whose vertices are relative to that centroid. Rotating or scaling a cell acts around its centre (e.g. scaling by 0.9 shrinks cells toward their centroids, leaving gaps between them). - Sites output.
sitesis parallel tocells:sites[i]is the site point that generatedcells[i]. Points outside the area or duplicates that produce empty or degenerate cells are skipped, so bothcellsandsitescan be shorter thanpoints. - Drawing. Array outputs spread into multi-inputs, so
cellscan be connected directly to the Output node.
Errors
areamust be connected (for example from Make BoundingBox or Page).- Non-finite coordinates in
areaor in any point ofpointsare node errors. - Providing more than 10 000 points is a node error.
Example
Voronoi cells generated from an orthogonal grid inside a bounding box.
Related nodes
- Voronoi tessellation: worked example with jittering, relaxation and gaps.
- Orthogonal Grid: generates a regular grid of points.
- Map: transforms or styles individual cells.
- Polygon: shape type for polygon cells.