# No. 178 (Brown 1868): "Contrivance for varying the speed of the slide carrying the cutting tool in slotting and shaping machines, etc. The driving-shaft works through an opening in a fixed disk, in which is a circular slot. At the end of the said shaft is a slotted crank. A slide fits in the slot of the crank and in the circular slot; and to the outward extremity of this slide is attached the connecting-rod which works the slide carrying the cutting tool. When the driving-shaft rotates the crank is carried round, and the slide carrying the end of the connecting-rod is guided by the circular slot, which is placed eccentrically to the shaft; therefore, as the slide approaches the bottom, the length of the crank is shortened and the speed of the connecting-rod is diminished."
#
# Model (cm, no gravity; a plan): the slotted crank (the one driven joint, 20 turns a minute, clockwise in the view) carries a pin in its slot (by real contact); the same pin runs in the circular slot (1.30 cm wide, radius 6) of a fixed disk behind the crank,
# whose centre is 2.5 cm from the shaft. So the pin runs 3.5 to 8.5 cm from the shaft (the crank's length changing as it turns). The 16 cm connecting-rod from the pin works the tool slide in its guides, a stroke of 12.2 cm.
# Generator: opencode-runs/batch11/gen178.py.
number: 178
slug: slotted-crank-eccentric-circular-slot
name: A slotted crank in an eccentric circular slot
brown: "Contrivance for varying the speed of the slide carrying the cutting tool in slotting and shaping machines, etc. The driving-shaft works through an opening in a fixed disk, in which is a circular slot. At the end of the said shaft is a slotted crank. A slide fits in the slot of the crank and in the circular slot; and to the outward extremity of this slide is attached the connecting-rod which works the slide carrying the cutting tool. When the driving-shaft rotates the crank is carried round, and the slide carrying the end of the connecting-rod is guided by the circular slot, which is placed eccentrically to the shaft; therefore, as the slide approaches the bottom, the length of the crank is shortened and the speed of the connecting-rod is diminished."
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: 0.3
    friction: 0.05
    color: "#d9cfb6"
    pieces:
      - {kind: poly, points: [[-1.15, -1.0], [1.15, -1.0], [1.15, 2.1], [-1.15, 2.1]], y: [-1.2, -0.4], collide: 2, color: "#d9cfb6"}
      - {kind: poly, points: [[0.65, 2.1], [0.65, 9.9], [1.15, 9.9], [1.15, 2.1]], y: [-1.2, -0.4], collide: 2, color: "#d9cfb6"}
      - {kind: poly, points: [[-0.65, 2.1], [-0.65, 9.9], [-1.15, 9.9], [-1.15, 2.1]], y: [-1.2, -0.4], collide: 2, color: "#d9cfb6"}
      - {kind: poly, points: [[-1.15, 9.9], [1.15, 9.9], [1.15, 10.4], [-1.15, 10.4]], y: [-1.2, -0.4], collide: 2, color: "#d9cfb6"}
      - {kind: rod, from: [0, -0.5, 0], to: [0, 1.5, 0], radius: 1.1, collide: 0, color: "#8f8a80"}
  - id: slide
    shape: part
    pos: [13.5554, 0, 0.0]
    mass: 0.3
    color: "#cfc6b4"
    pieces:
      - {kind: rod, from: [12.3554, -2.3, 0.0], to: [20.5554, -2.3, 0.0], radius: 0.7, collide: 0, color: "#a89a7e"}   # the tool slide's rod
      - {kind: poly, points: [[12.3554, -1.2], [14.7554, -1.2], [14.7554, 1.2], [12.3554, 1.2]], y: [-2.9, -1.7], collide: 0}
  - id: con
    shape: part
    pos: [13.5554, 0, 0.0]
    mount: slide
    mass: 0.4
    friction: 0.05
    color: "#a89a7e"
    pieces:
      - {kind: rod, from: [0.0, -1.7, 8.5], to: [13.5554, -1.7, 0.0], radius: 0.5, collide: 0, color: "#a89a7e"}
      - {kind: rod, from: [0.0, -1.7, 8.5], to: [0.0, 1.0, 8.5], radius: 0.6, collide: 1, capsule: true, color: "#8f8a80"}   # the slide: a pin in the crank's slot and in the circular slot
      - {kind: rod, from: [13.5554, -2.4, 0.0], to: [13.5554, -1.5, 0.0], radius: 0.6, collide: 0, color: "#8f8a80"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[5.35, 2.6751], [5.3271, 3.0247], [5.2814, 3.372], [5.213, 3.7155], [5.1224, 4.0539], [5.0098, 4.3855], [4.8757, 4.7092], [4.7208, 5.0233], [4.5457, 5.3267], [4.3511, 5.6179], [4.1378, 5.8958], [3.9069, 6.1592], [3.6592, 6.4069], [3.3958, 6.6378], [3.1179, 6.8511], [2.8267, 7.0457], [2.5233, 7.2208], [2.2092, 7.3757], [1.8855, 7.5098], [1.5539, 7.6224], [1.2155, 7.713], [0.872, 7.7814], [0.5247, 7.8271], [0.1751, 7.85], [-0.1751, 7.85], [-0.5247, 7.8271], [-0.872, 7.7814], [-1.2155, 7.713], [-1.5539, 7.6224], [-1.8855, 7.5098], [-2.2092, 7.3757], [-2.5233, 7.2208], [-2.8267, 7.0457], [-3.1179, 6.8511], [-3.3958, 6.6378], [-3.6592, 6.4069], [-3.9069, 6.1592], [-4.1378, 5.8958], [-4.3511, 5.6179], [-4.5457, 5.3267], [-4.7208, 5.0233], [-4.8757, 4.7092], [-5.0098, 4.3855], [-5.1224, 4.0539], [-5.213, 3.7155], [-5.2814, 3.372], [-5.3271, 3.0247], [-5.35, 2.6751], [-5.35, 2.3249], [-5.3271, 1.9753], [-5.2814, 1.628], [-5.213, 1.2845], [-5.1224, 0.9461], [-5.0098, 0.6145], [-4.8757, 0.2908], [-4.7208, -0.0233], [-4.5457, -0.3267], [-4.3511, -0.6179], [-4.1378, -0.8958], [-3.9069, -1.1592], [-3.6592, -1.4069], [-3.3958, -1.6378], [-3.1179, -1.8511], [-2.8267, -2.0457], [-2.5233, -2.2208], [-2.2092, -2.3757], [-1.8855, -2.5098], [-1.5539, -2.6224], [-1.2155, -2.713], [-0.872, -2.7814], [-0.5247, -2.8271], [-0.1751, -2.85], [0.1751, -2.85], [0.5247, -2.8271], [0.872, -2.7814], [1.2155, -2.713], [1.5539, -2.6224], [1.8855, -2.5098], [2.2092, -2.3757], [2.5233, -2.2208], [2.8267, -2.0457], [3.1179, -1.8511], [3.3958, -1.6378], [3.6592, -1.4069], [3.9069, -1.1592], [4.1378, -0.8958], [4.3511, -0.6179], [4.5457, -0.3267], [4.7208, -0.0233], [4.8757, 0.2908], [5.0098, 0.6145], [5.1224, 0.9461], [5.213, 1.2845], [5.2814, 1.628], [5.3271, 1.9753], [5.35, 2.3249]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}   # the disc inside the circular slot
      - {kind: poly, points: [[6.6536, 2.5], [6.6393, 2.9352], [7.3382, 2.981], [7.3539, 2.5]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.6393, 2.9352], [6.5966, 3.3685], [7.291, 3.4599], [7.3382, 2.981]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.5966, 3.3685], [6.5257, 3.798], [7.2126, 3.9347], [7.291, 3.4599]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.5257, 3.798], [6.4268, 4.2221], [7.1034, 4.4033], [7.2126, 3.9347]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.4268, 4.2221], [6.3005, 4.6387], [6.9637, 4.8638], [7.1034, 4.4033]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.3005, 4.6387], [6.1471, 5.0462], [6.7942, 5.3142], [6.9637, 4.8638]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.1471, 5.0462], [5.9674, 5.4428], [6.5955, 5.7526], [6.7942, 5.3142]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.9674, 5.4428], [5.7622, 5.8268], [6.3687, 6.177], [6.5955, 5.7526]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.7622, 5.8268], [5.5322, 6.1965], [6.1146, 6.5856], [6.3687, 6.177]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.5322, 6.1965], [5.2786, 6.5504], [5.8343, 6.9768], [6.1146, 6.5856]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.2786, 6.5504], [5.0024, 6.887], [5.529, 7.3488], [5.8343, 6.9768]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.0024, 6.887], [4.7048, 7.2048], [5.2, 7.7], [5.529, 7.3488]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.7048, 7.2048], [4.387, 7.5024], [4.8488, 8.029], [5.2, 7.7]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.387, 7.5024], [4.0504, 7.7786], [4.4768, 8.3343], [4.8488, 8.029]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.0504, 7.7786], [3.6965, 8.0322], [4.0856, 8.6146], [4.4768, 8.3343]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[3.6965, 8.0322], [3.3268, 8.2622], [3.677, 8.8687], [4.0856, 8.6146]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[3.3268, 8.2622], [2.9428, 8.4674], [3.2526, 9.0955], [3.677, 8.8687]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.9428, 8.4674], [2.5462, 8.6471], [2.8142, 9.2942], [3.2526, 9.0955]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.5462, 8.6471], [2.1387, 8.8005], [2.3638, 9.4637], [2.8142, 9.2942]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.1387, 8.8005], [1.7221, 8.9268], [1.9033, 9.6034], [2.3638, 9.4637]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[1.7221, 8.9268], [1.298, 9.0257], [1.4347, 9.7126], [1.9033, 9.6034]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[1.298, 9.0257], [0.8685, 9.0966], [0.9599, 9.791], [1.4347, 9.7126]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[0.8685, 9.0966], [0.4352, 9.1393], [0.481, 9.8382], [0.9599, 9.791]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[0.4352, 9.1393], [0.0, 9.1536], [0.0, 9.8539], [0.481, 9.8382]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[0.0, 9.1536], [-0.4352, 9.1393], [-0.481, 9.8382], [0.0, 9.8539]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-0.4352, 9.1393], [-0.8685, 9.0966], [-0.9599, 9.791], [-0.481, 9.8382]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-0.8685, 9.0966], [-1.298, 9.0257], [-1.4347, 9.7126], [-0.9599, 9.791]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-1.298, 9.0257], [-1.7221, 8.9268], [-1.9033, 9.6034], [-1.4347, 9.7126]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-1.7221, 8.9268], [-2.1387, 8.8005], [-2.3638, 9.4637], [-1.9033, 9.6034]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.1387, 8.8005], [-2.5462, 8.6471], [-2.8142, 9.2942], [-2.3638, 9.4637]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.5462, 8.6471], [-2.9428, 8.4674], [-3.2526, 9.0955], [-2.8142, 9.2942]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.9428, 8.4674], [-3.3268, 8.2622], [-3.677, 8.8687], [-3.2526, 9.0955]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-3.3268, 8.2622], [-3.6965, 8.0322], [-4.0856, 8.6146], [-3.677, 8.8687]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-3.6965, 8.0322], [-4.0504, 7.7786], [-4.4768, 8.3343], [-4.0856, 8.6146]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.0504, 7.7786], [-4.387, 7.5024], [-4.8488, 8.029], [-4.4768, 8.3343]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.387, 7.5024], [-4.7048, 7.2048], [-5.2, 7.7], [-4.8488, 8.029]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.7048, 7.2048], [-5.0024, 6.887], [-5.529, 7.3488], [-5.2, 7.7]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.0024, 6.887], [-5.2786, 6.5504], [-5.8343, 6.9768], [-5.529, 7.3488]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.2786, 6.5504], [-5.5322, 6.1965], [-6.1146, 6.5856], [-5.8343, 6.9768]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.5322, 6.1965], [-5.7622, 5.8268], [-6.3687, 6.177], [-6.1146, 6.5856]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.7622, 5.8268], [-5.9674, 5.4428], [-6.5955, 5.7526], [-6.3687, 6.177]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.9674, 5.4428], [-6.1471, 5.0462], [-6.7942, 5.3142], [-6.5955, 5.7526]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.1471, 5.0462], [-6.3005, 4.6387], [-6.9637, 4.8638], [-6.7942, 5.3142]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.3005, 4.6387], [-6.4268, 4.2221], [-7.1034, 4.4033], [-6.9637, 4.8638]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.4268, 4.2221], [-6.5257, 3.798], [-7.2126, 3.9347], [-7.1034, 4.4033]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.5257, 3.798], [-6.5966, 3.3685], [-7.291, 3.4599], [-7.2126, 3.9347]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.5966, 3.3685], [-6.6393, 2.9352], [-7.3382, 2.981], [-7.291, 3.4599]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.6393, 2.9352], [-6.6536, 2.5], [-7.3539, 2.5], [-7.3382, 2.981]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.6536, 2.5], [-6.6393, 2.0648], [-7.3382, 2.019], [-7.3539, 2.5]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.6393, 2.0648], [-6.5966, 1.6315], [-7.291, 1.5401], [-7.3382, 2.019]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.5966, 1.6315], [-6.5257, 1.202], [-7.2126, 1.0653], [-7.291, 1.5401]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.5257, 1.202], [-6.4268, 0.7779], [-7.1034, 0.5967], [-7.2126, 1.0653]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.4268, 0.7779], [-6.3005, 0.3613], [-6.9637, 0.1362], [-7.1034, 0.5967]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.3005, 0.3613], [-6.1471, -0.0462], [-6.7942, -0.3142], [-6.9637, 0.1362]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-6.1471, -0.0462], [-5.9674, -0.4428], [-6.5955, -0.7526], [-6.7942, -0.3142]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.9674, -0.4428], [-5.7622, -0.8268], [-6.3687, -1.177], [-6.5955, -0.7526]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.7622, -0.8268], [-5.5322, -1.1965], [-6.1146, -1.5856], [-6.3687, -1.177]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.5322, -1.1965], [-5.2786, -1.5504], [-5.8343, -1.9768], [-6.1146, -1.5856]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.2786, -1.5504], [-5.0024, -1.887], [-5.529, -2.3488], [-5.8343, -1.9768]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-5.0024, -1.887], [-4.7048, -2.2048], [-5.2, -2.7], [-5.529, -2.3488]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.7048, -2.2048], [-4.387, -2.5024], [-4.8488, -3.029], [-5.2, -2.7]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.387, -2.5024], [-4.0504, -2.7786], [-4.4768, -3.3343], [-4.8488, -3.029]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-4.0504, -2.7786], [-3.6965, -3.0322], [-4.0856, -3.6146], [-4.4768, -3.3343]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-3.6965, -3.0322], [-3.3268, -3.2622], [-3.677, -3.8687], [-4.0856, -3.6146]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-3.3268, -3.2622], [-2.9428, -3.4674], [-3.2526, -4.0955], [-3.677, -3.8687]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.9428, -3.4674], [-2.5462, -3.6471], [-2.8142, -4.2942], [-3.2526, -4.0955]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.5462, -3.6471], [-2.1387, -3.8005], [-2.3638, -4.4637], [-2.8142, -4.2942]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-2.1387, -3.8005], [-1.7221, -3.9268], [-1.9033, -4.6034], [-2.3638, -4.4637]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-1.7221, -3.9268], [-1.298, -4.0257], [-1.4347, -4.7126], [-1.9033, -4.6034]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-1.298, -4.0257], [-0.8685, -4.0966], [-0.9599, -4.791], [-1.4347, -4.7126]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-0.8685, -4.0966], [-0.4352, -4.1393], [-0.481, -4.8382], [-0.9599, -4.791]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-0.4352, -4.1393], [-0.0, -4.1536], [-0.0, -4.8539], [-0.481, -4.8382]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-0.0, -4.1536], [0.4352, -4.1393], [0.481, -4.8382], [-0.0, -4.8539]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[0.4352, -4.1393], [0.8685, -4.0966], [0.9599, -4.791], [0.481, -4.8382]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[0.8685, -4.0966], [1.298, -4.0257], [1.4347, -4.7126], [0.9599, -4.791]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[1.298, -4.0257], [1.7221, -3.9268], [1.9033, -4.6034], [1.4347, -4.7126]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[1.7221, -3.9268], [2.1387, -3.8005], [2.3638, -4.4637], [1.9033, -4.6034]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.1387, -3.8005], [2.5462, -3.6471], [2.8142, -4.2942], [2.3638, -4.4637]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.5462, -3.6471], [2.9428, -3.4674], [3.2526, -4.0955], [2.8142, -4.2942]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[2.9428, -3.4674], [3.3268, -3.2622], [3.677, -3.8687], [3.2526, -4.0955]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[3.3268, -3.2622], [3.6965, -3.0322], [4.0856, -3.6146], [3.677, -3.8687]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[3.6965, -3.0322], [4.0504, -2.7786], [4.4768, -3.3343], [4.0856, -3.6146]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.0504, -2.7786], [4.387, -2.5024], [4.8488, -3.029], [4.4768, -3.3343]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.387, -2.5024], [4.7048, -2.2048], [5.2, -2.7], [4.8488, -3.029]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[4.7048, -2.2048], [5.0024, -1.887], [5.529, -2.3488], [5.2, -2.7]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.0024, -1.887], [5.2786, -1.5504], [5.8343, -1.9768], [5.529, -2.3488]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.2786, -1.5504], [5.5322, -1.1965], [6.1146, -1.5856], [5.8343, -1.9768]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.5322, -1.1965], [5.7622, -0.8268], [6.3687, -1.177], [6.1146, -1.5856]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.7622, -0.8268], [5.9674, -0.4428], [6.5955, -0.7526], [6.3687, -1.177]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[5.9674, -0.4428], [6.1471, -0.0462], [6.7942, -0.3142], [6.5955, -0.7526]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.1471, -0.0462], [6.3005, 0.3613], [6.9637, 0.1362], [6.7942, -0.3142]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.3005, 0.3613], [6.4268, 0.7779], [7.1034, 0.5967], [6.9637, 0.1362]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.4268, 0.7779], [6.5257, 1.202], [7.2126, 1.0653], [7.1034, 0.5967]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.5257, 1.202], [6.5966, 1.6315], [7.291, 1.5401], [7.2126, 1.0653]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.5966, 1.6315], [6.6393, 2.0648], [7.3382, 2.019], [7.291, 1.5401]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[6.6393, 2.0648], [6.6536, 2.5], [7.3539, 2.5], [7.3382, 2.019]], y: [0.0, 0.9], collide: 2, color: "#c9bfa6"}
      - {kind: poly, points: [[-1.4, -9.9], [1.4, -9.9], [1.0, -1], [-1.0, -1]], y: [1.0, 2.0], collide: 0}   # the shaft's standard, behind the disc
      - {kind: poly, points: [[7.5554, -2.4], [27.5554, -2.4], [27.5554, -1.4], [7.5554, -1.4]], y: [-3.4, -1.4], collide: 0, color: "#b9b09c"}   # the guides
      - {kind: poly, points: [[7.5554, 1.4], [27.5554, 1.4], [27.5554, 2.4], [7.5554, 2.4]], y: [-3.4, -1.4], collide: 0, color: "#b9b09c"}
      - {kind: poly, points: [[-15, -10.9], [28.5554, -10.9], [28.5554, -9.9], [-15, -9.9]], 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: the slotted crank; + : clockwise
  - {id: j_e, type: slide, body: slide, axis: [1, 0, 0], damping: 0.05}   # the tool slide in its guides; + : to the right
  - {id: j_p, type: hinge, body: con, axis: [0, 1, 0], damping: 0.002}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 20, kv: 2.0, max_torque: 20}
checks:
  - {type: follow, out: j_e, in: j_s, expect: 0.0857, tol: 0.0069, min_r2: 0.99, settle_s: 0.135, window_s: 0.25}
  - {type: follow, out: j_e, in: j_s, expect: -0.0402, tol: 0.0032, min_r2: 0.99, settle_s: 0.9683, window_s: 0.25}
  - {type: follow, out: j_e, in: j_s, expect: -0.0347, tol: 0.0028, min_r2: 0.99, settle_s: 1.4267, window_s: 0.25}
  - {type: follow, out: j_e, in: j_s, expect: -0.0321, tol: 0.0026, min_r2: 0.99, settle_s: 1.885, window_s: 0.25}
  - {type: position, joint: j_e, min: -4.173, max: 8.602, settle_s: 0.0, window_s: 8.5}
  - {type: penetration, max: 0.003, settle_s: 0.5}
camera: {target: [6.0, 0, -5.0], position: [6.0, -56.0, -5.0], fov: 34}
display:
  output: j_e
  labels: {j_s: "Slotted crank (driver)", j_e: "Tool slide", j_p: "Connecting-rod"}

