# No. 64 (Brown 1868): "Another arrangement of jumping motion."
#
# As drawn (cm; the drawing plane is x-z, depth y, the cam in front): No. 31's worm (the one motor-driven
# shaft) turns the worm-gear B (30 teeth). On B's shaft, in front, a pin; over the shaft a hollow shaft
# carrying the cam A, an eccentric disc (offset 1.2, radius 2.6); a short piece of the hollow shaft is half
# cut away (the remaining arc 2.3416 rad), so the pin turns it one way only and has a free half-turn in
# the cut-away part. A roller on a lever, pressed down by a spring (the joint's spring), bears on A.
# The pin carries A from its low point up to its high point, the spring holding A back against the pin;
# a little past the top the spring throws A forward half a turn, ahead of the pin, onto its low point,
# where it rests until the pin comes round to the sleeve again: a jump each turn of B.
# Generator: opencode-runs/batch7/gen064.py.
number: 64
slug: jumping-motion-worm-cam
name: Jumping motion by a worm-gear, pin and cam
brown: "Another arrangement of jumping motion. Motion is communicated to worm-gear, B, by worm or endless screw at the bottom, which is fixed upon the driving-shaft. Upon the shaft carrying the worm-gear works another hollow shaft, on which is fixed cam, A. A short piece of this hollow shaft is half cut away. A pin fixed in worm-gear shaft turns hollow shaft and cam, the spring which presses on cam holding hollow shaft back against the pin until it arrives a little further than shown in the figure, when the spring will force the cam forward independently of the pin, and give a sudden jump."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: true
  duration_s: 12
  floor: false
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    color: "#e8dec6"
    pieces:
      - {kind: disc, center: [0, 0], radius: 6.4, inner: 0.6, y: [0.42, 0.9]}   # B's web, behind its teeth
      - {kind: rod, from: [0, -9.2, 0], to: [0, 2.2, 0], radius: 0.5, color: "#8f8a80"}   # B's shaft, out through the hollow shaft
      - {kind: rod, from: [0.3, -8.0, 0], to: [1.9, -8.0, 0], radius: 0.3, capsule: true, collide: 1, color: "#6b5a44"}   # the pin, fixed in the shaft
  - id: worm
    shape: part
    pos: [0, 0, -9.1]
    density: 7800
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: rod, from: [-2.75, 0, -9.1], to: [2.75, 0, -9.1], radius: 0.98, collide: 0}   # the worm's core
      - {kind: rod, from: [-9, 0, -9.1], to: [9, 0, -9.1], radius: 0.5, collide: 0}          # its shaft
      - {kind: loft, a: [[-2.89387, 0.975, -9.1], [-1.81851, 0.975, -9.1], [-2.22798, 2.1, -9.1], [-2.48441, 2.1, -9.1]], b: [[-2.82843, 0.94178, -8.84765], [-1.75306, 0.94178, -8.84765], [-2.16253, 2.02844, -8.55648], [-2.41896, 2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[-2.82843, 0.94178, -8.84765], [-1.75306, 0.94178, -8.84765], [-2.16253, 2.02844, -8.55648], [-2.41896, 2.02844, -8.55648]], b: [[-2.76298, 0.84437, -8.6125], [-1.68761, 0.84437, -8.6125], [-2.09708, 1.81865, -8.05], [-2.35351, 1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[-2.76298, 0.84437, -8.6125], [-1.68761, 0.84437, -8.6125], [-2.09708, 1.81865, -8.05], [-2.35351, 1.81865, -8.05]], b: [[-2.69753, 0.68943, -8.41057], [-1.62216, 0.68943, -8.41057], [-2.03163, 1.48492, -7.61508], [-2.28806, 1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[-2.69753, 0.68943, -8.41057], [-1.62216, 0.68943, -8.41057], [-2.03163, 1.48492, -7.61508], [-2.28806, 1.48492, -7.61508]], b: [[-2.63208, 0.4875, -8.25563], [-1.55671, 0.4875, -8.25563], [-1.96618, 1.05, -7.28135], [-2.22261, 1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[-2.63208, 0.4875, -8.25563], [-1.55671, 0.4875, -8.25563], [-1.96618, 1.05, -7.28135], [-2.22261, 1.05, -7.28135]], b: [[-2.56663, 0.25235, -8.15822], [-1.49126, 0.25235, -8.15822], [-1.90073, 0.54352, -7.07156], [-2.15716, 0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[-2.56663, 0.25235, -8.15822], [-1.49126, 0.25235, -8.15822], [-1.90073, 0.54352, -7.07156], [-2.15716, 0.54352, -7.07156]], b: [[-2.50118, 0.0, -8.125], [-1.42581, 0.0, -8.125], [-1.83528, 0.0, -7.0], [-2.09171, 0.0, -7.0]], collide: 1}
      - {kind: loft, a: [[-2.50118, 0.0, -8.125], [-1.42581, 0.0, -8.125], [-1.83528, 0.0, -7.0], [-2.09171, 0.0, -7.0]], b: [[-2.43573, -0.25235, -8.15822], [-1.36037, -0.25235, -8.15822], [-1.76983, -0.54352, -7.07156], [-2.02626, -0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[-2.43573, -0.25235, -8.15822], [-1.36037, -0.25235, -8.15822], [-1.76983, -0.54352, -7.07156], [-2.02626, -0.54352, -7.07156]], b: [[-2.37028, -0.4875, -8.25563], [-1.29492, -0.4875, -8.25563], [-1.70438, -1.05, -7.28135], [-1.96081, -1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[-2.37028, -0.4875, -8.25563], [-1.29492, -0.4875, -8.25563], [-1.70438, -1.05, -7.28135], [-1.96081, -1.05, -7.28135]], b: [[-2.30483, -0.68943, -8.41057], [-1.22947, -0.68943, -8.41057], [-1.63893, -1.48492, -7.61508], [-1.89536, -1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[-2.30483, -0.68943, -8.41057], [-1.22947, -0.68943, -8.41057], [-1.63893, -1.48492, -7.61508], [-1.89536, -1.48492, -7.61508]], b: [[-2.23938, -0.84437, -8.6125], [-1.16402, -0.84437, -8.6125], [-1.57348, -1.81865, -8.05], [-1.82991, -1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[-2.23938, -0.84437, -8.6125], [-1.16402, -0.84437, -8.6125], [-1.57348, -1.81865, -8.05], [-1.82991, -1.81865, -8.05]], b: [[-2.17393, -0.94178, -8.84765], [-1.09857, -0.94178, -8.84765], [-1.50803, -2.02844, -8.55648], [-1.76446, -2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[-2.17393, -0.94178, -8.84765], [-1.09857, -0.94178, -8.84765], [-1.50803, -2.02844, -8.55648], [-1.76446, -2.02844, -8.55648]], b: [[-2.10848, -0.975, -9.1], [-1.03312, -0.975, -9.1], [-1.44258, -2.1, -9.1], [-1.69901, -2.1, -9.1]], collide: 1}
      - {kind: loft, a: [[-2.10848, -0.975, -9.1], [-1.03312, -0.975, -9.1], [-1.44258, -2.1, -9.1], [-1.69901, -2.1, -9.1]], b: [[-2.04303, -0.94178, -9.35235], [-0.96767, -0.94178, -9.35235], [-1.37713, -2.02844, -9.64352], [-1.63356, -2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[-2.04303, -0.94178, -9.35235], [-0.96767, -0.94178, -9.35235], [-1.37713, -2.02844, -9.64352], [-1.63356, -2.02844, -9.64352]], b: [[-1.97758, -0.84437, -9.5875], [-0.90222, -0.84437, -9.5875], [-1.31168, -1.81865, -10.15], [-1.56811, -1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[-1.97758, -0.84437, -9.5875], [-0.90222, -0.84437, -9.5875], [-1.31168, -1.81865, -10.15], [-1.56811, -1.81865, -10.15]], b: [[-1.91213, -0.68943, -9.78943], [-0.83677, -0.68943, -9.78943], [-1.24623, -1.48492, -10.58492], [-1.50266, -1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[-1.91213, -0.68943, -9.78943], [-0.83677, -0.68943, -9.78943], [-1.24623, -1.48492, -10.58492], [-1.50266, -1.48492, -10.58492]], b: [[-1.84668, -0.4875, -9.94437], [-0.77132, -0.4875, -9.94437], [-1.18078, -1.05, -10.91865], [-1.43721, -1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[-1.84668, -0.4875, -9.94437], [-0.77132, -0.4875, -9.94437], [-1.18078, -1.05, -10.91865], [-1.43721, -1.05, -10.91865]], b: [[-1.78123, -0.25235, -10.04178], [-0.70587, -0.25235, -10.04178], [-1.11533, -0.54352, -11.12844], [-1.37176, -0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[-1.78123, -0.25235, -10.04178], [-0.70587, -0.25235, -10.04178], [-1.11533, -0.54352, -11.12844], [-1.37176, -0.54352, -11.12844]], b: [[-1.71578, -0.0, -10.075], [-0.64042, -0.0, -10.075], [-1.04988, -0.0, -11.2], [-1.30631, -0.0, -11.2]], collide: 1}
      - {kind: loft, a: [[-1.71578, -0.0, -10.075], [-0.64042, -0.0, -10.075], [-1.04988, -0.0, -11.2], [-1.30631, -0.0, -11.2]], b: [[-1.65033, 0.25235, -10.04178], [-0.57497, 0.25235, -10.04178], [-0.98443, 0.54352, -11.12844], [-1.24086, 0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[-1.65033, 0.25235, -10.04178], [-0.57497, 0.25235, -10.04178], [-0.98443, 0.54352, -11.12844], [-1.24086, 0.54352, -11.12844]], b: [[-1.58488, 0.4875, -9.94437], [-0.50952, 0.4875, -9.94437], [-0.91898, 1.05, -10.91865], [-1.17541, 1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[-1.58488, 0.4875, -9.94437], [-0.50952, 0.4875, -9.94437], [-0.91898, 1.05, -10.91865], [-1.17541, 1.05, -10.91865]], b: [[-1.51943, 0.68943, -9.78943], [-0.44407, 0.68943, -9.78943], [-0.85353, 1.48492, -10.58492], [-1.10996, 1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[-1.51943, 0.68943, -9.78943], [-0.44407, 0.68943, -9.78943], [-0.85353, 1.48492, -10.58492], [-1.10996, 1.48492, -10.58492]], b: [[-1.45398, 0.84437, -9.5875], [-0.37862, 0.84437, -9.5875], [-0.78808, 1.81865, -10.15], [-1.04451, 1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[-1.45398, 0.84437, -9.5875], [-0.37862, 0.84437, -9.5875], [-0.78808, 1.81865, -10.15], [-1.04451, 1.81865, -10.15]], b: [[-1.38853, 0.94178, -9.35235], [-0.31317, 0.94178, -9.35235], [-0.72263, 2.02844, -9.64352], [-0.97906, 2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[-1.38853, 0.94178, -9.35235], [-0.31317, 0.94178, -9.35235], [-0.72263, 2.02844, -9.64352], [-0.97906, 2.02844, -9.64352]], b: [[-1.32308, 0.975, -9.1], [-0.24772, 0.975, -9.1], [-0.65718, 2.1, -9.1], [-0.91361, 2.1, -9.1]], collide: 1}
      - {kind: loft, a: [[-1.32308, 0.975, -9.1], [-0.24772, 0.975, -9.1], [-0.65718, 2.1, -9.1], [-0.91361, 2.1, -9.1]], b: [[-1.25763, 0.94178, -8.84765], [-0.18227, 0.94178, -8.84765], [-0.59173, 2.02844, -8.55648], [-0.84816, 2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[-1.25763, 0.94178, -8.84765], [-0.18227, 0.94178, -8.84765], [-0.59173, 2.02844, -8.55648], [-0.84816, 2.02844, -8.55648]], b: [[-1.19218, 0.84437, -8.6125], [-0.11682, 0.84437, -8.6125], [-0.52628, 1.81865, -8.05], [-0.78271, 1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[-1.19218, 0.84437, -8.6125], [-0.11682, 0.84437, -8.6125], [-0.52628, 1.81865, -8.05], [-0.78271, 1.81865, -8.05]], b: [[-1.12673, 0.68943, -8.41057], [-0.05137, 0.68943, -8.41057], [-0.46083, 1.48492, -7.61508], [-0.71726, 1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[-1.12673, 0.68943, -8.41057], [-0.05137, 0.68943, -8.41057], [-0.46083, 1.48492, -7.61508], [-0.71726, 1.48492, -7.61508]], b: [[-1.06128, 0.4875, -8.25563], [0.01408, 0.4875, -8.25563], [-0.39538, 1.05, -7.28135], [-0.65181, 1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[-1.06128, 0.4875, -8.25563], [0.01408, 0.4875, -8.25563], [-0.39538, 1.05, -7.28135], [-0.65181, 1.05, -7.28135]], b: [[-0.99583, 0.25235, -8.15822], [0.07953, 0.25235, -8.15822], [-0.32993, 0.54352, -7.07156], [-0.58636, 0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[-0.99583, 0.25235, -8.15822], [0.07953, 0.25235, -8.15822], [-0.32993, 0.54352, -7.07156], [-0.58636, 0.54352, -7.07156]], b: [[-0.93038, 0.0, -8.125], [0.14498, 0.0, -8.125], [-0.26449, 0.0, -7.0], [-0.52091, 0.0, -7.0]], collide: 1}
      - {kind: loft, a: [[-0.93038, 0.0, -8.125], [0.14498, 0.0, -8.125], [-0.26449, 0.0, -7.0], [-0.52091, 0.0, -7.0]], b: [[-0.86493, -0.25235, -8.15822], [0.21043, -0.25235, -8.15822], [-0.19904, -0.54352, -7.07156], [-0.45546, -0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[-0.86493, -0.25235, -8.15822], [0.21043, -0.25235, -8.15822], [-0.19904, -0.54352, -7.07156], [-0.45546, -0.54352, -7.07156]], b: [[-0.79948, -0.4875, -8.25563], [0.27588, -0.4875, -8.25563], [-0.13359, -1.05, -7.28135], [-0.39001, -1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[-0.79948, -0.4875, -8.25563], [0.27588, -0.4875, -8.25563], [-0.13359, -1.05, -7.28135], [-0.39001, -1.05, -7.28135]], b: [[-0.73403, -0.68943, -8.41057], [0.34133, -0.68943, -8.41057], [-0.06814, -1.48492, -7.61508], [-0.32456, -1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[-0.73403, -0.68943, -8.41057], [0.34133, -0.68943, -8.41057], [-0.06814, -1.48492, -7.61508], [-0.32456, -1.48492, -7.61508]], b: [[-0.66858, -0.84437, -8.6125], [0.40678, -0.84437, -8.6125], [-0.00269, -1.81865, -8.05], [-0.25911, -1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[-0.66858, -0.84437, -8.6125], [0.40678, -0.84437, -8.6125], [-0.00269, -1.81865, -8.05], [-0.25911, -1.81865, -8.05]], b: [[-0.60313, -0.94178, -8.84765], [0.47223, -0.94178, -8.84765], [0.06276, -2.02844, -8.55648], [-0.19366, -2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[-0.60313, -0.94178, -8.84765], [0.47223, -0.94178, -8.84765], [0.06276, -2.02844, -8.55648], [-0.19366, -2.02844, -8.55648]], b: [[-0.53768, -0.975, -9.1], [0.53768, -0.975, -9.1], [0.12821, -2.1, -9.1], [-0.12821, -2.1, -9.1]], collide: 1}
      - {kind: loft, a: [[-0.53768, -0.975, -9.1], [0.53768, -0.975, -9.1], [0.12821, -2.1, -9.1], [-0.12821, -2.1, -9.1]], b: [[-0.47223, -0.94178, -9.35235], [0.60313, -0.94178, -9.35235], [0.19366, -2.02844, -9.64352], [-0.06276, -2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[-0.47223, -0.94178, -9.35235], [0.60313, -0.94178, -9.35235], [0.19366, -2.02844, -9.64352], [-0.06276, -2.02844, -9.64352]], b: [[-0.40678, -0.84437, -9.5875], [0.66858, -0.84437, -9.5875], [0.25911, -1.81865, -10.15], [0.00269, -1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[-0.40678, -0.84437, -9.5875], [0.66858, -0.84437, -9.5875], [0.25911, -1.81865, -10.15], [0.00269, -1.81865, -10.15]], b: [[-0.34133, -0.68943, -9.78943], [0.73403, -0.68943, -9.78943], [0.32456, -1.48492, -10.58492], [0.06814, -1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[-0.34133, -0.68943, -9.78943], [0.73403, -0.68943, -9.78943], [0.32456, -1.48492, -10.58492], [0.06814, -1.48492, -10.58492]], b: [[-0.27588, -0.4875, -9.94437], [0.79948, -0.4875, -9.94437], [0.39001, -1.05, -10.91865], [0.13359, -1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[-0.27588, -0.4875, -9.94437], [0.79948, -0.4875, -9.94437], [0.39001, -1.05, -10.91865], [0.13359, -1.05, -10.91865]], b: [[-0.21043, -0.25235, -10.04178], [0.86493, -0.25235, -10.04178], [0.45546, -0.54352, -11.12844], [0.19904, -0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[-0.21043, -0.25235, -10.04178], [0.86493, -0.25235, -10.04178], [0.45546, -0.54352, -11.12844], [0.19904, -0.54352, -11.12844]], b: [[-0.14498, -0.0, -10.075], [0.93038, -0.0, -10.075], [0.52091, -0.0, -11.2], [0.26449, -0.0, -11.2]], collide: 1}
      - {kind: loft, a: [[-0.14498, -0.0, -10.075], [0.93038, -0.0, -10.075], [0.52091, -0.0, -11.2], [0.26449, -0.0, -11.2]], b: [[-0.07953, 0.25235, -10.04178], [0.99583, 0.25235, -10.04178], [0.58636, 0.54352, -11.12844], [0.32993, 0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[-0.07953, 0.25235, -10.04178], [0.99583, 0.25235, -10.04178], [0.58636, 0.54352, -11.12844], [0.32993, 0.54352, -11.12844]], b: [[-0.01408, 0.4875, -9.94437], [1.06128, 0.4875, -9.94437], [0.65181, 1.05, -10.91865], [0.39538, 1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[-0.01408, 0.4875, -9.94437], [1.06128, 0.4875, -9.94437], [0.65181, 1.05, -10.91865], [0.39538, 1.05, -10.91865]], b: [[0.05137, 0.68943, -9.78943], [1.12673, 0.68943, -9.78943], [0.71726, 1.48492, -10.58492], [0.46083, 1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[0.05137, 0.68943, -9.78943], [1.12673, 0.68943, -9.78943], [0.71726, 1.48492, -10.58492], [0.46083, 1.48492, -10.58492]], b: [[0.11682, 0.84437, -9.5875], [1.19218, 0.84437, -9.5875], [0.78271, 1.81865, -10.15], [0.52628, 1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[0.11682, 0.84437, -9.5875], [1.19218, 0.84437, -9.5875], [0.78271, 1.81865, -10.15], [0.52628, 1.81865, -10.15]], b: [[0.18227, 0.94178, -9.35235], [1.25763, 0.94178, -9.35235], [0.84816, 2.02844, -9.64352], [0.59173, 2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[0.18227, 0.94178, -9.35235], [1.25763, 0.94178, -9.35235], [0.84816, 2.02844, -9.64352], [0.59173, 2.02844, -9.64352]], b: [[0.24772, 0.975, -9.1], [1.32308, 0.975, -9.1], [0.91361, 2.1, -9.1], [0.65718, 2.1, -9.1]], collide: 1}
      - {kind: loft, a: [[0.24772, 0.975, -9.1], [1.32308, 0.975, -9.1], [0.91361, 2.1, -9.1], [0.65718, 2.1, -9.1]], b: [[0.31317, 0.94178, -8.84765], [1.38853, 0.94178, -8.84765], [0.97906, 2.02844, -8.55648], [0.72263, 2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[0.31317, 0.94178, -8.84765], [1.38853, 0.94178, -8.84765], [0.97906, 2.02844, -8.55648], [0.72263, 2.02844, -8.55648]], b: [[0.37862, 0.84437, -8.6125], [1.45398, 0.84437, -8.6125], [1.04451, 1.81865, -8.05], [0.78808, 1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[0.37862, 0.84437, -8.6125], [1.45398, 0.84437, -8.6125], [1.04451, 1.81865, -8.05], [0.78808, 1.81865, -8.05]], b: [[0.44407, 0.68943, -8.41057], [1.51943, 0.68943, -8.41057], [1.10996, 1.48492, -7.61508], [0.85353, 1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[0.44407, 0.68943, -8.41057], [1.51943, 0.68943, -8.41057], [1.10996, 1.48492, -7.61508], [0.85353, 1.48492, -7.61508]], b: [[0.50952, 0.4875, -8.25563], [1.58488, 0.4875, -8.25563], [1.17541, 1.05, -7.28135], [0.91898, 1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[0.50952, 0.4875, -8.25563], [1.58488, 0.4875, -8.25563], [1.17541, 1.05, -7.28135], [0.91898, 1.05, -7.28135]], b: [[0.57497, 0.25235, -8.15822], [1.65033, 0.25235, -8.15822], [1.24086, 0.54352, -7.07156], [0.98443, 0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[0.57497, 0.25235, -8.15822], [1.65033, 0.25235, -8.15822], [1.24086, 0.54352, -7.07156], [0.98443, 0.54352, -7.07156]], b: [[0.64042, 0.0, -8.125], [1.71578, 0.0, -8.125], [1.30631, 0.0, -7.0], [1.04988, 0.0, -7.0]], collide: 1}
      - {kind: loft, a: [[0.64042, 0.0, -8.125], [1.71578, 0.0, -8.125], [1.30631, 0.0, -7.0], [1.04988, 0.0, -7.0]], b: [[0.70587, -0.25235, -8.15822], [1.78123, -0.25235, -8.15822], [1.37176, -0.54352, -7.07156], [1.11533, -0.54352, -7.07156]], collide: 1}
      - {kind: loft, a: [[0.70587, -0.25235, -8.15822], [1.78123, -0.25235, -8.15822], [1.37176, -0.54352, -7.07156], [1.11533, -0.54352, -7.07156]], b: [[0.77132, -0.4875, -8.25563], [1.84668, -0.4875, -8.25563], [1.43721, -1.05, -7.28135], [1.18078, -1.05, -7.28135]], collide: 1}
      - {kind: loft, a: [[0.77132, -0.4875, -8.25563], [1.84668, -0.4875, -8.25563], [1.43721, -1.05, -7.28135], [1.18078, -1.05, -7.28135]], b: [[0.83677, -0.68943, -8.41057], [1.91213, -0.68943, -8.41057], [1.50266, -1.48492, -7.61508], [1.24623, -1.48492, -7.61508]], collide: 1}
      - {kind: loft, a: [[0.83677, -0.68943, -8.41057], [1.91213, -0.68943, -8.41057], [1.50266, -1.48492, -7.61508], [1.24623, -1.48492, -7.61508]], b: [[0.90222, -0.84437, -8.6125], [1.97758, -0.84437, -8.6125], [1.56811, -1.81865, -8.05], [1.31168, -1.81865, -8.05]], collide: 1}
      - {kind: loft, a: [[0.90222, -0.84437, -8.6125], [1.97758, -0.84437, -8.6125], [1.56811, -1.81865, -8.05], [1.31168, -1.81865, -8.05]], b: [[0.96767, -0.94178, -8.84765], [2.04303, -0.94178, -8.84765], [1.63356, -2.02844, -8.55648], [1.37713, -2.02844, -8.55648]], collide: 1}
      - {kind: loft, a: [[0.96767, -0.94178, -8.84765], [2.04303, -0.94178, -8.84765], [1.63356, -2.02844, -8.55648], [1.37713, -2.02844, -8.55648]], b: [[1.03312, -0.975, -9.1], [2.10848, -0.975, -9.1], [1.69901, -2.1, -9.1], [1.44258, -2.1, -9.1]], collide: 1}
      - {kind: loft, a: [[1.03312, -0.975, -9.1], [2.10848, -0.975, -9.1], [1.69901, -2.1, -9.1], [1.44258, -2.1, -9.1]], b: [[1.09857, -0.94178, -9.35235], [2.17393, -0.94178, -9.35235], [1.76446, -2.02844, -9.64352], [1.50803, -2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[1.09857, -0.94178, -9.35235], [2.17393, -0.94178, -9.35235], [1.76446, -2.02844, -9.64352], [1.50803, -2.02844, -9.64352]], b: [[1.16402, -0.84437, -9.5875], [2.23938, -0.84437, -9.5875], [1.82991, -1.81865, -10.15], [1.57348, -1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[1.16402, -0.84437, -9.5875], [2.23938, -0.84437, -9.5875], [1.82991, -1.81865, -10.15], [1.57348, -1.81865, -10.15]], b: [[1.22947, -0.68943, -9.78943], [2.30483, -0.68943, -9.78943], [1.89536, -1.48492, -10.58492], [1.63893, -1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[1.22947, -0.68943, -9.78943], [2.30483, -0.68943, -9.78943], [1.89536, -1.48492, -10.58492], [1.63893, -1.48492, -10.58492]], b: [[1.29492, -0.4875, -9.94437], [2.37028, -0.4875, -9.94437], [1.96081, -1.05, -10.91865], [1.70438, -1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[1.29492, -0.4875, -9.94437], [2.37028, -0.4875, -9.94437], [1.96081, -1.05, -10.91865], [1.70438, -1.05, -10.91865]], b: [[1.36037, -0.25235, -10.04178], [2.43573, -0.25235, -10.04178], [2.02626, -0.54352, -11.12844], [1.76983, -0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[1.36037, -0.25235, -10.04178], [2.43573, -0.25235, -10.04178], [2.02626, -0.54352, -11.12844], [1.76983, -0.54352, -11.12844]], b: [[1.42581, 0.0, -10.075], [2.50118, 0.0, -10.075], [2.09171, 0.0, -11.2], [1.83528, 0.0, -11.2]], collide: 1}
      - {kind: loft, a: [[1.42581, 0.0, -10.075], [2.50118, 0.0, -10.075], [2.09171, 0.0, -11.2], [1.83528, 0.0, -11.2]], b: [[1.49126, 0.25235, -10.04178], [2.56663, 0.25235, -10.04178], [2.15716, 0.54352, -11.12844], [1.90073, 0.54352, -11.12844]], collide: 1}
      - {kind: loft, a: [[1.49126, 0.25235, -10.04178], [2.56663, 0.25235, -10.04178], [2.15716, 0.54352, -11.12844], [1.90073, 0.54352, -11.12844]], b: [[1.55671, 0.4875, -9.94437], [2.63208, 0.4875, -9.94437], [2.22261, 1.05, -10.91865], [1.96618, 1.05, -10.91865]], collide: 1}
      - {kind: loft, a: [[1.55671, 0.4875, -9.94437], [2.63208, 0.4875, -9.94437], [2.22261, 1.05, -10.91865], [1.96618, 1.05, -10.91865]], b: [[1.62216, 0.68943, -9.78943], [2.69753, 0.68943, -9.78943], [2.28806, 1.48492, -10.58492], [2.03163, 1.48492, -10.58492]], collide: 1}
      - {kind: loft, a: [[1.62216, 0.68943, -9.78943], [2.69753, 0.68943, -9.78943], [2.28806, 1.48492, -10.58492], [2.03163, 1.48492, -10.58492]], b: [[1.68761, 0.84437, -9.5875], [2.76298, 0.84437, -9.5875], [2.35351, 1.81865, -10.15], [2.09708, 1.81865, -10.15]], collide: 1}
      - {kind: loft, a: [[1.68761, 0.84437, -9.5875], [2.76298, 0.84437, -9.5875], [2.35351, 1.81865, -10.15], [2.09708, 1.81865, -10.15]], b: [[1.75306, 0.94178, -9.35235], [2.82843, 0.94178, -9.35235], [2.41896, 2.02844, -9.64352], [2.16253, 2.02844, -9.64352]], collide: 1}
      - {kind: loft, a: [[1.75306, 0.94178, -9.35235], [2.82843, 0.94178, -9.35235], [2.41896, 2.02844, -9.64352], [2.16253, 2.02844, -9.64352]], b: [[1.81851, 0.975, -9.1], [2.89387, 0.975, -9.1], [2.48441, 2.1, -9.1], [2.22798, 2.1, -9.1]], collide: 1}
  - id: cam
    shape: part
    pos: [0, 0, 0]
    friction: 0.2
    color: "#d8ceba"
    pieces:
      - {kind: rod, from: [0, -4.1, -1.2], to: [0, -2.9000000000000004, -1.2], radius: 2.6, capsule: true, collide: 2}   # A: the eccentric, smooth all round
      - {kind: rod, from: [0, -8.8, 0], to: [0, -2.7, 0], radius: 0.8, color: "#a89a80"}   # the hollow shaft
      - {kind: band, center: [0, 0], r: [0.85, 1.6], a: [-2.8916, -0.55], slices: 12, y: [-8.6, -7.4], collide: 2}   # its half cut away piece
  - id: lever
    shape: part
    pos: [-9.0, -3.5, 2.0]
    friction: 0.2
    mass: 0.3
    color: "#cfc4ad"
    pieces:
      - {kind: rod, from: [-9.0, -3.5, 2.0], to: [0, -3.5, 2.0], radius: 0.35}   # the lever
      - {kind: rod, from: [0, -4.7, 2.0], to: [0, -2.3000000000000003, 2.0], radius: 0.6, capsule: true, collide: 1, color: "#8f8a80"}   # its roller, on A
  - id: frame
    shape: frame
    color: "#8f8a80"
    rods:
      - {from: [0, 0.9, 0], to: [0, 2.6, 0], radius: 0.6}             # B's bearing behind
      - {from: [-7.6, 0, -9.1], to: [-6.4, 0, -9.1], radius: 0.9}     # the worm's bearings
      - {from: [6.4, 0, -9.1], to: [7.6, 0, -9.1], radius: 0.9}
      - {from: [-9.0, -4.5, 2.0], to: [-9.0, -2.5, 2.0], radius: 0.5}   # the lever's pin
      - {from: [-11.0, -3.5, 6.5], to: [-6.0, -3.5, 6.5], radius: 0.4}   # where the spring is fixed
joints:
  - {id: j_worm, type: hinge, body: worm, axis: [1, 0, 0], damping: 0.001}
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.02}
  - {id: j_cam, type: hinge, body: cam, axis: [0, 1, 0], damping: 0.01}
  - {id: j_lever, type: hinge, body: lever, axis: [0, 1, 0], damping: 0.02, stiffness: 6, springref: 0.3, range: [-0.5, 0.5]}   # the spring presses the roller down
spurs:
  - {id: ww, body: wheel, pos: [0, 0, 0], teeth: 30, module: 0.5, width: 0.8, backlash: 0.02, phase: 0.052, meets_parts: true}
contact: {solref: [0.002, 1.0], solimp: [0.98, 0.99, 0.0002], margin: 0}
driver: {joint: j_worm, kind: velocity, rpm: 180, kv: 2, max_torque: 3}
checks:
  - {type: ratio, out: j_wheel, in: j_worm, expect: 0.03333, tol: 0.001, settle_s: 1, window_s: 10}
  - {type: ratio, out: j_cam, in: j_wheel, expect: 1.0, tol: 0.02, settle_s: 1.0, window_s: 3.5}   # the pin carries A up its rise
  - {type: still, joint: j_cam, max: 0.05, settle_s: 6.8, window_s: 2.6}                             # thrown ahead, A waits for the pin
  - {type: position, joint: j_cam, min: 5.7832, max: 6.5832, settle_s: 6.8, window_s: 2.6}   # half a turn ahead of where the pin left it
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [-2, -3, -1], position: [-20, -60, 12], fov: 34}
display:
  output: j_cam
  labels: {j_worm: "Worm (driver)", j_wheel: "Worm-gear B (30 teeth)", j_cam: "Cam A, on the hollow shaft", j_lever: "Spring lever and roller"}
  proof: {label: "Cut-away shaft out of contact", sub: "the pin turns past it: the cam is never carried up"}
