# No. 280 (Brown 1868): "A mode of working a windlass. By the alternating motion of the long handlever to the right, motion is communicated to the short lever, the end of which is in immediate contact with the rim of the wheel. The short lever has a very limited motion upon a pin, which is fixed in a block of cast-iron, which is made with two jaws, each having a flange projecting inward in contact with the inner surface of the rim of the wheel. By the upward motion of the outward end of the short lever, the rim of the wheel is jammed between the end of the lever and the flanges of the block, so as to cause friction sufficient to turn the wheel by the further upward movement of the lever. The backward movement of the wheel is prevented by a common ratchet-wheel and pawls; as the short lever is pushed down it frees the wheel and slides freely over it."
#
# Model (cm, gravity on): the wheel (9/10 cm rim, the windlass's barrel behind it with its ratchet-wheel) turns on a fixed axle against its load (friction in the
# bearings). A cast-iron block straddles the rim at the right; an arm on the axle keeps it to the rim but leaves it free to slide round it and, a little, in and out.
# Its two jaws carry a flange (one bar here) inside the rim's inner face, and a pin on which the short lever rocks, its end on the rim's outer face. The long hand-lever,
# pivoted on the frame to the right, is the one driven joint: it is worked up and down 1 times a second, and a link carries its motion to the short lever's outward end.
# On the upstroke the lever's end and the flange pinch the rim between them, and the further upstroke turns the wheel by that friction alone; on the downstroke the grip lets go
# and the block slides back over the rim, while the pawl on the ratchet-wheel holds the wheel. Generator: opencode-runs/batch12/gen280.py.
number: 280
slug: windlass-friction-lever
name: A windlass worked by a friction-grip lever
brown: "A mode of working a windlass. By the alternating motion of the long handlever to the right, motion is communicated to the short lever, the end of which is in immediate contact with the rim of the wheel. The short lever has a very limited motion upon a pin, which is fixed in a block of cast-iron, which is made with two jaws, each having a flange projecting inward in contact with the inner surface of the rim of the wheel. By the upward motion of the outward end of the short lever, the rim of the wheel is jammed between the end of the lever and the flanges of the block, so as to cause friction sufficient to turn the wheel by the further upward movement of the lever. The backward movement of the wheel is prevented by a common ratchet-wheel and pawls; as the short lever is pushed down it frees the wheel and slides freely over it."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 8
  floor: false
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    mass: 2.0
    friction: 0.7
    color: "#d9cfb6"
    pieces:
      - {kind: rod, from: [0, -0.6, 0], to: [0, 4.0, 0], radius: 1.5, color: "#8f8a80"}   # the windlass's barrel and axle
      - {kind: disc, center: [0, 0], radius: 4.2, y: [1.2, 2.0], collide: 0, color: "#2f5d8a"}   # the ratchet-wheel
      - {kind: poly, points: [[0.0, 4.2], [0.0, 4.85], [0.3662, 5.2372], [0.293, 4.1898]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.293, 4.1898], [0.3383, 4.8382], [0.7307, 5.1989], [0.5845, 4.1591]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.5845, 4.1591], [0.675, 4.8028], [1.0915, 5.1353], [0.8732, 4.1082]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.8732, 4.1082], [1.0084, 4.744], [1.4471, 5.0466], [1.1577, 4.0373]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.1577, 4.0373], [1.3368, 4.6621], [1.7956, 4.9334], [1.4365, 3.9467]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.4365, 3.9467], [1.6588, 4.5575], [2.1354, 4.7961], [1.7083, 3.8369]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.7083, 3.8369], [1.9727, 4.4307], [2.4647, 4.6355], [1.9718, 3.7084]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.9718, 3.7084], [2.2769, 4.2823], [2.7821, 4.4523], [2.2257, 3.5618]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.2257, 3.5618], [2.5701, 4.113], [3.0859, 4.2473], [2.4687, 3.3979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.4687, 3.3979], [2.8508, 3.9237], [3.3746, 4.0217], [2.6997, 3.2174]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.6997, 3.2174], [3.1175, 3.7153], [3.647, 3.7765], [2.9176, 3.0212]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.9176, 3.0212], [3.3691, 3.4888], [3.9015, 3.5129], [3.1212, 2.8103]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.1212, 2.8103], [3.6043, 3.2453], [4.1371, 3.2322], [3.3096, 2.5858]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.3096, 2.5858], [3.8219, 2.986], [4.3524, 2.9358], [3.482, 2.3486]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.482, 2.3486], [4.0208, 2.7121], [4.5466, 2.625], [3.6373, 2.1]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.6373, 2.1], [4.2002, 2.425], [4.7187, 2.3014], [3.7749, 1.8412]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.7749, 1.8412], [4.3592, 2.1261], [4.8677, 1.9667], [3.8942, 1.5733]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.8942, 1.5733], [4.4968, 1.8168], [4.993, 1.6223], [3.9944, 1.2979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.9944, 1.2979], [4.6126, 1.4987], [5.0941, 1.2701], [4.0752, 1.0161]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.0752, 1.0161], [4.7059, 1.1733], [5.1702, 0.9117], [4.1362, 0.7293]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.1362, 0.7293], [4.7763, 0.8422], [5.2212, 0.5488], [4.177, 0.439]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.177, 0.439], [4.8234, 0.507], [5.2468, 0.1832], [4.1974, 0.1466]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.1974, 0.1466], [4.847, 0.1693], [5.2468, -0.1832], [4.1974, -0.1466]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.1974, -0.1466], [4.847, -0.1693], [5.2212, -0.5488], [4.177, -0.439]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.177, -0.439], [4.8234, -0.507], [5.1702, -0.9117], [4.1362, -0.7293]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.1362, -0.7293], [4.7763, -0.8422], [5.0941, -1.2701], [4.0752, -1.0161]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[4.0752, -1.0161], [4.7059, -1.1733], [4.993, -1.6223], [3.9944, -1.2979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.9944, -1.2979], [4.6126, -1.4987], [4.8677, -1.9667], [3.8942, -1.5733]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.8942, -1.5733], [4.4968, -1.8168], [4.7187, -2.3014], [3.7749, -1.8412]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.7749, -1.8412], [4.3592, -2.1261], [4.5466, -2.625], [3.6373, -2.1]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.6373, -2.1], [4.2002, -2.425], [4.3524, -2.9358], [3.482, -2.3486]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.482, -2.3486], [4.0208, -2.7121], [4.1371, -3.2322], [3.3096, -2.5858]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.3096, -2.5858], [3.8219, -2.986], [3.9015, -3.5129], [3.1212, -2.8103]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[3.1212, -2.8103], [3.6043, -3.2453], [3.647, -3.7765], [2.9176, -3.0212]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.9176, -3.0212], [3.3691, -3.4888], [3.3746, -4.0217], [2.6997, -3.2174]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.6997, -3.2174], [3.1175, -3.7153], [3.0859, -4.2473], [2.4687, -3.3979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.4687, -3.3979], [2.8508, -3.9237], [2.7821, -4.4523], [2.2257, -3.5618]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[2.2257, -3.5618], [2.5701, -4.113], [2.4647, -4.6355], [1.9718, -3.7084]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.9718, -3.7084], [2.2769, -4.2823], [2.1354, -4.7961], [1.7083, -3.8369]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.7083, -3.8369], [1.9727, -4.4307], [1.7956, -4.9334], [1.4365, -3.9467]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.4365, -3.9467], [1.6588, -4.5575], [1.4471, -5.0466], [1.1577, -4.0373]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[1.1577, -4.0373], [1.3368, -4.6621], [1.0915, -5.1353], [0.8732, -4.1082]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.8732, -4.1082], [1.0084, -4.744], [0.7307, -5.1989], [0.5845, -4.1591]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.5845, -4.1591], [0.675, -4.8028], [0.3662, -5.2372], [0.293, -4.1898]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.293, -4.1898], [0.3383, -4.8382], [0.0, -5.25], [0.0, -4.2]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.0, -4.2], [0.0, -4.85], [-0.3662, -5.2372], [-0.293, -4.1898]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.293, -4.1898], [-0.3383, -4.8382], [-0.7307, -5.1989], [-0.5845, -4.1591]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.5845, -4.1591], [-0.675, -4.8028], [-1.0915, -5.1353], [-0.8732, -4.1082]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.8732, -4.1082], [-1.0084, -4.744], [-1.4471, -5.0466], [-1.1577, -4.0373]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.1577, -4.0373], [-1.3368, -4.6621], [-1.7956, -4.9334], [-1.4365, -3.9467]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.4365, -3.9467], [-1.6588, -4.5575], [-2.1354, -4.7961], [-1.7083, -3.8369]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.7083, -3.8369], [-1.9727, -4.4307], [-2.4647, -4.6355], [-1.9718, -3.7084]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.9718, -3.7084], [-2.2769, -4.2823], [-2.7821, -4.4523], [-2.2257, -3.5618]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.2257, -3.5618], [-2.5701, -4.113], [-3.0859, -4.2473], [-2.4687, -3.3979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.4687, -3.3979], [-2.8508, -3.9237], [-3.3746, -4.0217], [-2.6997, -3.2174]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.6997, -3.2174], [-3.1175, -3.7153], [-3.647, -3.7765], [-2.9176, -3.0212]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.9176, -3.0212], [-3.3691, -3.4888], [-3.9015, -3.5129], [-3.1212, -2.8103]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.1212, -2.8103], [-3.6043, -3.2453], [-4.1371, -3.2322], [-3.3096, -2.5858]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.3096, -2.5858], [-3.8219, -2.986], [-4.3524, -2.9358], [-3.482, -2.3486]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.482, -2.3486], [-4.0208, -2.7121], [-4.5466, -2.625], [-3.6373, -2.1]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.6373, -2.1], [-4.2002, -2.425], [-4.7187, -2.3014], [-3.7749, -1.8412]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.7749, -1.8412], [-4.3592, -2.1261], [-4.8677, -1.9667], [-3.8942, -1.5733]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.8942, -1.5733], [-4.4968, -1.8168], [-4.993, -1.6223], [-3.9944, -1.2979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.9944, -1.2979], [-4.6126, -1.4987], [-5.0941, -1.2701], [-4.0752, -1.0161]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.0752, -1.0161], [-4.7059, -1.1733], [-5.1702, -0.9117], [-4.1362, -0.7293]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.1362, -0.7293], [-4.7763, -0.8422], [-5.2212, -0.5488], [-4.177, -0.439]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.177, -0.439], [-4.8234, -0.507], [-5.2468, -0.1832], [-4.1974, -0.1466]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.1974, -0.1466], [-4.847, -0.1693], [-5.2468, 0.1832], [-4.1974, 0.1466]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.1974, 0.1466], [-4.847, 0.1693], [-5.2212, 0.5488], [-4.177, 0.439]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.177, 0.439], [-4.8234, 0.507], [-5.1702, 0.9117], [-4.1362, 0.7293]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.1362, 0.7293], [-4.7763, 0.8422], [-5.0941, 1.2701], [-4.0752, 1.0161]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-4.0752, 1.0161], [-4.7059, 1.1733], [-4.993, 1.6223], [-3.9944, 1.2979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.9944, 1.2979], [-4.6126, 1.4987], [-4.8677, 1.9667], [-3.8942, 1.5733]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.8942, 1.5733], [-4.4968, 1.8168], [-4.7187, 2.3014], [-3.7749, 1.8412]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.7749, 1.8412], [-4.3592, 2.1261], [-4.5466, 2.625], [-3.6373, 2.1]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.6373, 2.1], [-4.2002, 2.425], [-4.3524, 2.9358], [-3.482, 2.3486]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.482, 2.3486], [-4.0208, 2.7121], [-4.1371, 3.2322], [-3.3096, 2.5858]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.3096, 2.5858], [-3.8219, 2.986], [-3.9015, 3.5129], [-3.1212, 2.8103]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-3.1212, 2.8103], [-3.6043, 3.2453], [-3.647, 3.7765], [-2.9176, 3.0212]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.9176, 3.0212], [-3.3691, 3.4888], [-3.3746, 4.0217], [-2.6997, 3.2174]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.6997, 3.2174], [-3.1175, 3.7153], [-3.0859, 4.2473], [-2.4687, 3.3979]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.4687, 3.3979], [-2.8508, 3.9237], [-2.7821, 4.4523], [-2.2257, 3.5618]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-2.2257, 3.5618], [-2.5701, 4.113], [-2.4647, 4.6355], [-1.9718, 3.7084]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.9718, 3.7084], [-2.2769, 4.2823], [-2.1354, 4.7961], [-1.7083, 3.8369]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.7083, 3.8369], [-1.9727, 4.4307], [-1.7956, 4.9334], [-1.4365, 3.9467]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.4365, 3.9467], [-1.6588, 4.5575], [-1.4471, 5.0466], [-1.1577, 4.0373]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-1.1577, 4.0373], [-1.3368, 4.6621], [-1.0915, 5.1353], [-0.8732, 4.1082]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.8732, 4.1082], [-1.0084, 4.744], [-0.7307, 5.1989], [-0.5845, 4.1591]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.5845, 4.1591], [-0.675, 4.8028], [-0.3662, 5.2372], [-0.293, 4.1898]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[-0.293, 4.1898], [-0.3383, 4.8382], [-0.0, 5.25], [-0.0, 4.2]], y: [1.2, 2.0], collide: 1, color: "#2f5d8a"}
      - {kind: poly, points: [[0.0, 9.0], [0.0, 10.0], [0.8716, 9.9619], [0.7844, 8.9658]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[0.7844, 8.9658], [0.8716, 9.9619], [1.7365, 9.8481], [1.5628, 8.8633]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[1.5628, 8.8633], [1.7365, 9.8481], [2.5882, 9.6593], [2.3294, 8.6933]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[2.3294, 8.6933], [2.5882, 9.6593], [3.4202, 9.3969], [3.0782, 8.4572]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.0782, 8.4572], [3.4202, 9.3969], [4.2262, 9.0631], [3.8036, 8.1568]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8036, 8.1568], [4.2262, 9.0631], [5.0, 8.6603], [4.5, 7.7942]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5, 7.7942], [5.0, 8.6603], [5.7358, 8.1915], [5.1622, 7.3724]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.1622, 7.3724], [5.7358, 8.1915], [6.4279, 7.6604], [5.7851, 6.8944]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.7851, 6.8944], [6.4279, 7.6604], [7.0711, 7.0711], [6.364, 6.364]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[6.364, 6.364], [7.0711, 7.0711], [7.6604, 6.4279], [6.8944, 5.7851]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[6.8944, 5.7851], [7.6604, 6.4279], [8.1915, 5.7358], [7.3724, 5.1622]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[7.3724, 5.1622], [8.1915, 5.7358], [8.6603, 5.0], [7.7942, 4.5]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[7.7942, 4.5], [8.6603, 5.0], [9.0631, 4.2262], [8.1568, 3.8036]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.1568, 3.8036], [9.0631, 4.2262], [9.3969, 3.4202], [8.4572, 3.0782]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.4572, 3.0782], [9.3969, 3.4202], [9.6593, 2.5882], [8.6933, 2.3294]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.6933, 2.3294], [9.6593, 2.5882], [9.8481, 1.7365], [8.8633, 1.5628]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.8633, 1.5628], [9.8481, 1.7365], [9.9619, 0.8716], [8.9658, 0.7844]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.9658, 0.7844], [9.9619, 0.8716], [10.0, 0.0], [9.0, 0.0]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[9.0, 0.0], [10.0, 0.0], [9.9619, -0.8716], [8.9658, -0.7844]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.9658, -0.7844], [9.9619, -0.8716], [9.8481, -1.7365], [8.8633, -1.5628]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.8633, -1.5628], [9.8481, -1.7365], [9.6593, -2.5882], [8.6933, -2.3294]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.6933, -2.3294], [9.6593, -2.5882], [9.3969, -3.4202], [8.4572, -3.0782]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.4572, -3.0782], [9.3969, -3.4202], [9.0631, -4.2262], [8.1568, -3.8036]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[8.1568, -3.8036], [9.0631, -4.2262], [8.6603, -5.0], [7.7942, -4.5]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[7.7942, -4.5], [8.6603, -5.0], [8.1915, -5.7358], [7.3724, -5.1622]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[7.3724, -5.1622], [8.1915, -5.7358], [7.6604, -6.4279], [6.8944, -5.7851]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[6.8944, -5.7851], [7.6604, -6.4279], [7.0711, -7.0711], [6.364, -6.364]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[6.364, -6.364], [7.0711, -7.0711], [6.4279, -7.6604], [5.7851, -6.8944]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.7851, -6.8944], [6.4279, -7.6604], [5.7358, -8.1915], [5.1622, -7.3724]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[5.1622, -7.3724], [5.7358, -8.1915], [5.0, -8.6603], [4.5, -7.7942]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[4.5, -7.7942], [5.0, -8.6603], [4.2262, -9.0631], [3.8036, -8.1568]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.8036, -8.1568], [4.2262, -9.0631], [3.4202, -9.3969], [3.0782, -8.4572]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[3.0782, -8.4572], [3.4202, -9.3969], [2.5882, -9.6593], [2.3294, -8.6933]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[2.3294, -8.6933], [2.5882, -9.6593], [1.7365, -9.8481], [1.5628, -8.8633]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[1.5628, -8.8633], [1.7365, -9.8481], [0.8716, -9.9619], [0.7844, -8.9658]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[0.7844, -8.9658], [0.8716, -9.9619], [0.0, -10.0], [0.0, -9.0]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[0.0, -9.0], [0.0, -10.0], [-0.8716, -9.9619], [-0.7844, -8.9658]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-0.7844, -8.9658], [-0.8716, -9.9619], [-1.7365, -9.8481], [-1.5628, -8.8633]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-1.5628, -8.8633], [-1.7365, -9.8481], [-2.5882, -9.6593], [-2.3294, -8.6933]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-2.3294, -8.6933], [-2.5882, -9.6593], [-3.4202, -9.3969], [-3.0782, -8.4572]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-3.0782, -8.4572], [-3.4202, -9.3969], [-4.2262, -9.0631], [-3.8036, -8.1568]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-3.8036, -8.1568], [-4.2262, -9.0631], [-5.0, -8.6603], [-4.5, -7.7942]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-4.5, -7.7942], [-5.0, -8.6603], [-5.7358, -8.1915], [-5.1622, -7.3724]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-5.1622, -7.3724], [-5.7358, -8.1915], [-6.4279, -7.6604], [-5.7851, -6.8944]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-5.7851, -6.8944], [-6.4279, -7.6604], [-7.0711, -7.0711], [-6.364, -6.364]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-6.364, -6.364], [-7.0711, -7.0711], [-7.6604, -6.4279], [-6.8944, -5.7851]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-6.8944, -5.7851], [-7.6604, -6.4279], [-8.1915, -5.7358], [-7.3724, -5.1622]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-7.3724, -5.1622], [-8.1915, -5.7358], [-8.6603, -5.0], [-7.7942, -4.5]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-7.7942, -4.5], [-8.6603, -5.0], [-9.0631, -4.2262], [-8.1568, -3.8036]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.1568, -3.8036], [-9.0631, -4.2262], [-9.3969, -3.4202], [-8.4572, -3.0782]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.4572, -3.0782], [-9.3969, -3.4202], [-9.6593, -2.5882], [-8.6933, -2.3294]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.6933, -2.3294], [-9.6593, -2.5882], [-9.8481, -1.7365], [-8.8633, -1.5628]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.8633, -1.5628], [-9.8481, -1.7365], [-9.9619, -0.8716], [-8.9658, -0.7844]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.9658, -0.7844], [-9.9619, -0.8716], [-10.0, -0.0], [-9.0, -0.0]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-9.0, -0.0], [-10.0, -0.0], [-9.9619, 0.8716], [-8.9658, 0.7844]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.9658, 0.7844], [-9.9619, 0.8716], [-9.8481, 1.7365], [-8.8633, 1.5628]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.8633, 1.5628], [-9.8481, 1.7365], [-9.6593, 2.5882], [-8.6933, 2.3294]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.6933, 2.3294], [-9.6593, 2.5882], [-9.3969, 3.4202], [-8.4572, 3.0782]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.4572, 3.0782], [-9.3969, 3.4202], [-9.0631, 4.2262], [-8.1568, 3.8036]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-8.1568, 3.8036], [-9.0631, 4.2262], [-8.6603, 5.0], [-7.7942, 4.5]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-7.7942, 4.5], [-8.6603, 5.0], [-8.1915, 5.7358], [-7.3724, 5.1622]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-7.3724, 5.1622], [-8.1915, 5.7358], [-7.6604, 6.4279], [-6.8944, 5.7851]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-6.8944, 5.7851], [-7.6604, 6.4279], [-7.0711, 7.0711], [-6.364, 6.364]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-6.364, 6.364], [-7.0711, 7.0711], [-6.4279, 7.6604], [-5.7851, 6.8944]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-5.7851, 6.8944], [-6.4279, 7.6604], [-5.7358, 8.1915], [-5.1622, 7.3724]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-5.1622, 7.3724], [-5.7358, 8.1915], [-5.0, 8.6603], [-4.5, 7.7942]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-4.5, 7.7942], [-5.0, 8.6603], [-4.2262, 9.0631], [-3.8036, 8.1568]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-3.8036, 8.1568], [-4.2262, 9.0631], [-3.4202, 9.3969], [-3.0782, 8.4572]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-3.0782, 8.4572], [-3.4202, 9.3969], [-2.5882, 9.6593], [-2.3294, 8.6933]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-2.3294, 8.6933], [-2.5882, 9.6593], [-1.7365, 9.8481], [-1.5628, 8.8633]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-1.5628, 8.8633], [-1.7365, 9.8481], [-0.8716, 9.9619], [-0.7844, 8.9658]], y: [-0.5, 0.5], collide: 1}
      - {kind: poly, points: [[-0.7844, 8.9658], [-0.8716, 9.9619], [-0.0, 10.0], [-0.0, 9.0]], y: [-0.5, 0.5], collide: 1}
      - {kind: rod, from: [0.0, 0, 1.5], to: [0.0, 0, 9.1], radius: 0.35, collide: 0}
      - {kind: rod, from: [1.299, 0, 0.75], to: [7.8808, 0, 4.55], radius: 0.35, collide: 0}
      - {kind: rod, from: [1.299, 0, -0.75], to: [7.8808, 0, -4.55], radius: 0.35, collide: 0}
      - {kind: rod, from: [0.0, 0, -1.5], to: [0.0, 0, -9.1], radius: 0.35, collide: 0}
      - {kind: rod, from: [-1.299, 0, -0.75], to: [-7.8808, 0, -4.55], radius: 0.35, collide: 0}
      - {kind: rod, from: [-1.299, 0, 0.75], to: [-7.8808, 0, 4.55], radius: 0.35, collide: 0}
  - id: arm
    shape: part
    pos: [0, 0, 0]
    mass: 0.05
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [0, -1.5, 0], to: [8.2, -1.5, 0], radius: 0.25, collide: 0}   # the arm on the axle, in front
  - id: block
    shape: part
    pos: [10, 0, 0]
    mount: arm
    mass: 0.25
    friction: 0.7
    color: "#9a8f7c"
    pieces:
      - {kind: poly, points: [[8.3, -2.0], [12.0, -2.0], [12.0, 1.2], [8.3, 1.2]], y: [0.6, 1.1], collide: 0}   # the jaws, behind ...
      - {kind: poly, points: [[8.3, -2.0], [12.0, -2.0], [12.0, 1.2], [8.3, 1.2]], y: [-1.1, -0.6], collide: 0}   # ... and before the rim
      - {kind: poly, points: [[11.9, -2.0], [12.4, -2.0], [12.4, 1.2], [11.9, 1.2]], y: [-1.1, 1.1], collide: 0}   # the block's top
      - {kind: rod, from: [8.7, -1.1, -0.8], to: [8.7, -1.1, 0.8], radius: 0.2, collide: 0}
      - {kind: rod, from: [8.7, -0.9, 0], to: [8.7, 0.9, 0], radius: 0.25, capsule: true, collide: 2}   # the flanges, under the rim's inner face
      - {kind: rod, from: [11.2, -1.2, -1.2], to: [11.2, 1.2, -1.2], radius: 0.15, collide: 0, color: "#5f5a52"}   # the pin
  - id: lever
    shape: part
    pos: [11.2, 0, -1.2]
    mount: block
    mass: 0.1
    friction: 0.7
    color: "#e4d9bf"
    pieces:
      - {kind: rod, from: [10.4, 0, 0.0], to: [11.2, 0, -1.2], radius: 0.25, collide: 0}   # the short lever
      - {kind: rod, from: [11.2, 0, -1.2], to: [16.0, 0, -1.2], radius: 0.25, collide: 0}
      - {kind: rod, from: [10.4, -0.45, 0.0], to: [10.4, 0.45, 0.0], radius: 0.25, capsule: true, collide: 2}   # its end, on the rim's outer face
  - id: hand
    shape: part
    pos: [22.0, 0, -6.0]
    mass: 0.4
    color: "#cbbf9f"
    pieces:
      - {kind: rod, from: [16.0, -1.8, -6.0], to: [33, -1.8, -6.0], radius: 0.35, collide: 0}   # the long hand-lever
      - {kind: rod, from: [22.0, -2.3, -6.0], to: [22.0, -1.3, -6.0], radius: 0.5, collide: 0, color: "#8f8a80"}
  - id: link
    shape: part
    pos: [16.0, 0, -6.0]
    mount: hand
    mass: 0.03
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [16.0, -1.3, -6.0], to: [16.0, -1.3, -1.2], radius: 0.18, collide: 0}   # the link to the short lever's outward end
  - id: pawl
    shape: part
    pos: [-6.0, 0, 4.0]
    mass: 0.03
    friction: 0.2
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [-6.0, 1.6, 4.0], to: [-4.95, 1.6, 0.0], radius: 0.18, collide: 0}   # the pawl
      - {kind: rod, from: [-4.95, 1.25, 0.0], to: [-4.95, 1.95, 0.0], radius: 0.18, capsule: true, collide: 2}   # its tip, in the ratchet
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-2, -11], [2, -11], [1.2, 0], [-1.2, 0]], y: [4.0, 5.0]}   # the windlass's standard, behind
      - {kind: poly, points: [[21.2, -11], [22.8, -11], [22.8, -6], [21.2, -6]], y: [-2.8, -2.3]}   # the hand-lever's post
      - {kind: rod, from: [-6.0, 1.0, 4.0], to: [-6.0, 4.0, 4.0], radius: 0.2, color: "#5f5a52"}   # the pawl's stud
      - {kind: poly, points: [[-13, -12], [34, -12], [34, -11], [-13, -11]], y: [-3, 5], color: "#b9b09c"}
