]> www.fi.muni.cz Git - things.git/commitdiff
switch holder.scad master
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 15 Apr 2024 06:15:19 +0000 (08:15 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 15 Apr 2024 06:15:19 +0000 (08:15 +0200)
switch-holder.scad [new file with mode: 0644]

diff --git a/switch-holder.scad b/switch-holder.scad
new file mode 100644 (file)
index 0000000..2bd00fc
--- /dev/null
@@ -0,0 +1,44 @@
+include <yenyalib.scad>
+
+$fn = 128;
+
+wall = 1.67;
+
+switch_d = 13.4; // zvenku 17.5, hloubka i s kontakty 12.5
+switch_cut = 0.8;
+
+body_w = 30;
+body_h = 60;
+body_depth = 30;
+bottom_depth = 15;
+
+bottom_r = 12;
+screw_d = 3.5;
+
+difference() {
+       hull() {
+               Tx(-body_w/2) cube([body_w, eps, body_depth]);
+               Mx() Tx(body_w/2-bottom_r) Ty(body_h - bottom_r) union() {
+                       cylinder(r1 = bottom_r-wall/2, r2=bottom_r,h = wall);
+                       Tz(wall)
+                               cylinder(r = bottom_r, h = bottom_depth-wall);
+               }
+       }
+       Tz(wall) hull() {
+               Tx(-body_w/2+wall) Ty(wall)
+                       cube([body_w-2*wall, eps, body_depth]);
+               Mx() Tx(body_w/2-bottom_r) Ty(body_h - bottom_r)
+                       cylinder(r = bottom_r-wall, h = body_depth);
+       }
+       // sw1
+       for (y = [0.3*body_h, 0.75*body_h]) Ty(y) difference() {
+               Tz(-eps)
+                       cylinder(r = switch_d/2, h = wall + 2*eps);
+               Tz(-2*eps) Tx(switch_d/2-switch_cut) Ty(-switch_d/2)
+                       cube([switch_cut+eps, switch_d, wall + 4*eps]);
+       }
+       for (z = [body_depth/4, 3*body_depth/4+wall],
+               x = [-body_w/4, body_w/4])
+               translate([x, -eps, z]) Rx(-90)
+               cylinder(r = screw_d/2, h = wall + 2*eps, $fn = 6);
+}