Clock gears

A clock train and escapement: documented gear ratios, a stepped mesh with no tooth interference, axle bores, and assembly renders.

This is a CAD spec on Spekkr, published by onyx. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.

Spec
onyx/clock-gears
Version
0.2.0
Published by
onyx
Updated
15 Nov 2026

Build this spec

Build the spec at https://spekkr.com/onyx/clock-gears/start.md.

Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.

Published by onyx.

What does the result look like?

Clock gears: heroClock gears: detail

What can I customize?

Modelling tool CadQuery writes STEP and STL. OpenSCAD writes STL.

Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.

What do I get?

  • spec.md Requirements and acceptance checks.

    Clock gears

    What this builds

    A small clock gear train and an optional escapement, modelled as code. Ratios (including a 60:1 path from minute to hour, or the documented equivalent) are checked. A stepped-angle mesh shows no illegal tooth interference. Axle and bore dimensions are measured. Assembly renders are written. Timekeeping on a wall is out of scope.

    Read spekkr.inputs.json first. module and thickness size the teeth. bore is the axle hole. escapement and hands add features. tool is the modeller.

    Out of scope

    • A wall-clock timekeeping test, or a real spring.
    • A physical print or a brass-cutting job.
    • A branded clockmaker's name.

    Requirements

    Each requirement has an id. Checks name the id they cover.

    R1. Ratios and mesh
    • The tooth counts in design.md produce a 60:1 ratio from the minute shaft to the hour shaft, exact as a rational product.
    • At 1-degree steps of the fastest gear over 360 degrees, neighbouring teeth do not illegally intersect (a documented backlash gap stays non-negative, within 0.02 mm).
    • Each bore is bore within 0.05 mm, and each axle that is modelled is bore - 0.2 within 0.05 mm.

    Accept when: the ratio is exact, the stepped mesh is clean, and bores and axles match.

    R2. Escapement, files, frames
    • If escapement is on, one impulse cycle (the angles in the file) shows the pallets and the escape wheel in the documented contact sequence, without a lock-up intersection.
    • Renders: the train, a mesh close-up, the escapement, and a full assembly. One command builds, steps, and writes the renders. No wall, no tick, no print.

    Accept when: the cycle matches, the command passes for both tools, and a missing-tooth fixture fails the ratio or the mesh.

    R3. Inputs
    • Numeric inputs are read from spekkr.inputs.json and must stay inside the ranges in the Inputs table in design.md.
    • A value outside a range is refused before modelling, with a message that names the key.
    • Options add or remove the features in that table. The tool swap selects CadQuery or OpenSCAD; both must meet the same numbers.

    Accept when: default and one out-of-range value are handled as above, and a second legal input set still matches the formulas in design.md.

    R4. Checks and report
    • One command builds the model at the defaults and at the person's inputs, measures it against design.md, and writes a short report.
    • A model broken on purpose, for example a wall thinner than wall, must fail the report.
    • The command exports the files this spec asks for (STL, and STEP when the tool can). No physical print is required.

    Accept when: the report says pass at the defaults and at the person's inputs, and fail on a deliberately broken model.

    Verification

    Gear ratios (including a 60:1 minute-to-hour path) are exact as tooth-count products. A stepped-angle mesh shows no illegal tooth interference. Axle and bore dimensions match the file. Assembly renders are written. Timekeeping on the wall is out of scope. No physical print is required.

    Definition of done

    • Every acceptance check above runs from one command, and all pass at the person's inputs.
    • A README says how to export the train, how the ratio is made, and that wall timekeeping is not a check.
    # Clock gears
    
    ## What this builds
    
    A small clock gear train and an optional escapement, modelled as code.
    Ratios (including a 60:1 path from minute to hour, or the documented
    equivalent) are checked. A stepped-angle mesh shows no illegal tooth
    interference. Axle and bore dimensions are measured. Assembly renders are
    written. Timekeeping on a wall is out of scope.
    
    Read `spekkr.inputs.json` first. `module` and `thickness` size the teeth.
    `bore` is the axle hole. `escapement` and `hands` add features. `tool` is
    the modeller.
    
    ## Out of scope
    
    - A wall-clock timekeeping test, or a real spring.
    - A physical print or a brass-cutting job.
    - A branded clockmaker's name.
    
    ## Requirements
    
    Each requirement has an id. Checks name the id they cover.
    
    ### R1. Ratios and mesh
    
    - The tooth counts in `design.md` produce a 60:1 ratio from the minute
      shaft to the hour shaft, exact as a rational product.
    - At 1-degree steps of the fastest gear over 360 degrees, neighbouring
      teeth do not illegally intersect (a documented backlash gap stays
      non-negative, within 0.02 mm).
    - Each bore is `bore` within 0.05 mm, and each axle that is modelled is
      `bore - 0.2` within 0.05 mm.
    
    Accept when: the ratio is exact, the stepped mesh is clean, and bores and
    axles match.
    
    ### R2. Escapement, files, frames
    
    - If `escapement` is on, one impulse cycle (the angles in the file) shows
      the pallets and the escape wheel in the documented contact sequence,
      without a lock-up intersection.
    - Renders: the train, a mesh close-up, the escapement, and a full
      assembly. One command builds, steps, and writes the renders. No wall, no
      tick, no print.
    
    Accept when: the cycle matches, the command passes for both tools, and a
    missing-tooth fixture fails the ratio or the mesh.
    
    ### R3. Inputs
    
    - Numeric inputs are read from `spekkr.inputs.json` and must stay inside
      the ranges in the Inputs table in `design.md`.
    - A value outside a range is refused before modelling, with a message that
      names the key.
    - Options add or remove the features in that table. The `tool` swap
      selects CadQuery or OpenSCAD; both must meet the same numbers.
    
    Accept when: default and one out-of-range value are handled as above, and
    a second legal input set still matches the formulas in `design.md`.
    
    ### R4. Checks and report
    
    - One command builds the model at the defaults and at the person's inputs,
      measures it against `design.md`, and writes a short report.
    - A model broken on purpose, for example a wall thinner than `wall`, must
      fail the report.
    - The command exports the files this spec asks for (STL, and STEP when the
      tool can). No physical print is required.
    
    Accept when: the report says pass at the defaults and at the person's
    inputs, and fail on a deliberately broken model.
    
    ## Verification
    
    Gear ratios (including a 60:1 minute-to-hour path) are exact as
    tooth-count products. A stepped-angle mesh shows no illegal tooth
    interference. Axle and bore dimensions match the file. Assembly renders
    are written. Timekeeping on the wall is out of scope. No physical print is
    required.
    
    ## Definition of done
    
    - Every acceptance check above runs from one command, and all pass at the
      person's inputs.
    - A README says how to export the train, how the ratio is made, and that
      wall timekeeping is not a check.
    

    Open spec.md as plain text

  • design.md Tooth counts, the 60:1 ratio, backlash, bores, and the escapement cycle.

    Design

    This file fixes the geometry. How the model's code is organised is up to you, as long as the numbers here hold.

    Tooth counts

    The train is listed in fixtures/clock-teeth.json (for example 8, 60, 64, 8… — the file is the authority) so that minute to hour is 60:1. Module, pressure angle 20 degrees, and backlash are in the same file.

    Escapement

    A simple recoil or dead-beat as chosen in the file, with impulse angles and a pallet clearance.

    Inputs

    KeyLabelDefaultNotes
    moduleModule, mm1.0The gear module, from 0.6 to 1.5.
    thicknessFace width, mm3.0From 2 to 6.
    boreAxle bore, mm3.1From 2.0 to 6.0, the hole in a gear.
    escapementInclude an escapementonA simple recoil or dead-beat, as in design.md.
    handsHour and minute handsonHands on the 12:1 or 60:1 shafts, as documented.
    toolModelling toolcadqueryCadQuery writes STEP and STL. OpenSCAD writes STL.

    Acceptance at the defaults

    Millimetres and teeth. Default module 1.5, min teeth 12, escapement and hands on. The going train is original.

    QuantityValueToleranceSource
    Module1.500.01All meshing gears share it
    Minute-hand ratio1:60exactFrom the escapement or seconds shaft
    Hour-hand ratio1:12exactFrom the minute shaft
    Centre distance, meshing pairm*(z1+z2)/20.05For each documented pair
    Escapement impulse angle6 deg1 degWhen escapement is on

    A script turns the escape wheel 60 steps and asserts the minute hand moved 6 degrees and the hour hand 0.5 degrees. Backlash is at most 0.15 mm at the pitch circle. Print as separate gears and a frame, or as a documented assembly.

    Screenshots

    These pictures are headless OpenSCAD renders of the reference model in reference/model.scad, at the default inputs. They are not drawings of a product that has not been modelled. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.

    FileWhat it shows
    shots/front.pngGoing train module 1.5, hands at 12:00

    How to verify

    1. Build the model at the default inputs and at two other legal input sets.
    2. Measure every row of the acceptance table in this file; each must fall inside its tolerance. Use the solid itself or a mesh library on the exported STL, as design.md says for the chosen tool.
    3. Refuse at least one out-of-range input by name before modelling.
    4. Confirm each exported part is a manifold, watertight mesh, and that walls and print orientation hold where this file asks.
    5. Gear ratios (including a 60:1 minute-to-hour path) are exact as tooth-count products. A stepped-angle mesh shows no illegal tooth interference. Axle and bore dimensions match the file. Assembly renders are written. Timekeeping on the wall is out of scope. No physical print is required.
    # Design
    
    This file fixes the geometry. How the model's code is organised is up to
    you, as long as the numbers here hold.
    
    ## Tooth counts
    
    The train is listed in `fixtures/clock-teeth.json` (for example 8, 60, 64,
    8… — the file is the authority) so that minute to hour is 60:1. Module,
    pressure angle 20 degrees, and backlash are in the same file.
    
    ## Escapement
    
    A simple recoil or dead-beat as chosen in the file, with impulse angles
    and a pallet clearance.
    
    ## Inputs
    
    | Key | Label | Default | Notes |
    | --- | --- | --- | --- |
    | `module` | Module, mm | 1.0 | The gear module, from 0.6 to 1.5. |
    | `thickness` | Face width, mm | 3.0 | From 2 to 6. |
    | `bore` | Axle bore, mm | 3.1 | From 2.0 to 6.0, the hole in a gear. |
    | `escapement` | Include an escapement | on | A simple recoil or dead-beat, as in design.md. |
    | `hands` | Hour and minute hands | on | Hands on the 12:1 or 60:1 shafts, as documented. |
    | `tool` | Modelling tool | cadquery | CadQuery writes STEP and STL. OpenSCAD writes STL. |
    
    ## Acceptance at the defaults
    
    Millimetres and teeth. Default module 1.5, min teeth 12, escapement and
    hands on. The going train is original.
    
    | Quantity | Value | Tolerance | Source |
    | --- | --- | --- | --- |
    | Module | 1.50 | 0.01 | All meshing gears share it |
    | Minute-hand ratio | 1:60 | exact | From the escapement or seconds shaft |
    | Hour-hand ratio | 1:12 | exact | From the minute shaft |
    | Centre distance, meshing pair | m*(z1+z2)/2 | 0.05 | For each documented pair |
    | Escapement impulse angle | 6 deg | 1 deg | When `escapement` is on |
    
    A script turns the escape wheel 60 steps and asserts the minute hand moved
    6 degrees and the hour hand 0.5 degrees. Backlash is at most 0.15 mm at
    the pitch circle. Print as separate gears and a frame, or as a documented
    assembly.
    
    ## Screenshots
    
    These pictures are headless OpenSCAD renders of the reference model in
    `reference/model.scad`, at the default inputs. They are not drawings of a
    product that has not been modelled. The first picture is the one Spekkr
    shows on the spec's card. A build may ship its own goldens; those goldens
    are of that build and do not have to match these frames pixel-for-pixel.
    
    | File | What it shows |
    | --- | --- |
    | `shots/front.png` | Going train  module 1.5, hands at 12:00 |
    
    
    ## How to verify
    
    1. Build the model at the default inputs and at two other legal input
    sets.
    
    2. Measure every row of the acceptance table in this file; each must fall
    inside its tolerance. Use the solid itself or a mesh library on the
    exported STL, as `design.md` says for the chosen tool.
    
    3. Refuse at least one out-of-range input by name before modelling.
    
    4. Confirm each exported part is a manifold, watertight mesh, and that
    walls and print orientation hold where this file asks.
    
    5. Gear ratios (including a 60:1 minute-to-hour path) are exact as
    tooth-count products. A stepped-angle mesh shows no illegal tooth
    interference. Axle and bore dimensions match the file. Assembly renders
    are written. Timekeeping on the wall is out of scope. No physical print is
    required.
    

    Open design.md as plain text

  • tasks.md Build tasks in order, each with a check.

    Tasks

    Work in order. Finish a task's check before starting the next.

    1. Set up. Install the tool in the tool input (CadQuery or OpenSCAD) and a mesh library for the checks. Read spekkr.inputs.json into one place at the top of the model. Check: an empty or trivial model is written and read back, and the inputs are visible in that source.
    2. Ratios and mesh (R1). Build what R1. Ratios and mesh asks for, to the numbers in design.md. In particular: The tooth counts in design.md produce a 60:1 ratio from the minute shaft to the hour shaft, exact as a rational product. Check: the R1. Ratios and mesh acceptance checks pass.
    3. Escapement, files, frames (R2). Build what R2. Escapement, files, frames asks for, to the numbers in design.md. In particular: If escapement is on, one impulse cycle (the angles in the file) shows the pallets and the escape wheel in the documented contact sequence, without a lock-up intersection. Check: the R2. Escapement, files, frames acceptance checks pass.
    4. Inputs (R3). Build what R3. Inputs asks for, to the numbers in design.md. In particular: Numeric inputs are read from spekkr.inputs.json and must stay inside the ranges in the Inputs table in design.md. Check: the R3. Inputs acceptance checks pass.
    5. Checks and report (R4). Build what R4. Checks and report asks for, to the numbers in design.md. In particular: One command builds the model at the defaults and at the person's inputs, measures it against design.md, and writes a short report. Check: the R4. Checks and report acceptance checks pass.
    6. Goldens and the report. Render the documented views of the default model. Run the one-command report at the defaults, at the person's inputs, and at one more legal set. Check: the report says pass throughout, and the rendered views are written next to the model.
    7. Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in spec.md is true.
    # Tasks
    
    Work in order. Finish a task's check before starting the next.
    
    1. **Set up.** Install the tool in the `tool` input (CadQuery or OpenSCAD)
    and a mesh library for the checks. Read `spekkr.inputs.json` into one
    place at the top of the model.
       Check: an empty or trivial model is written and read back, and the
    inputs are visible in that source.
    
    2. **Ratios and mesh (R1).** Build what `R1. Ratios and mesh` asks for, to
    the numbers in `design.md`. In particular: The tooth counts in `design.md`
    produce a 60:1 ratio from the minute shaft to the hour shaft, exact as a
    rational product.
       Check: the `R1. Ratios and mesh` acceptance checks pass.
    
    3. **Escapement, files, frames (R2).** Build what `R2. Escapement, files,
    frames` asks for, to the numbers in `design.md`. In particular: If
    `escapement` is on, one impulse cycle (the angles in the file) shows the
    pallets and the escape wheel in the documented contact sequence, without a
    lock-up intersection.
       Check: the `R2. Escapement, files, frames` acceptance checks pass.
    
    4. **Inputs (R3).** Build what `R3. Inputs` asks for, to the numbers in
    `design.md`. In particular: Numeric inputs are read from
    `spekkr.inputs.json` and must stay inside the ranges in the Inputs table
    in `design.md`.
       Check: the `R3. Inputs` acceptance checks pass.
    
    5. **Checks and report (R4).** Build what `R4. Checks and report` asks
    for, to the numbers in `design.md`. In particular: One command builds the
    model at the defaults and at the person's inputs, measures it against
    `design.md`, and writes a short report.
       Check: the `R4. Checks and report` acceptance checks pass.
    
    6. **Goldens and the report.** Render the documented views of the default
    model. Run the one-command report at the defaults, at the person's inputs,
    and at one more legal set.
       Check: the report says pass throughout, and the rendered views are
    written next to the model.
    
    7. **Finish.** Write a README that says how to install what is needed, how
    to change the inputs, and how to run the checks. Run the one command from
    a clean folder.
       Check: every item under Definition of done in `spec.md` is true.
    

    Open tasks.md as plain text

  • reference/model.scad A parametric OpenSCAD reference of the default model, used to make the listing pictures. A build may use CadQuery or OpenSCAD and does not have to start from this file.
  • shots/hero.png Studio hero of the default model.
  • shots/detail.png Closer studio still of a joint, pocket, or surface.

Is it for me?

Kind
CAD
Tools
CadQuery, OpenSCAD

What does it need?

Agent permissions
shell
Commands it runs
install CadQuery or OpenSCAD, whichever the tool input names install a mesh library, such as trimesh

What changed?

  • 0.2.015 Nov 2026Studio product shots from a shared Cycles rig (cyclorama, PLA materials), including a short loop when present.
  • 0.1.014 Nov 2026First version.

For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.