# No. 412 (Brown 1868): "Wheel-work in the base of capstan. Thus provided, the capstan can be used as a simple or compound machine, single or
# triple purchase. The drumhead and barrel rotate independently; the former, being fixed on spindle, turns it round, and when locked to barrel turns it
# also, forming single purchase; but when unlocked, wheel-work acts, and drumhead and barrel rotate in opposite directions, with velocities as three to one."
#
# Model (cm, Brown's plan of the capstan's base, looking down the spindle). The wheel on the spindle (15 teeth, module 0.64) gears with three idlers
# (15 teeth) on studs fixed in the deck, and they with the barrel's internal ring (45 teeth). The capstan bars turn the drumhead and spindle (the one
# driven joint, 12 rpm); unlocked, the barrel turns by tooth contact alone, the opposite way at a third of the speed (triple purchase), against the
# drag of its load. Straight-flanked (20 deg) teeth, each its own convex piece. Generator: opencode-runs/batch13/gen412.py.
number: 412
slug: wheel-work-in-base-of-capstan
name: Wheel-work in the base of capstan
brown: "Wheel-work in the base of capstan. Thus provided, the capstan can be used as a simple or compound machine, single or triple purchase. The drumhead and barrel rotate independently; the former, being fixed on spindle, turns it round, and when locked to barrel turns it also, forming single purchase; but when unlocked, wheel-work acts, and drumhead and barrel rotate in opposite directions, with velocities as three to one."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS   # CG blows up at the first tooth contacts (the spindle's wheel wedged among three idlers), as in No. 55
  multiccd: true
  duration_s: 6
  floor: false
  gravity: 0
