chiark / gitweb /
cable-hole-trunking-cover: mirror the sides
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Dec 2012 18:51:36 +0000 (18:51 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Dec 2012 18:51:36 +0000 (18:51 +0000)
cable-hole-trunking-cover.scad

index ce44475..e6faa8e 100644 (file)
@@ -32,30 +32,29 @@ 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 - basebevelt, 0])
+         sheared_cube([basex, basebevelt, 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);
+  for (mir=[0,1]) mirror([0,mir,0]) {
+    translate([0, basey/2 + sideslop, 0])
+      sheared_cube([basex, basebevelt, bevelz], 0, bevelslope);
+  }
 }
 
 Base();