Models / Weave pintograph

Weave pintograph

Weave: a pintograph, a drawing machine with two turning discs. The crank turns a small drive gear that meshes with both discs; the right one has a few more teeth than the left, so it slowly falls behind. An arm on a pin in each disc carries the pencil where the two arms cross, and it draws loop after loop, each a little different, weaving a cushion of lines.

36 parts on 3 sheets, shown together. Each sheet has its own cut file.

Source 275 lines

// Weave: a pintograph, a drawing machine with two turning discs. The crank
// turns a small drive gear that meshes with both discs; the right one has a
// few more teeth than the left, so it slowly falls behind. An arm on a pin in
// each disc carries the pencil where the two arms cross, and it draws loop
// after loop, each a little different, weaving a cushion of lines.
 
/* [Drawing] */
// Teeth on the right disc, against 60 on the left: fewer teeth make a finer weave and more crank turns
right_teeth = 63; // [61:61 teeth / finest, 62:62 teeth / fine, 63:63 teeth / open, 64:64 teeth / widest]
// Hole the left arm's pin goes in, as its distance from the disc centre
left_pin = 40; // [16:16 mm, 24:24 mm, 32:32 mm, 40:40 mm]
// Hole the right arm's pin goes in
right_pin = 32; // [16:16 mm, 24:24 mm, 32:32 mm, 40:40 mm]
// Arm length, pin to pencil: longer arms draw higher up the paper and flatter
arm_length = 200; // [180:10:210]
 
/* [Fit] */
// Total play between two meshing gears, at the pitch circle
backlash = 0.4; // [0.3:0.05:0.6]
// Added to the 6 mm holes that turn on brass bushes
bearing_clearance = 0.3; // [0.2:0.05:0.4]
 
/* [Assembly] */
// Crank angle in the assembled view; the discs turn more slowly, so it
// goes past one turn
crank_angle = 340; // [0:10:3600]
 
/* [Export] */
// All parts, or one group at a time
output = "all"; // [all:All parts, base:Base and feet, gears:Discs and drive gear, arms:Arms and pen sleeve, spacers:Spacers and handle, coupon:Fit test]
 
/* [Material] */
// Sheet thickness
$thickness = 3; // [2.8:0.1:3.2]
// Beam width
$kerf = 0.15; // [0:0.01:0.25]
 
/* [Hidden] */
$material = "plywood";
$sheet = [600, 400];
$gap = 5;
$fn = 96;
t = $thickness;
m = 2.5;
z0 = 30;
z1 = 60;
z2 = right_teeth;
L = arm_length;
hole = 6 + bearing_clearance;
// The discs turn on axles 190 mm apart; the drive gear sits below them, at
// the pitch distance from both, so it moves a little with the tooth count
s = 95;
c1 = (z0 + z1) * m / 2;
c2 = (z0 + z2) * m / 2;
gx = (c1 * c1 - c2 * c2) / (4 * s);
drive = [gx, -sqrt(c1 * c1 - (gx + s) * (gx + s))];
discs = [[-s, 0], [s, 0]];
holes = [16, 24, 32, 40];
// The handle stands on the drive gear, inside its teeth
handle_r = 24;
// A5 paper, landscape
paper = [210, 148];
assert(contains([61, 62, 63, 64], z2), "Right disc: 61 to 64 teeth");
assert(contains(holes, left_pin), "Left pin: 16, 24, 32 or 40 mm");
assert(contains(holes, right_pin), "Right pin: 16, 24, 32 or 40 mm");
assert(L >= 180 && L <= 210, "Arm length: 180 to 210 mm");
assert(backlash >= 0.3 && backlash <= 0.6, "Backlash: 0.3 to 0.6 mm");
assert(bearing_clearance >= 0.2 && bearing_clearance <= 0.4, "Bearing clearance: 0.2 to 0.4 mm");
assert(t >= 2.8 && t <= 3.2, "Thickness: 2.8 to 3.2 mm");
assert($kerf >= 0 && $kerf <= 0.25, "Kerf: 0 to 0.25 mm");
assert(crank_angle >= 0 && crank_angle <= 3600, "Crank angle: 0 to 3600 degrees");
assert(contains(["all", "base", "gears", "arms", "spacers", "coupon"], output), "Unknown output");
 
