# No. 499 (Brown 1868): Bourdon's pressure-gauge. "The bent tube, B, is secured at C ... the ends of the tube are connected by links
# with a toothed sector which works a pinion on the spindle of the pointer: pressure inside the tube tends to straighten it, and so moves
# the pointer over the dial."
# Model (cm, gravity on, Brown's face view, the glass off). The pressure is lumped vessels (src/fluid/vessels.c): a pump barrel's air
# (the only drive is the hand lever on its plunger) piped to the tube's bore. The bent tube is flexible: each half from C is a chain of
# 5 short links hinged end to end, each hinge a spring (2.73 N m/rad) and a piston on the bore, whose volume grows 1.4 cm^3 per
# radian of each hinge opening (the tube's bore grows as its curvature lessens), so the pressure straightens the whole tube along its length
# (each hinge stands at q = 0 under 20 kPa). Links from the ends turn the sector; its teeth (collision) turn the pinion and pointer
# against a light hairspring.
# The dial is graduated every 5 kPa (-10 to 60) from a run of this model (a cubic fit of the pointer against the bore's pressure).
# Generator: opencode-runs/fluidgen/gen499.py (CAL=-1.67649e-16,-1.30486e-10,5.20313e-05,-1.38701).
number: 499
slug: bourdon-pressure-gauge
name: Bourdon pressure-gauge
brown: "Bourdon's pressure-gauge. The bent tube, B, is secured at C, and its ends are connected by links with a toothed sector which works a pinion on the spindle of the pointer. Pressure of steam or other fluid inside the tube tends to straighten it, and so moves the pointer over the dial."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 50, duration_s: 10, floor: false}
bodies:
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#d6cdb8"
    pieces:
      - {kind: disc, center: [0.0, 30.0], radius: 12.0, y: [1.0, 1.4], collide: 0, color: "#f1ece0"}
      - {kind: disc, center: [0.0, 30.0], radius: 12.8, y: [-3.6, 1.6], collide: 0, inner: 12.0, color: "#8f8a80"}
      - {kind: poly, points: [[-1.1, 38.3], [1.1, 38.3], [1.1, 40.4], [-1.1, 40.4]], y: [-1.8, 1.0], collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0.0, -1.0, 22.5], to: [0.0, 1.0, 22.5], radius: 0.35, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0.0, -1.0, 30.0], to: [0.0, 1.0, 30.0], radius: 0.3, collide: 0, color: "#6d675c"}
      - {kind: poly, points: [[-1.4, 4.0], [1.4, 4.0], [1.4, 17.6], [-1.4, 17.6]], y: [-1.4, 1.4], collide: 0, color: "#6d675c"}
      - {kind: poly, points: [[-2.2, 4.0], [2.2, 4.0], [2.2, 6.0], [-2.2, 6.0]], y: [-2.2, 2.2], collide: 0, color: "#7d776c"}
      - {kind: rod, from: [0.0, 0.0, 4.0], to: [0.0, 0.0, 2.0], radius: 0.35, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [0.0, 0.0, 2.0], to: [24.0, 0.0, 2.0], radius: 0.35, collide: 0, capsule: true, color: "#5f5a52"}
      - {kind: rod, from: [24.0, 0.0, 2.0], to: [24.0, 0.0, 0.2], radius: 0.35, collide: 0, capsule: true, color: "#5f5a52"}
      - {kind: rod, from: [-9.1139, 0.9, 26.679], to: [-9.9595, 0.9, 26.371], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-10.068, 0.9, 29.197], to: [-10.566, 0.9, 29.157], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-9.5366, 0.9, 31.773], to: [-10.421, 0.9, 31.937], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-9.1352, 0.9, 34.308], to: [-9.5874, 0.9, 34.521], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-7.4756, 0.9, 36.181], to: [-8.1692, 0.9, 36.755], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-6.003, 0.9, 38.122], to: [-6.3002, 0.9, 38.525], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-3.7766, 0.9, 38.935], to: [-4.127, 0.9, 39.764], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [-1.7127, 0.9, 39.954], to: [-1.7975, 0.9, 40.446], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [0.50383, 0.9, 39.687], to: [0.55058, 0.9, 40.586], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [2.6653, 0.9, 39.742], to: [2.7972, 0.9, 40.224], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [4.4339, 0.9, 38.627], to: [4.8453, 0.9, 39.428], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [6.3106, 0.9, 37.886], to: [6.623, 0.9, 38.276], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [7.3976, 0.9, 36.274], to: [8.084, 0.9, 36.856], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [8.7715, 0.9, 35.007], to: [9.2057, 0.9, 35.255], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: rod, from: [9.1386, 0.9, 33.252], to: [9.9865, 0.9, 33.554], radius: 0.09, collide: 0, color: "#2b2620"}
      - {kind: poly, points: [[22.4, 0.0], [25.6, 0.0], [25.6, 24.0], [22.4, 24.0]], y: [1.6, 1.9], collide: 0, color: "#8b7d66"}
      - {kind: poly, points: [[22.1, -0.4], [22.4, -0.4], [22.4, 24.0], [22.1, 24.0]], y: [-1.6, 1.6], collide: 0, color: "#6d675c"}
      - {kind: poly, points: [[25.6, -0.4], [25.9, -0.4], [25.9, 24.0], [25.6, 24.0]], y: [-1.6, 1.6], collide: 0, color: "#6d675c"}
      - {kind: poly, points: [[22.1, -0.8], [25.9, -0.8], [25.9, 0.0], [22.1, 0.0]], y: [-1.6, 1.6], collide: 0, color: "#6d675c"}
      - {kind: rod, from: [36.0, 0.9, -3.0], to: [36.0, 0.9, 30.0], radius: 0.45, collide: 0, color: "#6d675c"}
      - {kind: poly, points: [[-14.0, -3.5], [42.0, -3.5], [42.0, -2.5], [-14.0, -2.5]], y: [-4.0, 4.0], collide: 0, color: "#8b7d66"}
  - id: hL0
    shape: part
    pos: [5.5109e-16, 0, 39.0]
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [5.5109e-16, -0.6, 39.0], to: [-1.1747, -0.6, 38.923], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-1.1747, -0.6, 38.923], to: [-2.3294, -0.6, 38.693], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-2.3294, -0.6, 38.693], to: [-3.4442, -0.6, 38.315], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-3.4442, -0.6, 38.315], to: [-4.5, -0.6, 37.794], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [0.0, -1.2, 39.0], to: [0.0, 0.2, 39.0], radius: 0.35, collide: 0, color: "#6d675c"}
  - id: hL1
    shape: part
    pos: [-4.5, 0, 37.794]
    mount: hL0
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [-4.5, -0.6, 37.794], to: [-5.4789, -0.6, 37.14], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-5.4789, -0.6, 37.14], to: [-6.364, -0.6, 36.364], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-6.364, -0.6, 36.364], to: [-7.1402, -0.6, 35.479], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-7.1402, -0.6, 35.479], to: [-7.7942, -0.6, 34.5], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hL2
    shape: part
    pos: [-7.7942, 0, 34.5]
    mount: hL1
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [-7.7942, -0.6, 34.5], to: [-8.3149, -0.6, 33.444], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.3149, -0.6, 33.444], to: [-8.6933, -0.6, 32.329], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.6933, -0.6, 32.329], to: [-8.923, -0.6, 31.175], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.923, -0.6, 31.175], to: [-9.0, -0.6, 30.0], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hL3
    shape: part
    pos: [-9.0, 0, 30.0]
    mount: hL2
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [-9.0, -0.6, 30.0], to: [-8.923, -0.6, 28.825], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.923, -0.6, 28.825], to: [-8.6933, -0.6, 27.671], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.6933, -0.6, 27.671], to: [-8.3149, -0.6, 26.556], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-8.3149, -0.6, 26.556], to: [-7.7942, -0.6, 25.5], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hL4
    shape: part
    pos: [-7.7942, 0, 25.5]
    mount: hL3
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [-7.7942, -0.6, 25.5], to: [-7.1402, -0.6, 24.521], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-7.1402, -0.6, 24.521], to: [-6.364, -0.6, 23.636], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-6.364, -0.6, 23.636], to: [-5.4789, -0.6, 22.86], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [-5.4789, -0.6, 22.86], to: [-4.5, -0.6, 22.206], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hR0
    shape: part
    pos: [2.7555e-15, 0, 39.0]
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [2.7555e-15, -0.6, 39.0], to: [1.1747, -0.6, 38.923], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [1.1747, -0.6, 38.923], to: [2.3294, -0.6, 38.693], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [2.3294, -0.6, 38.693], to: [3.4442, -0.6, 38.315], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [3.4442, -0.6, 38.315], to: [4.5, -0.6, 37.794], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hR1
    shape: part
    pos: [4.5, 0, 37.794]
    mount: hR0
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [4.5, -0.6, 37.794], to: [5.4789, -0.6, 37.14], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [5.4789, -0.6, 37.14], to: [6.364, -0.6, 36.364], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [6.364, -0.6, 36.364], to: [7.1402, -0.6, 35.479], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [7.1402, -0.6, 35.479], to: [7.7942, -0.6, 34.5], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hR2
    shape: part
    pos: [7.7942, 0, 34.5]
    mount: hR1
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [7.7942, -0.6, 34.5], to: [8.3149, -0.6, 33.444], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.3149, -0.6, 33.444], to: [8.6933, -0.6, 32.329], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.6933, -0.6, 32.329], to: [8.923, -0.6, 31.175], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.923, -0.6, 31.175], to: [9.0, -0.6, 30.0], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hR3
    shape: part
    pos: [9.0, 0, 30.0]
    mount: hR2
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [9.0, -0.6, 30.0], to: [8.923, -0.6, 28.825], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.923, -0.6, 28.825], to: [8.6933, -0.6, 27.671], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.6933, -0.6, 27.671], to: [8.3149, -0.6, 26.556], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [8.3149, -0.6, 26.556], to: [7.7942, -0.6, 25.5], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: hR4
    shape: part
    pos: [7.7942, 0, 25.5]
    mount: hR3
    mass: 0.001
    color: "#c9a35a"
    pieces:
      - {kind: rod, from: [7.7942, -0.6, 25.5], to: [7.1402, -0.6, 24.521], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [7.1402, -0.6, 24.521], to: [6.364, -0.6, 23.636], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [6.364, -0.6, 23.636], to: [5.4789, -0.6, 22.86], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
      - {kind: rod, from: [5.4789, -0.6, 22.86], to: [4.5, -0.6, 22.206], radius: 0.5, collide: 0, capsule: true, color: "#c9a35a"}
  - id: linkL
    shape: part
    pos: [-4.5, 0, 22.206]
    mount: hL4
    mass: 0.001
    pieces:
      - {kind: rod, from: [-4.5, -2.0, 22.206], to: [0.0, -2.0, 24.5], radius: 0.18, collide: 0, capsule: true, color: "#5f5a52"}
      - {kind: rod, from: [-4.5, -2.2, 22.206], to: [-4.5, -0.4, 22.206], radius: 0.22, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0.0, -2.2, 24.5], to: [0.0, -0.8, 24.5], radius: 0.22, collide: 0, color: "#6d675c"}
  - id: linkR
    shape: part
    pos: [4.5, 0, 22.206]
    mount: hR4
    mass: 0.001
    pieces:
      - {kind: rod, from: [4.5, -2.0, 22.206], to: [0.0, -2.0, 19.5], radius: 0.18, collide: 0, capsule: true, color: "#5f5a52"}
      - {kind: rod, from: [4.5, -2.2, 22.206], to: [4.5, -0.4, 22.206], radius: 0.22, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0.0, -2.2, 19.5], to: [0.0, -0.8, 19.5], radius: 0.22, collide: 0, color: "#6d675c"}
  - id: sector
    shape: part
    pos: [0.0, 0, 22.5]
    mass: 0.004
    friction: 0.1
    pieces:
      - {kind: poly, points: [[0.0, 22.5], [3.5996, 26.79], [0.0, 28.1], [-3.5996, 26.79]], y: [-1.5, -0.9], collide: 0, color: "#b8ad97"}
      - {kind: poly, points: [[-0.4, 22.5], [0.4, 22.5], [0.4, 19.5], [-0.4, 19.5]], y: [-1.5, -0.9], collide: 0, color: "#b8ad97"}
      - {kind: disc, center: [0.0, 22.5], radius: 0.7, y: [-1.6, -0.8], collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[4.1578, 26.34], [3.8396, 26.658], [4.0984, 26.887], [4.3763, 27.012], [4.512, 26.876], [4.3869, 26.598]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[3.506, 26.943], [3.1419, 27.207], [3.3617, 27.474], [3.6166, 27.641], [3.7719, 27.528], [3.6918, 27.234]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[2.7678, 27.436], [2.3668, 27.641], [2.5422, 27.939], [2.7678, 28.144], [2.9389, 28.056], [2.9057, 27.753]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[1.9615, 27.809], [1.5335, 27.948], [1.6601, 28.269], [1.8509, 28.507], [2.0335, 28.448], [2.0481, 28.143]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[1.1069, 28.05], [0.66241, 28.121], [0.73712, 28.458], [0.88837, 28.723], [1.078, 28.693], [1.1401, 28.394]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[0.225, 28.155], [-0.225, 28.155], [-0.204, 28.5], [-0.096, 28.785], [0.096, 28.785], [0.204, 28.5]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[-0.66241, 28.121], [-1.1069, 28.05], [-1.1401, 28.394], [-1.078, 28.693], [-0.88837, 28.723], [-0.73712, 28.458]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[-1.5335, 27.948], [-1.9615, 27.809], [-2.0481, 28.143], [-2.0335, 28.448], [-1.8509, 28.507], [-1.6601, 28.269]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[-2.3668, 27.641], [-2.7678, 27.436], [-2.9057, 27.753], [-2.9389, 28.056], [-2.7678, 28.144], [-2.5422, 27.939]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[-3.1419, 27.207], [-3.506, 26.943], [-3.6918, 27.234], [-3.7719, 27.528], [-3.6166, 27.641], [-3.3617, 27.474]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
      - {kind: poly, points: [[-3.8396, 26.658], [-4.1578, 26.34], [-4.3869, 26.598], [-4.512, 26.876], [-4.3763, 27.012], [-4.0984, 26.887]], y: [-1.5, -0.9], collide: 1, color: "#b8ad97"}
  - id: pinion
    shape: part
    pos: [0.0, 0, 30.0]
    mass: 0.003
    friction: 0.1
    pieces:
      - {kind: disc, center: [0.0, 30.0], radius: 1.175, y: [-1.6, -0.8], collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[0.14293, 28.832], [0.5709, 28.971], [0.65754, 28.636], [0.6429, 28.332], [0.46029, 28.273], [0.26951, 28.51]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[0.80216, 29.139], [1.0667, 29.503], [1.3334, 29.283], [1.5005, 29.028], [1.3877, 28.873], [1.0936, 28.953]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[1.155, 29.775], [1.155, 30.225], [1.5, 30.204], [1.785, 30.096], [1.785, 29.904], [1.5, 29.796]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[1.0667, 30.497], [0.80216, 30.861], [1.0936, 31.047], [1.3877, 31.127], [1.5005, 30.972], [1.3334, 30.717]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[0.5709, 31.029], [0.14293, 31.168], [0.26951, 31.49], [0.46029, 31.727], [0.6429, 31.668], [0.65754, 31.364]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[-0.14293, 31.168], [-0.5709, 31.029], [-0.65754, 31.364], [-0.6429, 31.668], [-0.46029, 31.727], [-0.26951, 31.49]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[-0.80216, 30.861], [-1.0667, 30.497], [-1.3334, 30.717], [-1.5005, 30.972], [-1.3877, 31.127], [-1.0936, 31.047]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[-1.155, 30.225], [-1.155, 29.775], [-1.5, 29.796], [-1.785, 29.904], [-1.785, 30.096], [-1.5, 30.204]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[-1.0667, 29.503], [-0.80216, 29.139], [-1.0936, 28.953], [-1.3877, 28.873], [-1.5005, 29.028], [-1.3334, 29.283]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: poly, points: [[-0.5709, 28.971], [-0.14293, 28.832], [-0.26951, 28.51], [-0.46029, 28.273], [-0.6429, 28.332], [-0.65754, 28.636]], y: [-1.5, -0.9], collide: 2, color: "#8f8a80"}
      - {kind: rod, from: [0.0, -3.0, 27.5], to: [0.0, -3.0, 40.2], radius: 0.16, collide: 0, capsule: true, color: "#2a2a2a"}
      - {kind: disc, center: [0.0, 30.0], radius: 0.55, y: [-3.3, -0.8], collide: 0, color: "#2a2a2a"}
  - id: lever
    shape: part
    pos: [36.0, 0, 30.0]
    mass: 0.12
    color: "#5f5a52"
    pieces:
      - {kind: rod, from: [48.0, -0.6, 30.6], to: [36.0, -0.6, 30.0], radius: 0.42, collide: 0, capsule: true}
      - {kind: rod, from: [36.0, -0.6, 30.0], to: [24.0, -0.6, 30.0], radius: 0.42, collide: 0, capsule: true}
      - {kind: rod, from: [36.0, -1.2, 30.0], to: [36.0, 0.2, 30.0], radius: 0.6, collide: 0}
      - {kind: rod, from: [24.0, -1.2, 30.0], to: [24.0, 0.2, 30.0], radius: 0.45, collide: 0}
  - id: plunger
    shape: part
    pos: [24.0, 0, 12.0]
    mass: 0.05
    color: "#8a8478"
    pieces:
      - {kind: disc, center: [24.0, 12.5], radius: 1.57, y: [-1.6, 1.6], collide: 0, color: "#4f3b28"}
      - {kind: rod, from: [24.0, 0.0, 13.0], to: [24.0, 0.0, 22.0], radius: 0.3, collide: 0}
  - id: crod
    shape: part
    pos: [24.0, 0, 22.0]
    mount: plunger
    mass: 0.01
    pieces:
      - {kind: rod, from: [24.0, -0.6, 22.0], to: [24.0, -0.6, 30.0], radius: 0.3, collide: 0, capsule: true}
joints:
  - {id: j_lever, type: hinge, body: lever, axis: [0, 1, 0], damping: 0.002}   # the hand's lever (the only drive)
  - {id: j_p, type: slide, body: plunger, axis: [0, 0, 1], range: [-12, 12], damping: 0.01, frictionloss: 40}   # the plunger in its packing
  - {id: j_c, type: hinge, body: crod, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_hl0, type: hinge, body: hL0, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: -0.010251}   # + : the tube opens (straightens)
  - {id: j_hl1, type: hinge, body: hL1, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: -0.010251}
  - {id: j_hl2, type: hinge, body: hL2, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: -0.010251}
  - {id: j_hl3, type: hinge, body: hL3, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: -0.010251}
  - {id: j_hl4, type: hinge, body: hL4, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: -0.010251}
  - {id: j_hr0, type: hinge, body: hR0, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: 0.010251}   # - : the tube opens (straightens)
  - {id: j_hr1, type: hinge, body: hR1, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: 0.010251}
  - {id: j_hr2, type: hinge, body: hR2, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: 0.010251}
  - {id: j_hr3, type: hinge, body: hR3, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: 0.010251}
  - {id: j_hr4, type: hinge, body: hR4, axis: [0, 1, 0], damping: 0.004, stiffness: 2.7314, springref: 0.010251}
  - {id: j_ll, type: hinge, body: linkL, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_lr, type: hinge, body: linkR, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_s, type: hinge, body: sector, axis: [0, 1, 0], damping: 5e-05}
  - {id: j_ptr, type: hinge, body: pinion, axis: [0, 1, 0], damping: 2e-05, stiffness: 0.0003, springref: -3}   # the hairspring, wound up so that it always takes up the teeth's backlash
pins:
  - {id: p_L, a: lever, b: crod, at: [24.0, 0, 30.0]}
  - {id: p_SL, a: linkL, b: sector, at: [0.0, 0, 24.5]}
  - {id: p_SR, a: linkR, b: sector, at: [0.0, 0, 19.5]}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
vessels:
  substeps: 8
  nodes:
    - {id: pump, kind: chamber, fixed: 0.0, sections: [[0.0, 8.0425]], volume: 104.01, water: 0, p: 20000}   # the barrel's air under the plunger
    - {id: bore, kind: chamber, fixed: 0, sections: [[0, 1]], volume: 3, water: 0, p: 20000}   # the tube's bore
  links:
    - {id: stem, from: pump, to: bore, area: 0.05, cd: 0.62, z: 0.5, zTo: 0.5}
  pistons:
    - {node: pump, joint: j_p, area: 8.0425, sign: 1}
    - {node: bore, joint: j_hl0, area: 1.4, arm: 1, sign: 1}
    - {node: bore, joint: j_hl1, area: 1.4, arm: 1, sign: 1}
    - {node: bore, joint: j_hl2, area: 1.4, arm: 1, sign: 1}
    - {node: bore, joint: j_hl3, area: 1.4, arm: 1, sign: 1}
    - {node: bore, joint: j_hl4, area: 1.4, arm: 1, sign: 1}
    - {node: bore, joint: j_hr0, area: 1.4, arm: 1, sign: -1}
    - {node: bore, joint: j_hr1, area: 1.4, arm: 1, sign: -1}
    - {node: bore, joint: j_hr2, area: 1.4, arm: 1, sign: -1}
    - {node: bore, joint: j_hr3, area: 1.4, arm: 1, sign: -1}
    - {node: bore, joint: j_hr4, area: 1.4, arm: 1, sign: -1}
driver: {joint: j_lever, kind: velocity, rpm: 0, swing: {amplitude: 0.35, hz: 0.2}, kv: 2000, max_torque: 40}
checks:
  - {type: amplitude, joint: j_p, min: 0.03, max: 0.06, settle_s: 1.0, window_s: 8}
  - {type: penetration, max: 0.003}
camera: {target: [11, 0, 17], position: [11, -300, 19], fov: 14}
display:
  output: j_ptr
  labels: {j_lever: "Pump lever (driver)", j_p: "Plunger", j_hl0: "Tube, left half (at C)", j_hr0: "Tube, right half (at C)", j_s: "Toothed sector", j_ptr: "Pinion and pointer"}
