# No. 166 (Brown 1868): "The rotation of the disk carrying the crank pin gives a to-and-fro motion to the connecting-rod, and the slot allows the rod to remain at rest at the termination of each stroke; it has been used in a brick-press, in which the connecting-rod draws a mold backward and forward, and permits it to rest at the termination of each stroke, that the clay may be deposited in it and the brick extracted."
#
# Model (cm, no gravity; a plan): the disk (the one driven joint, 20 turns a minute, clockwise in the view) carries a crank-pin 5 cm from its centre. The pin works by real contact in an endless groove (1.44 cm wide, 1.2 mm clearance a side)
# cut in the connecting-rod, which slides to and fro 4 cm in fixed guides. The slot is the path of the pin in the rod's own frame when the rod rests for 60 degrees of the turn at each end of its stroke and goes between by a smooth cycloidal stroke: the pin runs round the arcs at the ends without moving the rod.
# Generator: opencode-runs/batch11/gen166.py.
number: 166
slug: crank-pin-slot-brick-press
name: A crank-pin in a slot, the rod resting at each end of the stroke
brown: "The rotation of the disk carrying the crank pin gives a to-and-fro motion to the connecting-rod, and the slot allows the rod to remain at rest at the termination of each stroke; it has been used in a brick-press, in which the connecting-rod draws a mold backward and forward, and permits it to rest at the termination of each stroke, that the clay may be deposited in it and the brick extracted."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: true
  duration_s: 9.0
  floor: false
  gravity: 0
