chiark / gitweb /
anke-gps-bracket: NestleCube: add some { }, nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Dec 2012 16:56:28 +0000 (16:56 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Dec 2012 16:56:28 +0000 (16:56 +0000)
anke-gps-bracket.scad

index 8d7c542..c340d1f 100644 (file)
@@ -219,29 +219,31 @@ module NestleCube(){ ////toplevel
   cutw0 = basew0 - nestlewallmin;
   cutw1 = basew1 + nestlewallmin;
 
-  translate([-(basew0+basew1)/2, -(based0+based1)/2, 0]) difference(){
-    polyhedron
-      (points=[[          +0      ,            +0,        0], // 0
-              [          +0      ,            +nestledr, 0], // 1
-              [          -midw   ,            +midd,     0], // 2
-              [          -nestlew,            +nestledl, 0], // 3
-              [          -nestlew,            +0,        0], // 4
-              [-nestledwr+0      , +nestleddf +0,        -nestleh], // 5
-              [-nestledwr+0      , -nestleddbr+nestledr, -nestleh], // 6
-              [          -midw   , -midddb    +midd,     -nestleh], // 7
-              [+nestledwl-nestlew, -nestleddbl+nestledl, -nestleh], // 8
-              [+nestledwl-nestlew, +nestleddf +0,        -nestleh]], // 9
-       triangles=[[0,1,6],[6,5,0],
-                 [1,2,7],[7,6,1],
-                 [2,3,8],[8,7,2],
-                 [3,4,9],[9,8,3],
-                 [4,0,5],[5,9,4],
-                 [4,3,2],[2,1,0],[0,4,2],
-                 [7,8,9],[5,6,7],[7,9,5]],
-       convexity=3);
-    intersection(){
-      NestleCubeCutout(cutw1, cutw0, max(nestledl,nestledr));
-      rotate([0,0,90]) NestleCubeCutout(cutd0, cutd1, nestlew);
+  translate([-(basew0+basew1)/2, -(based0+based1)/2, 0]) {
+    difference(){
+      polyhedron
+       (points=[[          +0      ,            +0,        0], // 0
+                [          +0      ,            +nestledr, 0], // 1
+                [          -midw   ,            +midd,     0], // 2
+                [          -nestlew,            +nestledl, 0], // 3
+                [          -nestlew,            +0,        0], // 4
+                [-nestledwr+0      , +nestleddf +0,        -nestleh], // 5
+                [-nestledwr+0      , -nestleddbr+nestledr, -nestleh], // 6
+                [          -midw   , -midddb    +midd,     -nestleh], // 7
+                [+nestledwl-nestlew, -nestleddbl+nestledl, -nestleh], // 8
+                [+nestledwl-nestlew, +nestleddf +0,        -nestleh]], // 9
+        triangles=[[0,1,6],[6,5,0],
+                   [1,2,7],[7,6,1],
+                   [2,3,8],[8,7,2],
+                   [3,4,9],[9,8,3],
+                   [4,0,5],[5,9,4],
+                   [4,3,2],[2,1,0],[0,4,2],
+                   [7,8,9],[5,6,7],[7,9,5]],
+        convexity=3);
+      intersection(){
+       NestleCubeCutout(cutw1, cutw0, max(nestledl,nestledr));
+       rotate([0,0,90]) NestleCubeCutout(cutd0, cutd1, nestlew);
+      }
     }
   }