Alexis Mabanza @ alexvolkihar.ovh

Hilbert

One line through every cell

A space-filling curve is a single line that passes through every cell of a square, and in its classic form it never crosses itself. Each piece draws one of five classic curves: Hilbert, Moore, Peano, Sierpinski, or the Gosper curve, which fills a hexagonal island instead of a square. The curve is built by repeated subdivision. At a fixed order every cell is divided the same number of times. At an adaptive order a seeded noise field decides where to go deeper, so the line packs tight in some places and opens into wide loops elsewhere, and it is still one unbroken line. The stroke can be a plain ink line, a colour gradient along the curve’s length with a slowly swelling width, a hollow ribbon, a faint hairline with only some stretches inked, three orders of the same curve stacked on top of each other, or two or three copies of the curve interleaved and blended. On a wide or tall canvas, two or three square blocks are laid end to end, and the Hilbert and Peano curves run on from one block to the next. Press New seed for a fresh hash, then share the URL to show someone that exact piece.

All series
0xac296e32…0d90
Curve HilbertOrder LowStroke InterleavedPalette EmberCorners Sharp
0x45637991…8308
Curve HilbertOrder HighStroke RevealPalette LagoonCorners Sharp
0x805c1553…8305
Curve SierpinskiOrder LowStroke GradientPalette RisoCorners Sharp
0x82c78425…9cc4
Curve GosperOrder AdaptiveStroke RibbonPalette EmberCorners Sharp
0x43a0a2ef…1c6d
Curve PeanoOrder AdaptiveStroke InterleavedPalette RisoCorners Rounded
0x98c45a75…b816
Curve HilbertOrder LowStroke NestedPalette RisoCorners Rounded
0xdf0d2efa…cce8
Curve SierpinskiOrder HighStroke InkPalette LagoonCorners Sharp
0x740e7b32…7283
Curve HilbertOrder AdaptiveStroke RibbonPalette BlueprintCorners Rounded
0xd1afa16e…225f
Curve PeanoOrder HighStroke RibbonPalette BlueprintCorners Rounded
0xd5ded07c…ffe0
Curve GosperOrder LowStroke GradientPalette GraphiteCorners Rounded
0x7cee0614…43b1
Curve GosperOrder HighStroke InkPalette GraphiteCorners Sharp
0x61db3d0f…3c24
Curve PeanoOrder AdaptiveStroke InkPalette EmberCorners Sharp

Traits

The weights were set before any drawing code was written. They were then checked against a census of 2,000 seeds.

TraitValues (weight)
CurveHilbert 26 · Moore 16 · Peano 18 · Sierpinski 20 · Gosper 20
OrderLow 25 · High 35 · Adaptive 40
StrokeInk 16 · Gradient 20 · Ribbon 18 · Reveal 16 · Nested 14 · Interleaved 16
PaletteGraphite 20 · Riso 20 · Lagoon 16 · Blueprint 16 · Ember 16 · Ultraviolet 12
CornersSharp 50 · Rounded 50

Credits

  • Curves: Giuseppe Peano’s curve (1890), David Hilbert’s (1891), E. H. Moore’s closed variant of Hilbert’s curve (1900), and Wacław Sierpiński’s curve (1912), built here by bisecting right isosceles triangles, as in the Pólya and Sierpiński–Knopp construction. The Gosper curve, or flowsnake, was found by Bill Gosper and published by Martin Gardner in Scientific American (1976). It is drawn here from its two-rule L-system, with 60° turns.
  • Adaptive order: a cell is subdivided only as long as its depth stays below a target that a two-octave value-noise field sets at its centre. Consecutive cells always touch, so the curve never breaks. Stroke widths follow the local spacing of the line.
  • Randomness: sfc32 by Chris Doty-Humphrey, seeded from the hash with named sub-streams, following Camille Roux’s genart skill (MIT).
  • The code was written with an AI assistant. It draws everything itself: no AI-generated images.

Artworks © Alexvolkihar, licensed CC BY-NC-ND 4.0. Code under the repository licence (MIT).


>