bodies:
  - id: spindle
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: disc, center: [0.0, 0.0], radius: 4.16, inner: 1, y: [-0.8, 0.8]}
      - {kind: disc, center: [0.0, 0.0], radius: 1, inner: 0.35, y: [-1.0, 1.0], color: "#b9ab8e"}
      - {kind: poly, points: [[3.9303, 1.5126], [3.2751, 2.6474], [4.4153, 2.8484], [4.6745, 2.3996]], y: [-0.8, 0.8], collide: 2}   # its teeth
      - {kind: poly, points: [[2.9752, 2.9804], [1.9151, 3.7506], [2.875, 4.3981], [3.2944, 4.0934]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[1.5058, 3.9329], [0.2241, 4.2053], [0.8376, 5.1872], [1.3446, 5.0794]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-0.2241, 4.2053], [-1.5058, 3.9329], [-1.3446, 5.0794], [-0.8376, 5.1872]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-1.9151, 3.7506], [-2.9752, 2.9804], [-3.2944, 4.0934], [-2.875, 4.3981]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-3.2751, 2.6474], [-3.9303, 1.5126], [-4.6745, 2.3996], [-4.4153, 2.8484]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-4.0687, 1.0864], [-4.2057, -0.2167], [-5.2463, 0.2908], [-5.1922, 0.8063]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-4.1589, -0.6624], [-3.7539, -1.9086], [-4.9111, -1.8682], [-5.0712, -1.3752]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-3.5299, -2.2967], [-2.6531, -3.2705], [-3.7266, -3.7042], [-4.0734, -3.319]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-2.2906, -3.5339], [-1.0935, -4.0668], [-1.8978, -4.8997], [-2.3713, -4.6889]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-0.6552, -4.16], [0.6552, -4.16], [0.2592, -5.248], [-0.2592, -5.248]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[1.0935, -4.0668], [2.2906, -3.5339], [2.3713, -4.6889], [1.8978, -4.8997]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[2.6531, -3.2705], [3.5299, -2.2967], [4.0734, -3.319], [3.7266, -3.7042]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[3.7539, -1.9086], [4.1589, -0.6624], [5.0712, -1.3752], [4.9111, -1.8682]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[4.2057, -0.2167], [4.0687, 1.0864], [5.1922, 0.8063], [5.2463, 0.2908]], y: [-0.8, 0.8], collide: 2}
  - id: idler_a
    shape: part
    pos: [-8.3138, 0, 4.8]
    friction: 0.1
    color: "#d8cdb2"
    pieces:
      - {kind: disc, center: [-8.3138, 4.8], radius: 4.16, inner: 1.1, y: [-0.8, 0.8]}
      - {kind: disc, center: [-8.3138, 4.8], radius: 1.1, inner: 0.35, y: [-1.0, 1.0], color: "#b9ab8e"}
      - {kind: poly, points: [[-4.5599, 2.8914], [-4.155, 4.1376], [-3.2426, 3.4248], [-3.4028, 2.9318]], y: [-0.8, 0.8], collide: 1}   # its teeth
      - {kind: poly, points: [[-4.1081, 4.5833], [-4.2451, 5.8864], [-3.1217, 5.6063], [-3.0675, 5.0908]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.3836, 6.3126], [-5.0388, 7.4474], [-3.8985, 7.6484], [-3.6394, 7.1996]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-5.3386, 7.7804], [-6.3987, 8.5506], [-5.4388, 9.1981], [-5.0195, 8.8934]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-6.8081, 8.7329], [-8.0898, 9.0053], [-7.4762, 9.9872], [-6.9692, 9.8794]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-8.5379, 9.0053], [-9.8196, 8.7329], [-9.6585, 9.8794], [-9.1515, 9.9872]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-10.229, 8.5506], [-11.2891, 7.7804], [-11.6082, 8.8934], [-11.1889, 9.1981]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-11.5889, 7.4474], [-12.2441, 6.3126], [-12.9883, 7.1996], [-12.7292, 7.6484]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-12.3826, 5.8864], [-12.5195, 4.5833], [-13.5602, 5.0908], [-13.506, 5.6063]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-12.4727, 4.1376], [-12.0678, 2.8914], [-13.2249, 2.9318], [-13.3851, 3.4248]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-11.8437, 2.5033], [-10.9669, 1.5295], [-12.0404, 1.0958], [-12.3873, 1.481]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-10.6044, 1.2661], [-9.4073, 0.7332], [-10.2116, -0.0997], [-10.6852, 0.1111]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-8.969, 0.64], [-7.6587, 0.64], [-8.0547, -0.448], [-8.573, -0.448]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-7.2203, 0.7332], [-6.0233, 1.2661], [-5.9425, 0.1111], [-6.4161, -0.0997]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-5.6608, 1.5295], [-4.784, 2.5033], [-4.2404, 1.481], [-4.5872, 1.0958]], y: [-0.8, 0.8], collide: 1}
  - id: idler_b
    shape: part
    pos: [8.3138, 0, 4.8]
    friction: 0.1
    color: "#d8cdb2"
    pieces:
      - {kind: disc, center: [8.3138, 4.8], radius: 4.16, inner: 1.1, y: [-0.8, 0.8]}
      - {kind: disc, center: [8.3138, 4.8], radius: 1.1, inner: 0.35, y: [-1.0, 1.0], color: "#b9ab8e"}
      - {kind: poly, points: [[4.784, 2.5033], [5.6608, 1.5295], [4.5872, 1.0958], [4.2404, 1.481]], y: [-0.8, 0.8], collide: 1}   # its teeth
      - {kind: poly, points: [[6.0233, 1.2661], [7.2203, 0.7332], [6.4161, -0.0997], [5.9425, 0.1111]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[7.6587, 0.64], [8.969, 0.64], [8.573, -0.448], [8.0547, -0.448]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[9.4073, 0.7332], [10.6044, 1.2661], [10.6852, 0.1111], [10.2116, -0.0997]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[10.9669, 1.5295], [11.8437, 2.5033], [12.3873, 1.481], [12.0404, 1.0958]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[12.0678, 2.8914], [12.4727, 4.1376], [13.3851, 3.4248], [13.2249, 2.9318]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[12.5195, 4.5833], [12.3826, 5.8864], [13.506, 5.6063], [13.5602, 5.0908]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[12.2441, 6.3126], [11.5889, 7.4474], [12.7292, 7.6484], [12.9883, 7.1996]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[11.2891, 7.7804], [10.229, 8.5506], [11.1889, 9.1981], [11.6082, 8.8934]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[9.8196, 8.7329], [8.5379, 9.0053], [9.1515, 9.9872], [9.6585, 9.8794]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[8.0898, 9.0053], [6.8081, 8.7329], [6.9692, 9.8794], [7.4762, 9.9872]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[6.3987, 8.5506], [5.3386, 7.7804], [5.0195, 8.8934], [5.4388, 9.1981]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[5.0388, 7.4474], [4.3836, 6.3126], [3.6394, 7.1996], [3.8985, 7.6484]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.2451, 5.8864], [4.1081, 4.5833], [3.0675, 5.0908], [3.1217, 5.6063]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.155, 4.1376], [4.5599, 2.8914], [3.4028, 2.9318], [3.2426, 3.4248]], y: [-0.8, 0.8], collide: 1}
  - id: idler_c
    shape: part
    pos: [-0.0, 0, -9.6]
    friction: 0.1
    color: "#d8cdb2"
    pieces:
      - {kind: disc, center: [-0.0, -9.6], radius: 4.16, inner: 1.1, y: [-0.8, 0.8]}
      - {kind: disc, center: [-0.0, -9.6], radius: 1.1, inner: 0.35, y: [-1.0, 1.0], color: "#b9ab8e"}
      - {kind: poly, points: [[-0.2241, -5.3947], [-1.5058, -5.6671], [-1.3446, -4.5206], [-0.8376, -4.4128]], y: [-0.8, 0.8], collide: 1}   # its teeth
      - {kind: poly, points: [[-1.9151, -5.8494], [-2.9752, -6.6196], [-3.2944, -5.5066], [-2.875, -5.2019]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-3.2751, -6.9526], [-3.9303, -8.0874], [-4.6745, -7.2004], [-4.4153, -6.7516]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.0687, -8.5136], [-4.2057, -9.8167], [-5.2463, -9.3092], [-5.1922, -8.7937]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.1589, -10.2624], [-3.7539, -11.5086], [-4.9111, -11.4682], [-5.0712, -10.9752]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-3.5299, -11.8967], [-2.6531, -12.8705], [-3.7266, -13.3042], [-4.0734, -12.919]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-2.2906, -13.1339], [-1.0935, -13.6668], [-1.8978, -14.4997], [-2.3713, -14.2889]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-0.6552, -13.76], [0.6552, -13.76], [0.2592, -14.848], [-0.2592, -14.848]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[1.0935, -13.6668], [2.2906, -13.1339], [2.3713, -14.2889], [1.8978, -14.4997]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[2.6531, -12.8705], [3.5299, -11.8967], [4.0734, -12.919], [3.7266, -13.3042]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[3.7539, -11.5086], [4.1589, -10.2624], [5.0712, -10.9752], [4.9111, -11.4682]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.2057, -9.8167], [4.0687, -8.5136], [5.1922, -8.7937], [5.2463, -9.3092]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[3.9303, -8.0874], [3.2751, -6.9526], [4.4153, -6.7516], [4.6745, -7.2004]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[2.9752, -6.6196], [1.9151, -5.8494], [2.875, -5.2019], [3.2944, -5.5066]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[1.5058, -5.6671], [0.2241, -5.3947], [0.8376, -4.4128], [1.3446, -4.5206]], y: [-0.8, 0.8], collide: 1}
  - id: barrel
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    color: "#e8dec6"
    pieces:
      - {kind: band, center: [0, 0], r: [15.04, 16.64], a: [0, 6.2832], y: [-0.8, 0.8], slices: 48}   # the barrel's foot, toothed inside
      - {kind: poly, points: [[11.7117, 7.587], [11.4218, 8.0167], [12.1024, 8.9534], [12.8351, 7.8671]], y: [-0.8, 0.8], collide: 2}   # its teeth
      - {kind: poly, points: [[10.5418, 9.1431], [10.1949, 9.5283], [10.7385, 10.5506], [11.6153, 9.5768]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[9.1667, 10.5213], [8.7696, 10.8544], [9.1656, 11.9424], [10.1694, 11.1002]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[7.6132, 11.6946], [7.1736, 11.9693], [7.4144, 13.1018], [8.5256, 12.4075]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[5.9116, 12.6404], [5.438, 12.8512], [5.5188, 14.0062], [6.7158, 13.4732]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[4.0948, 13.3401], [3.5966, 13.483], [3.5158, 14.638], [4.7754, 14.2768]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[2.1984, 13.7802], [1.6851, 13.8523], [1.4444, 14.9848], [2.742, 14.8024]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[0.2592, 13.952], [-0.2592, 13.952], [-0.6552, 15.04], [0.6552, 15.04]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-1.6851, 13.8523], [-2.1984, 13.7802], [-2.742, 14.8024], [-1.4444, 14.9848]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-3.5966, 13.483], [-4.0948, 13.3401], [-4.7754, 14.2768], [-3.5158, 14.638]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-5.438, 12.8512], [-5.9116, 12.6404], [-6.7158, 13.4732], [-5.5188, 14.0062]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-7.1736, 11.9693], [-7.6132, 11.6946], [-8.5256, 12.4075], [-7.4144, 13.1018]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-8.7696, 10.8544], [-9.1667, 10.5213], [-10.1694, 11.1002], [-9.1656, 11.9424]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-10.1949, 9.5283], [-10.5418, 9.1431], [-11.6153, 9.5768], [-10.7385, 10.5506]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-11.4218, 8.0167], [-11.7117, 7.587], [-12.8351, 7.8671], [-12.1024, 8.9534]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-12.4264, 6.3491], [-12.6536, 5.8832], [-13.8051, 6.0042], [-13.2307, 7.182]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.1891, 4.5579], [-13.3492, 4.0649], [-14.5063, 4.0245], [-14.1014, 5.2707]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.695, 2.678], [-13.785, 2.1675], [-14.9253, 1.9665], [-14.6977, 3.2569]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.9345, 0.7459], [-13.9525, 0.2279], [-15.0537, -0.1299], [-15.008, 1.1797]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.9027, -1.2006], [-13.8485, -1.7161], [-14.8891, -2.2237], [-15.0261, -0.9205]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.6003, -3.1238], [-13.4749, -3.6268], [-14.4347, -4.2742], [-14.7517, -3.0028]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-13.0332, -4.9862], [-12.839, -5.4668], [-13.6994, -6.2415], [-14.1903, -5.0266]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-12.2124, -6.7516], [-11.9532, -7.2004], [-12.6974, -8.0874], [-13.3526, -6.9526]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-11.1539, -8.3855], [-10.8348, -8.7939], [-11.4483, -9.7758], [-12.255, -8.7433]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-9.8783, -9.8562], [-9.5054, -10.2163], [-9.9764, -11.274], [-10.919, -10.3638]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-8.4105, -11.1351], [-7.9911, -11.4397], [-8.3102, -12.5527], [-9.3703, -11.7825]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-6.7789, -12.1972], [-6.3212, -12.4406], [-6.4824, -13.5871], [-7.6393, -12.9719]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-5.0154, -13.0219], [-4.5283, -13.1992], [-4.5283, -14.3571], [-5.7596, -13.9089]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-3.1543, -13.5932], [-2.6473, -13.701], [-2.4861, -14.8476], [-3.7678, -14.5751]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[-1.2318, -13.8999], [-0.7147, -13.9361], [-0.3956, -15.0491], [-1.7027, -14.9577]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[0.7147, -13.9361], [1.2318, -13.8999], [1.7027, -14.9577], [0.3956, -15.0491]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[2.6473, -13.701], [3.1543, -13.5932], [3.7678, -14.5751], [2.4861, -14.8476]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[4.5283, -13.1992], [5.0154, -13.0219], [5.7596, -13.9089], [4.5283, -14.3571]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[6.3212, -12.4406], [6.7789, -12.1972], [7.6393, -12.9719], [6.4824, -13.5871]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[7.9911, -11.4397], [8.4105, -11.1351], [9.3703, -11.7825], [8.3102, -12.5527]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[9.5054, -10.2163], [9.8783, -9.8562], [10.919, -10.3638], [9.9764, -11.274]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[10.8348, -8.7939], [11.1539, -8.3855], [12.255, -8.7433], [11.4483, -9.7758]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[11.9532, -7.2004], [12.2124, -6.7516], [13.3526, -6.9526], [12.6974, -8.0874]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[12.839, -5.4668], [13.0332, -4.9862], [14.1903, -5.0266], [13.6994, -6.2415]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[13.4749, -3.6268], [13.6003, -3.1238], [14.7517, -3.0028], [14.4347, -4.2742]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[13.8485, -1.7161], [13.9027, -1.2006], [15.0261, -0.9205], [14.8891, -2.2237]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[13.9525, 0.2279], [13.9345, 0.7459], [15.008, 1.1797], [15.0537, -0.1299]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[13.785, 2.1675], [13.695, 2.678], [14.6977, 3.2569], [14.9253, 1.9665]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[13.3492, 4.0649], [13.1891, 4.5579], [14.1014, 5.2707], [14.5063, 4.0245]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[12.6536, 5.8832], [12.4264, 6.3491], [13.2307, 7.182], [13.8051, 6.0042]], y: [-0.8, 0.8], collide: 2}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [0.2, 0.7], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [0.9854, 1.4854], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [1.7708, 2.2708], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [2.5562, 3.0562], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [3.3416, 3.8416], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [4.127, 4.627], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [4.9124, 5.4124], y: [-0.8, 0.8], slices: 4}
      - {kind: band, center: [0, 0], r: [16.59, 17.54], a: [5.6978, 6.1978], y: [-0.8, 0.8], slices: 4}
  - id: deck
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [10.3168, -0.9, 19.24], to: [-0.832, -0.9, 17.64], radius: 0.35}
      - {kind: disc, center: [10.3168, 19.24], radius: 1.1, inner: 0.5, y: [-1.2, -0.6]}
      - {kind: rod, from: [10.3168, -0.9, -19.24], to: [-0.832, -0.9, -17.64], radius: 0.35}
      - {kind: disc, center: [10.3168, -19.24], radius: 1.1, inner: 0.5, y: [-1.2, -0.6]}
      - {kind: disc, center: [-8.3138, 4.8], radius: 0.35, y: [-1.3, 1.3]}   # the idlers' studs, fast in the deck
      - {kind: disc, center: [8.3138, 4.8], radius: 0.35, y: [-1.3, 1.3]}
      - {kind: disc, center: [-0.0, -9.6], radius: 0.35, y: [-1.3, 1.3]}
      - {kind: disc, center: [-8.3138, 4.8], radius: 5.4, y: [0.9, 1.3], color: "#a39b8a"}   # the deck's three-lobed plate behind, carrying the studs
      - {kind: disc, center: [8.3138, 4.8], radius: 5.4, y: [0.9, 1.3], color: "#a39b8a"}
      - {kind: disc, center: [-0.0, -9.6], radius: 5.4, y: [0.9, 1.3], color: "#a39b8a"}
      - {kind: disc, center: [0, 0], radius: 7.2, y: [0.9, 1.3], color: "#a39b8a"}
