← Gallery

Packing

Throw a dart, and if it landed somewhere empty, grow a circle there until it touches something. The composition is the order things were placed in.

Output

A set shares every setting — paper, border, the sketch’s own knobs — and differs only in the seed. Regenerate any one of them without touching the others.

PNG: 3508 × 4961 px at 300 dpi. PDF: vector, RGB, 297 × 420 mm page, no bleed. Printed area 297 × 420 mm.

0 mm

Millimetres of unprinted paper on every side. The piece is composed to fit what is left, not shrunk to fit it.

Packing

14000

Most of the later ones land somewhere already full and come to nothing. That is the cost of the whole render.

Growing fills the sheet tightly and gives every size. Picking first leaves gaps, because a shape that does not fit is simply thrown away.

4.0

A dart that cannot manage this much room is discarded.

110
3.0

Clear space kept between every pair. What makes the packing read as considered rather than crammed.

Size

A ceiling on how big a shape may grow at a given place. The quickest way to get structure out of a packing.

2.4

Drawing

0.35

What proportion of the shapes are solid rather than outlined.

1.50

Colour

How it works

The least clever algorithm here and one of the most useful. Throw a dart at the sheet. Measure how much room there is at that point — the distance to the nearest edge of anything already placed, less the padding. If it is more than the minimum, put a circle there and grow it until it touches something. Repeat some tens of thousands of times, most of which land somewhere already full and come to nothing.

There is no plan and no relaxation, and yet the size distribution looks deliberate. That is entirely an artefact of ordering: the first darts have the whole sheet to grow into and come out large, and every later one is squeezed by what is already down, so the small ones end up exactly in the seams. Choosing a size before looking is offered as the alternative and is worth trying, because it fails in an instructive way — a shape that does not fit is simply thrown away, so the sheet never fills.

Two things are worth knowing if you build one. Collision is circles-against-circles even when squares are drawn, which is the usual compromise: exact overlap tests for arbitrary shapes cost far more than they are worth, and a square inscribed in a clear circle is clear. And the spatial index has to have cells as wide as the furthest a placed shape could possibly reach — its radius, plus the candidate’s, plus the padding. Sizing them to the radius alone quietly misses a neighbour two cells away and lets the shapes overlap by up to the padding, which is the kind of bug that looks like a rendering artefact for a long time.

R regenerate · S PNG · P PDF