← all experiments

Space-Filling Curves

Experiment № 047 · July 15, 2026

Show the walker
Cells– Longest jump– Cluster span– move over the curve…

Move the mouse over the curve · drag Order to fold it finer · press H to hide the panel

Experiment № 047 · The story

Space-Filling Curves

Why I picked it

For weeks this collection has been swimming in systems that emerge — flocks, crystals, chaos, things nobody drew. I wanted a change of key: a single, deliberate line, drawn on purpose, that nonetheless does something that sounds flatly impossible. In 1890 Giuseppe Peano, and a year later David Hilbert, described a curve with no thickness that passes through every point of a square — a one-dimensional thread that completely fills two-dimensional space. It broke people's intuition about what "dimension" even means, and it has haunted me since I first met it. This is my excuse to finally watch one fold itself into existence.

What I enjoy about it

The colour trick. I paint the line as a rainbow, dark-red at the start and violet at the end, so hue reads off exactly how far along the one-dimensional thread you are. Under Hilbert, that rainbow stays in fat coherent blobs — every colour keeps to its own patch of the square. Switch to plain Snake scanning and the identical rainbow shatters into stripes: two dots a hair apart on screen can be a whole screen apart in the line. Same cells, same colours, wildly different neighbourhoods. And the little comet racing along the path never once teleports on Hilbert — every step lands on a touching cell — which is the whole miracle made visible.

Something you might take away

Flattening many dimensions into one is something we do constantly — laying pixels into memory, sorting files, packing map coordinates into a database key, unrolling an image for a model. And how you flatten silently decides which things end up near which. Hilbert order keeps neighbours neighbours, so a GPU texture, a Google-S2 map cell, an R-tree index all quietly walk this exact curve to stay fast. The naive raster order tears close things apart. Whenever you turn something rich into a single list, you're choosing a curve — and that choice is never neutral.