~kennylevinsen/skadis-brackets

a9792db72b29d8eac5dd4b89ed581fca8198c11e — Kenny Levinsen 1 year, 2 months ago
Initial commit
2 files changed, 234 insertions(+), 0 deletions(-)

A hook.scad
A plug.scad
A  => hook.scad +221 -0
@@ 1,221 @@
$fn = 100;

module prism(l, w, h){
   polyhedron(
           points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
           faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
           );
}

module backTabs(short=false) {
    holeBore = 2.45;
    depth = 11;
    zOffset = -2.75;
    up = short ? 0.5 : 10;
    
    slotTolerance = 4.5;
    slotLength = 10 - slotTolerance;
    throughDepth = 5.5;

    translate([0, 0, zOffset])
        difference() {
            union() {
                hull() {
                    // lower slot, made of 2 balls cut to half height
                    intersection() {
                        hull() {
                            translate([0, up, -1+zOffset])
                                sphere(r=holeBore);
                            translate([0, -8.5, -1+zOffset])
                                sphere(r=holeBore);
                        }
                        hull() {
                            translate([0, up, -1-holeBore+zOffset])
                                cylinder(h=holeBore, r=holeBore);
                            translate([0, -8.5, -1-holeBore+zOffset])
                                cylinder(h=holeBore, r=holeBore);
                        }
                    }

                    // Top edge, two slim cylinders
                    translate([0, up, -0.1+zOffset])
                        cylinder(h=0.1, r=holeBore);
                    translate([0, -9, -0.1+zOffset])
                        cylinder(h=0.1, r=holeBore);
                }

                // Through-slot component
                hull() {
                    translate([0, (slotLength/2)-(slotTolerance/2), -throughDepth/2])
                        cylinder(h=throughDepth, r=holeBore);
                    translate([0, (-slotLength/2)-(slotTolerance/2), -throughDepth/2])
                        cylinder(h=throughDepth, r=holeBore);
                };
            }
        }
}


module frontHook(hook_angle=160, hook_radius=10) {
    radius=2.45;
    
    union() {
        translate([0,-7.5, 10.25+radius]) {
            translate([0,0,hook_radius-7.5]) {
                union() {
                    rotate([90,90+hook_angle,90])
                        rotate_extrude(angle=hook_angle)
                            translate([hook_radius,0,0])
                                circle(r=radius);
                    rotate([-hook_angle,0,0])
                        translate([0, 0, -hook_radius])
                            sphere(r=radius);
                }
            }
            translate([0, 8, -7.5]) {
                union() {
                    rotate([90,0,0])
                        cylinder(r=radius, h=8);
                    sphere(r=radius);
                }
            }
            hull() {
                union() {
                    translate([0, -2, -7.5-radius]) {
                        cylinder(r=radius, h=radius);
                    }
                    translate([0, 8, -7.5-radius]) {
                        cylinder(r=radius, h=radius);
                    }
                }
            }
        }
    }
}

module hook() {
    union() {
        backTabs();
        frontHook(hook_radius=15);
    }
}

module frontScrewDriverBracket() {
    bore = 2.45;
    screwHole = 3.5;
    plateThickness = 16.3;
    difference() {
        union() {
            hull() {
                translate([0, -5, 0])
                    cylinder(h=5, r=bore);
                translate([0, 40.5, 0])
                    cylinder(h=5, r=bore);
            }
            
            hull() {
                translate([0, -5, 0])
                    cylinder(h=5, r=bore);
                translate([-bore, -5, 5])
                    prism(bore*2, 20, 40);
            }
            
            hull() {
                translate([0, 40.5, 0])
                    cylinder(h=5, r=bore);
                translate([bore, 15+8+plateThickness, 5])
                    rotate([0, 0, 180])
                        prism(bore*2, 8, 5);
            }
        }
        // back screw hole
        union() {
            translate([0, 22.5, 0.5])
                cylinder(h=5, r=screwHole/2);
            translate([0, 22.5, 0.5])
                cylinder(h=2.5, r2=screwHole/2, r1=3.5);
            translate([0, 22.5, -9.5])
                cylinder(h=10, r=3.5);
        }
        
        
        // bottom screw hole
        translate([0, 11, 15])
            rotate([90, 0, 180]) {
                translate([0, 22.5, 0])
                    cylinder(h=10, r=screwHole/2);
                translate([0, 22.5, 0])
                    cylinder(h=2.5, r2=screwHole/2, r1=3.5);
                translate([0, 22.5, -10])
                    cylinder(h=10, r=3.5);
            }
    }
}

module screwDriverBracketMount() {
    union() {
        backTabs(short=true);
        translate([0, 40, 0])
            backTabs();
        frontScrewDriverBracket();
    }
}


module frontPowerDrillBracketCyl(bore, r, girth, h, minDist) {
    translate([0, bore, r+minDist]) {
        rotate([90, 0, 0]) {
            difference() {
                cylinder(r=r+girth, h=h);
                cylinder(r=r, h=h);
            }
        }
    }
}
module frontPowerDrillBracket() {
    bore = 2.45;
    h = 10;
    r = 21.5;
    girth = 3;
    minDist = 11;
    
    difference() {
        hull() {
            frontPowerDrillBracketCyl(bore, r, girth, h, minDist);
            // The four pegs
            translate([0, -25, 0])
                cylinder(h=1, r=bore);
            translate([0, -19.5, 0])
                cylinder(h=1, r=bore);
            translate([-20, 0.5, 0])
                cylinder(h=1, r=bore);
            translate([-20, -5, 0])
                cylinder(h=1, r=bore);
            translate([20, 0.5, 0])
                cylinder(h=1, r=bore);
            translate([20, -5, 0])
                cylinder(h=1, r=bore);
        }
        // Cut the hole
        translate([0, 10, r+minDist]) {
            rotate([90, 0, 0]) {
                cylinder(r=r, h=40);
            }
        }
    }
}

module powerDrillMount() {
    union() {
        translate([0, -20, 0])
            backTabs(short=true);
        translate([-20, 0, 0])
            backTabs();
        translate([20, 0, 0])
            backTabs();
        
        frontPowerDrillBracket();
    }
}

powerDrillMount();
\ No newline at end of file

A  => plug.scad +13 -0
@@ 1,13 @@
$fn=100;
difference() {
    difference() {
        union() {
            cylinder(h=8, r=2.45);
            translate([0, 2.45-0.75, 4])
                cube([2.45*2, (2.45-0.75)*2, 8], center=true);
        }
        translate([0, 4.5, 0])
            cylinder(h=8, r=2.45);
    }
    cylinder(h=8, r=1.25);
}
\ No newline at end of file