chiark / gitweb /
cable-hole-trunking-cover: lid done
[reprap-play.git] / cable-hole-trunking-cover.scad
index ce44475..584ee01 100644 (file)
@@ -4,6 +4,7 @@ holedia = 25.4;
 
 sidewidth = 5;
 tapewidth = 7;
+tapethick = 1;
 
 innerz = 10;
 
@@ -17,9 +18,12 @@ bevely = bevelz * bevelslope;
 sideslop = 0.5;
 
 basebaset = 2;
-basebevelt = 3;
+sidewallt = 3;
 
+lidt = 2;
 endwallt = 2;
+zslop = 0.75;
+endslop = 0.75;
 
 module sheared_cube(sz, xperz, yperz) {
   multmatrix([[1,0,xperz,0],
@@ -32,31 +36,38 @@ module sheared_cube(sz, xperz, yperz) {
 module Base(){
   difference(){
     union(){
-      translate([0, basey-basebevelt, 0])
-       sheared_cube([basex, basebevelt, bevelz], 0, bevelslope);
-      sheared_cube([basex, basebevelt, bevelz], 0, -bevelslope);
-      cube([basex, basey, basebaset]);
+      for (mir=[0,1]) mirror([0,mir,0]) {
+       translate([0, basey/2 - sidewallt, 0])
+         sheared_cube([basex, sidewallt, bevelz], 0, bevelslope);
+       cube([basex, basey/2, basebaset]);
+       rotate([90, 0, 90])
+         linear_extrude(height=endwallt)
+         polygon([[-0.1,             0],
+                  [basey/2,          0],
+                  [basey/2 + bevely, bevelz],
+                  [basey/2 + bevely, innerz],
+                  [-0.1,             innerz]]);
+      }
     }
-    translate([basex/2, basey/2, -1])
+    translate([basex/2, 0, -1])
       cylinder(r=holedia/2, h=bevelz+2);
   }
-
-  rotate([90, 0, 90])
-    linear_extrude(height=endwallt)
-    polygon([[0,     0],
-            [basey, 0],
-            [basey + bevely, bevelz],
-            [basey + bevely, innerz],
-            [      - bevely, innerz],
-            [      - bevely, bevelz]]);
 }
 
 module Lid(){
-  translate([0, basey + sideslop, 0])
-    sheared_cube([basex, basebevelt, bevelz], 0, bevelslope);
-  translate([0, -basebevelt - sideslop, 0])
-    sheared_cube([basex, basebevelt, bevelz], 0, -bevelslope);
+  lidx = basex + endslop + endwallt;
+  for (mir=[0,1]) mirror([0,mir,0]) {
+    translate([0, basey/2 + sideslop, 0])
+      sheared_cube([lidx, sidewallt, bevelz], 0, bevelslope);
+    translate([0, basey/2 + sideslop + bevely, -tapethick])
+      cube([lidx, sidewallt, innerz + tapethick + lidt + zslop]);
+    translate([0, -1, innerz + zslop])
+      cube([lidx, 1 + basey/2 + sideslop + bevely + sidewallt, lidt]);
+    translate([basex + endslop, -1, -tapethick])
+      cube([endwallt, 1 + basey/2 + sideslop + bevely + sidewallt,
+           tapethick + innerz + zslop + 0.1]);
+  }
 }
 
 Base();
-Lid();
+%Lid();