# No. 66 (Brown 1868): "A modification of 64."
#
# As drawn (cm; the drawing plane is x-z, depth y, the weight in front): No. 64's worm (the one motor-driven
# shaft) turns the worm-gear B (30 teeth); a pin in B's shaft turns the hollow shaft over it, half cut away
# (the remaining arc 2.0416 rad), so the pin turns it one way only and leaves it a free 3.7416 rad. On the
# hollow shaft, instead of No. 64's spring and cam, an arm (8.0 long) with the weight D. The pin carries D
# up from where it hangs; a little past the top D falls over ahead of the pin, half a turn, and hangs
# there until the pin comes round to the sleeve again: a jump each turn of B.
# Generator: opencode-runs/batch8/gen066.py.
number: 66
slug: jumping-motion-worm-weight
name: Jumping motion by a worm-gear, pin and weight
brown: "A modification of 64; a weight, D, attached to an arm secured in the shaft of the worm-gear, being used instead of spring and cam."
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: weight
    shape: part
    pos: [0, 0, 0]
    friction: 0.2
    color: "#d8ceba"
    pieces:
      - {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.5916, -0.55], slices: 12, y: [-8.6, -7.4], collide: 2}   # its half cut away piece
      - {kind: disc, center: [0, 0], radius: 1.3, y: [-4.3, -2.7]}   # the arm's boss
      - {kind: rod, from: [0, -3.5, -0.8], to: [0, -3.5, -6.8], radius: 0.3}   # the arm
      - {kind: disc, center: [0, -8.0], radius: 2.0, y: [-4.5, -2.5], density: 7800, color: "#6b6258"}   # the weight D
  - 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}
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_weight, type: hinge, body: weight, axis: [0, 1, 0], damping: 0.01}
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_weight, in: j_wheel, expect: 1.0, tol: 0.02, settle_s: 1.0, window_s: 3.5}   # the pin carries D up
  - {type: still, joint: j_weight, max: 0.05, settle_s: 7.5, window_s: 2.0}                           # fallen ahead, D hangs and waits for the pin
  - {type: position, joint: j_weight, min: 6.1832, max: 6.3832, settle_s: 7.5, window_s: 2.0}   # hanging again, a turn from where it began
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, -3, -2], position: [-20, -60, 10], fov: 36}
display:
  output: j_weight
  labels: {j_worm: "Worm (driver)", j_wheel: "Worm-gear B (30 teeth)", j_weight: "Weight D, on the hollow shaft"}
  proof: {label: "Cut-away shaft out of contact", sub: "the pin turns past it: the weight is never lifted"}
