Wave Collapse: tiles that fit their neighbours
Wave function collapse fills a grid with tiles so that their edges line up. Maxim Gumin published it in 2016 for making game levels and textures, and borrowed the name from quantum physics: every cell starts out as all of the tiles at once and is narrowed down to one.
Forgeplot's Wave Collapse generator uses nine tiles: a blank, two straight pipes, four corners and two tiles with a pair of corners. A pipe either reaches the middle of a cell's edge or it doesn't, and two tiles may sit side by side only when their shared edge agrees. The generator settles the cell with the fewest options left, picks one of them at random by weight, then crosses the tiles that no longer fit off its neighbours' lists, and repeats until the grid is full. The result is a network of closed shapes and paths that run off the edge of the page. Pipes that meet are joined into single strokes, so the default page plots as 40 strokes. Grid sets how many tiles fit across the short side, from 8 to 40. Motif draws the corners as arcs or straight lines. Density shifts the odds from blank tiles toward pipes, and Colour By tiles puts arcs and straight lines on different pens.
The recipe
Enter these settings and the same drawing comes back, line for line.
- Generator
- Wave Collapse
- Seed
- 1
- Page
- AxiDraw V3 · A4, portrait
- Pens
- Black Fineliner
- Grid
- 20
- Motif
- Arcs
- Density
- 0.7
- Colour By
- Off
For the second preview, change Grid to 16 and Motif to Lines.