pins:
  - {id: p_link, a: link, b: lever, at: [16.0, -1.3, -1.2]}   # the link's upper pin, in the short lever's outward end
joints:
  - {id: j_h, type: hinge, body: hand, axis: [0, 1, 0], damping: 0.01}   # the one driven joint: the hand-lever; + : its left end up
  - {id: j_w, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.2, frictionloss: 0.05}   # the windlass; - : winding (the top to the left)
  - {id: j_a, type: hinge, body: arm, axis: [0, 1, 0], damping: 0.001}   # the block's arm on the axle
  - {id: j_r, type: slide, body: block, axis: [1, 0, 0], range: [-0.1, 0.1], damping: 0.01}   # the block, in and out on its arm
  - {id: j_l, type: hinge, body: lever, axis: [0, 1, 0], range: [-0.3, 0.08], damping: 0.001}   # the short lever on its pin
  - {id: j_k, type: hinge, body: link, axis: [0, 1, 0], damping: 0.0005}   # the link's lower pin, in the hand-lever
  - {id: j_p, type: hinge, body: pawl, axis: [0, 1, 0], range: [-0.3, 0.3], stiffness: 0.02, springref: -0.15, damping: 0.0005}   # the pawl; its spring presses it to the ratchet
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_h, kind: velocity, rpm: 0, swing: {amplitude: 0.2, hz: 1}, kv: 50.0, max_torque: 100}
checks:
  - {type: advance, joint: j_w, beat: j_h, expect: -0.0693, tol: 0.15, settle_s: 1.0, window_s: 6.8}   # the windlass winds on, stroke by stroke
  - {type: monotonic, joint: j_w, direction: -1, max_back: 0.03, settle_s: 1.0, window_s: 6.8}   # the pawl holds it on the down-strokes
  - {type: penetration, max: 0.0008, settle_s: 0.5}
camera: {target: [3.0, 0, -6.3], position: [3.0, -56.0, -3.3], fov: 34}
display:
  output: j_w
  labels: {j_h: "Hand-lever (driver)", j_w: "Windlass"}
  proof: {label: "A windlass worked by a friction grip", sub: "the lever pinches the rim and turns the wheel; the pawl holds it"}