function gcd(a, b) = b == 0 ? a : gcd(b, a % b);
function polar(r, a) = [r * cos(a), r * sin(a)];
// The pins when the crank has turned a degrees: both discs turn the other
// way, the left at z0 / z1 and the right at z0 / z2 of the crank's speed.
// Both rows of holes point up at a = 0.
function pins(a) = [discs[0] + polar(left_pin, 90 - a * z0 / z1), discs[1] + polar(right_pin, 90 - a * z0 / z2)];
// The pencil, where two circles of the arm length round the pins cross,
// on the paper side
function pen(a) = let (p = pins(a), v = p[1] - p[0], d = norm(v), h = sqrt(L * L - d * d / 4))
  p[0] + v / 2 + [-v[1], v[0]] * h / d;
// The drawing closes when the left disc has made z2 / gcd turns
loops = z2 / gcd(z1, z2);
turns = loops * z1 / z0;
drawing = [for (i = [0:turns * 72]) pen(i * 5)];
xs = [for (p = drawing) p.x];
ys = [for (p = drawing) p.y];
// The arms always meet: the pins are at most this far apart, under 2 L
reach = 2 * s + left_pin + right_pin;
assert(reach < 2 * L - 60, "The arms must be long enough to meet");
// The angle between the arms at the pencil, widest and narrowest
widest = 2 * asin(reach / 2 / L);
narrowest = 2 * asin((2 * s - left_pin - right_pin) / 2 / L);
// The paper sits as low as it can without going under the discs
box = [max(xs) - min(xs), max(ys) - min(ys)];
paper_y = min(min(ys) - 8, max(88, (min(ys) + max(ys)) / 2 - paper[1] / 2));
assert(box[0] < paper[0] - 16 && max(ys) < paper_y + paper[1] - 8, "The drawing must fit on the paper");
// Base outline
bx = 187.5;
by0 = -116;
by1 = ceil(paper_y + paper[1] + 10);
 
// Involute teeth with a 20 degree pressure angle. backlash is shared between
// the two gears of a mesh: every tooth is thinned by backlash / 2. The roots
// get a plain radial relief.
function gear_inv(a) = tan(a) * 180 / PI - a;
function gear_polar(r, a) = [r * cos(a), r * sin(a)];
// Half the angular width of a tooth at radius r
function gear_half(z, m, r, backlash) =
  let (rp = m * z / 2, rb = rp * cos(20), ar = acos(min(1, rb / r)))
  90 / z + gear_inv(20) - gear_inv(ar) - backlash / (4 * rp) * 180 / PI;
function gear_outline(z, m, backlash, steps = 12) =
  let (rp = m * z / 2, rb = rp * cos(20), lo = rp - 1.25 * m, hi = rp + m, start = max(lo, rb),
    hs = gear_half(z, m, start, backlash), ht = gear_half(z, m, hi, backlash))
  [for (k = [0:z - 1]) each concat(
    [gear_polar(lo, 360 * k / z - hs)],
    [for (j = [(start > lo ? 0 : 1):steps]) let (r = start + (hi - start) * j / steps) gear_polar(r, 360 * k / z - gear_half(z, m, r, backlash))],
    [for (j = [1:4]) gear_polar(hi, 360 * k / z - ht + 2 * ht * j / 4)],
    [for (j = [steps - 1:-1:0]) let (r = start + (hi - start) * j / steps) gear_polar(r, 360 * k / z + gear_half(z, m, r, backlash))],
    [if (start > lo) gear_polar(lo, 360 * k / z + hs)],
    [for (j = [1:5]) gear_polar(lo, 360 * k / z + hs + (360 / z - 2 * hs) * j / 6)]
  )];
module externalgear(z) {
  polygon(gear_outline(z, m, backlash));
}
 