bodies:
  - id: crank
    shape: part
    pos: [0, 0, 0]
    mass: 1.0
    friction: 0.05
    color: "#d9cfb6"
    pieces:
      - {kind: rod, from: [0, 0.5, 0], to: [0, 3.0, 0], radius: 0.8, color: "#8f8a80"}   # the shaft
      - {kind: disc, center: [0, 0], radius: 7.2, y: [0.0, 0.5]}   # the disk, behind the rod
      - {kind: rod, from: [5.0, 0.0, 0.0], to: [5.0, -1.3, 0.0], radius: 0.6, collide: 1, capsule: true, color: "#8f8a80"}   # the crank-pin
  - id: yoke
    shape: part
    pos: [2.0, 0, 0]
    mass: 0.6
    friction: 0.05
    color: "#b8ad97"
    pieces:
      - {kind: poly, points: [[-0.2798, -0.0], [-0.2758, -0.1867], [-0.2635, -0.373], [-0.2432, -0.5586], [-0.2148, -0.7432], [-0.1784, -0.9263], [-0.134, -1.1077], [-0.0817, -1.287], [-0.0217, -1.4638], [0.046, -1.6378], [0.1212, -1.8087], [0.2037, -1.9762], [0.2937, -2.1402], [0.3916, -2.3018], [0.4969, -2.4617], [0.6086, -2.6194], [0.7249, -2.7742], [0.8445, -2.9253], [0.9657, -3.0721], [1.0872, -3.214], [1.2075, -3.3504], [1.3255, -3.4806], [1.4399, -3.6043], [1.5497, -3.7207], [1.6539, -3.8293], [1.7518, -3.9295], [1.8424, -4.0205], [1.9249, -4.1015], [1.9985, -4.1714], [2.0, -4.1728], [2.0015, -4.1714], [2.0751, -4.1015], [2.1576, -4.0205], [2.2482, -3.9295], [2.3461, -3.8293], [2.4503, -3.7207], [2.5601, -3.6043], [2.6745, -3.4806], [2.7925, -3.3504], [2.9128, -3.214], [3.0343, -3.0721], [3.1555, -2.9253], [3.2751, -2.7742], [3.3914, -2.6194], [3.5031, -2.4617], [3.6084, -2.3018], [3.7063, -2.1402], [3.7963, -1.9762], [3.8788, -1.8087], [3.954, -1.6378], [4.0217, -1.4638], [4.0817, -1.287], [4.134, -1.1077], [4.1784, -0.9263], [4.2148, -0.7432], [4.2432, -0.5586], [4.2635, -0.373], [4.2758, -0.1867], [4.2798, -0.0], [4.2758, 0.1867], [4.2635, 0.373], [4.2432, 0.5586], [4.2148, 0.7432], [4.1784, 0.9263], [4.134, 1.1077], [4.0817, 1.287], [4.0217, 1.4638], [3.954, 1.6378], [3.8788, 1.8087], [3.7963, 1.9762], [3.7063, 2.1402], [3.6084, 2.3018], [3.5031, 2.4617], [3.3914, 2.6194], [3.2751, 2.7742], [3.1555, 2.9253], [3.0343, 3.0721], [2.9128, 3.214], [2.7925, 3.3504], [2.6745, 3.4806], [2.5601, 3.6043], [2.4503, 3.7207], [2.3461, 3.8293], [2.2482, 3.9295], [2.1576, 4.0205], [2.0751, 4.1015], [2.0015, 4.1714], [2.0, 4.1728], [1.9985, 4.1714], [1.9249, 4.1015], [1.8424, 4.0205], [1.7518, 3.9295], [1.6539, 3.8293], [1.5497, 3.7207], [1.4399, 3.6043], [1.3255, 3.4806], [1.2075, 3.3504], [1.0872, 3.214], [0.9657, 3.0721], [0.8445, 2.9253], [0.7249, 2.7742], [0.6086, 2.6194], [0.4969, 2.4617], [0.3916, 2.3018], [0.2937, 2.1402], [0.2037, 1.9762], [0.1212, 1.8087], [0.046, 1.6378], [-0.0217, 1.4638], [-0.0817, 1.287], [-0.134, 1.1077], [-0.1784, 0.9263], [-0.2148, 0.7432], [-0.2432, 0.5586], [-0.2635, 0.373], [-0.2758, 0.1867]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.72, 0.0], [-1.7152, -0.2181], [-3.2138, -0.2835], [-3.22, 0.0]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.7152, -0.2181], [-1.701, -0.4358], [-3.1953, -0.5665], [-3.2138, -0.2835]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.701, -0.4358], [-1.6772, -0.6526], [-3.1664, -0.8322], [-3.1953, -0.5665]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6772, -0.6526], [-1.6527, -0.839], [-3.1376, -1.051], [-3.1664, -0.8322]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6527, -0.839], [-1.6195, -1.0546], [-3.0967, -1.3151], [-3.1376, -1.051]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6195, -1.0546], [-1.5769, -1.2685], [-3.0414, -1.5932], [-3.0967, -1.3151]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.5769, -1.2685], [-1.5251, -1.4804], [-2.974, -1.8687], [-3.0414, -1.5932]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.5251, -1.4804], [-1.4641, -1.6899], [-2.8946, -2.1409], [-2.974, -1.8687]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.4641, -1.6899], [-1.3939, -1.8965], [-2.8035, -2.4095], [-2.8946, -2.1409]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.3939, -1.8965], [-1.3149, -2.0998], [-2.7069, -2.6586], [-2.8035, -2.4095]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.3149, -2.0998], [-1.2429, -2.2734], [-2.6224, -2.8625], [-2.7069, -2.6586]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.2429, -2.2734], [-1.1551, -2.4731], [-2.5145, -3.107], [-2.6224, -2.8625]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.1551, -2.4731], [-1.0586, -2.6687], [-2.3891, -3.3614], [-2.5145, -3.107]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.0586, -2.6687], [-0.9537, -2.86], [-2.2531, -3.6094], [-2.3891, -3.3614]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.9537, -2.86], [-0.8407, -3.0465], [-2.1087, -3.8478], [-2.2531, -3.6094]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.8407, -3.0465], [-0.7212, -3.2279], [-1.9598, -4.074], [-2.1087, -3.8478]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.7212, -3.2279], [-0.5967, -3.4038], [-1.8085, -4.2879], [-1.9598, -4.074]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.5967, -3.4038], [-0.4688, -3.5739], [-1.6633, -4.4812], [-1.8085, -4.2879]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.4688, -3.5739], [-0.3544, -3.7231], [-1.5376, -4.645], [-1.6633, -4.4812]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.3544, -3.7231], [-0.2246, -3.8871], [-1.3912, -4.83], [-1.5376, -4.645]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.2246, -3.8871], [-0.0945, -4.0447], [-1.2426, -5.01], [-1.3912, -4.83]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.0945, -4.0447], [0.0347, -4.1955], [-1.0974, -5.1796], [-1.2426, -5.01]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.0347, -4.1955], [0.1616, -4.3393], [-0.9567, -5.339], [-1.0974, -5.1796]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.1616, -4.3393], [0.2852, -4.4759], [-0.8212, -5.4887], [-0.9567, -5.339]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.2852, -4.4759], [0.4046, -4.6049], [-0.6915, -5.6288], [-0.8212, -5.4887]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.4046, -4.6049], [0.5189, -4.7261], [-0.5679, -5.76], [-0.6915, -5.6288]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.5189, -4.7261], [0.6275, -4.8392], [-0.4502, -5.8826], [-0.5679, -5.76]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.6275, -4.8392], [0.73, -4.9442], [-0.3381, -5.9974], [-0.4502, -5.8826]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.73, -4.9442], [0.8261, -5.0407], [-0.2306, -6.1053], [-0.3381, -5.9974]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.8261, -5.0407], [0.9156, -5.1285], [-0.1264, -6.2075], [-0.2306, -6.1053]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.9156, -5.1285], [0.9988, -5.2076], [-0.0232, -6.3056], [-0.1264, -6.2075]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.9988, -5.2076], [1.0758, -5.2777], [0.0824, -6.4016], [-0.0232, -6.3056]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.0758, -5.2777], [1.1469, -5.3387], [0.195, -6.498], [0.0824, -6.4016]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.1469, -5.3387], [1.2129, -5.3906], [0.2928, -6.5752], [0.195, -6.498]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.2129, -5.3906], [1.362, -5.505], [0.4779, -6.7167], [0.2928, -6.5752]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.362, -5.505], [1.4234, -5.5476], [0.6209, -6.8149], [0.4779, -6.7167]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.4234, -5.5476], [1.481, -5.5808], [0.8066, -6.9206], [0.6209, -6.8149]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.481, -5.5808], [1.5357, -5.6045], [0.9498, -6.9854], [0.8066, -6.9206]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.5357, -5.6045], [1.7093, -5.6764], [1.2252, -7.0962], [0.9498, -6.9854]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.7093, -5.6764], [1.762, -5.6907], [1.4673, -7.1615], [1.2252, -7.0962]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.762, -5.6907], [1.9483, -5.7152], [1.7816, -7.2059], [1.4673, -7.1615]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.9483, -5.7152], [2.0, -5.72], [2.0, -7.22], [1.7816, -7.2059]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.0, -5.72], [2.0517, -5.7152], [2.2184, -7.2059], [2.0, -7.22]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.0517, -5.7152], [2.238, -5.6907], [2.5327, -7.1615], [2.2184, -7.2059]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.238, -5.6907], [2.2907, -5.6764], [2.7748, -7.0962], [2.5327, -7.1615]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.2907, -5.6764], [2.4643, -5.6045], [3.0502, -6.9854], [2.7748, -7.0962]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.4643, -5.6045], [2.519, -5.5808], [3.1934, -6.9206], [3.0502, -6.9854]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.519, -5.5808], [2.5766, -5.5476], [3.3791, -6.8149], [3.1934, -6.9206]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.5766, -5.5476], [2.638, -5.505], [3.5221, -6.7167], [3.3791, -6.8149]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.638, -5.505], [2.7871, -5.3906], [3.7072, -6.5752], [3.5221, -6.7167]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.7871, -5.3906], [2.8531, -5.3387], [3.805, -6.498], [3.7072, -6.5752]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.8531, -5.3387], [2.9242, -5.2777], [3.9176, -6.4016], [3.805, -6.498]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.9242, -5.2777], [3.0012, -5.2076], [4.0232, -6.3056], [3.9176, -6.4016]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.0012, -5.2076], [3.0844, -5.1285], [4.1264, -6.2075], [4.0232, -6.3056]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.0844, -5.1285], [3.1739, -5.0407], [4.2306, -6.1053], [4.1264, -6.2075]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.1739, -5.0407], [3.27, -4.9442], [4.3381, -5.9974], [4.2306, -6.1053]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.27, -4.9442], [3.3725, -4.8392], [4.4502, -5.8826], [4.3381, -5.9974]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.3725, -4.8392], [3.4811, -4.7261], [4.5679, -5.76], [4.4502, -5.8826]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.4811, -4.7261], [3.5954, -4.6049], [4.6915, -5.6288], [4.5679, -5.76]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.5954, -4.6049], [3.7148, -4.4759], [4.8212, -5.4887], [4.6915, -5.6288]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.7148, -4.4759], [3.8384, -4.3393], [4.9567, -5.339], [4.8212, -5.4887]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.8384, -4.3393], [3.9653, -4.1955], [5.0974, -5.1796], [4.9567, -5.339]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.9653, -4.1955], [4.0945, -4.0447], [5.2426, -5.01], [5.0974, -5.1796]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.0945, -4.0447], [4.2246, -3.8871], [5.3912, -4.83], [5.2426, -5.01]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.2246, -3.8871], [4.3544, -3.7231], [5.5376, -4.645], [5.3912, -4.83]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.3544, -3.7231], [4.4688, -3.5739], [5.6633, -4.4812], [5.5376, -4.645]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.4688, -3.5739], [4.5967, -3.4038], [5.8085, -4.2879], [5.6633, -4.4812]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.5967, -3.4038], [4.7212, -3.2279], [5.9598, -4.074], [5.8085, -4.2879]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.7212, -3.2279], [4.8407, -3.0465], [6.1087, -3.8478], [5.9598, -4.074]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.8407, -3.0465], [4.9537, -2.86], [6.2531, -3.6094], [6.1087, -3.8478]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.9537, -2.86], [5.0586, -2.6687], [6.3891, -3.3614], [6.2531, -3.6094]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.0586, -2.6687], [5.1551, -2.4731], [6.5145, -3.107], [6.3891, -3.3614]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.1551, -2.4731], [5.2429, -2.2734], [6.6224, -2.8625], [6.5145, -3.107]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.2429, -2.2734], [5.3149, -2.0998], [6.7069, -2.6586], [6.6224, -2.8625]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.3149, -2.0998], [5.3939, -1.8965], [6.8035, -2.4095], [6.7069, -2.6586]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.3939, -1.8965], [5.4641, -1.6899], [6.8946, -2.1409], [6.8035, -2.4095]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.4641, -1.6899], [5.5251, -1.4804], [6.974, -1.8687], [6.8946, -2.1409]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.5251, -1.4804], [5.5769, -1.2685], [7.0414, -1.5932], [6.974, -1.8687]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.5769, -1.2685], [5.6195, -1.0546], [7.0967, -1.3151], [7.0414, -1.5932]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6195, -1.0546], [5.6527, -0.839], [7.1376, -1.051], [7.0967, -1.3151]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6527, -0.839], [5.6772, -0.6526], [7.1664, -0.8322], [7.1376, -1.051]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6772, -0.6526], [5.701, -0.4358], [7.1953, -0.5665], [7.1664, -0.8322]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.701, -0.4358], [5.7152, -0.2181], [7.2138, -0.2835], [7.1953, -0.5665]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.7152, -0.2181], [5.72, 0.0], [7.22, 0.0], [7.2138, -0.2835]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.72, 0.0], [5.7152, 0.2181], [7.2138, 0.2835], [7.22, 0.0]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.7152, 0.2181], [5.701, 0.4358], [7.1953, 0.5665], [7.2138, 0.2835]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.701, 0.4358], [5.6772, 0.6526], [7.1664, 0.8322], [7.1953, 0.5665]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6772, 0.6526], [5.6527, 0.839], [7.1376, 1.051], [7.1664, 0.8322]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6527, 0.839], [5.6195, 1.0546], [7.0967, 1.3151], [7.1376, 1.051]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.6195, 1.0546], [5.5769, 1.2685], [7.0414, 1.5932], [7.0967, 1.3151]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.5769, 1.2685], [5.5251, 1.4804], [6.974, 1.8687], [7.0414, 1.5932]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.5251, 1.4804], [5.4641, 1.6899], [6.8946, 2.1409], [6.974, 1.8687]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.4641, 1.6899], [5.3939, 1.8965], [6.8035, 2.4095], [6.8946, 2.1409]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.3939, 1.8965], [5.3149, 2.0998], [6.7069, 2.6586], [6.8035, 2.4095]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.3149, 2.0998], [5.2429, 2.2734], [6.6224, 2.8625], [6.7069, 2.6586]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.2429, 2.2734], [5.1551, 2.4731], [6.5145, 3.107], [6.6224, 2.8625]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.1551, 2.4731], [5.0586, 2.6687], [6.3891, 3.3614], [6.5145, 3.107]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[5.0586, 2.6687], [4.9537, 2.86], [6.2531, 3.6094], [6.3891, 3.3614]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.9537, 2.86], [4.8407, 3.0465], [6.1087, 3.8478], [6.2531, 3.6094]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.8407, 3.0465], [4.7212, 3.2279], [5.9598, 4.074], [6.1087, 3.8478]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.7212, 3.2279], [4.5967, 3.4038], [5.8085, 4.2879], [5.9598, 4.074]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.5967, 3.4038], [4.4688, 3.5739], [5.6633, 4.4812], [5.8085, 4.2879]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.4688, 3.5739], [4.3544, 3.7231], [5.5376, 4.645], [5.6633, 4.4812]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.3544, 3.7231], [4.2246, 3.8871], [5.3912, 4.83], [5.5376, 4.645]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.2246, 3.8871], [4.0945, 4.0447], [5.2426, 5.01], [5.3912, 4.83]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[4.0945, 4.0447], [3.9653, 4.1955], [5.0974, 5.1796], [5.2426, 5.01]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.9653, 4.1955], [3.8384, 4.3393], [4.9567, 5.339], [5.0974, 5.1796]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.8384, 4.3393], [3.7148, 4.4759], [4.8212, 5.4887], [4.9567, 5.339]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.7148, 4.4759], [3.5954, 4.6049], [4.6915, 5.6288], [4.8212, 5.4887]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.5954, 4.6049], [3.4811, 4.7261], [4.5679, 5.76], [4.6915, 5.6288]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.4811, 4.7261], [3.3725, 4.8392], [4.4502, 5.8826], [4.5679, 5.76]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.3725, 4.8392], [3.27, 4.9442], [4.3381, 5.9974], [4.4502, 5.8826]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.27, 4.9442], [3.1739, 5.0407], [4.2306, 6.1053], [4.3381, 5.9974]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.1739, 5.0407], [3.0844, 5.1285], [4.1264, 6.2075], [4.2306, 6.1053]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.0844, 5.1285], [3.0012, 5.2076], [4.0232, 6.3056], [4.1264, 6.2075]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[3.0012, 5.2076], [2.9242, 5.2777], [3.9176, 6.4016], [4.0232, 6.3056]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.9242, 5.2777], [2.8531, 5.3387], [3.805, 6.498], [3.9176, 6.4016]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.8531, 5.3387], [2.7871, 5.3906], [3.7072, 6.5752], [3.805, 6.498]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.7871, 5.3906], [2.638, 5.505], [3.5221, 6.7167], [3.7072, 6.5752]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.638, 5.505], [2.5766, 5.5476], [3.3791, 6.8149], [3.5221, 6.7167]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.5766, 5.5476], [2.519, 5.5808], [3.1934, 6.9206], [3.3791, 6.8149]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.519, 5.5808], [2.4643, 5.6045], [3.0502, 6.9854], [3.1934, 6.9206]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.4643, 5.6045], [2.2907, 5.6764], [2.7748, 7.0962], [3.0502, 6.9854]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.2907, 5.6764], [2.238, 5.6907], [2.5327, 7.1615], [2.7748, 7.0962]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.238, 5.6907], [2.0517, 5.7152], [2.2184, 7.2059], [2.5327, 7.1615]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.0517, 5.7152], [2.0, 5.72], [2.0, 7.22], [2.2184, 7.2059]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[2.0, 5.72], [1.9483, 5.7152], [1.7816, 7.2059], [2.0, 7.22]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.9483, 5.7152], [1.762, 5.6907], [1.4673, 7.1615], [1.7816, 7.2059]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.762, 5.6907], [1.7093, 5.6764], [1.2252, 7.0962], [1.4673, 7.1615]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.7093, 5.6764], [1.5357, 5.6045], [0.9498, 6.9854], [1.2252, 7.0962]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.5357, 5.6045], [1.481, 5.5808], [0.8066, 6.9206], [0.9498, 6.9854]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.481, 5.5808], [1.4234, 5.5476], [0.6209, 6.8149], [0.8066, 6.9206]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.4234, 5.5476], [1.362, 5.505], [0.4779, 6.7167], [0.6209, 6.8149]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.362, 5.505], [1.2129, 5.3906], [0.2928, 6.5752], [0.4779, 6.7167]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.2129, 5.3906], [1.1469, 5.3387], [0.195, 6.498], [0.2928, 6.5752]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.1469, 5.3387], [1.0758, 5.2777], [0.0824, 6.4016], [0.195, 6.498]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[1.0758, 5.2777], [0.9988, 5.2076], [-0.0232, 6.3056], [0.0824, 6.4016]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.9988, 5.2076], [0.9156, 5.1285], [-0.1264, 6.2075], [-0.0232, 6.3056]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.9156, 5.1285], [0.8261, 5.0407], [-0.2306, 6.1053], [-0.1264, 6.2075]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.8261, 5.0407], [0.73, 4.9442], [-0.3381, 5.9974], [-0.2306, 6.1053]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.73, 4.9442], [0.6275, 4.8392], [-0.4502, 5.8826], [-0.3381, 5.9974]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.6275, 4.8392], [0.5189, 4.7261], [-0.5679, 5.76], [-0.4502, 5.8826]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.5189, 4.7261], [0.4046, 4.6049], [-0.6915, 5.6288], [-0.5679, 5.76]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.4046, 4.6049], [0.2852, 4.4759], [-0.8212, 5.4887], [-0.6915, 5.6288]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.2852, 4.4759], [0.1616, 4.3393], [-0.9567, 5.339], [-0.8212, 5.4887]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.1616, 4.3393], [0.0347, 4.1955], [-1.0974, 5.1796], [-0.9567, 5.339]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[0.0347, 4.1955], [-0.0945, 4.0447], [-1.2426, 5.01], [-1.0974, 5.1796]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.0945, 4.0447], [-0.2246, 3.8871], [-1.3912, 4.83], [-1.2426, 5.01]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.2246, 3.8871], [-0.3544, 3.7231], [-1.5376, 4.645], [-1.3912, 4.83]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.3544, 3.7231], [-0.4688, 3.5739], [-1.6633, 4.4812], [-1.5376, 4.645]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.4688, 3.5739], [-0.5967, 3.4038], [-1.8085, 4.2879], [-1.6633, 4.4812]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.5967, 3.4038], [-0.7212, 3.2279], [-1.9598, 4.074], [-1.8085, 4.2879]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.7212, 3.2279], [-0.8407, 3.0465], [-2.1087, 3.8478], [-1.9598, 4.074]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.8407, 3.0465], [-0.9537, 2.86], [-2.2531, 3.6094], [-2.1087, 3.8478]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-0.9537, 2.86], [-1.0586, 2.6687], [-2.3891, 3.3614], [-2.2531, 3.6094]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.0586, 2.6687], [-1.1551, 2.4731], [-2.5145, 3.107], [-2.3891, 3.3614]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.1551, 2.4731], [-1.2429, 2.2734], [-2.6224, 2.8625], [-2.5145, 3.107]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.2429, 2.2734], [-1.3149, 2.0998], [-2.7069, 2.6586], [-2.6224, 2.8625]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.3149, 2.0998], [-1.3939, 1.8965], [-2.8035, 2.4095], [-2.7069, 2.6586]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.3939, 1.8965], [-1.4641, 1.6899], [-2.8946, 2.1409], [-2.8035, 2.4095]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.4641, 1.6899], [-1.5251, 1.4804], [-2.974, 1.8687], [-2.8946, 2.1409]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.5251, 1.4804], [-1.5769, 1.2685], [-3.0414, 1.5932], [-2.974, 1.8687]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.5769, 1.2685], [-1.6195, 1.0546], [-3.0967, 1.3151], [-3.0414, 1.5932]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6195, 1.0546], [-1.6527, 0.839], [-3.1376, 1.051], [-3.0967, 1.3151]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6527, 0.839], [-1.6772, 0.6526], [-3.1664, 0.8322], [-3.1376, 1.051]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.6772, 0.6526], [-1.701, 0.4358], [-3.1953, 0.5665], [-3.1664, 0.8322]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.701, 0.4358], [-1.7152, 0.2181], [-3.2138, 0.2835], [-3.1953, 0.5665]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-1.7152, 0.2181], [-1.72, 0.0], [-3.22, 0.0], [-3.2138, 0.2835]], y: [-1.2, -0.1], collide: 2}
      - {kind: poly, points: [[-3.22, 6.02], [7.22, 6.02], [7.22, 7.82], [-3.22, 7.82]], y: [-1.2, -0.1], collide: 0}   # the head of the rod
      - {kind: rod, from: [-8.0, -0.65, 6.92], to: [12.0, -0.65, 6.92], radius: 0.55, collide: 0, color: "#a89a7e"}   # the connecting-rod
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.4, -14.0], [1.4, -14.0], [1.0, 0], [-1.0, 0]], y: [1.8, 2.8]}   # the shaft's standard, behind
      - {kind: poly, points: [[-12.5, 5.02], [-10.5, 5.02], [-10.5, 8.82], [-12.5, 8.82]], y: [-1.7, 0.4], collide: 0}   # the guide at the left
      - {kind: poly, points: [[10.5, 5.02], [12.5, 5.02], [12.5, 8.82], [10.5, 8.82]], y: [-1.7, 0.4], collide: 0}   # and at the right
      - {kind: poly, points: [[-12.5, 8.82], [12.5, 8.82], [12.5, 9.82], [-12.5, 9.82]], y: [-1.7, 0.4], collide: 0}
      - {kind: poly, points: [[-12.5, -14.0], [-11.5, -14.0], [-11.5, 9.82], [-12.5, 9.82]], y: [1.0, 1.8], collide: 0}   # the posts, behind
      - {kind: poly, points: [[11.5, -14.0], [12.5, -14.0], [12.5, 9.82], [11.5, 9.82]], y: [1.0, 1.8], collide: 0}
      - {kind: poly, points: [[-14.5, -15.0], [14.5, -15.0], [14.5, -14.0], [-14.5, -14.0]], y: [-3, 3], collide: 0, color: "#b9b09c"}
