chiark / gitweb /
cable-hole-trunking-cover: sides using polygon
[reprap-play.git] / cable-hole-trunking-cover.scad
index c1b06e07f90bd4319900aa725460d12411595f8c..d599e8241c1b5a60b7a0ef0b183e2ebae17914ad 100644 (file)
@@ -6,6 +6,8 @@ sidewidth = 5;
 tapewidth = 7;
 tapethick = 1;
 
+cutoutsz= 10;
+
 innerz = 10;
 
 basex = holedia + sidewidth*2;
@@ -33,7 +35,8 @@ module sheared_cube(sz, xperz, yperz) {
     cube(sz);
 }
 
-module Base(){
+module Base(cutouty){
+  echo(cutouty);
   difference(){
     union(){
       for (mir=[0,1]) mirror([0,mir,0]) {
@@ -55,6 +58,8 @@ module Base(){
                     [basey/2 + bevely, innerz],
                     [-0.1,             innerz]]);
        }
+       translate([cutouty, 0])
+         square(size=[cutoutsz, 3*innerz], center=true);
       }
     }
   }
@@ -63,10 +68,16 @@ module Base(){
 module Lid(){
   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, basey/2 + sideslop + bevely, 0])
+      rotate([90,0,90])
+      linear_extrude(height = lidx)
+      polygon([[0,         0],
+              [-bevely,   0],
+              [0,         bevelz],
+              [0,         innerz + lidt + zslop],
+              [sidewallt, innerz + lidt + zslop],
+              [sidewallt, -tapethick],
+              [0,         -tapethick]]);
     translate([0, -1, innerz + zslop])
       cube([lidx, 1 + basey/2 + sideslop + bevely + sidewallt, lidt]);
     translate([basex + endslop, -1, -tapethick])
@@ -75,5 +86,23 @@ module Lid(){
   }
 }
 
-Base();
-%Lid();
+module LidT(){ ////toplevel
+  rotate([180,0,0]) Lid();
+}
+
+module BaseCMid(){ ////toplevel
+  Base(0);
+}
+
+module BaseCTop(){ ////toplevel
+  Base(basey/2 + bevely - cutoutsz/2);
+}
+
+module BaseCBot(){ ////toplevel
+  Base(-(basey/2 + bevely - cutoutsz/2));
+}
+
+//BaseCTop();
+//BaseCMid();
+//BaseCBot();
+//LidT();