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
A mosaic, pixelation or crystallise look on an image: wire Cells into Quantize's Cells input.
Cells that stay coarse in flat areas and get fine where the detail is: Quadtree.
A template copied onto every cell, a dot or tile or shape: wire Cell Elements into an instancer.
Cell outlines to stroke, fill or fracture along: wire Boundary Out into a path or shape consumer.
A Mondrian or treemap layout driven by a picture rather than laid out by hand: Binary or Treemap.
| Parameter | Type | Default |
|---|---|---|
domain_in | OneOf([FieldOf(Raster)]) | — |
mode | String | "Grid" |
cell_size | Number | 16 |
separate_xy | Boolean | false |
cell_size_x | Number | 16 |
cell_size_y | Number | 16 |
seed | Number | 1 |
jitter | Number | 1 |
min_cell_size | Number | 2 |
detail_threshold | Number | 0.020 |
split_ratio | Number | 0.600 |
opacity | Number | 1 |
Gotchas
Cell Elements and Boundary Out appear in Grid mode only. The other four rules carve cells that are not rectangles of the lattice, and emitting the lattice outline for them would draw a set of cells that is not the set the image is actually divided into. The pins hide rather than hand you a wrong answer, so the field output is what Quadtree, Voronoi, Binary and Treemap offer today.
Quadtree and Treemap read the wired image's brightness, both its detail and its mass. A flat or empty image gives them nothing to adapt to, and both fall back to something close to a uniform grid. Feed them the picture you want the cells to follow.
Quantize's Cells dropdown calls the Voronoi rule Fill Cells. Picking it there creates a Cells node set to Voronoi: the same carving under an older name.
In Voronoi, Jitter 0 collapses the cells back onto the square lattice exactly, so Jitter is a continuous dial from Grid to fully organic rather than a separate look. Seed reshuffles the layout without changing how big the cells are.
If the wired image is rotated in the scene, prefer Cell Elements over the field output for anything you draw. Each row carries its own orientation, while the field reports cell extents along the image's own axes.
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
Add a Cells node and wire an image into Domain. It starts in Grid at 16 px.
Raise Cell Size for chunkier cells. Turn Separate XY on for non-square ones.
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.
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.
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.
Wire the Cells output into Quantize's Cells input to paint the same carving as a mosaic.