# No. 71 (Brown 1868): intermittent rotary motion, the inner circumference of the driver's rim a lock.
#
# As drawn (cm; the drawing plane is x-z, depth y, B in front): B at the left (the one motor-driven shaft,
# turning with the clock) is a hub and four spokes carrying a rim 0.3 thick, and the tappet A, a pin on an
# arm inside the rim. C at the right (behind) has 8 studs on its face reaching forward into the rim's depth.
# Between strokes two of C's studs stand inside the rim and bear on its inner circumference (0.02 clear):
# C cannot turn either way. A strikes the upper stud and carries C round; the stud below passes out through
# the lower notch and the next enters through the upper. A carries C past the pitch; the trailing edges of
# the notches then cam it back. The notches are generated by sweeping the studs along C's motion.
# Generator: opencode-runs/batch8/gen071.py.
number: 71
slug: tappet-inner-rim-lock
name: Intermittent motion, the inner circumference of the driver's rim a lock
brown: "The inner circumference (shown by dotted lines) of the rim of the driving-wheel, B, serves as a lock against which two of the studs in the wheel, C, rest until the tappet, A, striking one of the studs, the next one below passes out from the guard-rim through the lower notch, and another stud enters the rim through the upper notch."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: false
  duration_s: 24
  floor: false
bodies:
  - id: wheel_b
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    color: "#e8dec6"
    pieces:
      - {kind: disc, center: [0, 0], radius: 0.9, y: [-1.6, -1.0], color: "#8f8a80"}   # B's hub
      - {kind: rod, from: [0, -1.35, 0], to: [-1.1906, -1.35, 4.4433], radius: 0.25, color: "#cfc4ad"}
      - {kind: rod, from: [0, -1.35, 0], to: [-4.4433, -1.35, -1.1906], radius: 0.25, color: "#cfc4ad"}
      - {kind: rod, from: [0, -1.35, 0], to: [1.1906, -1.35, -4.4433], radius: 0.25, color: "#cfc4ad"}
      - {kind: rod, from: [0, -1.35, 0], to: [4.4433, -1.35, 1.1906], radius: 0.25, color: "#cfc4ad"}
      # its rim, with the two notches
      - {kind: poly, points: [[4.5199, -0.0316], [4.7799, -0.0334], [4.7993, 0.0838], [4.7758, 0.2002], [4.516, 0.1893], [4.4993, 0.0785]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.5182, 0.1262], [4.7781, 0.1335], [4.7934, 0.2512], [4.7659, 0.3667], [4.5067, 0.3468], [4.4938, 0.2355]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.5111, 0.2838], [4.7706, 0.3001], [4.7817, 0.4183], [4.7502, 0.5328], [4.4918, 0.5038], [4.4829, 0.3922]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4984, 0.4411], [4.7572, 0.4664], [4.7642, 0.585], [4.7287, 0.6983], [4.4715, 0.6603], [4.4665, 0.5484]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4803, 0.5978], [4.738, 0.6322], [4.7409, 0.7509], [4.7015, 0.8629], [4.4457, 0.8159], [4.4446, 0.704]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4567, 0.7538], [4.7131, 0.7972], [4.7118, 0.9159], [4.6685, 1.0264], [4.4146, 0.9706], [4.4173, 0.8586]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4277, 0.9089], [4.6824, 0.9612], [4.677, 1.0798], [4.6298, 1.1887], [4.378, 1.1241], [4.3847, 1.0123]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.3933, 1.0628], [4.646, 1.124], [4.6364, 1.2423], [4.5855, 1.3496], [4.3361, 1.2762], [4.3467, 1.1647]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.3535, 1.2155], [4.6039, 1.2854], [4.5903, 1.4034], [4.5356, 1.5088], [4.2889, 1.4267], [4.3034, 1.3157]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.3084, 1.3667], [4.5563, 1.4453], [4.5385, 1.5627], [4.4802, 1.6662], [4.2365, 1.5755], [4.2548, 1.4651]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.2581, 1.5162], [4.503, 1.6035], [4.4812, 1.7202], [4.4193, 1.8215], [4.1789, 1.7224], [4.2011, 1.6127]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.2026, 1.6639], [4.4443, 1.7596], [4.4184, 1.8755], [4.3531, 1.9746], [4.1163, 1.8672], [4.1423, 1.7583]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.142, 1.8096], [4.3802, 1.9137], [4.3503, 2.0286], [4.2815, 2.1254], [4.1561, 2.0631], [4.1328, 1.9271]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.0613, 3.3526], [3.2232, 3.5298], [3.1491, 3.6226], [3.0469, 3.6831], [2.964, 3.5829], [2.9916, 3.4415]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.0138, 3.5412], [3.098, 3.6402], [2.9821, 3.7357], [2.9322, 3.6731]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.0776, 4.5234], [1.1078, 4.6499], [0.9612, 4.6824], [0.9169, 4.4669]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.4445, 4.5333], [-0.4538, 4.6278], [-0.5691, 4.6352], [-0.6793, 4.6001], [-0.6603, 4.4715], [-0.5505, 4.4838]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.5978, 4.4803], [-0.615, 4.6092], [-0.7305, 4.6125], [-0.8394, 4.5736], [-0.8159, 4.4457], [-0.704, 4.4446]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.7538, 4.4567], [-0.7755, 4.5849], [-0.8911, 4.5842], [-0.9985, 4.5415], [-0.9706, 4.4146], [-0.8586, 4.4173]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.9089, 4.4277], [-0.935, 4.555], [-1.0505, 4.5503], [-1.1564, 4.5039], [-1.1241, 4.378], [-1.0123, 4.3847]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.0628, 4.3933], [-1.0934, 4.5196], [-1.2113, 4.5205], [-1.3214, 4.4896], [-1.2762, 4.3361], [-1.1647, 4.3467]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.2155, 4.3535], [-1.2585, 4.5076], [-1.3917, 4.552], [-1.5088, 4.5356], [-1.4267, 4.2889], [-1.3157, 4.3034]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.3667, 4.3084], [-1.4453, 4.5563], [-1.5627, 4.5385], [-1.6662, 4.4802], [-1.5755, 4.2365], [-1.4651, 4.2548]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.5162, 4.2581], [-1.6035, 4.503], [-1.7202, 4.4812], [-1.8215, 4.4193], [-1.7224, 4.1789], [-1.6127, 4.2011]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.6639, 4.2026], [-1.7596, 4.4443], [-1.8755, 4.4184], [-1.9746, 4.3531], [-1.8672, 4.1163], [-1.7583, 4.1423]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.8096, 4.142], [-1.9137, 4.3802], [-2.0286, 4.3503], [-2.1254, 4.2815], [-2.0098, 4.0486], [-1.9018, 4.0784]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.953, 4.0763], [-2.0654, 4.3108], [-2.1792, 4.2768], [-2.2735, 4.2047], [-2.1498, 3.976], [-2.043, 4.0095]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.0941, 4.0056], [-2.2146, 4.2361], [-2.3271, 4.1982], [-2.4188, 4.1228], [-2.2873, 3.8986], [-2.1816, 3.9358]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.2326, 3.9301], [-2.361, 4.1562], [-2.4722, 4.1144], [-2.5613, 4.0359], [-2.4219, 3.8164], [-2.3177, 3.8573]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.3684, 3.8498], [-2.5047, 4.0713], [-2.6143, 4.0256], [-2.7005, 3.944], [-2.5537, 3.7295], [-2.4509, 3.774]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.5013, 3.7648], [-2.6452, 3.9814], [-2.7532, 3.9319], [-2.8365, 3.8474], [-2.6823, 3.6381], [-2.5811, 3.6862]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.6312, 3.6752], [-2.7825, 3.8866], [-2.8887, 3.8335], [-2.9691, 3.7461], [-2.8076, 3.5423], [-2.7082, 3.5939]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.7579, 3.5811], [-2.9165, 3.7871], [-3.0207, 3.7303], [-3.098, 3.6402], [-2.9295, 3.4422], [-2.8319, 3.4972]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.8812, 3.4827], [-3.0469, 3.6831], [-3.1491, 3.6226], [-3.2232, 3.5298], [-3.0478, 3.3378], [-2.9523, 3.3962]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.0009, 3.38], [-3.1736, 3.5745], [-3.2736, 3.5105], [-3.3444, 3.4152], [-3.1625, 3.2294], [-3.069, 3.2911]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.1171, 3.2733], [-3.2964, 3.4615], [-3.3941, 3.3941], [-3.4615, 3.2964], [-3.2733, 3.1171], [-3.182, 3.182]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.2294, 3.1625], [-3.4152, 3.3444], [-3.5105, 3.2736], [-3.5745, 3.1736], [-3.38, 3.0009], [-3.2911, 3.069]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.3378, 3.0478], [-3.5298, 3.2232], [-3.6226, 3.1491], [-3.6831, 3.0469], [-3.4827, 2.8812], [-3.3962, 2.9523]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.4422, 2.9295], [-3.6402, 3.098], [-3.7303, 3.0207], [-3.7871, 2.9165], [-3.5811, 2.7579], [-3.4972, 2.8319]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.5423, 2.8076], [-3.7461, 2.9691], [-3.8335, 2.8887], [-3.8866, 2.7825], [-3.6752, 2.6312], [-3.5939, 2.7082]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.6381, 2.6823], [-3.8474, 2.8365], [-3.9319, 2.7532], [-3.9814, 2.6452], [-3.7648, 2.5013], [-3.6862, 2.5811]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.7295, 2.5537], [-3.944, 2.7005], [-4.0256, 2.6143], [-4.0713, 2.5047], [-3.8498, 2.3684], [-3.774, 2.4509]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.8164, 2.4219], [-4.0359, 2.5613], [-4.1144, 2.4722], [-4.1562, 2.361], [-3.9301, 2.2326], [-3.8573, 2.3177]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.8986, 2.2873], [-4.1228, 2.4188], [-4.1982, 2.3271], [-4.2361, 2.2146], [-4.0056, 2.0941], [-3.9358, 2.1816]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.976, 2.1498], [-4.2047, 2.2735], [-4.2768, 2.1792], [-4.3108, 2.0654], [-4.0763, 1.953], [-4.0095, 2.043]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.0486, 2.0098], [-4.2815, 2.1254], [-4.3503, 2.0286], [-4.3802, 1.9137], [-4.142, 1.8096], [-4.0784, 1.9018]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.1163, 1.8672], [-4.3531, 1.9746], [-4.4184, 1.8755], [-4.4443, 1.7596], [-4.2026, 1.6639], [-4.1423, 1.7583]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.1789, 1.7224], [-4.4193, 1.8215], [-4.4812, 1.7202], [-4.503, 1.6035], [-4.2581, 1.5162], [-4.2011, 1.6127]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.2365, 1.5755], [-4.4802, 1.6662], [-4.5385, 1.5627], [-4.5563, 1.4453], [-4.3084, 1.3667], [-4.2548, 1.4651]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.2889, 1.4267], [-4.5356, 1.5088], [-4.5903, 1.4034], [-4.6039, 1.2854], [-4.3535, 1.2155], [-4.3034, 1.3157]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.3361, 1.2762], [-4.5855, 1.3496], [-4.6364, 1.2423], [-4.646, 1.124], [-4.3933, 1.0628], [-4.3467, 1.1647]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.378, 1.1241], [-4.6298, 1.1887], [-4.677, 1.0798], [-4.6824, 0.9612], [-4.4277, 0.9089], [-4.3847, 1.0123]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4146, 0.9706], [-4.6685, 1.0264], [-4.7118, 0.9159], [-4.7131, 0.7972], [-4.4567, 0.7538], [-4.4173, 0.8586]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4457, 0.8159], [-4.7015, 0.8629], [-4.7409, 0.7509], [-4.738, 0.6322], [-4.4803, 0.5978], [-4.4446, 0.704]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4715, 0.6603], [-4.7287, 0.6983], [-4.7642, 0.585], [-4.7572, 0.4664], [-4.4984, 0.4411], [-4.4665, 0.5484]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4918, 0.5038], [-4.7502, 0.5328], [-4.7817, 0.4183], [-4.7706, 0.3001], [-4.5111, 0.2838], [-4.4829, 0.3922]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.5067, 0.3468], [-4.7659, 0.3667], [-4.7934, 0.2512], [-4.7781, 0.1335], [-4.5182, 0.1262], [-4.4938, 0.2355]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.516, 0.1893], [-4.7758, 0.2002], [-4.7993, 0.0838], [-4.7799, -0.0334], [-4.5199, -0.0316], [-4.4993, 0.0785]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.5199, 0.0316], [-4.7799, 0.0334], [-4.7993, -0.0838], [-4.7758, -0.2002], [-4.516, -0.1893], [-4.4993, -0.0785]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.5182, -0.1262], [-4.7781, -0.1335], [-4.7934, -0.2512], [-4.7659, -0.3667], [-4.5067, -0.3468], [-4.4938, -0.2355]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.5111, -0.2838], [-4.7706, -0.3001], [-4.7817, -0.4183], [-4.7502, -0.5328], [-4.4918, -0.5038], [-4.4829, -0.3922]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4984, -0.4411], [-4.7572, -0.4664], [-4.7642, -0.585], [-4.7287, -0.6983], [-4.4715, -0.6603], [-4.4665, -0.5484]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4803, -0.5978], [-4.738, -0.6322], [-4.7409, -0.7509], [-4.7015, -0.8629], [-4.4457, -0.8159], [-4.4446, -0.704]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4567, -0.7538], [-4.7131, -0.7972], [-4.7118, -0.9159], [-4.6685, -1.0264], [-4.4146, -0.9706], [-4.4173, -0.8586]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.4277, -0.9089], [-4.6824, -0.9612], [-4.677, -1.0798], [-4.6298, -1.1887], [-4.378, -1.1241], [-4.3847, -1.0123]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.3933, -1.0628], [-4.646, -1.124], [-4.6364, -1.2423], [-4.5855, -1.3496], [-4.3361, -1.2762], [-4.3467, -1.1647]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.3535, -1.2155], [-4.6039, -1.2854], [-4.5903, -1.4034], [-4.5356, -1.5088], [-4.2889, -1.4267], [-4.3034, -1.3157]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.3084, -1.3667], [-4.5563, -1.4453], [-4.5385, -1.5627], [-4.4802, -1.6662], [-4.2365, -1.5755], [-4.2548, -1.4651]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.2581, -1.5162], [-4.503, -1.6035], [-4.4812, -1.7202], [-4.4193, -1.8215], [-4.1789, -1.7224], [-4.2011, -1.6127]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.2026, -1.6639], [-4.4443, -1.7596], [-4.4184, -1.8755], [-4.3531, -1.9746], [-4.1163, -1.8672], [-4.1423, -1.7583]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.142, -1.8096], [-4.3802, -1.9137], [-4.3503, -2.0286], [-4.2815, -2.1254], [-4.0486, -2.0098], [-4.0784, -1.9018]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.0763, -1.953], [-4.3108, -2.0654], [-4.2768, -2.1792], [-4.2047, -2.2735], [-3.976, -2.1498], [-4.0095, -2.043]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-4.0056, -2.0941], [-4.2361, -2.2146], [-4.1982, -2.3271], [-4.1228, -2.4188], [-3.8986, -2.2873], [-3.9358, -2.1816]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.9301, -2.2326], [-4.1562, -2.361], [-4.1144, -2.4722], [-4.0359, -2.5613], [-3.8164, -2.4219], [-3.8573, -2.3177]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.8498, -2.3684], [-4.0713, -2.5047], [-4.0256, -2.6143], [-3.944, -2.7005], [-3.7295, -2.5537], [-3.774, -2.4509]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.7648, -2.5013], [-3.9814, -2.6452], [-3.9319, -2.7532], [-3.8474, -2.8365], [-3.6381, -2.6823], [-3.6862, -2.5811]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.6752, -2.6312], [-3.8866, -2.7825], [-3.8335, -2.8887], [-3.7461, -2.9691], [-3.5423, -2.8076], [-3.5939, -2.7082]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.5811, -2.7579], [-3.7871, -2.9165], [-3.7303, -3.0207], [-3.6402, -3.098], [-3.4422, -2.9295], [-3.4972, -2.8319]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.4827, -2.8812], [-3.6831, -3.0469], [-3.6226, -3.1491], [-3.5298, -3.2232], [-3.3378, -3.0478], [-3.3962, -2.9523]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.38, -3.0009], [-3.5745, -3.1736], [-3.5105, -3.2736], [-3.4152, -3.3444], [-3.2294, -3.1625], [-3.2911, -3.069]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.2733, -3.1171], [-3.4615, -3.2964], [-3.3941, -3.3941], [-3.2964, -3.4615], [-3.1171, -3.2733], [-3.182, -3.182]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.1625, -3.2294], [-3.3444, -3.4152], [-3.2736, -3.5105], [-3.1736, -3.5745], [-3.0009, -3.38], [-3.069, -3.2911]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-3.0478, -3.3378], [-3.2232, -3.5298], [-3.1491, -3.6226], [-3.0469, -3.6831], [-2.8812, -3.4827], [-2.9523, -3.3962]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.9295, -3.4422], [-3.098, -3.6402], [-3.0207, -3.7303], [-2.9165, -3.7871], [-2.7579, -3.5811], [-2.8319, -3.4972]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.8076, -3.5423], [-2.9691, -3.7461], [-2.8887, -3.8335], [-2.7825, -3.8866], [-2.6312, -3.6752], [-2.7082, -3.5939]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.6823, -3.6381], [-2.8365, -3.8474], [-2.7532, -3.9319], [-2.6452, -3.9814], [-2.5013, -3.7648], [-2.5811, -3.6862]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.5537, -3.7295], [-2.7005, -3.944], [-2.6143, -4.0256], [-2.5047, -4.0713], [-2.3684, -3.8498], [-2.4509, -3.774]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.4219, -3.8164], [-2.5613, -4.0359], [-2.4722, -4.1144], [-2.361, -4.1562], [-2.2326, -3.9301], [-2.3177, -3.8573]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.2873, -3.8986], [-2.4188, -4.1228], [-2.3271, -4.1982], [-2.2146, -4.2361], [-2.0941, -4.0056], [-2.1816, -3.9358]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.1498, -3.976], [-2.2735, -4.2047], [-2.1792, -4.2768], [-2.0654, -4.3108], [-1.953, -4.0763], [-2.043, -4.0095]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-2.0098, -4.0486], [-2.1254, -4.2815], [-2.0286, -4.3503], [-1.9137, -4.3802], [-1.8096, -4.142], [-1.9018, -4.0784]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.8672, -4.1163], [-1.9746, -4.3531], [-1.8755, -4.4184], [-1.7596, -4.4443], [-1.6639, -4.2026], [-1.7583, -4.1423]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.7224, -4.1789], [-1.8215, -4.4193], [-1.7202, -4.4812], [-1.6035, -4.503], [-1.5162, -4.2581], [-1.6127, -4.2011]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.5755, -4.2365], [-1.6662, -4.4802], [-1.5627, -4.5385], [-1.4453, -4.5563], [-1.3667, -4.3084], [-1.4651, -4.2548]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.4267, -4.2889], [-1.5088, -4.5356], [-1.4034, -4.5903], [-1.2854, -4.6039], [-1.2155, -4.3535], [-1.3157, -4.3034]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.2762, -4.3361], [-1.3496, -4.5855], [-1.2423, -4.6364], [-1.124, -4.646], [-1.0628, -4.3933], [-1.1647, -4.3467]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-1.1241, -4.378], [-1.1887, -4.6298], [-1.0798, -4.677], [-0.9612, -4.6824], [-0.9089, -4.4277], [-1.0123, -4.3847]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.9706, -4.4146], [-1.0264, -4.6685], [-0.9159, -4.7118], [-0.7972, -4.7131], [-0.7538, -4.4567], [-0.8586, -4.4173]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.8159, -4.4457], [-0.8629, -4.7015], [-0.7509, -4.7409], [-0.6322, -4.738], [-0.5978, -4.4803], [-0.704, -4.4446]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.6603, -4.4715], [-0.6983, -4.7287], [-0.585, -4.7642], [-0.4664, -4.7572], [-0.4411, -4.4984], [-0.5484, -4.4665]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.5038, -4.4918], [-0.5328, -4.7502], [-0.4183, -4.7817], [-0.3001, -4.7706], [-0.2838, -4.5111], [-0.3922, -4.4829]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.3468, -4.5067], [-0.3667, -4.7659], [-0.2512, -4.7934], [-0.1335, -4.7781], [-0.1262, -4.5182], [-0.2355, -4.4938]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.1893, -4.516], [-0.2002, -4.7758], [-0.0838, -4.7993], [0.0334, -4.7799], [0.0316, -4.5199], [-0.0785, -4.4993]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[-0.0316, -4.5199], [-0.0334, -4.7799], [0.0838, -4.7993], [0.2002, -4.7758], [0.1893, -4.516], [0.0785, -4.4993]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.1262, -4.5182], [0.1335, -4.7781], [0.2512, -4.7934], [0.3667, -4.7659], [0.3468, -4.5067], [0.2355, -4.4938]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.2838, -4.5111], [0.3001, -4.7706], [0.4183, -4.7817], [0.5328, -4.7502], [0.5038, -4.4918], [0.3922, -4.4829]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.4411, -4.4984], [0.4664, -4.7572], [0.585, -4.7642], [0.6983, -4.7287], [0.6603, -4.4715], [0.5484, -4.4665]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.5978, -4.4803], [0.6322, -4.738], [0.7509, -4.7409], [0.8629, -4.7015], [0.8159, -4.4457], [0.704, -4.4446]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.7538, -4.4567], [0.7972, -4.7131], [0.9159, -4.7118], [1.0264, -4.6685], [0.9706, -4.4146], [0.8586, -4.4173]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[0.9089, -4.4277], [0.9612, -4.6824], [1.0798, -4.677], [1.1887, -4.6298], [1.1241, -4.378], [1.0123, -4.3847]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.0628, -4.3933], [1.124, -4.646], [1.2423, -4.6364], [1.3496, -4.5855], [1.2762, -4.3361], [1.1647, -4.3467]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.2155, -4.3535], [1.2854, -4.6039], [1.4034, -4.5903], [1.5088, -4.5356], [1.4267, -4.2889], [1.3157, -4.3034]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.3667, -4.3084], [1.4453, -4.5563], [1.5627, -4.5385], [1.6662, -4.4802], [1.5755, -4.2365], [1.4651, -4.2548]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.5162, -4.2581], [1.6035, -4.503], [1.7202, -4.4812], [1.8215, -4.4193], [1.7224, -4.1789], [1.6127, -4.2011]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.6639, -4.2026], [1.7596, -4.4443], [1.8755, -4.4184], [1.9746, -4.3531], [1.8672, -4.1163], [1.7583, -4.1423]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.8096, -4.142], [1.9137, -4.3802], [2.0286, -4.3503], [2.1254, -4.2815], [2.0098, -4.0486], [1.9018, -4.0784]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[1.953, -4.0763], [2.0654, -4.3108], [2.1792, -4.2768], [2.2735, -4.2047], [2.1498, -3.976], [2.043, -4.0095]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.0941, -4.0056], [2.2146, -4.2361], [2.3271, -4.1982], [2.4188, -4.1228], [2.2873, -3.8986], [2.1816, -3.9358]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.2326, -3.9301], [2.361, -4.1562], [2.4722, -4.1144], [2.5613, -4.0359], [2.4219, -3.8164], [2.3177, -3.8573]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.3684, -3.8498], [2.5047, -4.0713], [2.6143, -4.0256], [2.7005, -3.944], [2.5537, -3.7295], [2.4509, -3.774]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.5013, -3.7648], [2.6452, -3.9814], [2.7532, -3.9319], [2.8365, -3.8474], [2.6823, -3.6381], [2.5811, -3.6862]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.6312, -3.6752], [2.7825, -3.8866], [2.8887, -3.8335], [2.9691, -3.7461], [2.8076, -3.5423], [2.7082, -3.5939]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.7579, -3.5811], [2.9165, -3.7871], [3.0207, -3.7303], [3.098, -3.6402], [2.9295, -3.4422], [2.8319, -3.4972]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[2.8812, -3.4827], [3.0469, -3.6831], [3.1491, -3.6226], [3.2232, -3.5298], [3.0478, -3.3378], [2.9523, -3.3962]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.0009, -3.38], [3.1736, -3.5745], [3.2736, -3.5105], [3.3444, -3.4152], [3.1625, -3.2294], [3.069, -3.2911]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.1171, -3.2733], [3.2964, -3.4615], [3.3941, -3.3941], [3.4615, -3.2964], [3.2733, -3.1171], [3.182, -3.182]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.2294, -3.1625], [3.4152, -3.3444], [3.5105, -3.2736], [3.5745, -3.1736], [3.38, -3.0009], [3.2911, -3.069]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.3378, -3.0478], [3.5298, -3.2232], [3.6226, -3.1491], [3.6831, -3.0469], [3.4827, -2.8812], [3.3962, -2.9523]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.4422, -2.9295], [3.6402, -3.098], [3.7303, -3.0207], [3.7871, -2.9165], [3.5811, -2.7579], [3.4972, -2.8319]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.5423, -2.8076], [3.7461, -2.9691], [3.8335, -2.8887], [3.8866, -2.7825], [3.6752, -2.6312], [3.5939, -2.7082]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.6381, -2.6823], [3.8474, -2.8365], [3.9319, -2.7532], [3.9814, -2.6452], [3.7648, -2.5013], [3.6862, -2.5811]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.7295, -2.5537], [3.944, -2.7005], [4.0256, -2.6143], [4.0713, -2.5047], [3.8498, -2.3684], [3.774, -2.4509]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.8164, -2.4219], [4.0359, -2.5613], [4.1144, -2.4722], [4.1562, -2.361], [3.9301, -2.2326], [3.8573, -2.3177]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.8986, -2.2873], [4.1228, -2.4188], [4.1982, -2.3271], [4.2361, -2.2146], [4.0056, -2.0941], [3.9358, -2.1816]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[3.976, -2.1498], [4.2047, -2.2735], [4.2768, -2.1792], [4.3108, -2.0654], [4.0763, -1.953], [4.0095, -2.043]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.0486, -2.0098], [4.2815, -2.1254], [4.3503, -2.0286], [4.3802, -1.9137], [4.142, -1.8096], [4.0784, -1.9018]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.1163, -1.8672], [4.3531, -1.9746], [4.4184, -1.8755], [4.4443, -1.7596], [4.2026, -1.6639], [4.1423, -1.7583]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.1789, -1.7224], [4.4193, -1.8215], [4.4812, -1.7202], [4.503, -1.6035], [4.2581, -1.5162], [4.2011, -1.6127]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.2365, -1.5755], [4.4802, -1.6662], [4.5385, -1.5627], [4.5563, -1.4453], [4.3084, -1.3667], [4.2548, -1.4651]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.2889, -1.4267], [4.5356, -1.5088], [4.5903, -1.4034], [4.6039, -1.2854], [4.3535, -1.2155], [4.3034, -1.3157]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.3361, -1.2762], [4.5855, -1.3496], [4.6364, -1.2423], [4.646, -1.124], [4.3933, -1.0628], [4.3467, -1.1647]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.378, -1.1241], [4.6298, -1.1887], [4.677, -1.0798], [4.6824, -0.9612], [4.4277, -0.9089], [4.3847, -1.0123]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4146, -0.9706], [4.6685, -1.0264], [4.7118, -0.9159], [4.7131, -0.7972], [4.4567, -0.7538], [4.4173, -0.8586]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4457, -0.8159], [4.7015, -0.8629], [4.7409, -0.7509], [4.738, -0.6322], [4.4803, -0.5978], [4.4446, -0.704]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4715, -0.6603], [4.7287, -0.6983], [4.7642, -0.585], [4.7572, -0.4664], [4.4984, -0.4411], [4.4665, -0.5484]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.4918, -0.5038], [4.7502, -0.5328], [4.7817, -0.4183], [4.7706, -0.3001], [4.5111, -0.2838], [4.4829, -0.3922]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.5067, -0.3468], [4.7659, -0.3667], [4.7934, -0.2512], [4.7781, -0.1335], [4.5182, -0.1262], [4.4938, -0.2355]], y: [-1.6, 1.2], collide: 1}
      - {kind: poly, points: [[4.516, -0.1893], [4.7758, -0.2002], [4.7993, -0.0838], [4.7799, 0.0334], [4.5199, 0.0316], [4.4993, -0.0785]], y: [-1.6, 1.2], collide: 1}
      - {kind: rod, from: [1.0, 0.1, 1.7321], to: [1.9, 0.1, 3.2909], radius: 0.3, capsule: true, collide: 1, color: "#6b5a44"}   # the tappet A
      - {kind: rod, from: [0.45, -1.0, 0.7794], to: [1.0, -1.0, 1.7321], radius: 0.3, color: "#6b5a44"}   # its arm from the hub
      - {kind: rod, from: [1.0, -1.0, 1.7321], to: [1.0, 0.1, 1.7321], radius: 0.3, color: "#6b5a44"}
      - {kind: disc, center: [0, 0], radius: 1.4, y: [-3.0, -1.6], color: "#8f8a80"}   # B's boss
  - id: wheel_c
    shape: part
    pos: [5.9571, 0, 0]
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: disc, center: [5.9571, 0], radius: 2.5, y: [1.6, 2.4]}   # C
      - {kind: disc, center: [5.9571, 0], radius: 0.7, y: [2.4, 3.2], color: "#8f8a80"}
      # its 8 studs
      - {kind: rod, from: [4.1093, 1.6, -0.7654], to: [4.1093, -0.7, -0.7654], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [5.1917, 1.6, -1.8478], to: [5.1917, -0.7, -1.8478], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [6.7225, 1.6, -1.8478], to: [6.7225, -0.7, -1.8478], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [7.8049, 1.6, -0.7654], to: [7.8049, -0.7, -0.7654], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [7.8049, 1.6, 0.7654], to: [7.8049, -0.7, 0.7654], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [6.7225, 1.6, 1.8478], to: [6.7225, -0.7, 1.8478], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [5.1917, 1.6, 1.8478], to: [5.1917, -0.7, 1.8478], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
      - {kind: rod, from: [4.1093, 1.6, 0.7654], to: [4.1093, -0.7, 0.7654], radius: 0.3, capsule: true, collide: 2, color: "#6b5a44"}
  - id: frame
    shape: frame
    color: "#8f8a80"
    rods:
      - {from: [0, -3.0, 0], to: [0, -4.2, 0], radius: 0.6}
      - {from: [5.9571, 3.2, 0], to: [5.9571, 4.4, 0], radius: 0.6}
joints:
  - {id: j_b, type: hinge, body: wheel_b, axis: [0, 1, 0], damping: 0.05}   # positive: with the clock, as drawn
  - {id: j_c, type: hinge, body: wheel_c, axis: [0, -1, 0], damping: 0.05}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_b, kind: velocity, rpm: 12, kv: 2, max_torque: 20}
checks:
  - {type: ratio, out: j_c, in: j_b, expect: 0.125, tol: 0.001, settle_s: 3.76, window_s: 15.62}   # one stud a turn (three whole turns of B, mid-dwell to mid-dwell)
  - {type: still, joint: j_c, max: 0.005, settle_s: 3.0, window_s: 1.5}   # held by the rim between strokes
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [3.0, 0, 0], position: [3.0, -42, 6], fov: 34}
display:
  output: j_c
  labels: {j_b: "B with its rim and tappet A (driver)", j_c: "C, the stud wheel"}
  proof: {label: "Tappet out of contact", sub: "C is never turned"}

