# No. 173 (Brown 1868): "A movement used in silk machinery for the same purpose as that described in 142. On the back of a disk or bevel-gear is secured
#  a screw with a tappet-wheel at one extremity. On each revolution of the disk the tappet-wheel comes in contact with a pin or tappet, and thus receives an
#  intermittent rotary movement. A wrist secured to a nut on the screw enters and works in a slotted bar at the end of the rod which guides the silk on the
#  bobbins. Each revolution of the disk varies the length of stroke of the guide-rod, as the tappet-wheel on the end of the screw turns the screw with it, and the
#  position of the nut on the screw is therefore changed."
#
# Model (cm): the disk (the one driven joint, 10 rpm) turns about y. Along one radius, in bearings on its face, lies the screw: a single thread of pitch 1.2
# (root 0.6, tip 0.95, 86 loft segments), held from turning on its own by friction in its bearings (0.05 N m). At its outer end is a tappet-wheel of 4 arms
# (1.5 long); once a turn the arms pass a fixed tappet, which catches one arm and turns the screw a quarter turn. The nut slides along the disk's radius in a
# guide and carries two teeth in the thread (top and bottom), so each quarter turn of the screw moves it 0.30 along the radius. A wrist on the nut works
# in the vertical slot of the guide-rod's slotted bar; the guide-rod slides along x, so its stroke is twice the wrist's radius, which changes once a turn.
# Generator: opencode-runs/batch11/gen173.py.
number: 173
slug: silk-guide-variable-stroke-screw
name: Variable stroke for a silk guide by a screw and tappet-wheel
brown: "A movement used in silk machinery ... Each revolution of the disk varies the length of stroke of the guide-rod ..."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 39.0
  floor: false
