doggie-door/limit-switch-flag-and-chain-catch.scad
2024-04-03 16:04:36 -07:00

59 lines
1.5 KiB
OpenSCAD

showAssembled=1;
$fn=12;
flagHeight=15;
flagWidth=20;
flagDepth=10;
baseThickness=2;
chainHolderDiameter=3;
gutterHeight=5;
gutterWidth=4;
// slice it for printing
if (showAssembled) {
wholeModel();
} else {
difference(){
wholeModel();
translate([-50,-50,baseThickness]) cube(100);
}
translate([-50,0,0]) difference(){
wholeModel();
translate([-50,-50,-100+baseThickness]) cube(100);
}
}
module wholeModel(){
difference() {
union() {
translate([0,-gutterWidth/2,gutterHeight/2-(gutterHeight-1)]){
cube([flagDepth,flagWidth-gutterWidth,gutterHeight-2], center=true);
}
translate([0,-gutterWidth,(flagHeight-gutterHeight)/2]){
cube([flagDepth,flagWidth,flagHeight-gutterHeight], center=true);
}
translate([0,-(flagWidth+20)/2,2/2]){
difference(){
cube([flagDepth,20,baseThickness], center=true);
translate([0,0,0])
cylinder(h=4,r=2.5,center=true);
}
}
}
translate([0,0,baseThickness]){
chainHolder();
translate([0,chainHolderDiameter+.5,0]) chainHolder();
}
}
}
module chainHolder() {
translate([-flagDepth/3,-flagWidth/2+2,0]) rotate([0,90,0]) cylinder(h=flagDepth/2+1,d=chainHolderDiameter, center=true);
translate([flagDepth/3,-flagWidth/2+2,0]) rotate([0,90,0]) cylinder(h=flagDepth/2+1,d=chainHolderDiameter, center=true);
translate([0,-flagWidth/2+2,0]) rotate([0,90,0]) cylinder(h=flagDepth,d=0.7, center=true);
}