Balian.dev
St. Paul, MN · remote Book a call

Work

Tech demo

A rose engine, cutting guilloché in your browser.

Pick the rosettes, set the slide rest and watch the machine cut the plate in ink or metal. Then you send it to a plotter, an engraver or a share link.

  • RoleConcept, machine model, kinematics, renderer, exports, design and build
  • StatusLive tech demo, free to use
  • StackTypeScript, Vite, three.js, WebGL 2 and GLSL, Tailwind
  • PlatformStatic assets on a Cloudflare Worker
  • OutputSVG, PNG, G-code, preset JSON and share links
A barleycorn cut at four times speed, then the same machine cutting flame into blued steel.

What it is

A rose engine is the lathe that cuts guilloché, the engine-turned pattern on banknotes and certificates, pen barrels, lighters and cigarette cases, old car dashboards and watch dials. The work turns on a spindle that rocks against a fixed cutter, and a stack of lobed cams, the rosettes, decides how it rocks. A slide rest moves the cutter in a step for every pass, and the pattern is the sum of all those passes. This one runs in the browser. The machine is on the left, the plate on the right, and you can watch the cut at real speed, speed it up, scrub through it or skip to the end.

The plate can be ink on paper, with a palette and a colour per pass, or metal: a V-tool in silver, gold, rose gold, brass, steel or blued steel, lit from an angle you choose, with a translucent enamel over it. Twelve presets cover the classics. Random draws a new pattern from one of nine families and Mutate nudges the one you have, and any setting can be locked so it survives both.

The app with the controls on the left, the 3D lathe in the middle and a barleycorn plate part way through its passes on the right
The machine and the plate side by side, with the rosette stack and the slide rest in the panel.

The machine is real

Every rosette is a cam: a lobe count, an amplitude, a phase and a profile, from a plain sine through convex, concave, flame, square and saw. Rocking rosettes move the work sideways, pumping rosettes move it in and out, and up to eight of them add together. The follower that rides the cam is a round rubber, as on a real machine, so a sharp profile comes out rounded, because a roller cannot reach the bottom of a sharp notch. That envelope is computed, and the rounded curve is what drives the cut.

The slide rest has a start and end radius, a pass count, a taper and a spiral feed. The phase can drift a few degrees per pass, alternate by a fraction of a lobe on every other pass, which is what makes barleycorn and basket weave, or follow a list you type. An eccentric chuck offsets the work and repeats the program around divisions for a rosace. An elliptical chuck turns circles into ovals for a cartouche.

One set of kinematics produces the toolpath, and the drawing, the 3D machine and every export read from that same path. The rosettes on the model are extruded from the same profile functions, so the cam you pick is the cam you see turning, and the drawing cannot drift from the animation.

The back of the machine: the brass rosette on the spindle, the handwheel, and the spring-loaded rubber that follows the cam
The rosette end of the machine. The cam is built from the profile you chose, and the rubber rides it.

How the metal is drawn

The toolpath becomes one ribbon mesh, built once per recipe. Playing the cut, changing the line width or switching the finish only change uniforms, so playback never rebuilds geometry and stays smooth on a laptop. The flat view and the disc on the 3D machine redraw only the samples revealed since the last frame.

In metal mode each pass is a V-groove whose width follows the tool angle and the depth, and the pumping rosettes add depth of their own. The groove shader writes a normal and a depth for every pixel, and where two cuts cross, the deeper one wins, because engraving only removes material. Grooves narrower than a pixel are drawn a little wider with shallower walls so fine work still reads on a screen. The surface is shaded as a physical metal with anisotropy, lit from the direction you set, and the enamel is a translucent tint over it, capped so a dark blue stays a dark blue.

Close view of the cutter against a blued steel plate half way through a flame pattern, the slide rest in the foreground
The tool camera, part way through a flame pattern in blued steel.

Random that reads as guilloché

Random numbers on their own produce noise. Random here starts from a seed and picks one of nine families: barleycorn, basket weave, moiré, flame, sunburst, rosace, cartouche, spiral and pumped. Inside a family the amplitude is sized against the gap between passes so the lines interlock, extra rosettes get lobe counts that are multiples or divisors of the first so the pattern stays coherent, and in metal the grooves overlap slightly so no flat metal shows between cuts. Ink palettes are built in a perceptual colour space with a contrast floor against the paper.

Every setting has a lock. Lock the rosette stack and Random will only change the slide rest and the finish. Lock the finish and it keeps the metal while it changes everything else. Mutate takes the current recipe and moves a few things a short distance, so you can walk towards something instead of jumping.

A gold plate engraved with a basket weave: rows of short grooves that alternate direction from ring to ring
Basket weave in gold: alternate passes offset by a fraction of a lobe.

Out of the browser

The SVG export is in millimetres with one layer per colour, simplified so a plotter does not stutter on near-collinear points, and the recipe is stored in the file's metadata so a plate can be rebuilt from its own drawing. The PNG export renders in tiles for print sizes, by pixel count or by paper size and DPI, with a transparent background for ink. The G-code export has a pen-plotter profile and a CNC engraving profile, an origin at the centre or the corner, and an estimate of path length and run time. Its comments are kept to plain ASCII, because some controllers treat high bytes as commands.

A share link packs the whole recipe, compressed, into the URL. Nothing is stored on a server, and a link someone sends you is validated before it is loaded.

A rosace in violet ink on white paper: the same wave program repeated around an eccentric chuck so the lobes overlap into a flower
A rosace in ink. The eccentric chuck repeats the program around its divisions.

Why it matters for you

  • A configurator for a product with options, where every choice is drawn and priced in front of the customer
  • A simulator for a process or a machine, so a buyer or a trainee can turn the knobs instead of reading about them
  • An explainer for the thing your sales team describes with a PDF, running on a phone and sharing as a link
  • Output the business can use, whether that is a file for a machine, a report or a print, generated from the same model the screen shows

Want a product built this way?