chiark / gitweb /
digispark-with-cable: wip progress
[reprap-play.git] / digispark-with-cable.scad
index 430ce326957f1f0f0d8230b713245c3e943ee4d1..e6d3d7014966f32aa765b476ce1f1cda0dd01874 100644 (file)
@@ -23,7 +23,6 @@ front_wall_th = 0.75;
 // egress_w = 8.0;
 
 wall_y_min = -board_l - side_wall_th; // XXXX remove
-main_y_min = -board_l - side_wall_th;
 ceil_y_min = wall_y_min - 5;;
 
 small_walls = [
@@ -42,22 +41,33 @@ strain_pitch_along = 10;
 strain_groove_d = 2;
 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;
+
 cable_space_z = 6;
 cable_dia = 5;
 bottom_floor_th = 1.5;
 
 fit_gap_z = 0.5;
+fit_gap_y = 0.25;
 side_x_gap = 0.5;
 
 cover_ceil_th = 0.9;
 
+cover_strap_sz_x = side_wall_th * 3.5;
+
 // calculated
 
+strap_w = strain_w;
+cover_strap_cutout_z = side_wall_th;
+
 top_top_z = usb_wall_h;
 top_base_z = -board_th;
 bottom_base_z = top_base_z - cable_space_z - bottom_floor_th;;
 
 front_y_max = front_wall_th;
+main_y_min = -board_l - side_wall_th;
 
 strain_0_y_c = main_y_min - strain_w/2;
 strain_1_y_c = strain_0_y_c - strain_pitch_along;
@@ -70,13 +80,37 @@ cover_top_z  = top_top_z + cover_ceil_th;
 top_side_wall_x = +board_w/2 + side_wall_th;
 total_side_wall_x = top_side_wall_x + side_wall_th + side_x_gap;
 
+cover_registration_c_dy = -cover_strap_c_d_y - strap_w/2
+  - side_wall_th - cover_registration_sz_y/2;
+
 module BothSides(){
   for (m=[0,1]) {
-    mirror([m,0]) {
+    mirror([m,0,0]) {
       children();
     }
   }
 }
+
+module BottomStrapCutouts(y_c){
+  BothSides(){
+    translate([ -total_side_wall_x, y_c, bottom_base_z ])
+      rotate([0, -45, 0])
+      cube([ side_wall_th,
+            strap_w,
+            10 ],
+          center=true);
+  }
+}
+module CoverStrapCutouts(){
+  BothSides(){
+    translate([ -total_side_wall_x, -cover_strap_c_d_y, cover_top_z ])
+      cube([ cover_strap_sz_x*2,
+            strap_w,
+            cover_strap_cutout_z*2 ],
+          center=true);
+  }
+}
+
 module FrontWallsPlan(slop) {
   BothSides(){
     rectfromto([ -board_w/2 - side_wall_th,    0             ],
@@ -116,6 +150,21 @@ module TopMainWallsPlan() {
             [ +board_w/2 + side_wall_th,            total_y_min ]);
 }
 
+module CoverRegistrations(){
+  linextr_y_xz(cover_registration_c_dy - strap_w/2,
+              cover_registration_c_dy + strap_w/2) {
+    difference(){
+      rectfromto([ -total_side_wall_x,
+                         cover_wall_bot_z - cover_registration_sz_z  ],
+                [ +total_side_wall_x, cover_top_z ]);
+      hull(){
+       TopElevationForCutout();
+       translate([0, -20]) TopElevationForCutout();
+      }
+    }
+  }
+}
+
 module Top(){ ////toplevel
   difference(){
     union(){
@@ -125,6 +174,10 @@ module Top(){ ////toplevel
        TopCeilPlan();
       linextr(-board_th, usb_wall_h)
        TopMainWallsPlan();
+      BothSides()
+       linextr(cover_wall_bot_z, top_top_z)
+        rectfromto([ -(board_w/2 + 0.1),  total_y_min             ],
+                  [ -total_side_wall_x,  main_y_min - fit_gap_y  ]);
     }
 
     for (y_c = [strain_0_y_c, strain_1_y_c]) {
@@ -175,6 +228,11 @@ module Bottom(){ ////toplevel
        }
       }
     }
+    minkowski(){
+      CoverRegistrations();
+      cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
+    }
+    BottomStrapCutouts(-cover_strap_c_d_y);
   }
 }
 
@@ -187,8 +245,14 @@ module CoverMainElevation(){
   }
 }
 module Cover(){ ////toplevel
-  linextr_y_xz(main_y_min, front_y_max)
-    CoverMainElevation();
+  difference(){
+    union(){
+      linextr_y_xz(main_y_min, front_y_max)
+       CoverMainElevation();
+      CoverRegistrations();
+    }
+    CoverStrapCutouts();
+  }
 }
 
 module BottomDemo(){ ////toplevel