A glazed tea bowl shatters along branching cracks, then is mended with flowing gold.
The bowl is a surface of revolution: its profile (foot ring, belly, rim and inner wall) is swept around the axis and splatted into a z-buffer that keeps each pixel's normal and surface coordinates, so the glaze (hare's fur streaks, drips above a raw clay foot, speckles, a pooled well) is painted in surface space and relit every frame with Blinn-Phong highlights and a Fresnel sheen. The fracture runs on a Voronoi diagram whose seeds crowd around the impact, where stress is highest. Crack tips race along cell edges from the vertex nearest the blow, prefer the edge that deflects them least, fork more often near the impact, join cracks they run into and stop at the silhouette, and union-find merges the cells no crack separates into shards with shared jagged edges. The shards spring apart showing raw clay at the breaks, glide back, and gold lacquer flows along the seams in the order the cracks were born; old gold is baked into the next break, so a bowl keeps its history.
Try it. Click the bowl to strike it wherever you like, then click or press R to repair it with gold. N drops a new bowl with another glaze (tenmoku, celadon, shino, ruri), and dragging or the arrow keys move the light so the gold catches it.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a kintsugi animation with JavaScript and the HTML canvas element: a bowl breaks and is mended with gold. 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 and stays sharp on high-DPI screens. Use a dark, warm background.
- Draw a bowl in side view as a shaded shape: a wide ellipse for the rim opening, a curved body below it, and a small foot ring, filled with gradients so it reads as glossy glaze.
- When I click the bowl, scatter about 60 random points around it, denser near the click, and build their Voronoi cells by clipping a big rectangle with the perpendicular bisector to every other point.
- Grow cracks from the cell corner nearest the click: at each corner pick the next cell edge that turns the least, sometimes fork, and stop at the bowl's outline or when meeting another crack.
- Merge cells that no crack separates (union-find) into shards, and animate each shard (clipped from an image of the bowl) springing a little apart, then gliding back.
Once that works, make it beautiful:
- Draw gold along the cracks, flowing outward from the impact in the order the cracks formed, with a small glowing bead at each front.
- Shade the gold like a raised bead of lacquer: brighter where a segment runs across the light, with a thin highlight on the side facing it.
- Roughen every crack edge with seeded noise so neighboring shards share the same jagged boundary, and show a pale clay color on the broken faces while the pieces are apart.
- Add speckles and soft streaks to the glaze and a contact shadow on the table.
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 rendering the bowl per pixel as a true surface of revolution with a moving light, keeping old gold seams through new breaks, or different glazes.