bodies:
  - id: disk
    shape: part
    pos: [0, 0, 0]
    density: 2700
    color: "#d9ccae"
    pieces:
      - {kind: disc, center: [0, 0], radius: 11, y: [-0.6, 0.6], collide: 0}
      - {kind: poly, points: [[1.2, -0.3], [9.0, -0.3], [9.0, 0.3], [1.2, 0.3]], y: [-2.0, -0.6], collide: 0}   # the screw's bed
      - {kind: poly, points: [[0.9, -1.4], [1.3, -1.4], [1.3, 1.4], [0.9, 1.4]], y: [-3.6, -0.6], collide: 0}   # its inner bearing
      - {kind: poly, points: [[8.7, -1.4], [9.1, -1.4], [9.1, 1.4], [8.7, 1.4]], y: [-3.6, -0.6], collide: 0}   # its outer bearing
      - {kind: poly, points: [[1.2, 1.25], [8.7, 1.25], [8.7, 1.45], [1.2, 1.45]], y: [-3.6, -1.6], collide: 0}   # the nut's guide
  - id: screw
    shape: part
    mount: disk
    pos: [5, -2.6, 0]
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: rod, from: [1.0, -2.6, 0], to: [9.4, -2.6, 0], radius: 0.58, collide: 0}
      - {kind: loft, a: [[1.35, -2.0, 0.0], [1.85, -2.0, 0.0], [1.74, -1.65, 0.0], [1.46, -1.65, 0.0]], b: [[1.425, -2.0457, 0.2296], [1.925, -2.0457, 0.2296], [1.815, -1.7223, 0.3635], [1.535, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[1.425, -2.0457, 0.2296], [1.925, -2.0457, 0.2296], [1.815, -1.7223, 0.3635], [1.535, -1.7223, 0.3635]], b: [[1.5, -2.1757, 0.4243], [2.0, -2.1757, 0.4243], [1.89, -1.9282, 0.6718], [1.61, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[1.5, -2.1757, 0.4243], [2.0, -2.1757, 0.4243], [1.89, -1.9282, 0.6718], [1.61, -1.9282, 0.6718]], b: [[1.575, -2.3704, 0.5543], [2.075, -2.3704, 0.5543], [1.965, -2.2365, 0.8777], [1.685, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[1.575, -2.3704, 0.5543], [2.075, -2.3704, 0.5543], [1.965, -2.2365, 0.8777], [1.685, -2.2365, 0.8777]], b: [[1.65, -2.6, 0.6], [2.15, -2.6, 0.6], [2.04, -2.6, 0.95], [1.76, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[1.65, -2.6, 0.6], [2.15, -2.6, 0.6], [2.04, -2.6, 0.95], [1.76, -2.6, 0.95]], b: [[1.725, -2.8296, 0.5543], [2.225, -2.8296, 0.5543], [2.115, -2.9635, 0.8777], [1.835, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[1.725, -2.8296, 0.5543], [2.225, -2.8296, 0.5543], [2.115, -2.9635, 0.8777], [1.835, -2.9635, 0.8777]], b: [[1.8, -3.0243, 0.4243], [2.3, -3.0243, 0.4243], [2.19, -3.2718, 0.6718], [1.91, -3.2718, 0.6718]], collide: 1}
      - {kind: loft, a: [[1.8, -3.0243, 0.4243], [2.3, -3.0243, 0.4243], [2.19, -3.2718, 0.6718], [1.91, -3.2718, 0.6718]], b: [[1.875, -3.1543, 0.2296], [2.375, -3.1543, 0.2296], [2.265, -3.4777, 0.3635], [1.985, -3.4777, 0.3635]], collide: 1}
      - {kind: loft, a: [[1.875, -3.1543, 0.2296], [2.375, -3.1543, 0.2296], [2.265, -3.4777, 0.3635], [1.985, -3.4777, 0.3635]], b: [[1.95, -3.2, 0.0], [2.45, -3.2, 0.0], [2.34, -3.55, 0.0], [2.06, -3.55, 0.0]], collide: 1}
      - {kind: loft, a: [[1.95, -3.2, 0.0], [2.45, -3.2, 0.0], [2.34, -3.55, 0.0], [2.06, -3.55, 0.0]], b: [[2.025, -3.1543, -0.2296], [2.525, -3.1543, -0.2296], [2.415, -3.4777, -0.3635], [2.135, -3.4777, -0.3635]], collide: 1}
      - {kind: loft, a: [[2.025, -3.1543, -0.2296], [2.525, -3.1543, -0.2296], [2.415, -3.4777, -0.3635], [2.135, -3.4777, -0.3635]], b: [[2.1, -3.0243, -0.4243], [2.6, -3.0243, -0.4243], [2.49, -3.2718, -0.6718], [2.21, -3.2718, -0.6718]], collide: 1}
      - {kind: loft, a: [[2.1, -3.0243, -0.4243], [2.6, -3.0243, -0.4243], [2.49, -3.2718, -0.6718], [2.21, -3.2718, -0.6718]], b: [[2.175, -2.8296, -0.5543], [2.675, -2.8296, -0.5543], [2.565, -2.9635, -0.8777], [2.285, -2.9635, -0.8777]], collide: 1}
      - {kind: loft, a: [[2.175, -2.8296, -0.5543], [2.675, -2.8296, -0.5543], [2.565, -2.9635, -0.8777], [2.285, -2.9635, -0.8777]], b: [[2.25, -2.6, -0.6], [2.75, -2.6, -0.6], [2.64, -2.6, -0.95], [2.36, -2.6, -0.95]], collide: 1}
      - {kind: loft, a: [[2.25, -2.6, -0.6], [2.75, -2.6, -0.6], [2.64, -2.6, -0.95], [2.36, -2.6, -0.95]], b: [[2.325, -2.3704, -0.5543], [2.825, -2.3704, -0.5543], [2.715, -2.2365, -0.8777], [2.435, -2.2365, -0.8777]], collide: 1}
      - {kind: loft, a: [[2.325, -2.3704, -0.5543], [2.825, -2.3704, -0.5543], [2.715, -2.2365, -0.8777], [2.435, -2.2365, -0.8777]], b: [[2.4, -2.1757, -0.4243], [2.9, -2.1757, -0.4243], [2.79, -1.9282, -0.6718], [2.51, -1.9282, -0.6718]], collide: 1}
      - {kind: loft, a: [[2.4, -2.1757, -0.4243], [2.9, -2.1757, -0.4243], [2.79, -1.9282, -0.6718], [2.51, -1.9282, -0.6718]], b: [[2.475, -2.0457, -0.2296], [2.975, -2.0457, -0.2296], [2.865, -1.7223, -0.3635], [2.585, -1.7223, -0.3635]], collide: 1}
      - {kind: loft, a: [[2.475, -2.0457, -0.2296], [2.975, -2.0457, -0.2296], [2.865, -1.7223, -0.3635], [2.585, -1.7223, -0.3635]], b: [[2.55, -2.0, -0.0], [3.05, -2.0, -0.0], [2.94, -1.65, -0.0], [2.66, -1.65, -0.0]], collide: 1}
      - {kind: loft, a: [[2.55, -2.0, -0.0], [3.05, -2.0, -0.0], [2.94, -1.65, -0.0], [2.66, -1.65, -0.0]], b: [[2.625, -2.0457, 0.2296], [3.125, -2.0457, 0.2296], [3.015, -1.7223, 0.3635], [2.735, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[2.625, -2.0457, 0.2296], [3.125, -2.0457, 0.2296], [3.015, -1.7223, 0.3635], [2.735, -1.7223, 0.3635]], b: [[2.7, -2.1757, 0.4243], [3.2, -2.1757, 0.4243], [3.09, -1.9282, 0.6718], [2.81, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[2.7, -2.1757, 0.4243], [3.2, -2.1757, 0.4243], [3.09, -1.9282, 0.6718], [2.81, -1.9282, 0.6718]], b: [[2.775, -2.3704, 0.5543], [3.275, -2.3704, 0.5543], [3.165, -2.2365, 0.8777], [2.885, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[2.775, -2.3704, 0.5543], [3.275, -2.3704, 0.5543], [3.165, -2.2365, 0.8777], [2.885, -2.2365, 0.8777]], b: [[2.85, -2.6, 0.6], [3.35, -2.6, 0.6], [3.24, -2.6, 0.95], [2.96, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[2.85, -2.6, 0.6], [3.35, -2.6, 0.6], [3.24, -2.6, 0.95], [2.96, -2.6, 0.95]], b: [[2.925, -2.8296, 0.5543], [3.425, -2.8296, 0.5543], [3.315, -2.9635, 0.8777], [3.035, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[2.925, -2.8296, 0.5543], [3.425, -2.8296, 0.5543], [3.315, -2.9635, 0.8777], [3.035, -2.9635, 0.8777]], b: [[3.0, -3.0243, 0.4243], [3.5, -3.0243, 0.4243], [3.39, -3.2718, 0.6718], [3.11, -3.2718, 0.6718]], collide: 1}
      - {kind: loft, a: [[3.0, -3.0243, 0.4243], [3.5, -3.0243, 0.4243], [3.39, -3.2718, 0.6718], [3.11, -3.2718, 0.6718]], b: [[3.075, -3.1543, 0.2296], [3.575, -3.1543, 0.2296], [3.465, -3.4777, 0.3635], [3.185, -3.4777, 0.3635]], collide: 1}
      - {kind: loft, a: [[3.075, -3.1543, 0.2296], [3.575, -3.1543, 0.2296], [3.465, -3.4777, 0.3635], [3.185, -3.4777, 0.3635]], b: [[3.15, -3.2, 0.0], [3.65, -3.2, 0.0], [3.54, -3.55, 0.0], [3.26, -3.55, 0.0]], collide: 1}
      - {kind: loft, a: [[3.15, -3.2, 0.0], [3.65, -3.2, 0.0], [3.54, -3.55, 0.0], [3.26, -3.55, 0.0]], b: [[3.225, -3.1543, -0.2296], [3.725, -3.1543, -0.2296], [3.615, -3.4777, -0.3635], [3.335, -3.4777, -0.3635]], collide: 1}
      - {kind: loft, a: [[3.225, -3.1543, -0.2296], [3.725, -3.1543, -0.2296], [3.615, -3.4777, -0.3635], [3.335, -3.4777, -0.3635]], b: [[3.3, -3.0243, -0.4243], [3.8, -3.0243, -0.4243], [3.69, -3.2718, -0.6718], [3.41, -3.2718, -0.6718]], collide: 1}
      - {kind: loft, a: [[3.3, -3.0243, -0.4243], [3.8, -3.0243, -0.4243], [3.69, -3.2718, -0.6718], [3.41, -3.2718, -0.6718]], b: [[3.375, -2.8296, -0.5543], [3.875, -2.8296, -0.5543], [3.765, -2.9635, -0.8777], [3.485, -2.9635, -0.8777]], collide: 1}
      - {kind: loft, a: [[3.375, -2.8296, -0.5543], [3.875, -2.8296, -0.5543], [3.765, -2.9635, -0.8777], [3.485, -2.9635, -0.8777]], b: [[3.45, -2.6, -0.6], [3.95, -2.6, -0.6], [3.84, -2.6, -0.95], [3.56, -2.6, -0.95]], collide: 1}
      - {kind: loft, a: [[3.45, -2.6, -0.6], [3.95, -2.6, -0.6], [3.84, -2.6, -0.95], [3.56, -2.6, -0.95]], b: [[3.525, -2.3704, -0.5543], [4.025, -2.3704, -0.5543], [3.915, -2.2365, -0.8777], [3.635, -2.2365, -0.8777]], collide: 1}
      - {kind: loft, a: [[3.525, -2.3704, -0.5543], [4.025, -2.3704, -0.5543], [3.915, -2.2365, -0.8777], [3.635, -2.2365, -0.8777]], b: [[3.6, -2.1757, -0.4243], [4.1, -2.1757, -0.4243], [3.99, -1.9282, -0.6718], [3.71, -1.9282, -0.6718]], collide: 1}
      - {kind: loft, a: [[3.6, -2.1757, -0.4243], [4.1, -2.1757, -0.4243], [3.99, -1.9282, -0.6718], [3.71, -1.9282, -0.6718]], b: [[3.675, -2.0457, -0.2296], [4.175, -2.0457, -0.2296], [4.065, -1.7223, -0.3635], [3.785, -1.7223, -0.3635]], collide: 1}
      - {kind: loft, a: [[3.675, -2.0457, -0.2296], [4.175, -2.0457, -0.2296], [4.065, -1.7223, -0.3635], [3.785, -1.7223, -0.3635]], b: [[3.75, -2.0, -0.0], [4.25, -2.0, -0.0], [4.14, -1.65, -0.0], [3.86, -1.65, -0.0]], collide: 1}
      - {kind: loft, a: [[3.75, -2.0, -0.0], [4.25, -2.0, -0.0], [4.14, -1.65, -0.0], [3.86, -1.65, -0.0]], b: [[3.825, -2.0457, 0.2296], [4.325, -2.0457, 0.2296], [4.215, -1.7223, 0.3635], [3.935, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[3.825, -2.0457, 0.2296], [4.325, -2.0457, 0.2296], [4.215, -1.7223, 0.3635], [3.935, -1.7223, 0.3635]], b: [[3.9, -2.1757, 0.4243], [4.4, -2.1757, 0.4243], [4.29, -1.9282, 0.6718], [4.01, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[3.9, -2.1757, 0.4243], [4.4, -2.1757, 0.4243], [4.29, -1.9282, 0.6718], [4.01, -1.9282, 0.6718]], b: [[3.975, -2.3704, 0.5543], [4.475, -2.3704, 0.5543], [4.365, -2.2365, 0.8777], [4.085, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[3.975, -2.3704, 0.5543], [4.475, -2.3704, 0.5543], [4.365, -2.2365, 0.8777], [4.085, -2.2365, 0.8777]], b: [[4.05, -2.6, 0.6], [4.55, -2.6, 0.6], [4.44, -2.6, 0.95], [4.16, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[4.05, -2.6, 0.6], [4.55, -2.6, 0.6], [4.44, -2.6, 0.95], [4.16, -2.6, 0.95]], b: [[4.125, -2.8296, 0.5543], [4.625, -2.8296, 0.5543], [4.515, -2.9635, 0.8777], [4.235, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[4.125, -2.8296, 0.5543], [4.625, -2.8296, 0.5543], [4.515, -2.9635, 0.8777], [4.235, -2.9635, 0.8777]], b: [[4.2, -3.0243, 0.4243], [4.7, -3.0243, 0.4243], [4.59, -3.2718, 0.6718], [4.31, -3.2718, 0.6718]], collide: 1}
      - {kind: loft, a: [[4.2, -3.0243, 0.4243], [4.7, -3.0243, 0.4243], [4.59, -3.2718, 0.6718], [4.31, -3.2718, 0.6718]], b: [[4.275, -3.1543, 0.2296], [4.775, -3.1543, 0.2296], [4.665, -3.4777, 0.3635], [4.385, -3.4777, 0.3635]], collide: 1}
      - {kind: loft, a: [[4.275, -3.1543, 0.2296], [4.775, -3.1543, 0.2296], [4.665, -3.4777, 0.3635], [4.385, -3.4777, 0.3635]], b: [[4.35, -3.2, 0.0], [4.85, -3.2, 0.0], [4.74, -3.55, 0.0], [4.46, -3.55, 0.0]], collide: 1}
      - {kind: loft, a: [[4.35, -3.2, 0.0], [4.85, -3.2, 0.0], [4.74, -3.55, 0.0], [4.46, -3.55, 0.0]], b: [[4.425, -3.1543, -0.2296], [4.925, -3.1543, -0.2296], [4.815, -3.4777, -0.3635], [4.535, -3.4777, -0.3635]], collide: 1}
      - {kind: loft, a: [[4.425, -3.1543, -0.2296], [4.925, -3.1543, -0.2296], [4.815, -3.4777, -0.3635], [4.535, -3.4777, -0.3635]], b: [[4.5, -3.0243, -0.4243], [5.0, -3.0243, -0.4243], [4.89, -3.2718, -0.6718], [4.61, -3.2718, -0.6718]], collide: 1}
      - {kind: loft, a: [[4.5, -3.0243, -0.4243], [5.0, -3.0243, -0.4243], [4.89, -3.2718, -0.6718], [4.61, -3.2718, -0.6718]], b: [[4.575, -2.8296, -0.5543], [5.075, -2.8296, -0.5543], [4.965, -2.9635, -0.8777], [4.685, -2.9635, -0.8777]], collide: 1}
      - {kind: loft, a: [[4.575, -2.8296, -0.5543], [5.075, -2.8296, -0.5543], [4.965, -2.9635, -0.8777], [4.685, -2.9635, -0.8777]], b: [[4.65, -2.6, -0.6], [5.15, -2.6, -0.6], [5.04, -2.6, -0.95], [4.76, -2.6, -0.95]], collide: 1}
      - {kind: loft, a: [[4.65, -2.6, -0.6], [5.15, -2.6, -0.6], [5.04, -2.6, -0.95], [4.76, -2.6, -0.95]], b: [[4.725, -2.3704, -0.5543], [5.225, -2.3704, -0.5543], [5.115, -2.2365, -0.8777], [4.835, -2.2365, -0.8777]], collide: 1}
      - {kind: loft, a: [[4.725, -2.3704, -0.5543], [5.225, -2.3704, -0.5543], [5.115, -2.2365, -0.8777], [4.835, -2.2365, -0.8777]], b: [[4.8, -2.1757, -0.4243], [5.3, -2.1757, -0.4243], [5.19, -1.9282, -0.6718], [4.91, -1.9282, -0.6718]], collide: 1}
      - {kind: loft, a: [[4.8, -2.1757, -0.4243], [5.3, -2.1757, -0.4243], [5.19, -1.9282, -0.6718], [4.91, -1.9282, -0.6718]], b: [[4.875, -2.0457, -0.2296], [5.375, -2.0457, -0.2296], [5.265, -1.7223, -0.3635], [4.985, -1.7223, -0.3635]], collide: 1}
      - {kind: loft, a: [[4.875, -2.0457, -0.2296], [5.375, -2.0457, -0.2296], [5.265, -1.7223, -0.3635], [4.985, -1.7223, -0.3635]], b: [[4.95, -2.0, -0.0], [5.45, -2.0, -0.0], [5.34, -1.65, -0.0], [5.06, -1.65, -0.0]], collide: 1}
      - {kind: loft, a: [[4.95, -2.0, -0.0], [5.45, -2.0, -0.0], [5.34, -1.65, -0.0], [5.06, -1.65, -0.0]], b: [[5.025, -2.0457, 0.2296], [5.525, -2.0457, 0.2296], [5.415, -1.7223, 0.3635], [5.135, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[5.025, -2.0457, 0.2296], [5.525, -2.0457, 0.2296], [5.415, -1.7223, 0.3635], [5.135, -1.7223, 0.3635]], b: [[5.1, -2.1757, 0.4243], [5.6, -2.1757, 0.4243], [5.49, -1.9282, 0.6718], [5.21, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[5.1, -2.1757, 0.4243], [5.6, -2.1757, 0.4243], [5.49, -1.9282, 0.6718], [5.21, -1.9282, 0.6718]], b: [[5.175, -2.3704, 0.5543], [5.675, -2.3704, 0.5543], [5.565, -2.2365, 0.8777], [5.285, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[5.175, -2.3704, 0.5543], [5.675, -2.3704, 0.5543], [5.565, -2.2365, 0.8777], [5.285, -2.2365, 0.8777]], b: [[5.25, -2.6, 0.6], [5.75, -2.6, 0.6], [5.64, -2.6, 0.95], [5.36, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[5.25, -2.6, 0.6], [5.75, -2.6, 0.6], [5.64, -2.6, 0.95], [5.36, -2.6, 0.95]], b: [[5.325, -2.8296, 0.5543], [5.825, -2.8296, 0.5543], [5.715, -2.9635, 0.8777], [5.435, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[5.325, -2.8296, 0.5543], [5.825, -2.8296, 0.5543], [5.715, -2.9635, 0.8777], [5.435, -2.9635, 0.8777]], b: [[5.4, -3.0243, 0.4243], [5.9, -3.0243, 0.4243], [5.79, -3.2718, 0.6718], [5.51, -3.2718, 0.6718]], collide: 1}
      - {kind: loft, a: [[5.4, -3.0243, 0.4243], [5.9, -3.0243, 0.4243], [5.79, -3.2718, 0.6718], [5.51, -3.2718, 0.6718]], b: [[5.475, -3.1543, 0.2296], [5.975, -3.1543, 0.2296], [5.865, -3.4777, 0.3635], [5.585, -3.4777, 0.3635]], collide: 1}
      - {kind: loft, a: [[5.475, -3.1543, 0.2296], [5.975, -3.1543, 0.2296], [5.865, -3.4777, 0.3635], [5.585, -3.4777, 0.3635]], b: [[5.55, -3.2, 0.0], [6.05, -3.2, 0.0], [5.94, -3.55, 0.0], [5.66, -3.55, 0.0]], collide: 1}
      - {kind: loft, a: [[5.55, -3.2, 0.0], [6.05, -3.2, 0.0], [5.94, -3.55, 0.0], [5.66, -3.55, 0.0]], b: [[5.625, -3.1543, -0.2296], [6.125, -3.1543, -0.2296], [6.015, -3.4777, -0.3635], [5.735, -3.4777, -0.3635]], collide: 1}
      - {kind: loft, a: [[5.625, -3.1543, -0.2296], [6.125, -3.1543, -0.2296], [6.015, -3.4777, -0.3635], [5.735, -3.4777, -0.3635]], b: [[5.7, -3.0243, -0.4243], [6.2, -3.0243, -0.4243], [6.09, -3.2718, -0.6718], [5.81, -3.2718, -0.6718]], collide: 1}
      - {kind: loft, a: [[5.7, -3.0243, -0.4243], [6.2, -3.0243, -0.4243], [6.09, -3.2718, -0.6718], [5.81, -3.2718, -0.6718]], b: [[5.775, -2.8296, -0.5543], [6.275, -2.8296, -0.5543], [6.165, -2.9635, -0.8777], [5.885, -2.9635, -0.8777]], collide: 1}
      - {kind: loft, a: [[5.775, -2.8296, -0.5543], [6.275, -2.8296, -0.5543], [6.165, -2.9635, -0.8777], [5.885, -2.9635, -0.8777]], b: [[5.85, -2.6, -0.6], [6.35, -2.6, -0.6], [6.24, -2.6, -0.95], [5.96, -2.6, -0.95]], collide: 1}
      - {kind: loft, a: [[5.85, -2.6, -0.6], [6.35, -2.6, -0.6], [6.24, -2.6, -0.95], [5.96, -2.6, -0.95]], b: [[5.925, -2.3704, -0.5543], [6.425, -2.3704, -0.5543], [6.315, -2.2365, -0.8777], [6.035, -2.2365, -0.8777]], collide: 1}
      - {kind: loft, a: [[5.925, -2.3704, -0.5543], [6.425, -2.3704, -0.5543], [6.315, -2.2365, -0.8777], [6.035, -2.2365, -0.8777]], b: [[6.0, -2.1757, -0.4243], [6.5, -2.1757, -0.4243], [6.39, -1.9282, -0.6718], [6.11, -1.9282, -0.6718]], collide: 1}
      - {kind: loft, a: [[6.0, -2.1757, -0.4243], [6.5, -2.1757, -0.4243], [6.39, -1.9282, -0.6718], [6.11, -1.9282, -0.6718]], b: [[6.075, -2.0457, -0.2296], [6.575, -2.0457, -0.2296], [6.465, -1.7223, -0.3635], [6.185, -1.7223, -0.3635]], collide: 1}
      - {kind: loft, a: [[6.075, -2.0457, -0.2296], [6.575, -2.0457, -0.2296], [6.465, -1.7223, -0.3635], [6.185, -1.7223, -0.3635]], b: [[6.15, -2.0, -0.0], [6.65, -2.0, -0.0], [6.54, -1.65, -0.0], [6.26, -1.65, -0.0]], collide: 1}
      - {kind: loft, a: [[6.15, -2.0, -0.0], [6.65, -2.0, -0.0], [6.54, -1.65, -0.0], [6.26, -1.65, -0.0]], b: [[6.225, -2.0457, 0.2296], [6.725, -2.0457, 0.2296], [6.615, -1.7223, 0.3635], [6.335, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[6.225, -2.0457, 0.2296], [6.725, -2.0457, 0.2296], [6.615, -1.7223, 0.3635], [6.335, -1.7223, 0.3635]], b: [[6.3, -2.1757, 0.4243], [6.8, -2.1757, 0.4243], [6.69, -1.9282, 0.6718], [6.41, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[6.3, -2.1757, 0.4243], [6.8, -2.1757, 0.4243], [6.69, -1.9282, 0.6718], [6.41, -1.9282, 0.6718]], b: [[6.375, -2.3704, 0.5543], [6.875, -2.3704, 0.5543], [6.765, -2.2365, 0.8777], [6.485, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[6.375, -2.3704, 0.5543], [6.875, -2.3704, 0.5543], [6.765, -2.2365, 0.8777], [6.485, -2.2365, 0.8777]], b: [[6.45, -2.6, 0.6], [6.95, -2.6, 0.6], [6.84, -2.6, 0.95], [6.56, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[6.45, -2.6, 0.6], [6.95, -2.6, 0.6], [6.84, -2.6, 0.95], [6.56, -2.6, 0.95]], b: [[6.525, -2.8296, 0.5543], [7.025, -2.8296, 0.5543], [6.915, -2.9635, 0.8777], [6.635, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[6.525, -2.8296, 0.5543], [7.025, -2.8296, 0.5543], [6.915, -2.9635, 0.8777], [6.635, -2.9635, 0.8777]], b: [[6.6, -3.0243, 0.4243], [7.1, -3.0243, 0.4243], [6.99, -3.2718, 0.6718], [6.71, -3.2718, 0.6718]], collide: 1}
      - {kind: loft, a: [[6.6, -3.0243, 0.4243], [7.1, -3.0243, 0.4243], [6.99, -3.2718, 0.6718], [6.71, -3.2718, 0.6718]], b: [[6.675, -3.1543, 0.2296], [7.175, -3.1543, 0.2296], [7.065, -3.4777, 0.3635], [6.785, -3.4777, 0.3635]], collide: 1}
      - {kind: loft, a: [[6.675, -3.1543, 0.2296], [7.175, -3.1543, 0.2296], [7.065, -3.4777, 0.3635], [6.785, -3.4777, 0.3635]], b: [[6.75, -3.2, 0.0], [7.25, -3.2, 0.0], [7.14, -3.55, 0.0], [6.86, -3.55, 0.0]], collide: 1}
      - {kind: loft, a: [[6.75, -3.2, 0.0], [7.25, -3.2, 0.0], [7.14, -3.55, 0.0], [6.86, -3.55, 0.0]], b: [[6.825, -3.1543, -0.2296], [7.325, -3.1543, -0.2296], [7.215, -3.4777, -0.3635], [6.935, -3.4777, -0.3635]], collide: 1}
      - {kind: loft, a: [[6.825, -3.1543, -0.2296], [7.325, -3.1543, -0.2296], [7.215, -3.4777, -0.3635], [6.935, -3.4777, -0.3635]], b: [[6.9, -3.0243, -0.4243], [7.4, -3.0243, -0.4243], [7.29, -3.2718, -0.6718], [7.01, -3.2718, -0.6718]], collide: 1}
      - {kind: loft, a: [[6.9, -3.0243, -0.4243], [7.4, -3.0243, -0.4243], [7.29, -3.2718, -0.6718], [7.01, -3.2718, -0.6718]], b: [[6.975, -2.8296, -0.5543], [7.475, -2.8296, -0.5543], [7.365, -2.9635, -0.8777], [7.085, -2.9635, -0.8777]], collide: 1}
      - {kind: loft, a: [[6.975, -2.8296, -0.5543], [7.475, -2.8296, -0.5543], [7.365, -2.9635, -0.8777], [7.085, -2.9635, -0.8777]], b: [[7.05, -2.6, -0.6], [7.55, -2.6, -0.6], [7.44, -2.6, -0.95], [7.16, -2.6, -0.95]], collide: 1}
      - {kind: loft, a: [[7.05, -2.6, -0.6], [7.55, -2.6, -0.6], [7.44, -2.6, -0.95], [7.16, -2.6, -0.95]], b: [[7.125, -2.3704, -0.5543], [7.625, -2.3704, -0.5543], [7.515, -2.2365, -0.8777], [7.235, -2.2365, -0.8777]], collide: 1}
      - {kind: loft, a: [[7.125, -2.3704, -0.5543], [7.625, -2.3704, -0.5543], [7.515, -2.2365, -0.8777], [7.235, -2.2365, -0.8777]], b: [[7.2, -2.1757, -0.4243], [7.7, -2.1757, -0.4243], [7.59, -1.9282, -0.6718], [7.31, -1.9282, -0.6718]], collide: 1}
      - {kind: loft, a: [[7.2, -2.1757, -0.4243], [7.7, -2.1757, -0.4243], [7.59, -1.9282, -0.6718], [7.31, -1.9282, -0.6718]], b: [[7.275, -2.0457, -0.2296], [7.775, -2.0457, -0.2296], [7.665, -1.7223, -0.3635], [7.385, -1.7223, -0.3635]], collide: 1}
      - {kind: loft, a: [[7.275, -2.0457, -0.2296], [7.775, -2.0457, -0.2296], [7.665, -1.7223, -0.3635], [7.385, -1.7223, -0.3635]], b: [[7.35, -2.0, -0.0], [7.85, -2.0, -0.0], [7.74, -1.65, -0.0], [7.46, -1.65, -0.0]], collide: 1}
      - {kind: loft, a: [[7.35, -2.0, -0.0], [7.85, -2.0, -0.0], [7.74, -1.65, -0.0], [7.46, -1.65, -0.0]], b: [[7.425, -2.0457, 0.2296], [7.925, -2.0457, 0.2296], [7.815, -1.7223, 0.3635], [7.535, -1.7223, 0.3635]], collide: 1}
      - {kind: loft, a: [[7.425, -2.0457, 0.2296], [7.925, -2.0457, 0.2296], [7.815, -1.7223, 0.3635], [7.535, -1.7223, 0.3635]], b: [[7.5, -2.1757, 0.4243], [8.0, -2.1757, 0.4243], [7.89, -1.9282, 0.6718], [7.61, -1.9282, 0.6718]], collide: 1}
      - {kind: loft, a: [[7.5, -2.1757, 0.4243], [8.0, -2.1757, 0.4243], [7.89, -1.9282, 0.6718], [7.61, -1.9282, 0.6718]], b: [[7.575, -2.3704, 0.5543], [8.075, -2.3704, 0.5543], [7.965, -2.2365, 0.8777], [7.685, -2.2365, 0.8777]], collide: 1}
      - {kind: loft, a: [[7.575, -2.3704, 0.5543], [8.075, -2.3704, 0.5543], [7.965, -2.2365, 0.8777], [7.685, -2.2365, 0.8777]], b: [[7.65, -2.6, 0.6], [8.15, -2.6, 0.6], [8.04, -2.6, 0.95], [7.76, -2.6, 0.95]], collide: 1}
      - {kind: loft, a: [[7.65, -2.6, 0.6], [8.15, -2.6, 0.6], [8.04, -2.6, 0.95], [7.76, -2.6, 0.95]], b: [[7.725, -2.8296, 0.5543], [8.225, -2.8296, 0.5543], [8.115, -2.9635, 0.8777], [7.835, -2.9635, 0.8777]], collide: 1}
      - {kind: loft, a: [[7.725, -2.8296, 0.5543], [8.225, -2.8296, 0.5543], [8.115, -2.9635, 0.8777], [7.835, -2.9635, 0.8777]], b: [[7.8, -3.0243, 0.4243], [8.3, -3.0243, 0.4243], [8.19, -3.2718, 0.6718], [7.91, -3.2718, 0.6718]], collide: 1}
      - {kind: rod, from: [9.4, -2.6, 0], to: [9.4, -1.5393, 1.0607], radius: 0.2, capsule: true, collide: 1}
      - {kind: rod, from: [9.4, -2.6, 0], to: [9.4, -3.6607, 1.0607], radius: 0.2, capsule: true, collide: 1}
      - {kind: rod, from: [9.4, -2.6, 0], to: [9.4, -3.6607, -1.0607], radius: 0.2, capsule: true, collide: 1}
      - {kind: rod, from: [9.4, -2.6, 0], to: [9.4, -1.5393, -1.0607], radius: 0.2, capsule: true, collide: 1}
  - id: nut
    shape: part
    mount: disk
    pos: [6.4, -2.6, 0]
    density: 7800
    color: "#e8dec6"
    pieces:
      - {kind: poly, points: [[5.81, 0.62], [6.39, 0.62], [6.5, 0.98], [5.7, 0.98]], y: [-2.8, -2.4], collide: 2}
      - {kind: poly, points: [[6.41, -0.62], [6.99, -0.62], [7.1, -0.98], [6.3, -0.98]], y: [-2.8, -2.4], collide: 2}
      - {kind: poly, points: [[5.8, 1.0], [7.0, 1.0], [7.0, 1.25], [5.8, 1.25]], y: [-3.6, -1.6], collide: 0}   # the nut's body
      - {kind: poly, points: [[5.8, -1.0], [7.0, -1.0], [7.0, 1.0], [5.8, 1.0]], y: [-3.8, -3.6], collide: 0}
      - {kind: rod, from: [6.4, -3.8, 0], to: [6.4, -5.0, 0], radius: 0.3, collide: 0}
      - {kind: disc, center: [6.4, 0], radius: 0.6, y: [-6.0, -5.0], collide: 2}   # the wrist
  - id: guiderod
    shape: part
    pos: [6.4, 0, 0]
    density: 2700
    color: "#e4d9bf"
    pieces:
      - {kind: poly, points: [[5.26, -12], [5.76, -12], [5.76, 12], [5.26, 12]], y: [-6.2, -4.8], collide: 1}   # the slotted bar's cheeks
      - {kind: poly, points: [[7.04, -12], [7.54, -12], [7.54, 12], [7.04, 12]], y: [-6.2, -4.8], collide: 1}
      - {kind: poly, points: [[5.2, 12], [7.6, 12], [7.6, 12.6], [5.2, 12.6]], y: [-6.2, -4.8], collide: 0}
      - {kind: rod, from: [6.4, -5.5, 12.3], to: [30.4, -5.5, 12.3], radius: 0.35, collide: 0}   # the guide-rod
      - {kind: disc, center: [30.4, 12.3], radius: 0.7, y: [-6.3, -4.7], collide: 0}   # the silk eye
  - id: tappet
    shape: part
    fixed: true
    pos: [0, 0, 9.4]
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [0, -3.75, 8.5], to: [0, -3.75, 10.3], radius: 0.25, capsule: true, collide: 2}   # the tappet, over the disk's top
      - {kind: rod, from: [0, -3.75, 10.3], to: [0, 3, 10.3], radius: 0.25, collide: 0}
  - id: frame
    shape: frame
    color: "#8f8a80"
    rods:
      - {from: [0, 0.6, 0], to: [0, 3, 0], radius: 0.9}   # the disk's shaft
      - {from: [-14, 3, 10.3], to: [14, 3, 10.3], radius: 0.4}
      - {from: [-14, -5.5, 13.3], to: [36, -5.5, 13.3], radius: 0.25}   # the guide-rod's guide
joints:
  - {id: j_disk, type: hinge, body: disk, axis: [0, -1, 0], damping: 0.001}   # the one driven joint
  - {id: j_screw, type: hinge, body: screw, axis: [1, 0, 0], damping: 0.0005, frictionloss: 0.05}
  - {id: j_nut, type: slide, body: nut, axis: [1, 0, 0], damping: 0.01}   # along the disk's radius (+ out)
  - {id: j_rod, type: slide, body: guiderod, axis: [1, 0, 0], damping: 0.01}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_disk, kind: velocity, rpm: 10.0, kv: 3, max_torque: 12}
checks:
  - {type: position, joint: j_screw, min: 1.3708, max: 1.9836, settle_s: 2.3, window_s: 4.8}   # after 1 catches: the screw turned 1 quarter turns
  - {type: position, joint: j_nut, min: -0.41, max: -0.24, settle_s: 2.3, window_s: 4.8}   # and the nut 1 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -12.7, max: -0.1, settle_s: 2.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 6.10 cm
  - {type: position, joint: j_screw, min: 2.9416, max: 3.6173, settle_s: 8.3, window_s: 4.8}   # after 2 catches: the screw turned 2 quarter turns
  - {type: position, joint: j_nut, min: -0.74, max: -0.51, settle_s: 8.3, window_s: 4.8}   # and the nut 2 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -12.4, max: -0.4, settle_s: 8.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 5.80 cm
  - {type: position, joint: j_screw, min: 4.5124, max: 5.2509, settle_s: 14.3, window_s: 4.8}   # after 3 catches: the screw turned 3 quarter turns
  - {type: position, joint: j_nut, min: -1.07, max: -0.78, settle_s: 14.3, window_s: 4.8}   # and the nut 3 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -12.1, max: -0.7, settle_s: 14.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 5.50 cm
  - {type: position, joint: j_screw, min: 6.0832, max: 6.8845, settle_s: 20.3, window_s: 4.8}   # after 4 catches: the screw turned 4 quarter turns
  - {type: position, joint: j_nut, min: -1.4, max: -1.05, settle_s: 20.3, window_s: 4.8}   # and the nut 4 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -11.8, max: -1.0, settle_s: 20.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 5.20 cm
  - {type: position, joint: j_screw, min: 7.654, max: 8.5181, settle_s: 26.3, window_s: 4.8}   # after 5 catches: the screw turned 5 quarter turns
  - {type: position, joint: j_nut, min: -1.73, max: -1.32, settle_s: 26.3, window_s: 4.8}   # and the nut 5 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -11.5, max: -1.3, settle_s: 26.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 4.90 cm
  - {type: position, joint: j_screw, min: 9.2248, max: 10.1518, settle_s: 32.3, window_s: 4.8}   # after 6 catches: the screw turned 6 quarter turns
  - {type: position, joint: j_nut, min: -2.06, max: -1.59, settle_s: 32.3, window_s: 4.8}   # and the nut 6 x 0.30 cm nearer the centre
  - {type: position, joint: j_rod, min: -11.2, max: -1.6, settle_s: 32.3, window_s: 4.8}   # the guide-rod's stroke within 2 x 4.60 cm
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [3, 0, 0], position: [3, -110, 1], fov: 30}
display:
  output: j_rod
  labels: {j_disk: "Disk (driver)", j_screw: "Screw", j_nut: "Nut", j_rod: "Guide-rod"}
  proof: {label: "Tappet out of contact", sub: "the screw stands, the stroke stays the same"}

