# No. 300 (Brown 1868; one machine, shown as Nos. 300 and 301): "300 and 301. A clock or watch escapement; 300 being a front elevation, and 301 a side elevation. The pallet is acted upon by
# the teeth of one and the other of two escape-wheels alternately."
#
# Model (cm, gravity on). Brown's figures: two escape-wheels side by side on one horizontal arbor (301), and under them a pallet on its own arbor, which
# lies across the front elevation (300) along the way the lowest teeth go. In 301 the pallet is a half-disc, its straight edge up and its arbor at the middle
# of that edge, spanning both wheels; a rod hangs down from it (300). Here two wheels of 15 teeth, tips r 6, stand 5 apart on an arbor along x,
# their teeth half a pitch apart, turned by a constant torque (the weight; the one driven joint). The half-disc, radius 3, hangs on an arbor along y
# right under them with its straight edge at the teeth's tips, and a pendulum (10 to the bob's centre) hangs from the same arbor. When the pendulum swings
# one way the half-disc's edge rises under one wheel and falls under the other. The sloped front of a tooth on the raised side presses that corner down,
# which swings the pendulum and raises the other corner in front of a tooth of the other wheel, half a pitch behind; that tooth presses it down in turn.
# The wheels go round half a tooth a beat, and the pendulum is kept swinging. No. 300 and No. 301 are the same machine, seen as in Brown's two figures:
# this is the front elevation. Generator: opencode-runs/batch12/gen300.py (NUM=300).
number: 300
slug: two-wheel-escapement-front
name: "Escapement with two escape-wheels: front elevation"
brown: "300 and 301. A clock or watch escapement; 300 being a front elevation, and 301 a side elevation. The pallet is acted upon by the teeth of one and the other of two escape-wheels alternately."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: PGS, multiccd: false, duration_s: 10.0, floor: false}
bodies:
  - id: wheels
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - {kind: rod, from: [-4.5, 0, 0], to: [4.5, 0, 0], radius: 0.35, color: "#8f8a80"}   # the wheels' arbor
      - {kind: loft, a: [[2.25, 4.75, 0.0], [2.25, 6.0, 0.0], [2.25, 4.4858, 1.5621]], b: [[2.75, 4.75, 0.0], [2.75, 6.0, 0.0], [2.75, 4.4858, 1.5621]], collide: 1}   # wheel B's teeth
      - {kind: loft, a: [[2.25, 4.3393, 1.932], [2.25, 5.4813, 2.4404], [2.25, 3.4626, 3.2516]], b: [[2.75, 4.3393, 1.932], [2.75, 5.4813, 2.4404], [2.75, 3.4626, 3.2516]], collide: 1}
      - {kind: loft, a: [[2.25, 3.1784, 3.5299], [2.25, 4.0148, 4.4589], [2.25, 1.8407, 4.3788]], b: [[2.75, 3.1784, 3.5299], [2.75, 4.0148, 4.4589], [2.75, 1.8407, 4.3788]], collide: 1}
      - {kind: loft, a: [[2.25, 1.4678, 4.5175], [2.25, 1.8541, 5.7063], [2.25, -0.0995, 4.749]], b: [[2.75, 1.4678, 4.5175], [2.75, 1.8541, 5.7063], [2.75, -0.0995, 4.749]], collide: 1}
      - {kind: loft, a: [[2.25, -0.4965, 4.724], [2.25, -0.6272, 5.9671], [2.25, -2.0225, 4.2979]], b: [[2.75, -0.4965, 4.724], [2.75, -0.6272, 5.9671], [2.75, -2.0225, 4.2979]], collide: 1}
      - {kind: loft, a: [[2.25, -2.375, 4.1136], [2.25, -3.0, 5.1962], [2.25, -3.5957, 3.1037]], b: [[2.75, -2.375, 4.1136], [2.75, -3.0, 5.1962], [2.75, -3.5957, 3.1037]], collide: 1}
      - {kind: loft, a: [[2.25, -3.8428, 2.792], [2.25, -4.8541, 3.5267], [2.25, -4.5473, 1.3729]], b: [[2.75, -3.8428, 2.792], [2.75, -4.8541, 3.5267], [2.75, -4.5473, 1.3729]], collide: 1}
      - {kind: loft, a: [[2.25, -4.6462, 0.9876], [2.25, -5.8689, 1.2475], [2.25, -4.7125, -0.5953]], b: [[2.75, -4.6462, 0.9876], [2.75, -5.8689, 1.2475], [2.75, -4.7125, -0.5953]], collide: 1}
      - {kind: loft, a: [[2.25, -4.6462, -0.9876], [2.25, -5.8689, -1.2475], [2.25, -4.063, -2.4606]], b: [[2.75, -4.6462, -0.9876], [2.75, -5.8689, -1.2475], [2.75, -4.063, -2.4606]], collide: 1}
      - {kind: loft, a: [[2.25, -3.8428, -2.792], [2.25, -4.8541, -3.5267], [2.25, -2.7109, -3.9005]], b: [[2.75, -3.8428, -2.792], [2.75, -4.8541, -3.5267], [2.75, -2.7109, -3.9005]], collide: 1}
      - {kind: loft, a: [[2.25, -2.375, -4.1136], [2.25, -3.0, -5.1962], [2.25, -0.8901, -4.6659]], b: [[2.75, -2.375, -4.1136], [2.75, -3.0, -5.1962], [2.75, -0.8901, -4.6659]], collide: 1}
      - {kind: loft, a: [[2.25, -0.4965, -4.724], [2.25, -0.6272, -5.9671], [2.25, 1.0847, -4.6245]], b: [[2.75, -0.4965, -4.724], [2.75, -0.6272, -5.9671], [2.75, 1.0847, -4.6245]], collide: 1}
      - {kind: loft, a: [[2.25, 1.4678, -4.5175], [2.25, 1.8541, -5.7063], [2.25, 2.8718, -3.7835]], b: [[2.75, 1.4678, -4.5175], [2.75, 1.8541, -5.7063], [2.75, 2.8718, -3.7835]], collide: 1}
      - {kind: loft, a: [[2.25, 3.1784, -3.5299], [2.25, 4.0148, -4.4589], [2.25, 4.1625, -2.2883]], b: [[2.75, 3.1784, -3.5299], [2.75, 4.0148, -4.4589], [2.75, 4.1625, -2.2883]], collide: 1}
      - {kind: loft, a: [[2.25, 4.3393, -1.932], [2.25, 5.4813, -2.4404], [2.25, 4.7333, -0.3975]], b: [[2.75, 4.3393, -1.932], [2.75, 5.4813, -2.4404], [2.75, 4.7333, -0.3975]], collide: 1}
      - {kind: loft, a: [[2.25, 4.2, 0.0], [2.25, 4.8, 0.0], [2.25, 4.6951, 0.998], [2.25, 4.1082, 0.8732]], b: [[2.75, 4.2, 0.0], [2.75, 4.8, 0.0], [2.75, 4.6951, 0.998], [2.75, 4.1082, 0.8732]]}
      - {kind: loft, a: [[2.25, 4.1082, 0.8732], [2.25, 4.6951, 0.998], [2.25, 4.385, 1.9523], [2.25, 3.8369, 1.7083]], b: [[2.75, 4.1082, 0.8732], [2.75, 4.6951, 0.998], [2.75, 4.385, 1.9523], [2.75, 3.8369, 1.7083]]}
      - {kind: loft, a: [[2.25, 3.8369, 1.7083], [2.25, 4.385, 1.9523], [2.25, 3.8833, 2.8214], [2.25, 3.3979, 2.4687]], b: [[2.75, 3.8369, 1.7083], [2.75, 4.385, 1.9523], [2.75, 3.8833, 2.8214], [2.75, 3.3979, 2.4687]]}
      - {kind: loft, a: [[2.25, 3.3979, 2.4687], [2.25, 3.8833, 2.8214], [2.25, 3.2118, 3.5671], [2.25, 2.8103, 3.1212]], b: [[2.75, 3.3979, 2.4687], [2.75, 3.8833, 2.8214], [2.75, 3.2118, 3.5671], [2.75, 2.8103, 3.1212]]}
      - {kind: loft, a: [[2.25, 2.8103, 3.1212], [2.25, 3.2118, 3.5671], [2.25, 2.4, 4.1569], [2.25, 2.1, 3.6373]], b: [[2.75, 2.8103, 3.1212], [2.75, 3.2118, 3.5671], [2.75, 2.4, 4.1569], [2.75, 2.1, 3.6373]]}
      - {kind: loft, a: [[2.25, 2.1, 3.6373], [2.25, 2.4, 4.1569], [2.25, 1.4833, 4.5651], [2.25, 1.2979, 3.9944]], b: [[2.75, 2.1, 3.6373], [2.75, 2.4, 4.1569], [2.75, 1.4833, 4.5651], [2.75, 1.2979, 3.9944]]}
      - {kind: loft, a: [[2.25, 1.2979, 3.9944], [2.25, 1.4833, 4.5651], [2.25, 0.5017, 4.7737], [2.25, 0.439, 4.177]], b: [[2.75, 1.2979, 3.9944], [2.75, 1.4833, 4.5651], [2.75, 0.5017, 4.7737], [2.75, 0.439, 4.177]]}
      - {kind: loft, a: [[2.25, 0.439, 4.177], [2.25, 0.5017, 4.7737], [2.25, -0.5017, 4.7737], [2.25, -0.439, 4.177]], b: [[2.75, 0.439, 4.177], [2.75, 0.5017, 4.7737], [2.75, -0.5017, 4.7737], [2.75, -0.439, 4.177]]}
      - {kind: loft, a: [[2.25, -0.439, 4.177], [2.25, -0.5017, 4.7737], [2.25, -1.4833, 4.5651], [2.25, -1.2979, 3.9944]], b: [[2.75, -0.439, 4.177], [2.75, -0.5017, 4.7737], [2.75, -1.4833, 4.5651], [2.75, -1.2979, 3.9944]]}
      - {kind: loft, a: [[2.25, -1.2979, 3.9944], [2.25, -1.4833, 4.5651], [2.25, -2.4, 4.1569], [2.25, -2.1, 3.6373]], b: [[2.75, -1.2979, 3.9944], [2.75, -1.4833, 4.5651], [2.75, -2.4, 4.1569], [2.75, -2.1, 3.6373]]}
      - {kind: loft, a: [[2.25, -2.1, 3.6373], [2.25, -2.4, 4.1569], [2.25, -3.2118, 3.5671], [2.25, -2.8103, 3.1212]], b: [[2.75, -2.1, 3.6373], [2.75, -2.4, 4.1569], [2.75, -3.2118, 3.5671], [2.75, -2.8103, 3.1212]]}
      - {kind: loft, a: [[2.25, -2.8103, 3.1212], [2.25, -3.2118, 3.5671], [2.25, -3.8833, 2.8214], [2.25, -3.3979, 2.4687]], b: [[2.75, -2.8103, 3.1212], [2.75, -3.2118, 3.5671], [2.75, -3.8833, 2.8214], [2.75, -3.3979, 2.4687]]}
      - {kind: loft, a: [[2.25, -3.3979, 2.4687], [2.25, -3.8833, 2.8214], [2.25, -4.385, 1.9523], [2.25, -3.8369, 1.7083]], b: [[2.75, -3.3979, 2.4687], [2.75, -3.8833, 2.8214], [2.75, -4.385, 1.9523], [2.75, -3.8369, 1.7083]]}
      - {kind: loft, a: [[2.25, -3.8369, 1.7083], [2.25, -4.385, 1.9523], [2.25, -4.6951, 0.998], [2.25, -4.1082, 0.8732]], b: [[2.75, -3.8369, 1.7083], [2.75, -4.385, 1.9523], [2.75, -4.6951, 0.998], [2.75, -4.1082, 0.8732]]}
      - {kind: loft, a: [[2.25, -4.1082, 0.8732], [2.25, -4.6951, 0.998], [2.25, -4.8, 0.0], [2.25, -4.2, 0.0]], b: [[2.75, -4.1082, 0.8732], [2.75, -4.6951, 0.998], [2.75, -4.8, 0.0], [2.75, -4.2, 0.0]]}
      - {kind: loft, a: [[2.25, -4.2, 0.0], [2.25, -4.8, 0.0], [2.25, -4.6951, -0.998], [2.25, -4.1082, -0.8732]], b: [[2.75, -4.2, 0.0], [2.75, -4.8, 0.0], [2.75, -4.6951, -0.998], [2.75, -4.1082, -0.8732]]}
      - {kind: loft, a: [[2.25, -4.1082, -0.8732], [2.25, -4.6951, -0.998], [2.25, -4.385, -1.9523], [2.25, -3.8369, -1.7083]], b: [[2.75, -4.1082, -0.8732], [2.75, -4.6951, -0.998], [2.75, -4.385, -1.9523], [2.75, -3.8369, -1.7083]]}
      - {kind: loft, a: [[2.25, -3.8369, -1.7083], [2.25, -4.385, -1.9523], [2.25, -3.8833, -2.8214], [2.25, -3.3979, -2.4687]], b: [[2.75, -3.8369, -1.7083], [2.75, -4.385, -1.9523], [2.75, -3.8833, -2.8214], [2.75, -3.3979, -2.4687]]}
      - {kind: loft, a: [[2.25, -3.3979, -2.4687], [2.25, -3.8833, -2.8214], [2.25, -3.2118, -3.5671], [2.25, -2.8103, -3.1212]], b: [[2.75, -3.3979, -2.4687], [2.75, -3.8833, -2.8214], [2.75, -3.2118, -3.5671], [2.75, -2.8103, -3.1212]]}
      - {kind: loft, a: [[2.25, -2.8103, -3.1212], [2.25, -3.2118, -3.5671], [2.25, -2.4, -4.1569], [2.25, -2.1, -3.6373]], b: [[2.75, -2.8103, -3.1212], [2.75, -3.2118, -3.5671], [2.75, -2.4, -4.1569], [2.75, -2.1, -3.6373]]}
      - {kind: loft, a: [[2.25, -2.1, -3.6373], [2.25, -2.4, -4.1569], [2.25, -1.4833, -4.5651], [2.25, -1.2979, -3.9944]], b: [[2.75, -2.1, -3.6373], [2.75, -2.4, -4.1569], [2.75, -1.4833, -4.5651], [2.75, -1.2979, -3.9944]]}
      - {kind: loft, a: [[2.25, -1.2979, -3.9944], [2.25, -1.4833, -4.5651], [2.25, -0.5017, -4.7737], [2.25, -0.439, -4.177]], b: [[2.75, -1.2979, -3.9944], [2.75, -1.4833, -4.5651], [2.75, -0.5017, -4.7737], [2.75, -0.439, -4.177]]}
      - {kind: loft, a: [[2.25, -0.439, -4.177], [2.25, -0.5017, -4.7737], [2.25, 0.5017, -4.7737], [2.25, 0.439, -4.177]], b: [[2.75, -0.439, -4.177], [2.75, -0.5017, -4.7737], [2.75, 0.5017, -4.7737], [2.75, 0.439, -4.177]]}
      - {kind: loft, a: [[2.25, 0.439, -4.177], [2.25, 0.5017, -4.7737], [2.25, 1.4833, -4.5651], [2.25, 1.2979, -3.9944]], b: [[2.75, 0.439, -4.177], [2.75, 0.5017, -4.7737], [2.75, 1.4833, -4.5651], [2.75, 1.2979, -3.9944]]}
      - {kind: loft, a: [[2.25, 1.2979, -3.9944], [2.25, 1.4833, -4.5651], [2.25, 2.4, -4.1569], [2.25, 2.1, -3.6373]], b: [[2.75, 1.2979, -3.9944], [2.75, 1.4833, -4.5651], [2.75, 2.4, -4.1569], [2.75, 2.1, -3.6373]]}
      - {kind: loft, a: [[2.25, 2.1, -3.6373], [2.25, 2.4, -4.1569], [2.25, 3.2118, -3.5671], [2.25, 2.8103, -3.1212]], b: [[2.75, 2.1, -3.6373], [2.75, 2.4, -4.1569], [2.75, 3.2118, -3.5671], [2.75, 2.8103, -3.1212]]}
      - {kind: loft, a: [[2.25, 2.8103, -3.1212], [2.25, 3.2118, -3.5671], [2.25, 3.8833, -2.8214], [2.25, 3.3979, -2.4687]], b: [[2.75, 2.8103, -3.1212], [2.75, 3.2118, -3.5671], [2.75, 3.8833, -2.8214], [2.75, 3.3979, -2.4687]]}
      - {kind: loft, a: [[2.25, 3.3979, -2.4687], [2.25, 3.8833, -2.8214], [2.25, 4.385, -1.9523], [2.25, 3.8369, -1.7083]], b: [[2.75, 3.3979, -2.4687], [2.75, 3.8833, -2.8214], [2.75, 4.385, -1.9523], [2.75, 3.8369, -1.7083]]}
      - {kind: loft, a: [[2.25, 3.8369, -1.7083], [2.25, 4.385, -1.9523], [2.25, 4.6951, -0.998], [2.25, 4.1082, -0.8732]], b: [[2.75, 3.8369, -1.7083], [2.75, 4.385, -1.9523], [2.75, 4.6951, -0.998], [2.75, 4.1082, -0.8732]]}
      - {kind: loft, a: [[2.25, 4.1082, -0.8732], [2.25, 4.6951, -0.998], [2.25, 4.8, -0.0], [2.25, 4.2, -0.0]], b: [[2.75, 4.1082, -0.8732], [2.75, 4.6951, -0.998], [2.75, 4.8, -0.0], [2.75, 4.2, -0.0]]}
      - {kind: rod, from: [2.5, 0.5526, 0.2337], to: [2.5, 3.9606, 1.6745], radius: 0.22}
      - {kind: rod, from: [2.5, -0.2337, 0.5526], to: [2.5, -1.6745, 3.9606], radius: 0.22}
      - {kind: rod, from: [2.5, -0.5526, -0.2337], to: [2.5, -3.9606, -1.6745], radius: 0.22}
      - {kind: rod, from: [2.5, 0.2337, -0.5526], to: [2.5, 1.6745, -3.9606], radius: 0.22}
      - {kind: loft, a: [[-2.75, 4.6462, 0.9876], [-2.75, 5.8689, 1.2475], [-2.75, 4.063, 2.4606]], b: [[-2.25, 4.6462, 0.9876], [-2.25, 5.8689, 1.2475], [-2.25, 4.063, 2.4606]], collide: 1}   # wheel A's teeth
      - {kind: loft, a: [[-2.75, 3.8428, 2.792], [-2.75, 4.8541, 3.5267], [-2.75, 2.7109, 3.9005]], b: [[-2.25, 3.8428, 2.792], [-2.25, 4.8541, 3.5267], [-2.25, 2.7109, 3.9005]], collide: 1}
      - {kind: loft, a: [[-2.75, 2.375, 4.1136], [-2.75, 3.0, 5.1962], [-2.75, 0.8901, 4.6659]], b: [[-2.25, 2.375, 4.1136], [-2.25, 3.0, 5.1962], [-2.25, 0.8901, 4.6659]], collide: 1}
      - {kind: loft, a: [[-2.75, 0.4965, 4.724], [-2.75, 0.6272, 5.9671], [-2.75, -1.0847, 4.6245]], b: [[-2.25, 0.4965, 4.724], [-2.25, 0.6272, 5.9671], [-2.25, -1.0847, 4.6245]], collide: 1}
      - {kind: loft, a: [[-2.75, -1.4678, 4.5175], [-2.75, -1.8541, 5.7063], [-2.75, -2.8718, 3.7835]], b: [[-2.25, -1.4678, 4.5175], [-2.25, -1.8541, 5.7063], [-2.25, -2.8718, 3.7835]], collide: 1}
      - {kind: loft, a: [[-2.75, -3.1784, 3.5299], [-2.75, -4.0148, 4.4589], [-2.75, -4.1625, 2.2883]], b: [[-2.25, -3.1784, 3.5299], [-2.25, -4.0148, 4.4589], [-2.25, -4.1625, 2.2883]], collide: 1}
      - {kind: loft, a: [[-2.75, -4.3393, 1.932], [-2.75, -5.4813, 2.4404], [-2.75, -4.7333, 0.3975]], b: [[-2.25, -4.3393, 1.932], [-2.25, -5.4813, 2.4404], [-2.25, -4.7333, 0.3975]], collide: 1}
      - {kind: loft, a: [[-2.75, -4.75, 0.0], [-2.75, -6.0, 0.0], [-2.75, -4.4858, -1.5621]], b: [[-2.25, -4.75, 0.0], [-2.25, -6.0, 0.0], [-2.25, -4.4858, -1.5621]], collide: 1}
      - {kind: loft, a: [[-2.75, -4.3393, -1.932], [-2.75, -5.4813, -2.4404], [-2.75, -3.4626, -3.2516]], b: [[-2.25, -4.3393, -1.932], [-2.25, -5.4813, -2.4404], [-2.25, -3.4626, -3.2516]], collide: 1}
      - {kind: loft, a: [[-2.75, -3.1784, -3.5299], [-2.75, -4.0148, -4.4589], [-2.75, -1.8407, -4.3788]], b: [[-2.25, -3.1784, -3.5299], [-2.25, -4.0148, -4.4589], [-2.25, -1.8407, -4.3788]], collide: 1}
      - {kind: loft, a: [[-2.75, -1.4678, -4.5175], [-2.75, -1.8541, -5.7063], [-2.75, 0.0995, -4.749]], b: [[-2.25, -1.4678, -4.5175], [-2.25, -1.8541, -5.7063], [-2.25, 0.0995, -4.749]], collide: 1}
      - {kind: loft, a: [[-2.75, 0.4965, -4.724], [-2.75, 0.6272, -5.9671], [-2.75, 2.0225, -4.2979]], b: [[-2.25, 0.4965, -4.724], [-2.25, 0.6272, -5.9671], [-2.25, 2.0225, -4.2979]], collide: 1}
      - {kind: loft, a: [[-2.75, 2.375, -4.1136], [-2.75, 3.0, -5.1962], [-2.75, 3.5957, -3.1037]], b: [[-2.25, 2.375, -4.1136], [-2.25, 3.0, -5.1962], [-2.25, 3.5957, -3.1037]], collide: 1}
      - {kind: loft, a: [[-2.75, 3.8428, -2.792], [-2.75, 4.8541, -3.5267], [-2.75, 4.5473, -1.3729]], b: [[-2.25, 3.8428, -2.792], [-2.25, 4.8541, -3.5267], [-2.25, 4.5473, -1.3729]], collide: 1}
      - {kind: loft, a: [[-2.75, 4.6462, -0.9876], [-2.75, 5.8689, -1.2475], [-2.75, 4.7125, 0.5953]], b: [[-2.25, 4.6462, -0.9876], [-2.25, 5.8689, -1.2475], [-2.25, 4.7125, 0.5953]], collide: 1}
      - {kind: loft, a: [[-2.75, 4.2, 0.0], [-2.75, 4.8, 0.0], [-2.75, 4.6951, 0.998], [-2.75, 4.1082, 0.8732]], b: [[-2.25, 4.2, 0.0], [-2.25, 4.8, 0.0], [-2.25, 4.6951, 0.998], [-2.25, 4.1082, 0.8732]]}
      - {kind: loft, a: [[-2.75, 4.1082, 0.8732], [-2.75, 4.6951, 0.998], [-2.75, 4.385, 1.9523], [-2.75, 3.8369, 1.7083]], b: [[-2.25, 4.1082, 0.8732], [-2.25, 4.6951, 0.998], [-2.25, 4.385, 1.9523], [-2.25, 3.8369, 1.7083]]}
      - {kind: loft, a: [[-2.75, 3.8369, 1.7083], [-2.75, 4.385, 1.9523], [-2.75, 3.8833, 2.8214], [-2.75, 3.3979, 2.4687]], b: [[-2.25, 3.8369, 1.7083], [-2.25, 4.385, 1.9523], [-2.25, 3.8833, 2.8214], [-2.25, 3.3979, 2.4687]]}
      - {kind: loft, a: [[-2.75, 3.3979, 2.4687], [-2.75, 3.8833, 2.8214], [-2.75, 3.2118, 3.5671], [-2.75, 2.8103, 3.1212]], b: [[-2.25, 3.3979, 2.4687], [-2.25, 3.8833, 2.8214], [-2.25, 3.2118, 3.5671], [-2.25, 2.8103, 3.1212]]}
      - {kind: loft, a: [[-2.75, 2.8103, 3.1212], [-2.75, 3.2118, 3.5671], [-2.75, 2.4, 4.1569], [-2.75, 2.1, 3.6373]], b: [[-2.25, 2.8103, 3.1212], [-2.25, 3.2118, 3.5671], [-2.25, 2.4, 4.1569], [-2.25, 2.1, 3.6373]]}
      - {kind: loft, a: [[-2.75, 2.1, 3.6373], [-2.75, 2.4, 4.1569], [-2.75, 1.4833, 4.5651], [-2.75, 1.2979, 3.9944]], b: [[-2.25, 2.1, 3.6373], [-2.25, 2.4, 4.1569], [-2.25, 1.4833, 4.5651], [-2.25, 1.2979, 3.9944]]}
      - {kind: loft, a: [[-2.75, 1.2979, 3.9944], [-2.75, 1.4833, 4.5651], [-2.75, 0.5017, 4.7737], [-2.75, 0.439, 4.177]], b: [[-2.25, 1.2979, 3.9944], [-2.25, 1.4833, 4.5651], [-2.25, 0.5017, 4.7737], [-2.25, 0.439, 4.177]]}
      - {kind: loft, a: [[-2.75, 0.439, 4.177], [-2.75, 0.5017, 4.7737], [-2.75, -0.5017, 4.7737], [-2.75, -0.439, 4.177]], b: [[-2.25, 0.439, 4.177], [-2.25, 0.5017, 4.7737], [-2.25, -0.5017, 4.7737], [-2.25, -0.439, 4.177]]}
      - {kind: loft, a: [[-2.75, -0.439, 4.177], [-2.75, -0.5017, 4.7737], [-2.75, -1.4833, 4.5651], [-2.75, -1.2979, 3.9944]], b: [[-2.25, -0.439, 4.177], [-2.25, -0.5017, 4.7737], [-2.25, -1.4833, 4.5651], [-2.25, -1.2979, 3.9944]]}
      - {kind: loft, a: [[-2.75, -1.2979, 3.9944], [-2.75, -1.4833, 4.5651], [-2.75, -2.4, 4.1569], [-2.75, -2.1, 3.6373]], b: [[-2.25, -1.2979, 3.9944], [-2.25, -1.4833, 4.5651], [-2.25, -2.4, 4.1569], [-2.25, -2.1, 3.6373]]}
      - {kind: loft, a: [[-2.75, -2.1, 3.6373], [-2.75, -2.4, 4.1569], [-2.75, -3.2118, 3.5671], [-2.75, -2.8103, 3.1212]], b: [[-2.25, -2.1, 3.6373], [-2.25, -2.4, 4.1569], [-2.25, -3.2118, 3.5671], [-2.25, -2.8103, 3.1212]]}
      - {kind: loft, a: [[-2.75, -2.8103, 3.1212], [-2.75, -3.2118, 3.5671], [-2.75, -3.8833, 2.8214], [-2.75, -3.3979, 2.4687]], b: [[-2.25, -2.8103, 3.1212], [-2.25, -3.2118, 3.5671], [-2.25, -3.8833, 2.8214], [-2.25, -3.3979, 2.4687]]}
      - {kind: loft, a: [[-2.75, -3.3979, 2.4687], [-2.75, -3.8833, 2.8214], [-2.75, -4.385, 1.9523], [-2.75, -3.8369, 1.7083]], b: [[-2.25, -3.3979, 2.4687], [-2.25, -3.8833, 2.8214], [-2.25, -4.385, 1.9523], [-2.25, -3.8369, 1.7083]]}
      - {kind: loft, a: [[-2.75, -3.8369, 1.7083], [-2.75, -4.385, 1.9523], [-2.75, -4.6951, 0.998], [-2.75, -4.1082, 0.8732]], b: [[-2.25, -3.8369, 1.7083], [-2.25, -4.385, 1.9523], [-2.25, -4.6951, 0.998], [-2.25, -4.1082, 0.8732]]}
      - {kind: loft, a: [[-2.75, -4.1082, 0.8732], [-2.75, -4.6951, 0.998], [-2.75, -4.8, 0.0], [-2.75, -4.2, 0.0]], b: [[-2.25, -4.1082, 0.8732], [-2.25, -4.6951, 0.998], [-2.25, -4.8, 0.0], [-2.25, -4.2, 0.0]]}
      - {kind: loft, a: [[-2.75, -4.2, 0.0], [-2.75, -4.8, 0.0], [-2.75, -4.6951, -0.998], [-2.75, -4.1082, -0.8732]], b: [[-2.25, -4.2, 0.0], [-2.25, -4.8, 0.0], [-2.25, -4.6951, -0.998], [-2.25, -4.1082, -0.8732]]}
      - {kind: loft, a: [[-2.75, -4.1082, -0.8732], [-2.75, -4.6951, -0.998], [-2.75, -4.385, -1.9523], [-2.75, -3.8369, -1.7083]], b: [[-2.25, -4.1082, -0.8732], [-2.25, -4.6951, -0.998], [-2.25, -4.385, -1.9523], [-2.25, -3.8369, -1.7083]]}
      - {kind: loft, a: [[-2.75, -3.8369, -1.7083], [-2.75, -4.385, -1.9523], [-2.75, -3.8833, -2.8214], [-2.75, -3.3979, -2.4687]], b: [[-2.25, -3.8369, -1.7083], [-2.25, -4.385, -1.9523], [-2.25, -3.8833, -2.8214], [-2.25, -3.3979, -2.4687]]}
      - {kind: loft, a: [[-2.75, -3.3979, -2.4687], [-2.75, -3.8833, -2.8214], [-2.75, -3.2118, -3.5671], [-2.75, -2.8103, -3.1212]], b: [[-2.25, -3.3979, -2.4687], [-2.25, -3.8833, -2.8214], [-2.25, -3.2118, -3.5671], [-2.25, -2.8103, -3.1212]]}
      - {kind: loft, a: [[-2.75, -2.8103, -3.1212], [-2.75, -3.2118, -3.5671], [-2.75, -2.4, -4.1569], [-2.75, -2.1, -3.6373]], b: [[-2.25, -2.8103, -3.1212], [-2.25, -3.2118, -3.5671], [-2.25, -2.4, -4.1569], [-2.25, -2.1, -3.6373]]}
      - {kind: loft, a: [[-2.75, -2.1, -3.6373], [-2.75, -2.4, -4.1569], [-2.75, -1.4833, -4.5651], [-2.75, -1.2979, -3.9944]], b: [[-2.25, -2.1, -3.6373], [-2.25, -2.4, -4.1569], [-2.25, -1.4833, -4.5651], [-2.25, -1.2979, -3.9944]]}
      - {kind: loft, a: [[-2.75, -1.2979, -3.9944], [-2.75, -1.4833, -4.5651], [-2.75, -0.5017, -4.7737], [-2.75, -0.439, -4.177]], b: [[-2.25, -1.2979, -3.9944], [-2.25, -1.4833, -4.5651], [-2.25, -0.5017, -4.7737], [-2.25, -0.439, -4.177]]}
      - {kind: loft, a: [[-2.75, -0.439, -4.177], [-2.75, -0.5017, -4.7737], [-2.75, 0.5017, -4.7737], [-2.75, 0.439, -4.177]], b: [[-2.25, -0.439, -4.177], [-2.25, -0.5017, -4.7737], [-2.25, 0.5017, -4.7737], [-2.25, 0.439, -4.177]]}
      - {kind: loft, a: [[-2.75, 0.439, -4.177], [-2.75, 0.5017, -4.7737], [-2.75, 1.4833, -4.5651], [-2.75, 1.2979, -3.9944]], b: [[-2.25, 0.439, -4.177], [-2.25, 0.5017, -4.7737], [-2.25, 1.4833, -4.5651], [-2.25, 1.2979, -3.9944]]}
      - {kind: loft, a: [[-2.75, 1.2979, -3.9944], [-2.75, 1.4833, -4.5651], [-2.75, 2.4, -4.1569], [-2.75, 2.1, -3.6373]], b: [[-2.25, 1.2979, -3.9944], [-2.25, 1.4833, -4.5651], [-2.25, 2.4, -4.1569], [-2.25, 2.1, -3.6373]]}
      - {kind: loft, a: [[-2.75, 2.1, -3.6373], [-2.75, 2.4, -4.1569], [-2.75, 3.2118, -3.5671], [-2.75, 2.8103, -3.1212]], b: [[-2.25, 2.1, -3.6373], [-2.25, 2.4, -4.1569], [-2.25, 3.2118, -3.5671], [-2.25, 2.8103, -3.1212]]}
      - {kind: loft, a: [[-2.75, 2.8103, -3.1212], [-2.75, 3.2118, -3.5671], [-2.75, 3.8833, -2.8214], [-2.75, 3.3979, -2.4687]], b: [[-2.25, 2.8103, -3.1212], [-2.25, 3.2118, -3.5671], [-2.25, 3.8833, -2.8214], [-2.25, 3.3979, -2.4687]]}
      - {kind: loft, a: [[-2.75, 3.3979, -2.4687], [-2.75, 3.8833, -2.8214], [-2.75, 4.385, -1.9523], [-2.75, 3.8369, -1.7083]], b: [[-2.25, 3.3979, -2.4687], [-2.25, 3.8833, -2.8214], [-2.25, 4.385, -1.9523], [-2.25, 3.8369, -1.7083]]}
      - {kind: loft, a: [[-2.75, 3.8369, -1.7083], [-2.75, 4.385, -1.9523], [-2.75, 4.6951, -0.998], [-2.75, 4.1082, -0.8732]], b: [[-2.25, 3.8369, -1.7083], [-2.25, 4.385, -1.9523], [-2.25, 4.6951, -0.998], [-2.25, 4.1082, -0.8732]]}
      - {kind: loft, a: [[-2.75, 4.1082, -0.8732], [-2.75, 4.6951, -0.998], [-2.75, 4.8, -0.0], [-2.75, 4.2, -0.0]], b: [[-2.25, 4.1082, -0.8732], [-2.25, 4.6951, -0.998], [-2.25, 4.8, -0.0], [-2.25, 4.2, -0.0]]}
      - {kind: rod, from: [-2.5, 0.5526, 0.2337], to: [-2.5, 3.9606, 1.6745], radius: 0.22}
      - {kind: rod, from: [-2.5, -0.2337, 0.5526], to: [-2.5, -1.6745, 3.9606], radius: 0.22}
      - {kind: rod, from: [-2.5, -0.5526, -0.2337], to: [-2.5, -3.9606, -1.6745], radius: 0.22}
      - {kind: rod, from: [-2.5, 0.2337, -0.5526], to: [-2.5, 1.6745, -3.9606], radius: 0.22}
  - id: pallet
    shape: part
    pos: [0, 0, -6.0]
    friction: 0.1
    color: "#d9cfba"
    pieces:
      - {kind: poly, points: [[-3.0, -6.0], [-2.8978, -6.7765], [-2.5981, -7.5], [-2.1213, -8.1213], [-1.5, -8.5981], [-0.7765, -8.8978], [-0.0, -9.0], [0.7765, -8.8978], [1.5, -8.5981], [2.1213, -8.1213], [2.5981, -7.5], [2.8978, -6.7765], [3.0, -6.0]], y: [-0.15, 0.15], collide: 2}   # the half-disc pallet, its straight edge up
      - {kind: rod, from: [0, -2.5, -6.0], to: [0, 2.5, -6.0], radius: 0.25, color: "#8f8a80"}   # its arbor
      - {kind: rod, from: [0, 0, -8.8], to: [0, 0, -16.0], radius: 0.18}   # the pendulum's rod
      - {kind: rod, from: [0, -0.5, -16.0], to: [0, 0.5, -16.0], radius: 1.8, color: "#8f8a80"}   # its bob
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[3.5, -0.6], [4.1, -0.6], [4.1, 0.6], [3.5, 0.6]], y: [-0.6, 0.6]}   # the wheels' bearings
      - {kind: poly, points: [[-4.1, -0.6], [-3.5, -0.6], [-3.5, 0.6], [-4.1, 0.6]], y: [-0.6, 0.6]}
      - {kind: poly, points: [[-0.6, -6.6], [0.6, -6.6], [0.6, -5.4], [-0.6, -5.4]], y: [2.6, 3.2]}   # the pallet's bearing