// Timing, with the crank at 0: the drive gear has a tooth on +X. Seen along
// the line between the axles, a tooth on one side of the drive gear faces a
// space on the disc, so each disc's teeth are turned by rho to match.
function rho(c, z) = let (a = atan2(c[1] - drive[1], c[0] - drive[0]), f = a * z0 / 360 - floor(a * z0 / 360))
  a + 180 - (0.5 - f) * 360 / z;
 
// n scored tally marks
module tally(n, p) {
  score() for (j = [0:n - 1]) translate(p + [2 * j, 0]) rect([0.3, 4]);
}
 
module ring(od, id) {
  difference() {
    circle(d = od);
    circle(d = id);
  }
}
 
// A disc: the pin holes run up from the centre, numbered, and the one the
// settings use is ringed
module disc(z, c, pin, label) {
  difference() {
    rotate(rho(c, z)) externalgear(z);
    circle(d = hole);
    for (r = holes) translate([0, r]) circle(d = 4.4);
  }
  score() {
    for (r = holes) translate([5, r - 1.5]) text(str(r), size = 3);
    translate([0, pin]) outline() circle(d = 8.5);
    translate([0, -30]) text(label, size = 5, halign = "center");
    translate([0, -38]) text(str(z, " TEETH"), size = 3.5, halign = "center");
  }
}
 
module drive_gear() {
  difference() {
    externalgear(z0);
    circle(d = hole);
    translate([handle_r, 0]) circle(d = 4.4);
  }
  score() line([7, 0], [handle_r - 6, 0]);
}
 
// Pin hole at the origin, pencil hole at L along +X, and a short tail
// beyond it so the arms cross at the pencil
module arm() {
  difference() {
    hull() {
      circle(r = 8);
      translate([L, 0]) circle(r = 9);
      translate([L + 14, 0]) circle(r = 7);
    }
    circle(d = hole);
    translate([L, 0]) circle(d = 8.4);
  }
  score() translate([L / 2, 0]) text("WEAVE", size = 6, halign = "center", valign = "center");
  score() for (x = [14, L - 15]) translate([x, 0]) rect([6, 0.3], center = true);
}
 
module base() {
  difference() {
    translate([-bx, by0]) rect([2 * bx, by1 - by0], r = 12);
    // M4 axle bolts
    for (c = concat(discs, [drive])) translate(c) circle(d = 4.4);
  }
  score() {
    // Where the paper goes, with the drawing's corners marked inside it
    translate([-paper[0] / 2, paper_y]) outline() rect(paper);
    for (p = [[min(xs), min(ys)], [max(xs), min(ys)], [min(xs), max(ys)], [max(xs), max(ys)]])
      translate(p) {
        rect([6, 0.3], center = true);
        rect([0.3, 6], center = true);
      }
    translate([-146, by1 - 28]) text("WEAVE", size = 13, halign = "center");
    // The whole drawing at a third of its size
    translate([-146, by1 - 52]) scale(1 / 3) translate([-(min(xs) + max(xs)) / 2, -(min(ys) + max(ys)) / 2]) polyline(drawing);
    translate([-146, by1 - 80]) text(str(z1, " : ", z2, " TEETH"), size = 4, halign = "center");
    translate([-146, by1 - 87]) text(str("PINS ", left_pin, " / ", right_pin), size = 4, halign = "center");
    translate([-146, by1 - 94]) text(str("ARMS ", L), size = 4, halign = "center");
    translate([146, by1 - 28]) text("PINTOGRAPH", size = 6, halign = "center");
    translate([146, by1 - 38]) text(str(turns, " TURNS TO CLOSE"), size = 4, halign = "center");
  }
}
 
feet = [[-bx + 20, by0 + 20], [bx - 20, by0 + 20], [-bx + 20, by1 - 20], [bx - 20, by1 - 20]];
 
// The assembled view, base bottom at z = 0: gears on two axle spacers, the
// nut on each crank pin, then the left arm on one pin spacer and the right
// arm on two, crossing at the pencil
a = crank_angle;
P = pins(a);
pencil = pen(a);
zg = 4 * t;
zn = 6 * t + 3.2;
arm_z = [zn + t, zn + 2 * t];
function heading(p) = let (v = pencil - p) [0, 0, atan2(v[1], v[0])];
function at(p, z) = concat(p, [z]);
 
