# No. 486 (Brown 1868): "Plan of a vertical wind-mill. The sails are so pivoted as to present their edges in returning toward the wind, but to present their faces to the action of the wind, the direction of which is supposed to be as indicated by the arrow."
# Model (cm), seen from above as Brown's plan. Six arms (15 cm) on an upright shaft, a ring through them; on each arm an
# upright sail (10 x 8 cm) pivoted 12 cm out, reaching 2.5 cm outwards of its pivot and 7.5 cm inwards. The
# arm is its stop: pressed against it the sail lies along the arm, its face to the wind; let go it swings back on its pivot
# (up to 100 degrees) and trails edgeways. The wind (3 m/s, up the page as Brown's arrow) pushes the sails (MuJoCo's
# fluid forces, openspec add-air-wind: the ellipsoid model on each sail) and is the only input (nothing is driven); the shaft
# works against a load of 0.004 N m s. The sails swing on their pivots only as the wind and their own motion push them.
# Generator: opencode-runs/air/gen486.py.
number: 486
slug: vertical-wind-mill
name: Plan of a vertical wind-mill
brown: "Plan of a vertical wind-mill. The sails are so pivoted as to present their edges in returning toward the wind, but to present their faces to the action of the wind, the direction of which is supposed to be as indicated by the arrow."
units: cm
sim:
  timestep: 0.001
  integrator: implicitfast
  iterations: 50
  duration_s: 12
  floor: false