joints:
  - {id: j_s, type: hinge, body: crank, axis: [0, 1, 0], damping: 0.002}   # the one driven joint; + : clockwise
  - {id: j_u, type: slide, body: yoke, axis: [1, 0, 0], damping: 2.0}   # the connecting-rod in its guides; + : to the right
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 20, kv: 20.0, max_torque: 20}
checks:
  - {type: follow, out: j_u, in: j_s, expect: -0.0374, tol: 0.003, min_r2: 0.99, settle_s: 0.77, window_s: 0.2}   # the rod falls through the middle of its stroke
  - {type: follow, out: j_u, in: j_s, expect: 0.0374, tol: 0.003, min_r2: 0.99, settle_s: 2.27, window_s: 0.2}   # the rod rises through the middle of its stroke
  - {type: follow, out: j_u, in: j_s, expect: -0.0374, tol: 0.003, min_r2: 0.99, settle_s: 3.77, window_s: 0.2}   # the rod falls through the middle of its stroke
  - {type: ratio, out: j_u, in: j_s, expect: 0, tol: 0.0008, settle_s: 1.4533, window_s: 0.3333}   # the rod at rest at the end of its stroke while the disk goes on turning
  - {type: ratio, out: j_u, in: j_s, expect: 0, tol: 0.0008, settle_s: 2.9533, window_s: 0.3333}   # the rod at rest at the end of its stroke while the disk goes on turning
  - {type: ratio, out: j_u, in: j_s, expect: 0, tol: 0.0008, settle_s: 4.4533, window_s: 0.3333}   # the rod at rest at the end of its stroke while the disk goes on turning
  - {type: position, joint: j_u, min: -4.3, max: 0.3, settle_s: 0.0, window_s: 8.5}
camera: {target: [0, 0, -4.0], position: [0, -76.0, -4.0], fov: 34}
display:
  output: j_u
  labels: {j_s: "Disk (driver)", j_u: "Connecting-rod"}
  proof: {label: "Pin out of contact", sub: "the disk turns but the connecting-rod stands"}

