Cells

Carve a domain into cells: uniform Grid, adaptive Quadtree, organic Voronoi, recursive Binary, or area-weighted Treemap. Emits each cell's origin and size as a record field.

What it does

Cells carves an image into cells and hands them out three ways at once: as a field that answers which cell is this point in, as one row per cell to put a template on, and as the cell outlines to draw. Wire an image into Domain, pick a rule, and the frame divides into cells you can address rather than a picture of cells you can only look at.

The rule is the Mode. Grid is the uniform lattice. Quadtree makes cells small wherever the image carries detail and leaves them coarse where it is flat. Voronoi gives irregular organic cells. Binary cuts the longer side of each cell in two, over and over, for the Mondrian look. Treemap makes the same cuts but puts each one where the image's own brightness balances, so cells cluster and shrink where there is content and grow where there is none.

All three outputs come from the same carving, so the cells a consumer samples and the cells it draws always agree about where an edge is. That is the point of having one node do it: several effects can share one Cells node and none of them can drift from the others.

When to use it

ParameterTypeDefault
domain_inOneOf([FieldOf(Raster)])
modeString"Grid"
cell_sizeNumber16
separate_xyBooleanfalse
cell_size_xNumber16
cell_size_yNumber16
seedNumber1
jitterNumber1
min_cell_sizeNumber2
detail_thresholdNumber0.020
split_ratioNumber0.600
opacityNumber1

Gotchas

The size controls are in pixels of the wired image, not world units. A Quadtree cell is a block of that image, so its size has no meaning in any other unit. The positions that come out are in world units, so what you wire Cells into does not need the image as well.

Worked example

  1. Add a Cells node and wire an image into Domain. It starts in Grid at 16 px.

  2. Raise Cell Size for chunkier cells. Turn Separate XY on for non-square ones.

  3. Wire a small shape into an instancer's template and Cell Elements into its target: one copy lands on every cell, and it re-fills as you drag Cell Size.

  4. Switch Mode to Quadtree and lower Detail Threshold. The flat areas stay coarse while the busy ones break into smaller cells; Min Cell Size sets how fine that can go.

  5. Try Voronoi and pull Jitter from 0 to 1 to go from the lattice to organic cells, then Binary with Split Ratio near 1 for the Mondrian look.

  6. Wire the Cells output into Quantize's Cells input to paint the same carving as a mosaic.

See also

Quantize · Pattern · Fracture · Rasters (images)