git.haldean.org h1a / master guide.scad
master

Tree @master (Download .tar.gz)

guide.scad @masterraw · history · blame

include <dims.scad>

brace_w = 10;
brace_h = 4;

module brace() {
    translate([-otid/2, -brace_w/2, -cap_height])
        cube([otid, brace_w, brace_h]);
}

module diag(h) {
    d = sqrt(2 * itid * itid)/2;
    wt = 1.8;
    linear_extrude(height=h, center=false, scale=(itid-1)/itid)
        polygon([[-d, 0], [-d+wt, wt], [d-wt, wt],
                 [d, 0], [d-wt, -wt], [-d+wt, -wt]]);
}

module guide() {
    union() {
        difference() {
            union() {
                cylinder(h=cap_depth, r1=otid / 2, r2=(otid - 2) / 2);
                translate([0, 0, -cap_height])
                    cylinder(h=cap_height, r=otod/2);
            }
            translate([0, 0, -cap_height-eps]) {
                cylinder(h=cap_height+cap_depth+2*eps,
                          r=otid/2-wall_thickness);
                rotate([90, 0, 0])
                     cylinder(h = otod/2 + eps, r = channel_w/2);
            }
        }
        intersection() {
            union() {
                rotate([0, 0, 45]) brace();
                rotate([0, 0, -45]) brace();
                translate([0, 0, -cap_height]) {
                    rotate([0, 0, 45]) diag(cap_height + cap_depth);
                    rotate([0, 0, -45]) diag(cap_height + cap_depth);
                }
            }
            translate([0, 0, -cap_height])
                cylinder(h=cap_depth+cap_height, r=otid/2 - wall_thickness / 2);
        }
    }
}

guide();