Voronoi tessellation

Organic cell patterns from random points, evened out with Relax Points, and drawn with gaps using Scale and Map.

Voronoi tessellation splits an area into cells around a collection of points, where each cell covers the region closer to its point than to any other. In this example, you'll start with points on a grid, jitter them into a random cloud, use Relax Points (Lloyd relaxation) to even them into a honeycomb pattern, generate the cells with Voronoi, and scale each cell to leave gaps between them.

Organic honeycomb-like cells generated from relaxed points with gaps between themOpen in Playground

You'll use: Make BoundingBox, Orthogonal Grid, Map (New function…), Break Point, Random Number, Add, Make Point, Relax Points, Voronoi, Scale, Output.

Steps

1. Generate jittered points

Add a Make BoundingBox node (Objects → BoundingBox → Make BoundingBox) and set:

  • topLeft: x 100, y 100;
  • bottomRight: x 900, y 700.

Add an Orthogonal Grid node (Lattice → Orthogonal Grid) and connect the box's object to its area. Set its x and y spacing to 100.

Add a Map node (Array → Map) and connect the grid's points to its array.

Drag a wire from Map's function input to empty canvas and choose New function…. Inside the function body (Root › Map function):

  • Add a Break Point (Objects → Point → Break Point) and connect Graph Input's element to its object.
  • Add two Random Number nodes (Math → Random Number), each with min −35 and max 35.
  • Add two Add nodes (Math → Add): connect element.x and the first random number to one, and element.y and the second random number to the other.
  • Add a Make Point node (Objects → Point → Make Point) and connect the two sums to its x and y.
  • Select Graph Output, change the type of result from number to Point, and connect the new point's object to result.

Return to Root. The Map node now outputs an array of jittered points.

2. Smooth with Relax Points

Add a Relax Points node (Tessellation → Relax Points). Connect the box's object output to its area, Map's array output to its points, and set iterations to 3.

Relax Points applies Lloyd relaxation: in each iteration, every point moves to the area centroid of its Voronoi cell. Over 3 iterations, the chaotic jittered points even out into a harmonious, honeycomb-like distribution.

3. Generate Voronoi cells

Add a Voronoi node (Tessellation → Voronoi). Connect the box's object output to its area, and Relax Points' points output to its points.

Voronoi outputs cells, an array of Polygon shapes covering the area.

4. Scale cells to create gaps

Add a second Map node (Array → Map) and connect Voronoi's cells output to its array.

Drag a wire from Map's function input to empty canvas and choose New function…. Inside the new function body:

  • Add a Scale node (Transform → Scale). Connect Graph Input's element (type Polygon) to its object, and set factor to 0.88.
  • Select Graph Output, change the type of result from number to Polygon, and connect Scale's object output to result.

Return to Root. Connect Map's output array to the Output node's objects.

Because each Voronoi cell polygon's position is set to its area centroid, Scale shrinks each polygon around its own center, leaving uniform gaps between adjacent cells. The result is the mosaic at the top.

How it works

  • Jittering: Grid points are perfectly aligned. Adding a small random offset to each point's x and y breaks the regular grid into an organic cloud of points.
  • Relaxation: Raw random points produce cells of very uneven size. Relax Points moves points toward the centroids of their cells, rapidly converging toward an even centroidal Voronoi tessellation.
  • Centroid transforms: Each returned cell polygon's transform position is its area centroid. When Scale acts on a polygon, it scales around that centroid, shrinking each cell toward its middle and creating neat gaps between neighbours.

Nodes used

Variations

  • Adjust iterations: Change iterations on Relax Points to 0 for a raw jittered pattern, or to 10 for highly uniform cells.
  • Custom cell styling: Inside the cell-scaling function, add a Set Polygon node to style each cell's fill color using HSL or random colors.
  • Points outside the area: Try adding points outside the bounding box. They will shape border cells, and Relax Points will pull them into the area.
© 2026 Wirepaint