# No. 382 (Brown 1868): "Adjustable stand for mirrors, etc., by which a glass or other article can be raised or lowered, turned to the right or left, and varied in its inclination. The stem is fitted into a socket of pillar, and secured by a set screw, and the glass is hinged to the stem, and a set screw is applied to the hinge to tighten it. The same thing is used for photographic camera-stands."
#
# Model (cm): a baluster pillar on a round foot, a socket in its top; the stem stands in the socket (a slide joint: the socket's bore),
# the glass in its frame hinged on the stem's top (j_tilt, held at its inclination by the hinge's set screw: a friction of 3 N m).
# The hand lifts the glass (a soft spring, 100 N/m, its free end raised 23 cm by 2.0 s); the set screw in the side of the socket
# is run in by a steady 80 N thrust of the hand (the one driven joint, the screw's thread as its guide and its friction as a damper, so it creeps in at 0.35 cm/s) until its point bites the
# stem; at 3.8 s the hand lets go (the spring's free end goes back down), and only the screw's grip holds the glass up.
# The glass is shown turned 0.45 rad to the right on the stem and inclined 0.22 rad back on its hinge, as Brown draws it.
# Generator: opencode-runs/batch13/gen382g.py.
number: 382
slug: adjustable-mirror-stand
name: Adjustable stand for mirrors
brown: "Adjustable stand for mirrors, etc., by which a glass or other article can be raised or lowered, turned to the right or left, and varied in its inclination. The stem is fitted into a socket of pillar, and secured by a set screw, and the glass is hinged to the stem, and a set screw is applied to the hinge to tighten it. The same thing is used for photographic camera-stands."
units: cm
sim:
  timestep: 0.0005
  integrator: implicitfast
  iterations: 60
  duration_s: 7
  floor: false