air: {density: 1.2, viscosity: 1.8e-5, wind: [0, 3, 0]}
bodies:
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#a89878"
    pieces:
      - {kind: rod, from: [0, 0, -12], to: [0, 0, -1.2], radius: 1.2, collide: 0}   # the upright shaft's foot
      - {kind: loft, a: [[-0.25, -23, -11.9], [0.25, -23, -11.9], [0.25, -14.5, -11.9]], b: [[-0.25, -23, -11.7], [0.25, -23, -11.7], [0.25, -14.5, -11.7]], collide: 0, color: "#3a332a"}   # Brown's arrow: the wind's way (a marker under the mill)
      - {kind: loft, a: [[-1.4, -14.5, -11.9], [1.4, -14.5, -11.9], [0, -11.5, -11.9]], b: [[-1.4, -14.5, -11.7], [1.4, -14.5, -11.7], [0, -11.5, -11.7]], collide: 0, color: "#3a332a"}
  - id: rotor
    shape: part
    pos: [0, 0, 0]
    density: 600
    color: "#b49a70"
    pieces:
      - {kind: loft, a: [[3.2, 0, -1.2], [2.9564, 1.2246, -1.2], [2.2627, 2.2627, -1.2], [1.2246, 2.9564, -1.2], [0, 3.2, -1.2], [-1.2246, 2.9564, -1.2], [-2.2627, 2.2627, -1.2], [-2.9564, 1.2246, -1.2], [-3.2, 0, -1.2], [-2.9564, -1.2246, -1.2], [-2.2627, -2.2627, -1.2], [-1.2246, -2.9564, -1.2], [-0, -3.2, -1.2], [1.2246, -2.9564, -1.2], [2.2627, -2.2627, -1.2], [2.9564, -1.2246, -1.2]], b: [[3.2, 0, 1.2], [2.9564, 1.2246, 1.2], [2.2627, 2.2627, 1.2], [1.2246, 2.9564, 1.2], [0, 3.2, 1.2], [-1.2246, 2.9564, 1.2], [-2.2627, 2.2627, 1.2], [-2.9564, 1.2246, 1.2], [-3.2, 0, 1.2], [-2.9564, -1.2246, 1.2], [-2.2627, -2.2627, 1.2], [-1.2246, -2.9564, 1.2], [-0, -3.2, 1.2], [1.2246, -2.9564, 1.2], [2.2627, -2.2627, 1.2], [2.9564, -1.2246, 1.2]], collide: 0}   # the boss on the upright shaft
      - {kind: loft, a: [[1.6, 0, 1.3], [0, 1.6, 1.3], [-1.6, 0, 1.3], [0, -1.6, 1.3]], b: [[1.6, 0, 1.6], [0, 1.6, 1.6], [-1.6, 0, 1.6], [0, -1.6, 1.6]], collide: 0, color: "#6b5a40"}   # the shaft's square head
      - {kind: rod, from: [0, 0, 1.6], to: [0, 0, 2.4], radius: 0.9, collide: 0, color: "#d8d0bc"}
      - {kind: loft, a: [[3.2, -0.45, -0.45], [15, -0.45, -0.45], [15, 0.45, -0.45], [3.2, 0.45, -0.45]], b: [[3.2, -0.45, 0.45], [15, -0.45, 0.45], [15, 0.45, 0.45], [3.2, 0.45, 0.45]], collide: 0}   # an arm
      - {kind: loft, a: [[1.9897, 2.5463, -0.45], [7.8897, 12.7654, -0.45], [7.1103, 13.2154, -0.45], [1.2103, 2.9963, -0.45]], b: [[1.9897, 2.5463, 0.45], [7.8897, 12.7654, 0.45], [7.1103, 13.2154, 0.45], [1.2103, 2.9963, 0.45]], collide: 0}
      - {kind: loft, a: [[-1.2103, 2.9963, -0.45], [-7.1103, 13.2154, -0.45], [-7.8897, 12.7654, -0.45], [-1.9897, 2.5463, -0.45]], b: [[-1.2103, 2.9963, 0.45], [-7.1103, 13.2154, 0.45], [-7.8897, 12.7654, 0.45], [-1.9897, 2.5463, 0.45]], collide: 0}
      - {kind: loft, a: [[-3.2, 0.45, -0.45], [-15, 0.45, -0.45], [-15, -0.45, -0.45], [-3.2, -0.45, -0.45]], b: [[-3.2, 0.45, 0.45], [-15, 0.45, 0.45], [-15, -0.45, 0.45], [-3.2, -0.45, 0.45]], collide: 0}
      - {kind: loft, a: [[-1.9897, -2.5463, -0.45], [-7.8897, -12.7654, -0.45], [-7.1103, -13.2154, -0.45], [-1.2103, -2.9963, -0.45]], b: [[-1.9897, -2.5463, 0.45], [-7.8897, -12.7654, 0.45], [-7.1103, -13.2154, 0.45], [-1.2103, -2.9963, 0.45]], collide: 0}
      - {kind: loft, a: [[1.2103, -2.9963, -0.45], [7.1103, -13.2154, -0.45], [7.8897, -12.7654, -0.45], [1.9897, -2.5463, -0.45]], b: [[1.2103, -2.9963, 0.45], [7.1103, -13.2154, 0.45], [7.8897, -12.7654, 0.45], [1.9897, -2.5463, 0.45]], collide: 0}
      - {kind: rod, from: [13, 0, 0], to: [12.8888, 1.6968, 0], radius: 0.12, collide: 0, color: "#3a332a"}   # the ring
      - {kind: rod, from: [12.8888, 1.6968, 0], to: [12.557, 3.3646, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [12.557, 3.3646, 0], to: [12.0104, 4.9749, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [12.0104, 4.9749, 0], to: [11.2583, 6.5, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [11.2583, 6.5, 0], to: [10.3136, 7.9139, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [10.3136, 7.9139, 0], to: [9.1924, 9.1924, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [9.1924, 9.1924, 0], to: [7.9139, 10.3136, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [7.9139, 10.3136, 0], to: [6.5, 11.2583, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [6.5, 11.2583, 0], to: [4.9749, 12.0104, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [4.9749, 12.0104, 0], to: [3.3646, 12.557, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [3.3646, 12.557, 0], to: [1.6968, 12.8888, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [1.6968, 12.8888, 0], to: [0, 13, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [0, 13, 0], to: [-1.6968, 12.8888, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-1.6968, 12.8888, 0], to: [-3.3646, 12.557, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-3.3646, 12.557, 0], to: [-4.9749, 12.0104, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-4.9749, 12.0104, 0], to: [-6.5, 11.2583, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-6.5, 11.2583, 0], to: [-7.9139, 10.3136, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-7.9139, 10.3136, 0], to: [-9.1924, 9.1924, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-9.1924, 9.1924, 0], to: [-10.3136, 7.9139, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-10.3136, 7.9139, 0], to: [-11.2583, 6.5, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-11.2583, 6.5, 0], to: [-12.0104, 4.9749, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.0104, 4.9749, 0], to: [-12.557, 3.3646, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.557, 3.3646, 0], to: [-12.8888, 1.6968, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.8888, 1.6968, 0], to: [-13, 0, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-13, 0, 0], to: [-12.8888, -1.6968, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.8888, -1.6968, 0], to: [-12.557, -3.3646, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.557, -3.3646, 0], to: [-12.0104, -4.9749, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-12.0104, -4.9749, 0], to: [-11.2583, -6.5, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-11.2583, -6.5, 0], to: [-10.3136, -7.9139, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-10.3136, -7.9139, 0], to: [-9.1924, -9.1924, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-9.1924, -9.1924, 0], to: [-7.9139, -10.3136, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-7.9139, -10.3136, 0], to: [-6.5, -11.2583, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-6.5, -11.2583, 0], to: [-4.9749, -12.0104, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-4.9749, -12.0104, 0], to: [-3.3646, -12.557, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-3.3646, -12.557, 0], to: [-1.6968, -12.8888, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-1.6968, -12.8888, 0], to: [-0, -13, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [-0, -13, 0], to: [1.6968, -12.8888, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [1.6968, -12.8888, 0], to: [3.3646, -12.557, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [3.3646, -12.557, 0], to: [4.9749, -12.0104, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [4.9749, -12.0104, 0], to: [6.5, -11.2583, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [6.5, -11.2583, 0], to: [7.9139, -10.3136, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [7.9139, -10.3136, 0], to: [9.1924, -9.1924, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [9.1924, -9.1924, 0], to: [10.3136, -7.9139, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [10.3136, -7.9139, 0], to: [11.2583, -6.5, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [11.2583, -6.5, 0], to: [12.0104, -4.9749, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [12.0104, -4.9749, 0], to: [12.557, -3.3646, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [12.557, -3.3646, 0], to: [12.8888, -1.6968, 0], radius: 0.12, collide: 0, color: "#3a332a"}
      - {kind: rod, from: [12.8888, -1.6968, 0], to: [13, -0, 0], radius: 0.12, collide: 0, color: "#3a332a"}
  - id: sail0
    shape: part
    mount: rotor
    pos: [12, 0, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[4.5, -0.175, 0.55], [14.5, -0.175, 0.55], [14.5, 0.175, 0.55], [4.5, 0.175, 0.55]], b: [[4.5, -0.175, 8.55], [14.5, -0.175, 8.55], [14.5, 0.175, 8.55], [4.5, 0.175, 8.55]], collide: 0, sail: true}   # a sail, an upright board pivoted on the arm (the wind pushes on it)
      - {kind: rod, from: [12, 0, -0.5], to: [12, 0, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}   # its pivot pin
  - id: sail1
    shape: part
    mount: rotor
    pos: [6, 10.3923, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[2.4016, 3.8096, 0.55], [7.4016, 12.4699, 0.55], [7.0984, 12.6449, 0.55], [2.0984, 3.9846, 0.55]], b: [[2.4016, 3.8096, 8.55], [7.4016, 12.4699, 8.55], [7.0984, 12.6449, 8.55], [2.0984, 3.9846, 8.55]], collide: 0, sail: true}
      - {kind: rod, from: [6, 10.3923, -0.5], to: [6, 10.3923, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}
  - id: sail2
    shape: part
    mount: rotor
    pos: [-6, 10.3923, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[-2.0984, 3.9846, 0.55], [-7.0984, 12.6449, 0.55], [-7.4016, 12.4699, 0.55], [-2.4016, 3.8096, 0.55]], b: [[-2.0984, 3.9846, 8.55], [-7.0984, 12.6449, 8.55], [-7.4016, 12.4699, 8.55], [-2.4016, 3.8096, 8.55]], collide: 0, sail: true}
      - {kind: rod, from: [-6, 10.3923, -0.5], to: [-6, 10.3923, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}
  - id: sail3
    shape: part
    mount: rotor
    pos: [-12, 0, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[-4.5, 0.175, 0.55], [-14.5, 0.175, 0.55], [-14.5, -0.175, 0.55], [-4.5, -0.175, 0.55]], b: [[-4.5, 0.175, 8.55], [-14.5, 0.175, 8.55], [-14.5, -0.175, 8.55], [-4.5, -0.175, 8.55]], collide: 0, sail: true}
      - {kind: rod, from: [-12, 0, -0.5], to: [-12, 0, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}
  - id: sail4
    shape: part
    mount: rotor
    pos: [-6, -10.3923, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[-2.4016, -3.8096, 0.55], [-7.4016, -12.4699, 0.55], [-7.0984, -12.6449, 0.55], [-2.0984, -3.9846, 0.55]], b: [[-2.4016, -3.8096, 8.55], [-7.4016, -12.4699, 8.55], [-7.0984, -12.6449, 8.55], [-2.0984, -3.9846, 8.55]], collide: 0, sail: true}
      - {kind: rod, from: [-6, -10.3923, -0.5], to: [-6, -10.3923, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}
  - id: sail5
    shape: part
    mount: rotor
    pos: [6, -10.3923, 0]
    density: 500
    color: "#e6dcc4"
    pieces:
      - {kind: loft, a: [[2.0984, -3.9846, 0.55], [7.0984, -12.6449, 0.55], [7.4016, -12.4699, 0.55], [2.4016, -3.8096, 0.55]], b: [[2.0984, -3.9846, 8.55], [7.0984, -12.6449, 8.55], [7.4016, -12.4699, 8.55], [2.4016, -3.8096, 8.55]], collide: 0, sail: true}
      - {kind: rod, from: [6, -10.3923, -0.5], to: [6, -10.3923, 9.2], radius: 0.3, collide: 0, color: "#3a332a"}
joints:
  - {id: j_r, type: hinge, body: rotor, axis: [0, 0, 1], damping: 0.004}
  - {id: j_p0, type: hinge, body: sail0, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
  - {id: j_p1, type: hinge, body: sail1, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
  - {id: j_p2, type: hinge, body: sail2, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
  - {id: j_p3, type: hinge, body: sail3, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
  - {id: j_p4, type: hinge, body: sail4, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
  - {id: j_p5, type: hinge, body: sail5, axis: [0, 0, 1], damping: 0.0002, range: [0, 3.0543]}
driver: {joint: j_r, kind: torque, torque: 0, max_torque: 0.001}   # no hand on it: the wind is the only input
checks:
  - {type: turning, joint: j_r, direction: 1, min_mean: 0.5, min_fraction: 0.9, settle_s: 3.0, window_s: 8}
camera: {target: [0, -2, 0], position: [0, -32, 140], fov: 30}
display:
  output: j_r
  labels: {j_r: "Sails"}
