chiark / gitweb /
anke-gps-bracket: NestleCube: before more points, reformat, nfc
[reprap-play.git] / anke-gps-bracket.scad
index 2f05e45ba7e94334be440ca3d800fe7ab940ad8a..d2c69ab48d3931f253fe505c6e3f18943c5ab4d3 100644 (file)
@@ -54,9 +54,6 @@ nestleddf = 4.0;
 nestleddbl = 3.3;
 nestleddbr = 3.6;
 
-nestlewallmin = 4;
-nestleceilmin = 4;
-
 // Adjustment for the GPS attitude and position
 gpsazimuth = 45;
 gpselevation = 40;
@@ -87,6 +84,9 @@ holderdccount = 2;
 holderdoveclipl = 15;
 chassish = 13;
 chassist = 13;
+nestlefloorh = 2.0;
+nestleceilh = 2.0;
+nestlewallmin = 3.0;
 
 // Consequential values
 holderdcw = DoveClipPairSane_width(holderdccount);
@@ -192,21 +192,26 @@ module GpsPlugT(){ ////toplevel
 
 module NestleCubeCutout(ca,cb,d){
   dist = cb - ca;
+  cuth = -nestleh + nestlefloorh;
   mirror([0,1,0]){
+    translate([0,1,0])
     rotate([90,0,0]){
-      linear_extrude(height=d){
-       polygon([[ca, -nestleh-1],
-                [ca, -dist/2],
-                [(ca+cb)/2, 0],
-                [cb, -dist/2],
-                [cb, -nestleh-1]]);
+      linear_extrude(height=d+2){
+       polygon([[ca+nestlebevel, cuth],
+                [ca, cuth+nestlebevel*2],
+                [ca, -dist/2-nestleceilh],
+                [(ca+cb)/2, -nestleceilh],
+                [cb, -dist/2-nestleceilh],
+                [cb, cuth+nestlebevel*2],
+                [cb-nestlebevel, cuth]]);
       }
     }
   }
 }
 
-module NestleCubeBevel(){
-  translate([-nestlebevel, -100, -0.1])
+module NestleCubeBevel(rot){
+  rotate([0,0,rot])
+    translate([-nestlebevel, -100, -0.1])
     rotate([0,30,0])
     cube([nestlebevel*2, 200, nestlebevel*5]);
 }
@@ -229,16 +234,17 @@ module NestleCube(){ ////toplevel
   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
+       (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],
@@ -248,11 +254,12 @@ module NestleCube(){ ////toplevel
                    [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);
+       #NestleCubeCutout(cutw1, cutw0, max(nestledl,nestledr));
+       #rotate([0,0,90]) NestleCubeCutout(cutd0, cutd1, nestlew);
       }
       translate([0,0,-nestleh]) {
-       translate([-nestledwr, 0, 0]) NestleCubeBevel();
+       translate([-nestledwr, 0, 0]) NestleCubeBevel(0);
+       translate([-nestlew+nestledwl, 0, 0]) NestleCubeBevel(180);
       }
     }
   }