contact: {solref: [0.001, 1], solimp: [0.95, 0.99, 0.001]}
bodies:
  - id: pillar
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 2500
    friction: 0.4
    color: "#bfae8a"
    pieces:
      - {kind: rod, from: [0, 0, 0], to: [0, 0, 0.8], radius: 10.0, collide: 0}   # the foot
      - {kind: rod, from: [0, 0, 0.8], to: [0, 0, 1.5], radius: 7.0, collide: 0}
      - {kind: rod, from: [0, 0, 1.5], to: [0, 0, 2.6], radius: 5.0, collide: 0}
      - {kind: rod, from: [0, 0, 2.6], to: [0, 0, 3.4], radius: 3.6, collide: 0}
      - {kind: rod, from: [0, 0, 3.4], to: [0, 0, 4.2], radius: 2.2, collide: 0}
      - {kind: rod, from: [0, 0, 4.2], to: [0, 0, 5.5], radius: 1.6, collide: 0}
      - {kind: rod, from: [0, 0, 5.5], to: [0, 0, 7.0], radius: 2.0, collide: 0}
      - {kind: rod, from: [0, 0, 7.0], to: [0, 0, 9.5], radius: 2.4, collide: 0}
      - {kind: rod, from: [0, 0, 9.5], to: [0, 0, 11.5], radius: 2.2, collide: 0}
      - {kind: rod, from: [0, 0, 11.5], to: [0, 0, 13.0], radius: 1.8, collide: 0}
      - {kind: rod, from: [0, 0, 13.0], to: [0, 0, 14.4], radius: 1.4, collide: 0}
      - {kind: rod, from: [0, 0, 14.4], to: [0, 0, 15.2], radius: 1.6, collide: 0}
      - {kind: rod, from: [0, 0, 15.2], to: [0, 0, 18.0], radius: 2.0, collide: 0}
      - {kind: rod, from: [0, 0, 18.0], to: [0, 0, 18.5], radius: 1.6, collide: 0}   # the socket's mouth
      - {kind: rod, from: [1.7, 0, 16.6], to: [2.6, 0, 16.6], radius: 0.9, collide: 0}   # the screw's boss
  - id: screw
    shape: part
    pos: [1.7999999999999998, 0, 16.6]
    density: 7800
    mass: 0.25
    friction: 0.8
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [2.05, 0, 16.6], to: [6.2, 0, 16.6], radius: 0.4, collide: 0}   # the set screw
      - {kind: rod, from: [1.8, 0, 16.6], to: [2.3, 0, 16.6], radius: 0.3, capsule: true, collide: 1}   # its point
      - {kind: rod, from: [6.2, 0, 16.6], to: [6.9, 0, 16.6], radius: 1.3, collide: 0}   # its thumb head
  - id: stem
    shape: part
    pos: [0, 0, 8.0]
    density: 7800
    friction: 0.4
    color: "#d8cfbd"
    pieces:
      - {kind: rod, from: [0, 0, 8.0], to: [0, 0, 32.4], radius: 0.6, capsule: true, collide: 2}   # the stem, in the socket
      - {kind: rod, from: [-1.2606, -0.609, 33.0], to: [1.2606, 0.609, 33.0], radius: 0.6, collide: 0}   # the hinge's knuckle (turned with the glass)
  - id: glass
    shape: part
    pos: [0, 0, 33.0]
    mount: stem
    density: 1200
    color: "#a88c5e"
    pieces:
      - {kind: rod, from: [-0.5403, -0.261, 33.0], to: [-1.0921, 0.8814, 32.7163], radius: 0.5, collide: 0}   # the hinge's lug, on the glass
      - {kind: rod, from: [-1.3507, -0.6524, 33.0], to: [-2.7013, -1.3049, 33.0], radius: 0.25, collide: 0, color: "#8f8a80"}   # the hinge's set screw
      - {kind: rod, from: [-2.7013, -1.3049, 33.0], to: [-3.2416, -1.5659, 33.0], radius: 0.9, collide: 0, color: "#8f8a80"}   # its head
      - {kind: rod, from: [-7.4219, -5.3269, 20.0296], to: [8.7862, 2.5025, 20.0296], radius: 1.5, collide: 0}   # the frame's edge
      - {kind: rod, from: [-10.0797, 0.1752, 47.3548], to: [6.1284, 8.0046, 47.3548], radius: 1.5, collide: 0}   # the frame's edge
      - {kind: rod, from: [-10.408, -6.0423, 22.9573], to: [-12.4963, -1.7192, 44.4271], radius: 1.5, collide: 0}   # the frame's edge
      - {kind: rod, from: [11.2028, 4.3969, 22.9573], to: [9.1145, 8.72, 44.4271], radius: 1.5, collide: 0}   # the frame's edge
      - {kind: rod, from: [9.1145, 8.72, 44.4271], to: [8.7999, 8.8463, 45.5475], radius: 1.5, collide: 0}   # a corner
      - {kind: rod, from: [8.7999, 8.8463, 45.5475], to: [8.1219, 8.7547, 46.4973], radius: 1.5, collide: 0}
      - {kind: rod, from: [8.1219, 8.7547, 46.4973], to: [7.1838, 8.4591, 47.1319], radius: 1.5, collide: 0}
      - {kind: rod, from: [7.1838, 8.4591, 47.1319], to: [6.1284, 8.0046, 47.3548], radius: 1.5, collide: 0}
      - {kind: rod, from: [-10.0797, 0.1752, 47.3548], to: [-11.0918, -0.369, 47.1319], radius: 1.5, collide: 0}   # a corner
      - {kind: rod, from: [-11.0918, -0.369, 47.1319], to: [-11.9064, -0.9201, 46.4973], radius: 1.5, collide: 0}
      - {kind: rod, from: [-11.9064, -0.9201, 46.4973], to: [-12.3996, -1.3942, 45.5475], radius: 1.5, collide: 0}
      - {kind: rod, from: [-12.3996, -1.3942, 45.5475], to: [-12.4963, -1.7192, 44.4271], radius: 1.5, collide: 0}
      - {kind: rod, from: [-10.408, -6.0423, 22.9573], to: [-10.0934, -6.1685, 21.8369], radius: 1.5, collide: 0}   # a corner
      - {kind: rod, from: [-10.0934, -6.1685, 21.8369], to: [-9.4154, -6.0769, 20.8871], radius: 1.5, collide: 0}
      - {kind: rod, from: [-9.4154, -6.0769, 20.8871], to: [-8.4773, -5.7814, 20.2525], radius: 1.5, collide: 0}
      - {kind: rod, from: [-8.4773, -5.7814, 20.2525], to: [-7.4219, -5.3269, 20.0296], radius: 1.5, collide: 0}
      - {kind: rod, from: [8.7862, 2.5025, 20.0296], to: [9.7983, 3.0467, 20.2525], radius: 1.5, collide: 0}   # a corner
      - {kind: rod, from: [9.7983, 3.0467, 20.2525], to: [10.6129, 3.5979, 20.8871], radius: 1.5, collide: 0}
      - {kind: rod, from: [10.6129, 3.5979, 20.8871], to: [11.1061, 4.072, 21.8369], radius: 1.5, collide: 0}
      - {kind: rod, from: [11.1061, 4.072, 21.8369], to: [11.2028, 4.3969, 22.9573], radius: 1.5, collide: 0}
      - {kind: loft, a: [[-10.2081, -6.456, 19.986], [11.4026, 3.9831, 19.986], [8.7448, 9.4853, 47.3111], [-12.8659, -0.9539, 47.3111]], b: [[-10.5052, -5.8409, 19.8332], [11.1055, 4.5983, 19.8332], [8.4477, 10.1004, 47.1584], [-13.1631, -0.3388, 47.1584]], collide: 0, color: "#cdbf9f"}   # the back board
      - {kind: loft, a: [[-7.9864, -5.0778, 22.5888], [-1.5032, -1.9461, 22.5888], [-3.6674, 2.5342, 44.8393], [-10.1506, -0.5975, 44.8393]], b: [[-8.1137, -4.8142, 22.5233], [-1.6305, -1.6825, 22.5233], [-3.7947, 2.7978, 44.7738], [-10.278, -0.3339, 44.7738]], collide: 0, color: "#b9a882"}   # a sunk panel
      - {kind: loft, a: [[2.4588, -0.0322, 22.5888], [8.942, 3.0995, 22.5888], [6.7778, 7.5798, 44.8393], [0.2946, 4.4481, 44.8393]], b: [[2.3315, 0.2314, 22.5233], [8.8147, 3.3631, 22.5233], [6.6504, 7.8434, 44.7738], [0.1672, 4.7117, 44.7738]], collide: 0, color: "#b9a882"}   # a sunk panel
joints:
  - {id: j_h, type: slide, body: stem, axis: [0, 0, 1], range: [0, 9.0], stiffness: 100.0, damping: 3.0}   # the stem in the socket; + : up
  - {id: j_sc, type: slide, body: screw, axis: [1, 0, 0], range: [-1.5, 0.2], damping: 22857.1429}   # the one driven joint: the set screw
  - {id: j_tilt, type: hinge, body: glass, axis: [0.9004, 0.435, 0], range: [-0.02, 0.6], frictionloss: 3.0, damping: 0.5}   # the glass's hinge, tightened by its set screw; it leans on its back stop
driver: {joint: j_sc, kind: torque, torque: -80.0, max_torque: 80.0}
hand:
  - {t: 0.3, springref: {j_h: 2.3}}
  - {t: 0.47, springref: {j_h: 4.6}}
  - {t: 0.64, springref: {j_h: 6.9}}
  - {t: 0.81, springref: {j_h: 9.2}}
  - {t: 0.98, springref: {j_h: 11.5}}
  - {t: 1.15, springref: {j_h: 13.8}}
  - {t: 1.32, springref: {j_h: 16.1}}
  - {t: 1.49, springref: {j_h: 18.4}}
  - {t: 1.66, springref: {j_h: 20.7}}
  - {t: 1.83, springref: {j_h: 23.0}}
  - {t: 3.8, springref: {j_h: 20.125}}
  - {t: 3.85, springref: {j_h: 17.25}}
  - {t: 3.9, springref: {j_h: 14.375}}
  - {t: 3.95, springref: {j_h: 11.5}}
  - {t: 4.0, springref: {j_h: 8.625}}
  - {t: 4.05, springref: {j_h: 5.75}}
  - {t: 4.1, springref: {j_h: 2.875}}
  - {t: 4.15, springref: {j_h: 0.0}}
checks:
  - {type: position, joint: j_h, min: 3.0, max: 7.5, settle_s: 4.8, window_s: 2.1}   # the glass stays up after the hand lets go
  - {type: still, joint: j_h, max: 0.002, settle_s: 4.8, window_s: 2.1}
  - {type: position, joint: j_sc, min: -0.95, max: -0.85, settle_s: 4.8, window_s: 2.1}   # the screw stands on the stem
  - {type: still, joint: j_tilt, max: 0.01, settle_s: 1.0, window_s: 5.9}   # the hinge's screw holds the inclination
camera: {target: [0.0, 0, 20.5], position: [22.0, -116.0, 28.5], fov: 34}
display:
  output: j_h
  labels: {j_sc: "Set screw (driver)", j_h: "Stem, raised", j_tilt: "Glass, inclination"}
  proof: {label: "Set screw out of contact", sub: "let go, the glass drops back into the socket"}

