chiark / gitweb /
anke-gps-bracket: add NestleCubePin
[reprap-play.git] / anke-gps-bracket.scad
index c0ef222893cbba4fc84e1447951ab93049481ee7..4f01028ddfa507e647d1cff7e941d5461a23350d 100644 (file)
@@ -1,5 +1,7 @@
 // -*- C -*-
 
+include <doveclip.scad>
+
 // Dimensions of the main GPS body
 outerw = 120 + 2.5;
 outerh =  75 - 0.2;
@@ -38,7 +40,13 @@ nestleddf = 4.0;
 nestleddbl = 3.3;
 nestleddbr = 3.6;
 
-nestlewallmin = 5;
+nestlewallmin = 4;
+nestleceilmin = 4;
+
+// Adjustment for the GPS attitude
+gpsazimuth = 45;
+gpsrightwardoffset = 5;
+gpsrearwardoffset = 2;
 
 // Amount of wire protrusion to allow for
 plugwiremoreh = 25;
@@ -52,6 +60,7 @@ bodylhsrhsslop = 0.5;
 screent = 1.0;
 plugstrutw = 4;
 plugstrutt = min(outert, 5);
+nestledoveclipw = 20;
 
 module GpsPlugPlug(slop){
   effhslop = slop - plughstep;
@@ -150,7 +159,22 @@ module GpsPlugT(){ ////toplevel
   rotate([0,-90,0]) GpsPlug();
 }
 
-module InsertionCube(){
+module NestleCubeCutout(ca,cb,d){
+  dist = cb - ca;
+  mirror([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]]);
+      }
+    }
+  }
+}
+
+module NestleCube(){ ////toplevel
   midw = nestlew/2;
   midd = min(nestledl,nestledr);
   midddb = max(nestleddbl,nestleddbr);
@@ -160,7 +184,12 @@ module InsertionCube(){
   basew0 = -nestledwr;
   basew1 = +nestledwl-nestlew;
 
-  difference(){
+  cutd0 = based0 + nestlewallmin;
+  cutd1 = based1 - nestlewallmin;
+  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
@@ -180,11 +209,25 @@ module InsertionCube(){
                  [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([gpsrightwardoffset,-gpsrearwardoffset,0])
+    rotate([0,0,gpsazimuth])
+    translate([nestledoveclipw/2,0,DoveClip_depth()-0.5])
+    rotate([0,-90,0])
+    DoveClipPairSane(count=3, h=nestledoveclipw);
+}
+
+module NestleCubePin(){ ////toplevel
+  DoveClipPin(nestledoveclipw*0.4);
 }
 
 //GpsPlugT();
 //GpsAssembled();
 //GpsBody();
-
-InsertionCube();
+//NestleCube();
+//NestleCubePin();