Hard Fork
Material Studies / No. 017 · three.js

HardFork.

Four satoshis, set in a gummy bitcoin.
Cut close to one and it rolls away.
Not your knife, not your coins.

THREE.JS · STARTING

HandGrab any piece — tip, corner, field or rim — and pull.

Mass
≈—g
Pieces
1
Loose
0/ 4
Sats
Unspent

Illustrative scale: 1 sim unit ≈ 3.5 cm, gummy at 1.3 g/cm³. A satoshi counts as loose once it has dropped onto the table.

After the Spider Melon idea by @vib3coded · built with Claude Fable 5.1 on max thinking, about half a million tokens of back-and-forth · made with ❤ by idlebg.com

Inside the experiment

A body made of tetrahedra

The slice is a volumetric mesh of — particles and — tetrahedra, solved with XPBD on a fixed 60 Hz step split into 10 substeps. Each tetrahedron is pulled, with finite compliance, toward its best-fit rotated rest shape — a co-rotational elastic constraint that also flips inverted elements back out — and carries a volume constraint that keeps the candy close to incompressible, so a stretched slice necks in like the real thing.

Tetrahedra in the rim are roughly three times stiffer than the field. Damping acts only on relative velocity along the mesh edges, so the slice still falls and tumbles freely while its wobble dies away. Ground contact projects particles out of the floor with Coulomb-style friction; the grab is a soft attachment on a patch of particles, bounded in reach.

Cutting

Every piece is a convex outline in the slice’s original rest plane, with rounded corners. Your stroke, read on the surface it was drawn over, fixes a vertical blade plane. For each piece it crosses, the piece’s current pose is fitted with a best rotation, the plane is carried back into rest space and becomes a straight line, and the outline is split along it — the two halves are prebuilt as fresh tetrahedral meshes the moment you let go. Then the steel knife comes down: its edge first presses a groove into the candy, and when it breaks through the new pieces are swapped in, taking over the position and speed of the candy they came from, while the blade wedges the faces apart on its way to the board. The blade is drawn behind the candy’s surface, so the part that is buried in it is seen refracted. Each piece is its own soft body — grab it, stretch it, cut it again — and pieces push against each other instead of passing through.

Satoshis in the set

Four small gold coins stand in the candy at odd angles, each a rigid mesh — two faces with a recessed field and a raised rim, a reeded edge, the ₿ struck into each face as a signed-distance relief — posed on the CPU every frame from a centre and a basis. Sealed, a coin rides the best-fit rotation and centre of its piece and is seen through the candy, refracted and tinted; it shivers when the blade comes near, when its piece is held or the slice is tapped beside it. A cut that passes within reach works it loose: it rattles while the blade is still in, rights itself as it tips into the cut, drops between the two new faces and rolls out along them.

On the table a coin rolls on its edge. Rolling friction bleeds off its speed; its lean grows as it slows, and a leaning coin turns toward the lean (v²/R = g·tan θ), so the path curls into a spiral. Past a certain lean it goes over into the whirl of a spun coin — the point of contact races round faster and faster as it settles, as Euler’s disk does — and lies flat on one face or the other. Rolling coins bounce off the pieces and shove them, keep off each other, and lean back toward the slice when they stray; tap one and it is flipped, tumbling end over end, to land on a face.

Light through candy

The renderer is three.js on WebGL 2: nine THREE.Scene passes into render targets, drawn with GLSL ShaderMaterials. They render the table, the knife, the coins and the air bubbles first, then the slice’s back faces to measure how much candy each view ray crosses. The front faces refract the scene behind by that thickness — red bent a little less than blue, so the coins inside carry a thread of dispersion — and absorb it with Beer–Lambert colour; the field is clear gummy, so its colour is almost all absorption, with only a little in-body scattering, a back-lit glow at thin edges, Fresnel reflections of a procedural night studio and wet two-lobe GGX highlights from the key behind and a cool fill in front. The coin’s design is not geometry: the ring and the ₿ are regions of the shared rest frame, struck right through the thickness as columns of milky candy, and their edges — like the reeding round the rim and the faint undulation of a poured surface — are a height field whose screen-space derivatives bump the normal, so the relief stays put however the slice is cut or pulled. The floor gets a soft key shadow tinted by the candy, a wash of the candy’s own colour from a blurred top-down footprint, and contact occlusion from a height map; the bright end of the frame is blurred at quarter size and laid back over it, and three.js finishes with its Khronos PBR Neutral tone mapping. The Lightning mint also gives off its own light: each refracted tap adds emission over its own path through the candy, so the coins and the ₿ inside cut dark shapes into the glow, slow veins of noise drift through it in rest space, and the table picks up a violet pool from a blurred top-down footprint of the slice.

Colophon

Hard Fork began as Spider Melon — a gummy watermelon slice with gummy spiders set in it — an idea from @vib3coded. This bitcoin edition — the coin slice, the satoshis that work loose and roll away, the polish pass — was written with Claude Fable 5.1 on max thinking, in about half a million tokens of back-and-forth, and is made with ❤ by idlebg.com. The parts of three.js r170 it needs (MIT) are bundled into this file, so the page stands alone.