# No. 69 (Brown 1868): intermittent rotary motion by a small wheel with one tooth, its circumference the lock.
#
# As drawn (cm; the drawing plane is x-z, depth y): B at the right (the one motor-driven shaft, turning
# against the clock) is a small wheel with one tooth (a stud of radius 0.4, 0.3 proud of its circumference);
# A at the left has 30 teeth. Between strokes B's circumference stands between two of A's teeth, 0.01 clear of their
# points, and A cannot turn. Once a turn the tooth carries one tooth of A past; B's circumference is cut away beside
# the tooth to let A's teeth by, and where it returns between the next two teeth it sets A to the pitch (the tooth
# alone carries it 0.0526 rad past). The cut-away is generated from the motion. Generator: opencode-runs/batch8/gen069.py.
number: 69
slug: single-tooth-small-driver
name: Intermittent motion by a small wheel with one tooth
brown: "B, a small wheel with one tooth, is the driver, and the circumference entering between the teeth of the wheel, A, serves as a lock or stop while the tooth of the small wheel is out of operation."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: false
  duration_s: 24
  floor: false
bodies:
  - id: wheel_a
    shape: part
    pos: [-4.6, 0, 0]
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: disc, center: [-4.6, 0], radius: 7.0, y: [-0.5, 0.5]}   # A, to its roots
      # its 30 teeth
      - {kind: poly, points: [[2.3, 0.0], [2.4, 0.0], [3.2921, 0.7802], [3.2582, 0.7656], [3.2223, 0.7736], [3.1977, 0.801], [3.1939, 0.8377], [3.2122, 0.8697], [3.2457, 0.8849], [3.2818, 0.8777], [2.247, 1.4554], [2.1492, 1.4346]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[2.1492, 1.4346], [2.247, 1.4554], [2.9574, 2.404], [2.9273, 2.3827], [2.8905, 2.383], [2.8608, 2.4048], [2.8494, 2.4398], [2.8606, 2.4749], [2.8903, 2.4968], [2.9271, 2.4973], [1.7948, 2.8472], [1.7035, 2.8065]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[1.7035, 2.8065], [1.7948, 2.8472], [2.2925, 3.9227], [2.2675, 3.8957], [2.2314, 3.8883], [2.1978, 3.9034], [2.1793, 3.9353], [2.183, 3.972], [2.2075, 3.9996], [2.2434, 4.0077], [1.0631, 4.1145], [0.9822, 4.0557]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[0.9822, 4.0557], [1.0631, 4.1145], [1.3263, 5.27], [1.3074, 5.2383], [1.2737, 5.2236], [1.2376, 5.2314], [1.213, 5.2588], [1.209, 5.2955], [1.2271, 5.3275], [1.2606, 5.3429], [0.0839, 5.202], [0.017, 5.1277]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[0.017, 5.1277], [0.0839, 5.202], [0.1011, 6.387], [0.0892, 6.3521], [0.0592, 6.3307], [0.0224, 6.3308], [-0.0074, 6.3525], [-0.0189, 6.3875], [-0.0078, 6.4226], [0.0217, 6.4447], [-1.1, 6.0622], [-1.15, 5.9756]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-1.15, 5.9756], [-1.1, 6.0622], [-1.3296, 7.2248], [-1.3339, 7.1882], [-1.3588, 7.1611], [-1.3949, 7.1535], [-1.4285, 7.1685], [-1.4471, 7.2004], [-1.4435, 7.237], [-1.4192, 7.2647], [-2.4369, 6.6574], [-2.4678, 6.5623]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-2.4678, 6.5623], [-2.4369, 6.6574], [-2.9032, 7.7469], [-2.8998, 7.7102], [-2.9185, 7.6785], [-2.9522, 7.6636], [-2.9883, 7.6713], [-3.013, 7.6986], [-3.0172, 7.7352], [-2.9992, 7.7673], [-3.8683, 6.9617], [-3.8788, 6.8622]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-3.8788, 6.8622], [-3.8683, 6.9617], [-4.551, 7.9304], [-4.54, 7.8952], [-4.5517, 7.8603], [-4.5816, 7.8387], [-4.6184, 7.8387], [-4.6483, 7.8603], [-4.66, 7.8952], [-4.649, 7.9304], [-5.3317, 6.9617], [-5.3212, 6.8622]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-5.3212, 6.8622], [-5.3317, 6.9617], [-6.2008, 7.7673], [-6.1828, 7.7352], [-6.187, 7.6986], [-6.2117, 7.6713], [-6.2478, 7.6636], [-6.2815, 7.6785], [-6.3002, 7.7102], [-6.2968, 7.7469], [-6.7631, 6.6574], [-6.7322, 6.5623]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-6.7322, 6.5623], [-6.7631, 6.6574], [-7.7808, 7.2647], [-7.7565, 7.237], [-7.7529, 7.2004], [-7.7715, 7.1685], [-7.8051, 7.1535], [-7.8412, 7.1611], [-7.8661, 7.1882], [-7.8704, 7.2248], [-8.1, 6.0622], [-8.05, 5.9756]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-8.05, 5.9756], [-8.1, 6.0622], [-9.2217, 6.4447], [-9.1922, 6.4226], [-9.1811, 6.3875], [-9.1926, 6.3525], [-9.2224, 6.3308], [-9.2592, 6.3307], [-9.2892, 6.3521], [-9.3011, 6.387], [-9.2839, 5.202], [-9.217, 5.1277]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-9.217, 5.1277], [-9.2839, 5.202], [-10.4606, 5.3429], [-10.4271, 5.3275], [-10.409, 5.2955], [-10.413, 5.2588], [-10.4376, 5.2314], [-10.4737, 5.2236], [-10.5074, 5.2383], [-10.5263, 5.27], [-10.2631, 4.1145], [-10.1822, 4.0557]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-10.1822, 4.0557], [-10.2631, 4.1145], [-11.4434, 4.0077], [-11.4075, 3.9996], [-11.383, 3.972], [-11.3793, 3.9353], [-11.3978, 3.9034], [-11.4314, 3.8883], [-11.4675, 3.8957], [-11.4925, 3.9227], [-10.9948, 2.8472], [-10.9035, 2.8065]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-10.9035, 2.8065], [-10.9948, 2.8472], [-12.1271, 2.4973], [-12.0903, 2.4968], [-12.0606, 2.4749], [-12.0494, 2.4398], [-12.0608, 2.4048], [-12.0905, 2.383], [-12.1273, 2.3827], [-12.1574, 2.404], [-11.447, 1.4554], [-11.3492, 1.4346]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-11.3492, 1.4346], [-11.447, 1.4554], [-12.4818, 0.8777], [-12.4457, 0.8849], [-12.4122, 0.8697], [-12.3939, 0.8377], [-12.3977, 0.801], [-12.4223, 0.7736], [-12.4582, 0.7656], [-12.4921, 0.7802], [-11.6, 0.0], [-11.5, 0.0]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-11.5, 0.0], [-11.6, 0.0], [-12.4921, -0.7802], [-12.4582, -0.7656], [-12.4223, -0.7736], [-12.3977, -0.801], [-12.3939, -0.8377], [-12.4122, -0.8697], [-12.4457, -0.8849], [-12.4818, -0.8777], [-11.447, -1.4554], [-11.3492, -1.4346]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-11.3492, -1.4346], [-11.447, -1.4554], [-12.1574, -2.404], [-12.1273, -2.3827], [-12.0905, -2.383], [-12.0608, -2.4048], [-12.0494, -2.4398], [-12.0606, -2.4749], [-12.0903, -2.4968], [-12.1271, -2.4973], [-10.9948, -2.8472], [-10.9035, -2.8065]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-10.9035, -2.8065], [-10.9948, -2.8472], [-11.4925, -3.9227], [-11.4675, -3.8957], [-11.4314, -3.8883], [-11.3978, -3.9034], [-11.3793, -3.9353], [-11.383, -3.972], [-11.4075, -3.9996], [-11.4434, -4.0077], [-10.2631, -4.1145], [-10.1822, -4.0557]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-10.1822, -4.0557], [-10.2631, -4.1145], [-10.5263, -5.27], [-10.5074, -5.2383], [-10.4737, -5.2236], [-10.4376, -5.2314], [-10.413, -5.2588], [-10.409, -5.2955], [-10.4271, -5.3275], [-10.4606, -5.3429], [-9.2839, -5.202], [-9.217, -5.1277]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-9.217, -5.1277], [-9.2839, -5.202], [-9.3011, -6.387], [-9.2892, -6.3521], [-9.2592, -6.3307], [-9.2224, -6.3308], [-9.1926, -6.3525], [-9.1811, -6.3875], [-9.1922, -6.4226], [-9.2217, -6.4447], [-8.1, -6.0622], [-8.05, -5.9756]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-8.05, -5.9756], [-8.1, -6.0622], [-7.8704, -7.2248], [-7.8661, -7.1882], [-7.8412, -7.1611], [-7.8051, -7.1535], [-7.7715, -7.1685], [-7.7529, -7.2004], [-7.7565, -7.237], [-7.7808, -7.2647], [-6.7631, -6.6574], [-6.7322, -6.5623]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-6.7322, -6.5623], [-6.7631, -6.6574], [-6.2968, -7.7469], [-6.3002, -7.7102], [-6.2815, -7.6785], [-6.2478, -7.6636], [-6.2117, -7.6713], [-6.187, -7.6986], [-6.1828, -7.7352], [-6.2008, -7.7673], [-5.3317, -6.9617], [-5.3212, -6.8622]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-5.3212, -6.8622], [-5.3317, -6.9617], [-4.649, -7.9304], [-4.66, -7.8952], [-4.6483, -7.8603], [-4.6184, -7.8387], [-4.5816, -7.8387], [-4.5517, -7.8603], [-4.54, -7.8952], [-4.551, -7.9304], [-3.8683, -6.9617], [-3.8788, -6.8622]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-3.8788, -6.8622], [-3.8683, -6.9617], [-2.9992, -7.7673], [-3.0172, -7.7352], [-3.013, -7.6986], [-2.9883, -7.6713], [-2.9522, -7.6636], [-2.9185, -7.6785], [-2.8998, -7.7102], [-2.9032, -7.7469], [-2.4369, -6.6574], [-2.4678, -6.5623]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-2.4678, -6.5623], [-2.4369, -6.6574], [-1.4192, -7.2647], [-1.4435, -7.237], [-1.4471, -7.2004], [-1.4285, -7.1685], [-1.3949, -7.1535], [-1.3588, -7.1611], [-1.3339, -7.1882], [-1.3296, -7.2248], [-1.1, -6.0622], [-1.15, -5.9756]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[-1.15, -5.9756], [-1.1, -6.0622], [0.0217, -6.4447], [-0.0078, -6.4226], [-0.0189, -6.3875], [-0.0074, -6.3525], [0.0224, -6.3308], [0.0592, -6.3307], [0.0892, -6.3521], [0.1011, -6.387], [0.0839, -5.202], [0.017, -5.1277]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[0.017, -5.1277], [0.0839, -5.202], [1.2606, -5.3429], [1.2271, -5.3275], [1.209, -5.2955], [1.213, -5.2588], [1.2376, -5.2314], [1.2737, -5.2236], [1.3074, -5.2383], [1.3263, -5.27], [1.0631, -4.1145], [0.9822, -4.0557]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[0.9822, -4.0557], [1.0631, -4.1145], [2.2434, -4.0077], [2.2075, -3.9996], [2.183, -3.972], [2.1793, -3.9353], [2.1978, -3.9034], [2.2314, -3.8883], [2.2675, -3.8957], [2.2925, -3.9227], [1.7948, -2.8472], [1.7035, -2.8065]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[1.7035, -2.8065], [1.7948, -2.8472], [2.9271, -2.4973], [2.8903, -2.4968], [2.8606, -2.4749], [2.8494, -2.4398], [2.8608, -2.4048], [2.8905, -2.383], [2.9273, -2.3827], [2.9574, -2.404], [2.247, -1.4554], [2.1492, -1.4346]], y: [-0.5, 0.5], collide: 2}
      - {kind: poly, points: [[2.1492, -1.4346], [2.247, -1.4554], [3.2818, -0.8777], [3.2457, -0.8849], [3.2122, -0.8697], [3.1939, -0.8377], [3.1977, -0.801], [3.2223, -0.7736], [3.2582, -0.7656], [3.2921, -0.7802], [2.4, -0.0], [2.3, -0.0]], y: [-0.5, 0.5], collide: 2}
      - {kind: disc, center: [-4.6, 0], radius: 1.0, y: [-1.2, -0.5], color: "#8f8a80"}
  - id: wheel_b
    shape: part
    pos: [4.5881, 0, 0]
    friction: 0.1
    color: "#e8dec6"
    pieces:
      - {kind: disc, center: [4.5881, 0], radius: 1.0, y: [-0.5, 0.5]}   # B, inside its circumference
      # its circumference, cut away beside the tooth
      - {kind: poly, points: [[4.812, -0.8717], [4.9562, -1.4335], [4.9764, -1.4489], [5.0183, -1.437], [5.06, -1.4239], [5.1012, -1.4095], [5.1089, -1.3854], [4.9048, -0.8425]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.8871, -0.8489], [5.0797, -1.396], [5.1012, -1.4095], [5.142, -1.394], [5.1823, -1.3773], [5.2221, -1.3595], [5.2276, -1.3347], [4.977, -0.8116]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.9599, -0.8196], [5.1995, -1.3478], [5.2221, -1.3595], [5.2613, -1.3404], [5.3, -1.3203], [5.3381, -1.299], [5.3415, -1.2739], [5.0463, -0.7747]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.03, -0.7841], [5.3147, -1.2894], [5.3381, -1.299], [5.3756, -1.2767], [5.4124, -1.2532], [5.4485, -1.2287], [5.4497, -1.2034], [5.1121, -0.7318]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.0966, -0.7426], [5.4243, -1.2212], [5.4485, -1.2287], [5.4839, -1.2032], [5.5185, -1.1766], [5.5523, -1.1491], [5.5513, -1.1237], [5.1738, -0.6833]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.1594, -0.6955], [5.5275, -1.1436], [5.5523, -1.1491], [5.5853, -1.1205], [5.6175, -1.0911], [5.6488, -1.0607], [5.6456, -1.0355], [5.2312, -0.6297]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.2178, -0.643], [5.6236, -1.0574], [5.6488, -1.0607], [5.6792, -1.0294], [5.7087, -0.9972], [5.7372, -0.9642], [5.7318, -0.9394], [5.2836, -0.5713]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.2715, -0.5857], [5.7119, -0.9631], [5.7372, -0.9642], [5.7648, -0.9304], [5.7913, -0.8957], [5.8169, -0.8604], [5.8093, -0.8362], [5.3307, -0.5085]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.3199, -0.5239], [5.7915, -0.8615], [5.8169, -0.8604], [5.8414, -0.8243], [5.8648, -0.7875], [5.8872, -0.75], [5.8775, -0.7265], [5.3722, -0.4418]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.3628, -0.4581], [5.862, -0.7534], [5.8872, -0.75], [5.9084, -0.7119], [5.9286, -0.6732], [5.9476, -0.6339], [5.936, -0.6114], [5.4078, -0.3718]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.3998, -0.3889], [5.9229, -0.6395], [5.9476, -0.6339], [5.9655, -0.5941], [5.9822, -0.5538], [5.9977, -0.513], [5.9841, -0.4916], [5.437, -0.2989]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4306, -0.3167], [5.9735, -0.5207], [5.9977, -0.513], [6.012, -0.4718], [6.0251, -0.4302], [6.037, -0.3882], [6.0216, -0.3681], [5.4599, -0.2238]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.455, -0.242], [6.0136, -0.398], [6.037, -0.3882], [6.0477, -0.3459], [6.0572, -0.3033], [6.0654, -0.2605], [6.0483, -0.2417], [5.4761, -0.147]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4728, -0.1656], [6.0429, -0.2722], [6.0654, -0.2605], [6.0723, -0.2174], [6.0648, -0.1726], [6.0625, -0.129], [6.0438, -0.112], [5.4855, -0.069]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4838, -0.0878], [6.0412, -0.1425], [6.0625, -0.129], [6.059, -0.0857], [6.0575, -0.0428], [6.0581, -0.0], [6.0321, 0.0151], [5.4881, 0.0094]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4881, -0.0094], [6.0381, -0.0152], [6.0581, -0.0], [6.0475, 0.0425], [6.0357, 0.0843], [6.0227, 0.1255], [6.0014, 0.1386], [5.4838, 0.0878]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4855, 0.069], [6.0099, 0.1094], [6.0227, 0.1255], [6.0118, 0.1664], [5.9997, 0.2068], [5.9866, 0.2466], [5.9584, 0.2564], [5.4728, 0.1656]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4761, 0.147], [5.9693, 0.2287], [5.9866, 0.2466], [5.969, 0.2851], [5.9504, 0.3229], [5.9308, 0.3598], [5.9077, 0.3684], [5.455, 0.242]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4599, 0.2238], [5.9209, 0.3422], [5.9308, 0.3598], [5.9134, 0.3967], [5.8949, 0.433], [5.8755, 0.4686], [5.8462, 0.4729], [5.4306, 0.3167]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.437, 0.2989], [5.8615, 0.4484], [5.8755, 0.4686], [5.8521, 0.5021], [5.8339, 0.5373], [5.8117, 0.5705], [5.7822, 0.5721], [5.3998, 0.3889]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.4078, 0.3718], [5.7994, 0.5494], [5.8117, 0.5705], [5.7856, 0.6014], [5.7588, 0.6312], [5.74, 0.665], [5.7105, 0.6638], [5.3628, 0.4581]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.3722, 0.4418], [5.7294, 0.6431], [5.74, 0.665], [5.7116, 0.693], [5.6882, 0.7235], [5.6612, 0.7514], [5.637, 0.7509], [5.3199, 0.5239]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.3307, 0.5085], [5.6525, 0.7288], [5.6612, 0.7514], [5.6336, 0.7783], [5.6079, 0.8063], [5.584, 0.8356], [5.5555, 0.8291], [5.2715, 0.5857]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.2836, 0.5713], [5.5772, 0.8125], [5.584, 0.8356], [5.5518, 0.8576], [5.5216, 0.8807], [5.4862, 0.898], [5.4627, 0.8931], [5.2178, 0.643]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.2312, 0.6297], [5.4812, 0.8746], [5.4862, 0.898], [5.4505, 0.9141], [5.4103, 0.9238], [5.3788, 0.9422], [5.36, 0.9396], [5.1594, 0.6955]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.1738, 0.6833], [5.3756, 0.9187], [5.3788, 0.9422], [5.3531, 0.9674], [5.3087, 0.9679], [5.2764, 0.983], [5.2548, 0.9736], [5.0966, 0.7426]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.1121, 0.7318], [5.275, 0.9595], [5.2764, 0.983], [5.2476, 1.0026], [5.2111, 1.01], [5.1781, 1.0219], [5.1576, 1.0106], [5.03, 0.7841]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.0463, 0.7747], [5.1786, 0.9985], [5.1781, 1.0219], [5.1482, 1.0386], [5.1177, 1.0545], [5.0868, 1.0694], [5.0698, 1.0619], [4.9599, 0.8196]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.977, 0.8116], [5.0894, 1.0461], [5.0868, 1.0694], [5.0595, 1.0927], [5.0275, 1.1059], [4.9986, 1.1276], [4.9801, 1.113], [4.8871, 0.8489]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.9048, 0.8425], [5.0012, 1.0989], [4.9986, 1.1276], [4.9677, 1.1454], [4.939, 1.1719], [4.9117, 1.2074], [4.897, 1.203], [4.812, 0.8717]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.8302, 0.8668], [4.9157, 1.1731], [4.9117, 1.2074], [4.8826, 1.2423], [4.8524, 1.2797], [4.8208, 1.3196], [4.8057, 1.3141], [4.7351, 0.8879]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.7537, 0.8846], [4.8287, 1.2857], [4.8208, 1.3196], [4.7872, 1.3588], [4.7398, 1.2978], [4.6858, 1.1157], [4.6725, 1.0968], [4.6572, 0.8973]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.676, 0.8957], [4.6955, 1.0948], [4.6858, 1.1157], [4.6533, 1.1181], [4.6207, 1.1195], [4.5881, 1.12], [4.5766, 1.0999], [4.5787, 0.9]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5976, 0.9], [4.5997, 1.0999], [4.5881, 1.12], [4.5556, 1.1195], [4.523, 1.1181], [4.4905, 1.1157], [4.4808, 1.0948], [4.5003, 0.8957]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5191, 0.8973], [4.5038, 1.0968], [4.4905, 1.1157], [4.4581, 1.1124], [4.4258, 1.1082], [4.3937, 1.103], [4.3858, 1.0812], [4.4226, 0.8846]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.4411, 0.8879], [4.4085, 1.0852], [4.3937, 1.103], [4.3617, 1.0969], [4.3299, 1.0898], [4.2983, 1.0818], [4.2923, 1.0595], [4.3461, 0.8668]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.3643, 0.8717], [4.3146, 1.0654], [4.2983, 1.0818], [4.2669, 1.0729], [4.2359, 1.0632], [4.2051, 1.0525], [4.2011, 1.0297], [4.2715, 0.8425]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.2892, 0.8489], [4.2228, 1.0375], [4.2051, 1.0525], [4.1746, 1.0409], [4.1445, 1.0284], [4.1148, 1.0151], [4.1128, 0.992], [4.1993, 0.8116]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.2163, 0.8196], [4.1337, 1.0018], [4.1148, 1.0151], [4.0855, 1.0009], [4.0566, 0.9858], [4.0281, 0.9699], [4.0282, 0.9468], [4.13, 0.7747]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.1463, 0.7841], [4.0481, 0.9583], [4.0281, 0.9699], [4.0002, 0.9533], [3.9727, 0.9357], [3.9457, 0.9175], [3.9478, 0.8944], [4.0642, 0.7318]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.0797, 0.7426], [3.9667, 0.9076], [3.9457, 0.9175], [3.8994, 0.9251], [3.8625, 0.9178], [3.8361, 0.8963], [3.8398, 0.8732], [4.0024, 0.6833]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.0169, 0.6955], [3.8582, 0.8886], [3.8361, 0.8963], [3.8059, 0.879], [3.7807, 0.8559], [3.7608, 0.8273], [3.7622, 0.8088], [3.9451, 0.6297]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.9584, 0.643], [3.7835, 0.8216], [3.7608, 0.8273], [3.7347, 0.8052], [3.7141, 0.7778], [3.6842, 0.7585], [3.6871, 0.7401], [3.8927, 0.5713]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.9048, 0.5857], [3.7119, 0.751], [3.6842, 0.7585], [3.6495, 0.7422], [3.6096, 0.7285], [3.5478, 0.7284], [3.532, 0.7232], [3.8455, 0.5085]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8564, 0.5239], [3.5864, 0.7172], [3.5478, 0.7284], [3.4129, 0.773], [3.3115, 0.7875], [3.2891, 0.75], [3.2987, 0.7265], [3.804, 0.4418]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8135, 0.4581], [3.3142, 0.7534], [3.2891, 0.75], [3.2678, 0.7119], [3.2477, 0.6732], [3.2287, 0.6339], [3.2403, 0.6114], [3.7685, 0.3718]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7765, 0.3889], [3.2534, 0.6395], [3.2287, 0.6339], [3.2108, 0.5941], [3.1941, 0.5538], [3.1786, 0.513], [3.1922, 0.4916], [3.7392, 0.2989]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7457, 0.3167], [3.2028, 0.5207], [3.1786, 0.513], [3.1643, 0.4718], [3.1544, 0.4292], [3.1682, 0.3805], [3.1953, 0.3576], [3.7164, 0.2238]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7213, 0.242], [3.18, 0.3932], [3.1682, 0.3805], [3.1902, 0.3313], [3.2138, 0.2838], [3.2291, 0.2396], [3.2582, 0.2202], [3.7002, 0.147]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7035, 0.1656], [3.2455, 0.2513], [3.2291, 0.2396], [3.2491, 0.1961], [3.2704, 0.154], [3.2831, 0.1142], [3.3079, 0.0985], [3.6908, 0.069]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.6924, 0.0878], [3.2983, 0.1265], [3.2831, 0.1142], [3.2903, 0.0756], [3.2854, 0.0379], [3.2581, 0.0], [3.2662, -0.0138], [3.6882, -0.0094]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.6882, 0.0094], [3.2902, 0.0136], [3.2581, 0.0], [3.2387, -0.0393], [3.2105, -0.0802], [3.1636, -0.1246], [3.1849, -0.1376], [3.6924, -0.0878]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.6908, -0.069], [3.2002, -0.1068], [3.1636, -0.1246], [3.1612, -0.1668], [3.1337, -0.213], [3.1109, -0.2605], [3.1334, -0.2722], [3.7035, -0.1656]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7002, -0.147], [3.1339, -0.2407], [3.1109, -0.2605], [3.1191, -0.3033], [3.1286, -0.3459], [3.1393, -0.3882], [3.1627, -0.398], [3.7213, -0.242]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7164, -0.2238], [3.1546, -0.3681], [3.1393, -0.3882], [3.1512, -0.4302], [3.1643, -0.4718], [3.1786, -0.513], [3.2028, -0.5207], [3.7457, -0.3167]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7392, -0.2989], [3.1922, -0.4916], [3.1786, -0.513], [3.1941, -0.5538], [3.2108, -0.5941], [3.2287, -0.6339], [3.2534, -0.6395], [3.7765, -0.3889]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.7685, -0.3718], [3.2403, -0.6114], [3.2287, -0.6339], [3.2477, -0.6732], [3.2678, -0.7119], [3.2891, -0.75], [3.3142, -0.7534], [3.8135, -0.4581]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.804, -0.4418], [3.2987, -0.7265], [3.2891, -0.75], [3.3115, -0.7875], [3.3349, -0.8243], [3.3594, -0.8604], [3.3848, -0.8615], [3.8564, -0.5239]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8455, -0.5085], [3.367, -0.8362], [3.3594, -0.8604], [3.385, -0.8957], [3.4115, -0.9304], [3.4391, -0.9642], [3.4644, -0.9631], [3.9048, -0.5857]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8927, -0.5713], [3.4445, -0.9394], [3.4391, -0.9642], [3.4676, -0.9972], [3.4971, -1.0294], [3.5275, -1.0607], [3.5526, -1.0574], [3.9584, -0.643]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.9451, -0.6297], [3.5307, -1.0355], [3.5275, -1.0607], [3.5588, -1.0911], [3.5909, -1.1205], [3.624, -1.1491], [3.6487, -1.1436], [4.0169, -0.6955]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.0024, -0.6833], [3.625, -1.1237], [3.624, -1.1491], [3.6578, -1.1766], [3.6924, -1.2032], [3.7278, -1.2287], [3.752, -1.2212], [4.0797, -0.7426]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.0642, -0.7318], [3.7266, -1.2034], [3.7278, -1.2287], [3.7639, -1.2532], [3.8007, -1.2767], [3.8381, -1.299], [3.8616, -1.2894], [4.1463, -0.7841]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.13, -0.7747], [3.8348, -1.2739], [3.8381, -1.299], [3.8762, -1.3203], [3.9149, -1.3404], [3.9542, -1.3595], [3.9767, -1.3478], [4.2163, -0.8196]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.1993, -0.8116], [3.9487, -1.3347], [3.9542, -1.3595], [3.994, -1.3773], [4.0343, -1.394], [4.0751, -1.4095], [4.0965, -1.396], [4.2892, -0.8489]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.2715, -0.8425], [4.0674, -1.3854], [4.0751, -1.4095], [4.1163, -1.4239], [4.1579, -1.437], [4.1999, -1.4489], [4.2201, -1.4335], [4.3643, -0.8717]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.3461, -0.8668], [4.1901, -1.4255], [4.1999, -1.4489], [4.2422, -1.4596], [4.2848, -1.469], [4.3277, -1.4772], [4.3464, -1.4601], [4.4411, -0.8879]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.4226, -0.8846], [4.3159, -1.4547], [4.3277, -1.4772], [4.3707, -1.4842], [4.414, -1.4899], [4.4574, -1.4943], [4.4746, -1.4756], [4.5191, -0.8973]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5003, -0.8957], [4.4437, -1.4729], [4.4574, -1.4943], [4.5009, -1.4975], [4.5445, -1.4994], [4.5881, -1.5], [4.6036, -1.4799], [4.5976, -0.9]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5787, -0.9], [4.5726, -1.4799], [4.5881, -1.5], [4.6318, -1.4994], [4.6754, -1.4975], [4.7189, -1.4943], [4.7326, -1.4729], [4.676, -0.8957]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.6572, -0.8973], [4.7017, -1.4756], [4.7189, -1.4943], [4.7623, -1.4899], [4.8055, -1.4842], [4.8486, -1.4772], [4.8604, -1.4547], [4.7537, -0.8846]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.7351, -0.8879], [4.8299, -1.4601], [4.8486, -1.4772], [4.8915, -1.469], [4.9341, -1.4596], [4.9764, -1.4489], [4.9861, -1.4255], [4.8302, -0.8668]], y: [-0.5, 0.5], collide: 1}
      - {kind: rod, from: [4.2258, -0.5, 1.3523], to: [4.2258, 0.5, 1.3523], radius: 0.4, capsule: true, collide: 1, color: "#6b5a44"}   # the tooth
      - {kind: disc, center: [4.5881, 0], radius: 0.5, y: [-1.2, -0.5], color: "#8f8a80"}   # its boss
      - {kind: disc, center: [4.5881, 0], radius: 1.45, y: [1.0, 5.0], density: 7800, color: "#8f8a80"}   # a heavy drum on its shaft, hidden behind it (steadies the drive)
  - id: frame
    shape: frame
    color: "#8f8a80"
    rods:
      - {from: [-4.6, 0.5, 0], to: [-4.6, 2.0, 0], radius: 0.6}
      - {from: [4.5881, 5.0, 0], to: [4.5881, 6.0, 0], radius: 0.4}
joints:
  - {id: j_b, type: hinge, body: wheel_b, axis: [0, -1, 0], damping: 0.02}   # positive: against the clock, as drawn
  - {id: j_a, type: hinge, body: wheel_a, axis: [0, 1, 0], damping: 0.01}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_b, kind: velocity, rpm: 12, kv: 0.2, max_torque: 2}
checks:
  - {type: ratio, out: j_a, in: j_b, expect: 0.03333, tol: 0.001, settle_s: 4.31, window_s: 17.09}   # one tooth a turn (three whole turns of B, mid-dwell to mid-dwell)
  - {type: still, joint: j_a, max: 0.005, settle_s: 4.5, window_s: 1.5}   # locked by B's circumference
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [-1, 0, 0], position: [-1, -62, 6], fov: 34}
display:
  output: j_a
  labels: {j_b: "B, the small wheel with one tooth (driver)", j_a: "A, the toothed wheel"}
  proof: {label: "Tooth out of contact", sub: "A is never turned"}