joints:
  - {id: j_s, type: hinge, body: spindle, axis: [0, 1, 0], damping: 0.001}   # the one driven joint: drumhead and spindle, turned by the capstan bars
  - {id: j_ia, type: hinge, body: idler_a, axis: [0, 1, 0], damping: 0.001}
  - {id: j_ib, type: hinge, body: idler_b, axis: [0, 1, 0], damping: 0.001}
  - {id: j_ic, type: hinge, body: idler_c, axis: [0, 1, 0], damping: 0.001}
  - {id: j_b, type: hinge, body: barrel, axis: [0, 1, 0], damping: 1}   # the barrel, against its load's drag
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 12, kv: 2, max_torque: 6}
checks:
  - {type: ratio, out: j_b, in: j_s, expect: -0.3333, tol: 0.004, settle_s: 1, window_s: 5}   # drumhead and barrel the opposite ways, as three to one
  - {type: ratio, out: j_ia, in: j_s, expect: -1.0, tol: 0.01, settle_s: 1, window_s: 5}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 0, -8], position: [0, -80, -8], fov: 48}
display:
  output: j_b
  labels: {j_s: "Drumhead and spindle (driver, 15 teeth)", j_ia: "An idler (15 teeth)", j_b: "Barrel (internal ring, 45 teeth)"}
  proof: {label: "Idlers out of mesh", sub: "the spindle turns alone: the barrel stands still"}
