chiark / gitweb /
adafruit-powerboost: battery legend wip test
[reprap-play.git] / adafruit-powerboost-common.scad
index 14a9b975cb826a5d4e698bd2e852cddda1cee598..84430a05edac938a8cd77dcb9250d226a40e62f7 100644 (file)
@@ -42,6 +42,8 @@ psu_usba_v_space_below = 1.5;
 psu_usba_v_space_w = 1.7;
 psu_usba_v_space_l = 3.0;
 
+psu_test_ceil = 2.5;
+
 // ----- calculated -----
 
 psu_z = NutBox_h_base(psu_board_nutbox);
@@ -82,7 +84,7 @@ module PsuUsbAVSpacePlan(){
   for (x= [-1,+1] * psu_usba_v_apart/2) {
     translate([x, -psu_usba_v_from_edge ]) {
       hull(){
-       for (y= [-1,+1] * (psu_usba_v_space_l - psu_usba_v_space_w)) {
+       for (y= [-1,+1] * 0.5 * (psu_usba_v_space_l - psu_usba_v_space_w)) {
          translate([0,y])
            circle(r= psu_usba_v_space_w);
        }
@@ -173,7 +175,8 @@ module PsuClamp(){ ////toplevel
     }
     linextr(-10,10) {
       rotate(-90)
-      PsuUsbAVSpacePlan();
+       translate([0, -psu_board_nutbox[0]/2])
+       PsuUsbAVSpacePlan();
     }
   }
 }
@@ -185,7 +188,9 @@ module PsuLedWindowsPlan(){
   }
 }
 
-module PsuMountDemo(ceil = 2.5) { ////toplevel
+module PsuMountDemo() { ////toplevel
+  ceil = psu_test_ceil;
+
   translate([0, psu_y, psu_z]) {
     difference(){
       PsuMountPositive();
@@ -209,7 +214,8 @@ module PsuMountDemo(ceil = 2.5) { ////toplevel
   }
 }
 
-module PsuMountTest(ceil = 2.5) { ////toplevel
+module PsuMountTest() { ////toplevel
+  ceil = psu_test_ceil;
   $fs = 0.1;
   $fa = 3;
   difference(){
@@ -235,3 +241,38 @@ module PsuMountTest(ceil = 2.5) { ////toplevel
     }
   }
 }
+
+psu_multicolour_gap = 0.075;
+psu_initial_layer_thick = 0.400;
+psu_initial_layer_width = 0.750;
+psu_window_ledge = 0.50; // each side
+
+module PsuMountTestFullLayerFrame(ix) {
+  sz = psu_sz*2 + [1,1]*psu_initial_layer_width*(3+ix);
+  translate([0, psu_y]) difference(){
+    square(center=true, sz + psu_multicolour_gap*2*[1,1]);
+    square(center=true, sz);
+  }
+}
+
+
+module PsuMountTestFullMain() { ////toplevel
+  ceil = psu_test_ceil;
+
+  linextr(0, psu_initial_layer_thick)
+    PsuMountTestFullLayerFrame(0);
+  
+  difference(){
+    translate([0,0, ceil])
+      PsuMountTest();
+
+    translate([0, psu_y, 0]) {
+      linextr(-1, psu_initial_layer_thick) {
+       offset(delta=psu_window_ledge + psu_multicolour_gap)
+         PsuLedWindowsPlan();
+       offset(delta=psu_multicolour_gap)
+         PsuLedLegendsPlan();
+      }
+    }
+  }
+}