Visualizations
156 / 500

156 · Nature

Seashell Patterns

Meinhardt's lip chemistry paints tents, bands and dots onto a growing 3D shell.

A snail only adds shell at its lip, and the mantle edge deposits pigment as it goes, so a shell's pattern is the space-time record of a one-dimensional chemical system. Each species runs one of Hans Meinhardt's reaction-diffusion models along a ring of up to 380 lip cells: activator-substrate waves that eat their own fuel, collide and annihilate into the tents of a textile cone or the branching lines of an olive, or activator-inhibitor peaks that hold still as spiral bands, blink into rows of dots, or pulse as zebra stripes. Every growth step appends a row to that record, and the rows are wrapped onto a shell built from David Raup's coiling model: an aperture profile swept around the axis while it expands by a factor W each whorl, which makes the shell a self-similar logarithmic spiral. A small software rasterizer with a z-buffer, per-pixel normals and a glossy specular highlight draws it, and the camera rides the lip, so new shell extrudes toward you, the live activator glows along the mantle edge, and old whorls spin away into the spire.

Try it. Drag to turn the shell. Click the glowing lip, or the top of the growth record, to trigger a pigment wave there. Step through the five species with the < and > buttons, keys 1 to 5, N or Space, and drag the Diffusion and Decay sliders (or use the arrow keys) to evolve new patterns. T fires a wave at a random spot and R regrows the shell.

  • Meinhardt reaction-diffusion
  • Raup coiling model
  • Software rasterizer
  • Space-time texture

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a seashell pattern generator with JavaScript and the HTML canvas element, based on Hans Meinhardt's idea that a shell's pattern is the history of a one-dimensional chemical reaction running along its growing edge. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens, and resizes with it.
- Simulate a row of about 200 cells (the shell's lip) with two chemicals in Float32Arrays: an activator a and a substrate b, with wrap-around neighbors.
- Each step, use the activator-substrate model: production = s * b * (a*a / (1 + 0.5*a*a) + 0.0002), then a += production - 0.05*a + Da * (laplacian of a) and b += 0.006 - production, with Da around 0.015. Give each cell a slightly random rate s (0.7 to 1.3), and now and then kick a random cell's activator up by 0.5 to start new waves.
- After every two steps, draw the row as one line of pixels, colored from cream (b full) to dark brown (b used up), and move down one line. The picture that builds up is the shell pattern: waves that collide and annihilate draw tents and triangles.

Once that works, make it beautiful:
- Wrap the growing image onto a simple 3D shell: sweep an ellipse around an axis while scaling it by a constant factor each turn (a logarithmic spiral). Draw it as quads sorted back to front, each with its texture color and simple lighting.
- Add a second model, activator-inhibitor (a += 0.05*(s*a*a/b - a) and b += rb*(s*a*a - b) + Db*(laplacian of b)), which gives stripes or dots, and buttons to switch.
- Add sliders for diffusion and decay, and let a click on the edge inject activator.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as a third component that makes waves branch, a z-buffered per-pixel renderer for a glossy shell, or presets that match real species.
PreviousMark I PerceptronA 1950s-style perceptron panel: photocells, a rat's nest of wires, dials that learn. NextGaussian Process InkExact GP posteriors painted as watercolor bands with inked function samples.

Related visualizations

  • Turing PatternsEmergence Two chemicals react and diffuse into coral, spots and stripes.
  • Haeckel PlatesGenerative art An endless folio of generative radiolarians, diatoms and medusae in lithograph ink.
  • Cuttlefish SkinNature Thousands of chromatophores play passing clouds and camouflage on a cuttlefish.
  • Butterfly ScalesNature Zoom from a whole butterfly into its eyespots, its scales and their ridges.
  • Self-AssemblyEmergence Lipid membrane patches assemble themselves from a random soup into closed vesicles.
  • FireworksGenerative art Shells arc, burst and crackle with glowing, fading sparks.
  • Differential GrowthGenerative art One closed line grows, buckles and folds into brain coral without ever crossing.
  • Chrome Blob3D A wobbling liquid metal droplet with real reflections, rasterized by hand.
  • Faraday WavesFluids A shaken dish of liquid locks into stripes, squares, hexagons and a 12-fold quasicrystal.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs