# No. 383 (Brown 1868): "Represents the principal elements of machinery for dressing cloth and warps, consisting of two rollers, from one to the other of which the yarn or cloth is wound, and an interposed cylinder having its periphery either smooth-surfaced or armed with brushes, teasels, or other contrivances, according to the nature of the work to be done. These elements are used in machines for sizing warps, gig-mills for dressing woolen goods, and in most machines for finishing woven fabrics."
#
# Model (cm, gravity on): Brown's front view. A warp (three yarns: cords of elastic links) is wound 330 degrees on the upper roller and runs off
# its lower right, across to the cylinder, round its left side (98 degrees), and across onto the lower roller (tied there, 40 degrees on).
# The lower roller is turned clockwise at 4.5 rpm (the one driven joint) and winds the warp on; the upper roller pays it out against a friction
# brake of 0.25 N m (the yarn's tension), and the cylinder, free on its axle, is turned the other way by the yarn's friction on its face alone,
# at 0.545 of the rollers' speed. Its cards and teasels are cosmetic (drawn on its front face; the yarn bears on its smooth face).
# Generator: opencode-runs/batch13/gen383.py.
number: 383
slug: cloth-dressing-rollers
name: Rollers and cylinder for dressing cloth and warps
brown: "Represents the principal elements of machinery for dressing cloth and warps, consisting of two rollers, from one to the other of which the yarn or cloth is wound, and an interposed cylinder having its periphery either smooth-surfaced or armed with brushes, teasels, or other contrivances, according to the nature of the work to be done. These elements are used in machines for sizing warps, gig-mills for dressing woolen goods, and in most machines for finishing woven fabrics."
units: cm
sim: {timestep: 0.0004, integrator: implicitfast, iterations: 60, duration_s: 8.0, floor: false}
bodies:
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-15.5, -27.0], [-12.5, -27.0], [-9.1, 18.0], [-12.1, 18.0]], y: [5.0, 6.4], collide: 0}   # a leg (tapered)
      - {kind: poly, points: [[12.5, -27.0], [15.5, -27.0], [12.1, 18.0], [9.1, 18.0]], y: [5.0, 6.4], collide: 0}
      - {kind: band, center: [0, 18.0], r: [9.1, 12.1], a: [0, 3.1416], y: [5.0, 6.4], slices: 16, collide: 0}   # the arch
      - {kind: poly, points: [[-18, -28.2], [18, -28.2], [18, -27.0], [-18, -27.0]], y: [4.6, 6.8], collide: 0}   # the foot
      - {kind: poly, points: [[-11.0, 11.9], [11.0, 11.9], [11.0, 12.9], [-11.0, 12.9]], y: [4.4, 6.6], collide: 0}   # a cross-bar
      - {kind: poly, points: [[-13.5, -24.1], [13.5, -24.1], [13.5, -23.1], [-13.5, -23.1]], y: [4.4, 6.6], collide: 0}
      - {kind: rod, from: [0, 4.2, 18.0], to: [0, 6.6, 18.0], radius: 1.4, collide: 0, color: "#8f8a80"}   # bearings
      - {kind: rod, from: [0, 4.2, 0], to: [0, 6.6, 0], radius: 1.6, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [0, 4.2, -18.0], to: [0, 6.6, -18.0], radius: 1.4, collide: 0, color: "#8f8a80"}
  - {id: top, shape: assembly, pos: [0, 0, 18.0], color: "#e6dcc6"}
  - {id: cylinder, shape: assembly, pos: [0, 0, 0], color: "#d9cdb0"}
  - {id: bottom, shape: assembly, pos: [0, 0, -18.0], color: "#e6dcc6"}
  - id: cyl_face
    shape: part
    pos: [0, 0, 0]
    mount: cylinder
    fixed: true
    color: "#c7b28a"
    pieces:
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [0.09, 0.6954], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [7.6813, -4.3, 1.0296], to: [8.4048, -4.3, 1.1266], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.5637, -4.3, 1.6892], to: [8.2761, -4.3, 1.8483], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.3895, -4.3, 2.3362], to: [8.0855, -4.3, 2.5563], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.1601, -4.3, 2.9658], to: [7.8345, -4.3, 3.2452], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [6.8771, -4.3, 3.5732], to: [7.5249, -4.3, 3.9098], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [6.5428, -4.3, 4.1539], to: [7.1591, -4.3, 4.5451], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [6.1595, -4.3, 4.7035], to: [6.7397, -4.3, 5.1465], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [0.8754, 1.4808], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [4.7035, -4.3, 6.1595], to: [5.1465, -4.3, 6.7397], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [4.1539, -4.3, 6.5428], to: [4.5451, -4.3, 7.1591], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [3.5732, -4.3, 6.8771], to: [3.9098, -4.3, 7.5249], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [2.9658, -4.3, 7.1601], to: [3.2452, -4.3, 7.8345], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [2.3362, -4.3, 7.3895], to: [2.5563, -4.3, 8.0855], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [1.6892, -4.3, 7.5637], to: [1.8483, -4.3, 8.2761], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [1.0296, -4.3, 7.6813], to: [1.1266, -4.3, 8.4048], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [1.6608, 2.2662], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [-1.0296, -4.3, 7.6813], to: [-1.1266, -4.3, 8.4048], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-1.6892, -4.3, 7.5637], to: [-1.8483, -4.3, 8.2761], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-2.3362, -4.3, 7.3895], to: [-2.5563, -4.3, 8.0855], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-2.9658, -4.3, 7.1601], to: [-3.2452, -4.3, 7.8345], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-3.5732, -4.3, 6.8771], to: [-3.9098, -4.3, 7.5249], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-4.1539, -4.3, 6.5428], to: [-4.5451, -4.3, 7.1591], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-4.7035, -4.3, 6.1595], to: [-5.1465, -4.3, 6.7397], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [2.4462, 3.0516], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [-6.1595, -4.3, 4.7035], to: [-6.7397, -4.3, 5.1465], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-6.5428, -4.3, 4.1539], to: [-7.1591, -4.3, 4.5451], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-6.8771, -4.3, 3.5732], to: [-7.5249, -4.3, 3.9098], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.1601, -4.3, 2.9658], to: [-7.8345, -4.3, 3.2452], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.3895, -4.3, 2.3362], to: [-8.0855, -4.3, 2.5563], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.5637, -4.3, 1.6892], to: [-8.2761, -4.3, 1.8483], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.6813, -4.3, 1.0296], to: [-8.4048, -4.3, 1.1266], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [3.2316, 3.837], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [-7.6813, -4.3, -1.0296], to: [-8.4048, -4.3, -1.1266], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.5637, -4.3, -1.6892], to: [-8.2761, -4.3, -1.8483], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.3895, -4.3, -2.3362], to: [-8.0855, -4.3, -2.5563], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-7.1601, -4.3, -2.9658], to: [-7.8345, -4.3, -3.2452], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-6.8771, -4.3, -3.5732], to: [-7.5249, -4.3, -3.9098], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-6.5428, -4.3, -4.1539], to: [-7.1591, -4.3, -4.5451], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-6.1595, -4.3, -4.7035], to: [-6.7397, -4.3, -5.1465], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [4.017, 4.6224], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [-4.7035, -4.3, -6.1595], to: [-5.1465, -4.3, -6.7397], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-4.1539, -4.3, -6.5428], to: [-4.5451, -4.3, -7.1591], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-3.5732, -4.3, -6.8771], to: [-3.9098, -4.3, -7.5249], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-2.9658, -4.3, -7.1601], to: [-3.2452, -4.3, -7.8345], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-2.3362, -4.3, -7.3895], to: [-2.5563, -4.3, -8.0855], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-1.6892, -4.3, -7.5637], to: [-1.8483, -4.3, -8.2761], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [-1.0296, -4.3, -7.6813], to: [-1.1266, -4.3, -8.4048], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [4.8024, 5.4078], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [1.0296, -4.3, -7.6813], to: [1.1266, -4.3, -8.4048], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [1.6892, -4.3, -7.5637], to: [1.8483, -4.3, -8.2761], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [2.3362, -4.3, -7.3895], to: [2.5563, -4.3, -8.0855], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [2.9658, -4.3, -7.1601], to: [3.2452, -4.3, -7.8345], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [3.5732, -4.3, -6.8771], to: [3.9098, -4.3, -7.5249], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [4.1539, -4.3, -6.5428], to: [4.5451, -4.3, -7.1591], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [4.7035, -4.3, -6.1595], to: [5.1465, -4.3, -6.7397], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: band, center: [0, 0], r: [4.6, 7.7], a: [5.5878, 6.1932], y: [-4.45, -4.15], slices: 6, collide: 0, color: "#c7b28a"}   # a card
      - {kind: rod, from: [6.1595, -4.3, -4.7035], to: [6.7397, -4.3, -5.1465], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [6.5428, -4.3, -4.1539], to: [7.1591, -4.3, -4.5451], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [6.8771, -4.3, -3.5732], to: [7.5249, -4.3, -3.9098], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.1601, -4.3, -2.9658], to: [7.8345, -4.3, -3.2452], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.3895, -4.3, -2.3362], to: [8.0855, -4.3, -2.5563], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.5637, -4.3, -1.6892], to: [8.2761, -4.3, -1.8483], radius: 0.07, collide: 0, color: "#5b4a33"}
      - {kind: rod, from: [7.6813, -4.3, -1.0296], to: [8.4048, -4.3, -1.1266], radius: 0.07, collide: 0, color: "#5b4a33"}
  - id: top_face
    shape: part
    pos: [0, 0, 18.0]
    mount: top
    fixed: true
    color: "#e6dcc0"
    pieces:
      - {kind: disc, center: [0, 18.0], radius: 4.55, inner: 4.3, y: [-4.75, -4.55], collide: 0, color: "#e6dcc0"}
      - {kind: disc, center: [0, 18.0], radius: 4.2, inner: 3.95, y: [-4.75, -4.55], collide: 0, color: "#8a7a5c"}
      - {kind: disc, center: [0, 18.0], radius: 3.85, inner: 3.6, y: [-4.75, -4.55], collide: 0, color: "#e6dcc0"}
      - {kind: disc, center: [0, 18.0], radius: 3.5, y: [-4.7, -4.55], collide: 0, color: "#6f5f45"}   # the roller's end, in section
  - id: bottom_face
    shape: part
    pos: [0, 0, -18.0]
    mount: bottom
    fixed: true
    color: "#e6dcc0"
    pieces:
      - {kind: disc, center: [0, -18.0], radius: 4.55, inner: 4.3, y: [-4.75, -4.55], collide: 0, color: "#e6dcc0"}
      - {kind: disc, center: [0, -18.0], radius: 4.2, inner: 3.95, y: [-4.75, -4.55], collide: 0, color: "#8a7a5c"}
      - {kind: disc, center: [0, -18.0], radius: 3.85, inner: 3.6, y: [-4.75, -4.55], collide: 0, color: "#e6dcc0"}
      - {kind: disc, center: [0, -18.0], radius: 3.5, y: [-4.7, -4.55], collide: 0, color: "#6f5f45"}   # the roller's end, in section
wheels:
  - {id: r_top0, body: top, pos: [0, -2.4, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
  - {id: cyl0, body: cylinder, pos: [0, -2.4, 0], radius: 8.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.4, spokes: 4, hub: 1.6}
  - {id: r_bot0, body: bottom, pos: [0, -2.4, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
  - {id: r_top1, body: top, pos: [0, 0.0, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
  - {id: cyl1, body: cylinder, pos: [0, 0.0, 0], radius: 8.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.4}
  - {id: r_bot1, body: bottom, pos: [0, 0.0, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
  - {id: r_top2, body: top, pos: [0, 2.4, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
  - {id: cyl2, body: cylinder, pos: [0, 2.4, 0], radius: 8.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.4}
  - {id: r_bot2, body: bottom, pos: [0, 2.4, 0], radius: 4.5, width: 2.4, rim_width: 2.4, flange: 0.2, mass: 0.3, hub: 1.0}
shafts:
  - {id: ax_t, body: top, from: [0, -4.8, 0], to: [0, 5.0, 0], radius: 0.7}
  - {id: ax_c, body: cylinder, from: [0, -4.8, 0], to: [0, 5.0, 0], radius: 0.8}
  - {id: ax_b, body: bottom, from: [0, -4.8, 0], to: [0, 5.0, 0], radius: 0.7}
joints:
  - {id: j_b, type: hinge, body: bottom, axis: [0, 1, 0], damping: 0.01}   # the take-up roller: the one driven joint; + : clockwise
  - {id: j_t, type: hinge, body: top, axis: [0, 1, 0], damping: 0.01, frictionloss: 0.25}   # the supply roller, braked
  - {id: j_c, type: hinge, body: cylinder, axis: [0, 1, 0], damping: 0.002, frictionloss: 0.01}   # the cylinder, free on its axle (a little bearing friction)
cords:
  - id: yarn0
    from: {body: top, at: [0.9136, -2.4, 13.2674]}
    to: {body: bottom, at: [4.7597, -2.4, -17.2398]}
    over: [r_top0, cyl0, r_bot0]
    under: [cyl0]
    links: 58
    thickness: 0.6
    density: 1300
    stiffness: 30000
    pretension: 4.0
    damping: 8
    friction: 0.6
    color: "#4a6fa5"
  - id: yarn1
    from: {body: top, at: [0.9136, 0.0, 13.2674]}
    to: {body: bottom, at: [4.7597, 0.0, -17.2398]}
    over: [r_top1, cyl1, r_bot1]
    under: [cyl1]
    links: 58
    thickness: 0.6
    density: 1300
    stiffness: 30000
    pretension: 4.0
    damping: 8
    friction: 0.6
    color: "#4a6fa5"
  - id: yarn2
    from: {body: top, at: [0.9136, 2.4, 13.2674]}
    to: {body: bottom, at: [4.7597, 2.4, -17.2398]}
    over: [r_top2, cyl2, r_bot2]
    under: [cyl2]
    links: 58
    thickness: 0.6
    density: 1300
    stiffness: 30000
    pretension: 4.0
    damping: 8
    friction: 0.6
    color: "#4a6fa5"
contact: {solref: [0.0006, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_b, kind: velocity, rpm: 4.5, kv: 30.0, max_torque: 50}
checks:
  - {type: follow, out: j_c, in: j_b, expect: -0.5455, tol: 0.0327, min_r2: 0.99, settle_s: 1.5, window_s: 6}   # the cylinder turns the other way, at the radii's ratio
  - {type: follow, out: j_t, in: j_b, expect: 1.0, tol: 0.06, min_r2: 0.99, settle_s: 1.5, window_s: 6}   # what the lower roller winds on, the upper pays out
camera: {target: [0, 0, -4.0], position: [8.0, -150.0, 4.0], fov: 34}
display:
  output: j_c
  labels: {j_b: "Take-up roller (driver)", j_t: "Supply roller", j_c: "Cylinder"}
  proof: {label: "Warp cut", sub: "the rollers turn but the cylinder stands"}

