68 lines
1.8 KiB
OpenSCAD
68 lines
1.8 KiB
OpenSCAD
|
sw_w=10.5;
|
||
|
sw_t=6;
|
||
|
sw_l=20;
|
||
|
sw_clearance=1;
|
||
|
sw_hole_dist=10;
|
||
|
sw_hole_dia=2;
|
||
|
mt=2;
|
||
|
tab_w=20;
|
||
|
tab_h=4;
|
||
|
tab_d=10;
|
||
|
$fn=20;
|
||
|
offset=0.4;
|
||
|
|
||
|
module switch(){
|
||
|
difference(){
|
||
|
cube([sw_w,sw_t,sw_l]);
|
||
|
rotate([90,0,0]){
|
||
|
translate([sw_w/4,sw_l/2-sw_hole_dist/2,-sw_t])cylinder(d=sw_hole_dia,h=sw_t);
|
||
|
translate([sw_w/4,sw_l/2+sw_hole_dist/2,-sw_t])cylinder(d=sw_hole_dia,h=sw_t);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
module tab(){
|
||
|
union(){
|
||
|
cube([tab_d,tab_w,tab_h]);
|
||
|
translate([-tab_d,-tab_w/2,0])cube([tab_d,tab_w*2,tab_h]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module bracket(){
|
||
|
//switch baseplate
|
||
|
difference(){
|
||
|
cube([sw_w/2,mt,sw_l]);
|
||
|
rotate([90,0,0]){
|
||
|
translate([sw_w/4,sw_l/2-sw_hole_dist/2,-sw_t])cylinder(d=sw_hole_dia,h=sw_t);
|
||
|
translate([sw_w/4,sw_l/2+sw_hole_dist/2,-sw_t])cylinder(d=sw_hole_dia,h=sw_t);
|
||
|
}
|
||
|
}
|
||
|
// tab_clamp
|
||
|
translate([tab_d/2,-tab_h,-mt]){
|
||
|
difference(){
|
||
|
translate([0,-offset,0])cube([mt,tab_h+mt+offset,tab_w+2*mt]);
|
||
|
translate([0,tab_h,mt])rotate([90,0,0])tab();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module extender(){
|
||
|
difference(){
|
||
|
cube([sw_l,sw_w*3,mt]);
|
||
|
rotate([0,0,-90]){
|
||
|
hull(){
|
||
|
translate([-(sw_w*3/2)*0.25,sw_l/2-sw_hole_dist/2,0])#cylinder(d=sw_hole_dia,h=mt);
|
||
|
translate([-(sw_w*3/2)*1.75,sw_l/2-sw_hole_dist/2,0])#cylinder(d=sw_hole_dia,h=mt);
|
||
|
}
|
||
|
hull(){
|
||
|
translate([-(sw_w*3/2)*0.25,sw_l/2+sw_hole_dist/2,0])#cylinder(d=sw_hole_dia,h=mt);
|
||
|
translate([-(sw_w*3/2)*1.75,sw_l/2+sw_hole_dist/2,0])#cylinder(d=sw_hole_dia,h=mt);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
translate([-tab_d/2,0,tab_h+mt])rotate([90,0,0])%switch();
|
||
|
translate([0,-tab_w,0])%tab();
|
||
|
translate([-tab_d/2,0,tab_h])rotate([90,0,0])bracket();
|
||
|
//rotate([0,0,90])translate([-2*sw_w+mt/2,-sw_w*3/2,tab_h])extender();
|