Build glass canes by casing, moulding and bundling, then slice them into a paperweight.
A cane's cross-section is a stack of coloured polygons in a unit circle, painted back to front, and every working step is an exact map of those polygons. Casing scales the section into a fresh disc of glass, a star or petal mould is a radial map that dents the outer layers and spares the core, bundling packs seven pulled-down copies on a hex lattice, a rosette rings copies of a second cane around the first, and stirring is a differential rotation. Curved maps are refined by mapping the exact midpoints of long segments and shrunken copies are decimated, so a twice-bundled cane stays at tens of thousands of points. The side of the cane is a glass cylinder whose rows composite the glass along a chord front to back, so clear crystal shows the colours inside and twisting turns them into a helix, and slices fly into a paperweight whose dome magnifies the bed of murrine through a radial lens table.
Try it. Pick a glass colour, then build: Core starts a new cane, Case and Clear add a layer, Star and Petal press it into a mould, Bundle and Rosette pack copies together, Stir swirls it. Click the cane or press Space to slice a murrina into the paperweight, and drag across the cane (or use the arrow keys) to twist it. Keys: C, E, X, S, P, B, R and W for the steps, 1 to 9 for colours.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a millefiori glass cane designer with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
The idea: a glass cane's cross-section is just a list of coloured polygons inside a unit circle, drawn back to front. Every glassworking step is a function that transforms those polygons.
Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens, and has a dark background. Draw the current cane as a large circle in the middle.
- Represent a cane as an array of objects with points and color, where points is a closed polygon in a unit circle.
- Core: a new cane that is one circle of 120 points.
- Case: scale every polygon by 1 / (1 + t) and insert a new full circle of a new color at the front of the list (so it is drawn first, behind everything).
- Star mould: move every point radially with r' = r * (1 - depth * (0.5 - 0.5 * cos(k * theta)) * r^2), which dents the outer layers into k points and leaves the core almost untouched.
- Bundle: replace the cane with seven copies scaled by 1/3, one in the middle and six around it at distance 2/3, on top of a filler circle.
- Add a row of buttons for these steps and a palette of six glass colours.
Once that works, make it beautiful:
- Refine polygons after a mould: wherever two neighbouring points end up far apart, insert the transformed midpoint of the original segment.
- Make it look like polished glass: a soft diagonal sheen, a bright rim highlight and a thin darker seam around each polygon.
- Add Slice: copy the current cross-section into a growing grid of little murrine at the side, like a paperweight.
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 rosette of copies around a centre cane, a side view of the cane as a glass cylinder with twisted stripes, or a magnifying paperweight dome.