if (output == "all" || output == "base") step("Glue up the base and the feet, with two spacers round each axle hole") {
  part("Base", qty = 2, at = [[0, 0, 0], [0, 0, t]]) base();
  part("Foot", qty = 8, at = [for (f = feet, k = [0:1]) at(f, -2 * t + k * t)]) circle(d = 30);
}
if (output == "all" || output == "gears") step("Mesh the two discs and the drive gear on their axles") {
  // Both discs turn the other way from the crank, more slowly
  part("Left disc", qty = 2, at = [for (k = [0:1]) at(discs[0], zg + k * t)], rotate = [0, 0, -a * z0 / z1])
    disc(z1, discs[0], left_pin, "LEFT");
  part("Right disc", qty = 2, at = [for (k = [0:1]) at(discs[1], zg + k * t)], rotate = [0, 0, -a * z0 / z2])
    disc(z2, discs[1], right_pin, "RIGHT");
  part("Drive gear", qty = 2, at = [for (k = [0:1]) at(drive, zg + k * t)], rotate = [0, 0, a]) drive_gear();
}
if (output == "all" || output == "arms") step("Bolt the arms on the crank pins and push the pencil through") {
  part("Arm", qty = 2, at = [at(P[0], arm_z[0]), at(P[1], arm_z[1])], rotate = [heading(P[0]), heading(P[1])]) arm();
  // Under the left arm, down to the paper
  part("Pen sleeve", qty = 3, at = [for (k = [3:-1:1]) at(pencil, arm_z[0] - k * t)]) ring(16, 8.4);
}
if (output == "all" || output == "spacers") {
  step("Glue up the base and the feet, with two spacers round each axle hole")
    part("Axle spacer", qty = 6, at = [for (c = concat(discs, [drive]), k = [0:1]) at(c, 2 * t + k * t)]) ring(16, hole);
  step("Bolt the arms on the crank pins and push the pencil through")
    part("Pin spacer", qty = 3, at = [at(P[0], zn), at(P[1], zn), at(P[1], zn + t)]) ring(14, hole);
  step("Bolt the handle stack on the drive gear")
    part("Handle", qty = 5, at = [for (k = [0:4]) at(drive + polar(handle_r, a), 6 * t + 4 + k * t)]) ring(18, hole);
}
// The fit test lies on the table beside the base
if (output == "all" || output == "coupon") part("Fit test", at = [bx + 20, by0, -2 * t]) {
  difference() {
    rect([130, 45], r = 3);
    for (i = [0:3]) translate([15 + 25 * i, 15]) circle(d = 6.1 + 0.1 * i);
    translate([113, 15]) circle(d = 8.4);
    translate([113, 34]) circle(d = 4.4);
  }
  for (i = [0:3]) tally(i + 1, [12 + 25 * i, 29]);
}
 
echo(str("Weave: the drawing closes after ", turns, " crank turns (", loops, " loops), ", round(box[0]), " x ", round(box[1]), " mm, on A5 paper ", round(paper_y), " mm above the disc axles; the arms meet at ", round(narrowest), " to ", round(widest), " degrees"));
 
// Assembly, with base bottom at z = 0: glue the two plies of the base, each
// disc and the drive gear, then the feet in pairs under the corners and two
// axle spacers round each axle hole. Each axle is an M4 bolt up from below
// with a 6 mm brass bush over it standing on the base; the gear turns on the
// bush, clamped from above by a washer and nut. Mesh the gears with both rows
// of holes pointing at the paper. Each crank pin is an M4 bolt up through the
// ringed hole, nutted on the disc, with a brass bush: the left arm on one pin
// spacer, the right arm on two, each under a washer and nut. Glue the three
// pen sleeves under the left arm's pencil hole, lay the right arm on top and
// push a pencil down through both until it rests on the paper. Bolt the
// handle stack on a bush on the drive gear and tape A5 paper in its outline.