# No. 264 (Brown 1868): "Two worm-wheels of equal diameter, but one having one tooth more than the other, both in gear with the same worm."
#
# Model (cm): No. 31's worm (single thread, axial pitch 1.5708, the one driven joint, 60 rpm) along x at z = -9.1, and over it, side by
# side on one fixed stud along y, two loose worm-wheels of the same pitch radius 7.5: A with 30 teeth (module 0.5, matching the thread) and B with
# 31 (module 0.48387, its teeth that much finer, and given 0.12 of backlash so they hunt in the same thread). Each turn of the worm moves each wheel
# on by one of its own teeth: A at 1/30 of the worm, B at 1/31, so A gains one turn on B in 30 x 31 = 930 turns of the worm (Brown's
# 100 and 101: 10,100). Only the thread touches the teeth. Generator: opencode-runs/batch11/gen264.py.
number: 264
slug: two-worm-wheels-one-tooth-apart
name: Two worm-wheels of equal diameter, one tooth apart, on one worm
brown: "Two worm-wheels of equal diameter, but one having one tooth more than the other, both in gear with the same worm. Suppose the first wheel has 100 teeth and the second 101, one wheel will gain one revolution over the other during the passage of 100 × 101 teeth of either wheel across the plane of centers, or during 10,100 revolutions of the worm."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 10
  floor: false
bodies:
  - {id: wheel_a, shape: assembly, pos: [0, 0, 0], color: "#e8dec6"}
  - {id: wheel_b, shape: assembly, pos: [0, 0, 0], color: "#d9cdb0"}
  - 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: frame
    shape: frame
    color: "#8f8a80"
    rods:
      - {from: [0, 0.9, 0], to: [0, 3.0, 0], radius: 0.6}            # the wheels' stud, behind
      - {from: [-6.6, 0, -9.1], to: [-5.4, 0, -9.1], radius: 0.9}     # the worm's bearings
      - {from: [5.4, 0, -9.1], to: [6.6, 0, -9.1], radius: 0.9}
joints:
  - {id: j_worm, type: hinge, body: worm, axis: [1, 0, 0], damping: 0.001}
  - {id: j_a, type: hinge, body: wheel_a, axis: [0, 1, 0], damping: 0.02}
  - {id: j_b, type: hinge, body: wheel_b, axis: [0, 1, 0], damping: 0.02}
spurs:
  - {id: wa, body: wheel_a, pos: [0, -0.45, 0], teeth: 30, module: 0.5, width: 0.8, backlash: 0.02, phase: 0.056, meets_parts: true}
  - {id: wb, body: wheel_b, pos: [0, 0.45, 0], teeth: 31, module: 0.48387, width: 0.8, backlash: 0.12, phase: 0.1013, meets_parts: true, color: "#cdbf9f"}
contact: {solref: [0.002, 1.0], solimp: [0.98, 0.99, 0.0002], margin: 0}
driver: {joint: j_worm, kind: velocity, rpm: 60, kv: 2.0, max_torque: 3}
checks:
  - {type: ratio, out: j_a, in: j_worm, expect: 0.03333, tol: 0.00033, settle_s: 1, window_s: 8.5}   # A: one of its 30 teeth a turn
  - {type: ratio, out: j_b, in: j_worm, expect: 0.03226, tol: 0.00032, settle_s: 1, window_s: 8.5}   # B: one of its 31 teeth a turn
  - {type: follow, out: j_b, in: j_a, expect: 0.96774, tol: 0.00806, min_r2: 0.999, settle_s: 1, window_s: 8.5}   # B falls behind A by one tooth each turn of A
  - {type: penetration, max: 0.0008, settle_s: 0.5}
camera: {target: [0, 0, -4.0], position: [58.0, -58.0, 26.0], fov: 34.0}
display:
  output: j_b
  labels: {j_worm: "Worm (driver)", j_a: "Wheel A, 30 teeth", j_b: "Wheel B, 31 teeth"}
  proof: {label: "One tooth apart", sub: "the same worm turns the 31-tooth wheel a little slower"}

