include <yenyalib.scad>
base_wall = 0.6;
+// base_wall = 0.45*3;
inside_z = base_wall + 5;
+inside_wall = 0.45*3;
+/*
base_w = 18;
base_h1 = 7.5;
base_h2 = 14;
inside_w1 = inside_w - 2;
inside_h1 = 2;
+*/
-/*
base_w = 23.5;
base_h1 = 10;
base_h2 = 11;
-inside_yoff = 1;
-inside_w = 21;
+inside_yoff = 1.3;
+inside_w = 20.9;
inside_h = 1.8;
inside_w1 = inside_w - 2;
inside_h1 = 2;
+
+/*
+cable_w = 7;
+cable_h = 3 + inside_yoff;
*/
-// base
-union() {
- intersection() {
- let(r = (base_w^2)/(8*(base_h2-base_h1))
- + (base_h2-base_h1)/2)
- Ty(-r+base_h2)
- cylinder(r = r, h = base_wall, $fn = 256);
- Tx(-base_w/2) cube([base_w, infty, base_wall]);
+module body() {
+ // base
+ union() {
+ intersection() {
+ let(r = (base_w^2)/(8*(base_h2-base_h1))
+ + (base_h2-base_h1)/2)
+ Ty(-r+base_h2)
+ cylinder(r = r, h = base_wall, $fn = 256);
+ Tx(-base_w/2) cube([base_w, infty, base_wall]);
+ }
+ Tx(-base_w/2) cube([base_w, base_h1, base_wall]);
}
- Tx(-base_w/2) cube([base_w, base_h1, base_wall]);
-}
-// inside
-Tx(-inside_w/2) Ty(inside_yoff)
- cube([inside_w, inside_h, inside_z]);
+ difference() {
+ union() {
+ // inside
+ Tx(-inside_w/2) Ty(inside_yoff)
+ cube([inside_w, inside_h, inside_z]);
+
+ // inside upper
+ Tx(-inside_w1/2) Ty(inside_yoff+inside_h-eps)
+ cube([inside_w1, inside_h1+eps, inside_z]);
+ }
+ translate([-inside_w1/2+inside_wall,
+ inside_yoff+inside_wall, -eps])
+ cube([inside_w1-2*inside_wall,
+ inside_h + inside_h1, inside_z+2*eps]);
+ }
+}
-// innside higher part
-if (inside_w1 > 0) {
- Tx(-inside_w1/2) Ty(inside_yoff+inside_h-eps)
- cube([inside_w1, inside_h1+eps, inside_z]);
+difference() {
+ body();
+ // cable hole
+ if (cable_w != undef) {
+ translate([-cable_w/2, -eps, -eps])
+ cube([cable_w, cable_h+eps, inside_z+2*eps]);
+ }
}