joints:
  - {id: j_wheels, type: hinge, body: wheels, axis: [1, 0, 0], damping: 0.0005}   # the one driven joint; +: the lowest teeth go + y
  - {id: j_pend, type: hinge, body: pallet, axis: [0, 1, 0], damping: 0.0003}   # the pallet and pendulum
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
# The weight: a constant torque on the wheels' arbor. Nothing else is driven.
driver: {joint: j_wheels, kind: torque, torque: 0.002, max_torque: 0.01}
checks:
  - {type: advance, joint: j_wheels, beat: j_pend, expect: 0.20944, tol: 0.05, settle_s: 2, window_s: 7.5}   # half a tooth (2 pi / 15 / 2) a beat
  - {type: period, joint: j_pend, expect_s: 0.6253, tol: 0.12, settle_s: 2, window_s: 7.5}
  - {type: amplitude, joint: j_pend, min: 0.1, max: 0.6, sustain: 0.85, settle_s: 2, window_s: 7.5}
  - {type: penetration, max: 0.001, settle_s: 1}
camera: {target: [0, 0, -2.5], position: [-40.0, -9.0, 1.0], fov: 34}
display:
  output: j_pend
  swing: j_pend
  labels: {j_wheels: "Escape-wheels (weight)", j_pend: "Pallet and pendulum"}
  proof: {label: "Pallet out of contact", sub: "nothing keeps the pendulum going, so it hangs still, and the weight spins the wheels freely"}

