chiark / gitweb /
digispark-with-cable: tidying
[reprap-play.git] / digispark-with-cable.scad
index 14e9bbda2e41520e60e52e4c2485dc9d7819a163..47bca642632b843bcdb99c9b2e3a45acaa7791f2 100644 (file)
@@ -8,8 +8,6 @@
 
 include <utils.scad>
 
-//tongue_w = 11.92 + 0.4;
-
 usb_w = 12.01 + 0.19;
 usb_wall_w = 0.51;
 usb_tongue_d = 8.97 - 0.2;
@@ -28,7 +26,7 @@ sw_to_edge = board_w/2 + 0.1;
 front_wall_th = 0.75;
 // egress_w = 8.0;
 
-wall_y_min = -board_l - side_wall_th; // XXXX remove
+wall_y_min = -board_l - side_wall_th;
 ceil_y_min = wall_y_min - 5;;
 
 small_walls = [
@@ -50,6 +48,7 @@ strain_groove_w = 3;
 cover_strap_c_d_y = 5.5; // from front of board
 cover_registration_sz_y = 2;
 cover_registration_sz_z = 3;
+midbot_registraton_sz_x = 3;
 
 cable_space_z = 6;
 cable_dia = 5;
@@ -90,11 +89,13 @@ cover_registration_c_dy = -cover_strap_c_d_y - strap_w/2
   - side_wall_th - cover_registration_sz_y/2;
 
 midbot_registration_sz_y = cover_registration_sz_y;
+midbot_registration_sz_z = cover_registration_sz_z;
 midbot_registration_y_min = total_y_min + side_wall_th*2;
 midbot_registration_y_max = midbot_registration_y_min
   + midbot_registration_sz_y;
 midbot_registration_y_around_max = midbot_registration_y_max
   + side_wall_th*2;
+midbot_registration_bottom_x = board_w/2 - midbot_registraton_sz_x;
 
 module BothSides(){
   for (m=[0,1]) {
@@ -120,7 +121,6 @@ module BottomStrapCutouts(y_c){
 // XXXX check strap width
 // XXXX check cable diameter
 // XXXX need rear strap
-// XXXX need bottom-to-middle registration
 module CoverStrapCutouts(){
   BothSides(){
     translate([ -total_side_wall_x, -cover_strap_c_d_y, cover_top_z ])
@@ -170,6 +170,12 @@ module MiddleMainWallsPlan() {
             [ +board_w/2 + side_wall_th,            total_y_min ]);
 }
 
+module RegistrationsMinkowski(){
+  minkowski(){
+    cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
+    children();
+  }
+}
 module CoverRegistrations(){
   linextr_y_xz(cover_registration_c_dy - strap_w/2,
               cover_registration_c_dy + strap_w/2) {
@@ -184,6 +190,16 @@ module CoverRegistrations(){
     }
   }
 }
+module MidBotRegistrations(){
+  linextr_y_xz(midbot_registration_y_min,
+              midbot_registration_y_max) {
+    BothSides(){
+      rectfromto([ midbot_registration_bottom_x, middle_base_z + 0.1 ],
+                [ middle_side_wall_x, middle_base_z
+                       - midbot_registration_sz_z ]);
+    }
+  }
+}
 
 module Middle(){ ////toplevel
   difference(){
@@ -198,6 +214,7 @@ module Middle(){ ////toplevel
        linextr(cover_wall_bot_z, middle_top_z)
         rectfromto([ -(board_w/2 + 0.1),  total_y_min             ],
                   [ -total_side_wall_x,  main_y_min - fit_gap_y  ]);
+      MidBotRegistrations();
     }
 
     for (y_c = [strain_0_y_c, strain_1_y_c]) {
@@ -218,7 +235,8 @@ module MiddlePrint(){ ////toplevel
 }
 
 module MiddleElevationForCutout(){
-    rectfromto([ -(middle_side_wall_x + side_x_gap), middle_base_z ],
+    rectfromto([ -(middle_side_wall_x + side_x_gap),
+                   middle_base_z - fit_gap_z ],
               [ +(middle_side_wall_x + side_x_gap), middle_top_z  ]);
 }
 module BottomMainElevation(){
@@ -236,11 +254,17 @@ module Bottom(){ ////toplevel
        BottomMainElevation();
     }
 
-    linextr_y_xz(total_y_min + side_wall_th,
+    linextr_y_xz(midbot_registration_y_around_max,
                 front_y_max - side_wall_th)
       rectfromto([ -board_w/2, bottom_base_z + bottom_floor_th ],
                 [ +board_w/2, 20         ]);
 
+    linextr_y_xz(total_y_min + side_wall_th,
+                front_y_max - side_wall_th)
+      rectfromto([ -midbot_registration_bottom_x,
+                    bottom_base_z + bottom_floor_th ],
+                [ +midbot_registration_bottom_x, 20         ]);
+
     linextr_y_xz(total_y_min - 1,
                 total_y_min + side_wall_th + 1){
       translate([ 0, middle_base_z ]){
@@ -251,10 +275,10 @@ module Bottom(){ ////toplevel
        }
       }
     }
-    minkowski(){
+    RegistrationsMinkowski()
       CoverRegistrations();
-      cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
-    }
+    RegistrationsMinkowski()
+      MidBotRegistrations();
     BottomStrapCutouts(-cover_strap_c_d_y);
   }
 }