Skip to content

Example Mechanical Movements for Security Hardware

github-actions[bot] edited this page Nov 30, 2026 · 1 revision

Last reviewed: 2026-11-29

Part of the OpenSCAD Design & Prototyping Guide ยท CAD & 3D Printing ยท ULTIMATE CYBERSECURITY MASTER GUIDE

Source files for 07 ยท Mechanical Movements. Eight small, original parametric models of classic mechanisms, each tied to a movement in Henry T. Brown's Five Hundred and Seven Mechanical Movements (1868, public domain in the US; cited by movement number from the Internet Archive 1868 scan) and to a piece of security or test hardware. No plate or text from the book is reproduced beyond short quotations.

Warning

Verified in software, not physically printed. The checks prove that the models render, export, keep their clearances at the listed phases and agree with idealized textbook formulas. They do not test strength, wear, friction or how a printer reproduces small teeth. Print a part and record the result before relying on it.

Files

File Mechanism (Brown no.) Security / Lab Application
rack_pinion_shutter.scad Rack and pinion (no. 113) Webcam privacy shutter
ratchet_seal.scad Ratchet and pawl (no. 225) One-way spool for a tamper-evident wire seal (teaching model)
geneva_carousel.scad Intermittent wheel with locking (no. 68; stop-work variant after no. 212) Media or key-token indexing carousel
cam_latch.scad Plate cam and follower (heart cam, no. 96) Enclosure cam latch
worm_positioner.scad Worm and worm-wheel (no. 31) Hand-set SDR antenna positioner axis
button_rig.scad Crank motion (no. 92) and slotted yoke (no. 93) Repeat-press test rig for buttons and switches
toggle_clamp.scad Toggle joint (no. 140) and knee-lever (no. 164) Pogo-pin test-fixture clamp
mangle_shuttle.scad Mangle rack (no. 197) Reciprocating card shuttle for a reader test bench (kinematic model)
*.json โ€” Saved parameter sets, one file per demo that has presets
check.sh โ€” Design checks, STL export and clash sweeps for every demo
lib/gears.scad โ€” spur_gear_2d(), rack_2d() and the ISO 53 / KHK gear math
lib/ratchet.scad โ€” ratchet_wheel_2d(), ratchet_pawl_2d(), the pawl moment test
lib/geneva.scad โ€” geneva_wheel_2d(), geneva_driver_2d(), geneva_wheel_angle()
lib/cams.scad โ€” plate_cam_2d(), motion laws, pressure angle
lib/worm.scad โ€” Approximate worm() and worm_wheel(), lead angle and self-locking rule
lib/linkages.scad โ€” Crank-slider, Scotch yoke and toggle math, link_2d()
lib/mangle.scad โ€” Mangle-rack kinematics and teaching geometry
lib/report.scad โ€” mm_echo() report lines and the animation phase

Parts

Every demo has the same selector pattern: preview (animated by $t, or the phase slider), one branch per printable part already in print orientation, mockups, clash (must be empty) and clash_view (overlaps in red). Mockups never appear in a printable branch.

Demo Printable Parts Clash Sweep Phases Presets
rack_pinion_shutter housing, shutter, pinion 0, 0.25, 0.5, 0.75, 1 fine-module
ratchet_seal housing, wheel, pawl 0 (rest position) โ€”
geneva_carousel housing, wheel, driver 0, 0.05, 0.1, 0.16, 0.25, 0.5, 0.84, 0.9, 0.95 four-slot, eight-slot
cam_latch housing, cam, bolt 0, 0.1 ... 0.7, 0.85 uniform-heart, parabolic
worm_positioner housing, worm, wheel 0, 0.5 (housing only, not the mesh) two-start, khk-table-4-23
button_rig housing, crank, slider, rod (rod only with drive = "crank_slider") 0, 0.125 ... 0.875 scotch-yoke
toggle_clamp housing, plate, upper_link, lower_link 0, 0.25, 0.5, 0.75, 1 short-links
mangle_shuttle frame, pinion none (tooth contact not modeled) โ€”

Use the Part Selector & Presets

In the OpenSCAD GUI, open a demo, pick part and a preset in the Customizer, and press F5 for a preview or F6 then F7 to render and export an STL. View โ†’ Animate with a nonzero step count drives $t, which overrides the phase slider. The same choices work on the command line:

mkdir -p out
# one printable part, already in print orientation
openscad -o out/geneva_wheel.stl --export-format asciistl -D 'part="wheel"' geneva_carousel.scad

# a saved preset from the demo's .json file
openscad -o out/geneva_four.echo -p geneva_carousel.json -P four-slot geneva_carousel.scad

# the clash test at one phase: the result must be empty
openscad -o out/clash.stl --export-format asciistl -D 'part="clash"' -D 'phase=0.25' geneva_carousel.scad

Use part="clash_view" in the GUI to see any overlap in red. An empty clash result can make OpenSCAD 2021.01 print Current top level object is empty. and exit non-zero; check.sh accepts exactly that case.

Run the Checks

./check.sh                       # every demo: design checks, presets, STLs, clash sweeps
./check.sh geneva_carousel       # one or more named demos
xvfb-run -a ./check.sh --png     # also preview PNGs on a headless machine (--png comes first)
python3 -B ../../../../tools/check_mechanisms_math.py --echo-dir out --summary out/summary.tsv
python3 -B ../../../../tools/check_mechanisms_math.py   # no OpenSCAD: print the expected values and self-test

check.sh needs openscad on PATH (tested with 2021.01) and python3. For each demo it:

  1. evaluates the defaults and every preset with --hardwarnings and fails on any ERROR: or WARNING: line (OpenSCAD 2021.01 can log a failed assert() and still exit 0);
  2. exports every part named in the demo's printable_parts report line as ASCII STL and fails if one is empty;
  3. runs part="clash" at every phase in the clash_phases report line and fails on any facet;
  4. runs the negative controls (rack, Geneva and cam demos), which hold one part out of step and must report a clash, so a silently insensitive sweep fails the run.

Results go to out/ (ignored by git); out/summary.tsv feeds the Python checker. The Python checker recomputes every reported value from the parameters with separately written textbook formulas and fails on a mismatch. The cad-mechanisms workflow runs both on Ubuntu 24.04 with the archive's openscad package pinned to 2021.01-6build4.

Verification

Evidence: evidence/ci-run-46311702157.json from CI run 46311702157 (Ubuntu 24.04, openscad 2021.01-6build4). All 17 configurations passed their design checks and matched the independent formulas, 25 printable parts exported, 39 of 39 clash checks across the seven swept demos were empty (the mangle shuttle has none; its evidence row reads not-modeled) and 3 of 3 negative controls detected their deliberate interference. The idealized formulas, the worm's self-locking rule in particular, are not a brake or a strength rating. See the Verification Record for the echoed values. Preview images in ../../images/mechanisms/ were rendered in that run.


โฌ…๏ธ Back to Master Index | ๐ŸŽฏ Role Navigation | Legal Notice


๐Ÿ“„ Source: CAD/OpenSCAD/examples/mechanical-movements/README.md | โœ๏ธ Suggest an edit | โฌ…๏ธ Back to CAD

Clone this wiki locally