Skip to content

Ratchet Escapement

The escapement of a mechanical watch, enlarged: a ratchet wheel, a rocking anchor with ruby pallets, a swinging balance and a following gear, ticking in sharp steps. Loops perfectly.

3D object, V2 Objects3DSeamless loop, verified142 lines of codev1.0.0

In Machines & clockwork, Craft & heritage

Next: HourglassSurprise me

Ratchet Escapement preview
Starting live preview…
00:00:00:00 / 00:00:00:01

Live, running the real source at reduced resolution.

Your current settings go with it. Combine several clips and hand them over together from your sequence.

Effect controls

Presets

1

Whole turns of the escape wheel per loop, sixteen ticks each.

The preview runs the same code your AI receives. These settings travel with the hand-off.

Info

What it is

The heart of a mechanical watch, enlarged and laid bare. A sixteen-toothed escape wheel is held by the two jewelled pallets of an anchor; the anchor rocks to and fro, letting one tooth escape at every tick, and the wheel advances in a sharp little step each time. A balance wheel with a hairspring swings steadily above it, setting the pace, and a larger gear turned by the wheel follows at half its speed. Choose the metal (brass, steel, rose or blue steel), the whole turns of the escape wheel per loop, whether a dark bridge plate sits behind, the backdrop colour and whether the camera sways.

Reuse it in your own idea

  • Watch brand: Brass, one turn.
  • Cool engineering: Steel, three turns.
  • Luxury: Rose gold, no plate.

Which part is reusable

src/ratchet-escapement.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses chrome-material only for the demo.

Good to know

  • The pallets do not truly lock against the teeth: the motion is timed by formula, not simulated.
  • The follower gear's teeth only roughly mesh with the escape wheel.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/ratchet-escapement.js
Exports
  • createEscapement({ metal?, turns?, plate? }) => { group, ticks, setProgress(progress), dispose() }
  • METALS: { brass, steel, rose, blue }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and shader materials.
  • chrome-material@1.1.0 (demo) — Studio environment light, backdrop and contact shadow.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: The escape wheel (radius 2.05) is at the origin of the group; the anchor pivots 3.5 above it and the balance wheel sits 6 above it; the follower gear is 4.75 to the right.

Lighting: A warm key light with a shadow map and the studio environment on the metal.

Timing: setProgress(progress) sets every part's angle in closed form from the tick count; frames render in any order.

Output
1080×1080, 30 fps, 16 s · procedural (computed from the frame number) · seamless loop — The wheel advances a whole number of teeth per loop (sixteen ticks per turn, an even number so the anchor is back where it started), the balance swings in a sine of the ticks and the camera sway is a sine of the loop, so the last frame meets the first.
Tested
Rendered 480 frames on 2026-10-06 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)). Same frame twice from fresh pages: identical. Loop: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.
Performance
A few thousand triangles and a shadow map: about a millisecond a frame on an integrated Intel GPU. Software WebGL renders in about a second a frame.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- ratchet-escapement/1.0.0 --out my-video.mp4Needs Node 18+, ffmpeg and Chrome/Chromium. Add --params my-settings.json (from Copy settings) for your own settings.
Version
1.0.0 · sha256:b3b78447dcf7e48e…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. License details
Provenance
Adapted from the owner's threejs-sketches/objects-scenes/ratchet-escapement (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: an extruded sawtooth escape wheel, a ruby-pallet anchor, a balance wheel with hairspring and a follower gear, all timed from a whole tick count on an exact loop.
BinMore like this

Hourglass

3D object3DSeamless loop16 seconds

Music Box

3D object3DSeamless loop12 seconds

Astrolabe

3D object3DSeamless loop16 seconds

Gyroscope

3D object3DSeamless loop16 seconds