chiark / gitweb /
adafruit-powerboost: make PsuMountWindowsNegative have window ledges
[reprap-play.git] / adafruit-powerboost-common.scad
index acbf33bca1a14d6d1a8d1734a169e359af0d2faa..505e47247dab9824cc70e814915dc1b142d294a7 100644 (file)
@@ -192,6 +192,15 @@ module PsuLedWindowsPlan(){
   }
 }
 
+module PsuMountWindowsNegative(ceil){
+  linextr(-10, 0.1)
+    PsuLedWindowsPlan();
+  translate([0, 0, -psu_z - ceil])
+    linextr(-1, psu_initial_layer_thick)
+    offset(delta=psu_window_ledge + psu_multicolour_gap)
+    PsuLedWindowsPlan();
+}
+
 module PsuMountDemo() { ////toplevel
   ceil = psu_test_ceil;
 
@@ -227,6 +236,8 @@ module PsuMountTest() { ////toplevel
       translate([0, psu_y, psu_z])
        PsuMountPositive();
       difference(){
+
+       // rectangular box with wall
        linextr_x_yz(-psu_mount_outer_sz_x/2,
                     +psu_mount_outer_sz_x/2) {
          difference(){
@@ -235,15 +246,14 @@ module PsuMountTest() { ////toplevel
            rectfromto([ceil,0], 400*[1,1]);
          }
        }
+
        translate([0, psu_y, psu_z]) {
          PsuMountNegative();
        }
       }
     }
-    translate([0, psu_y, psu_z]) {
-      linextr(-10, 0.1)
-       PsuLedWindowsPlan();
-    }
+    translate([0, psu_y, psu_z])
+      PsuMountWindowsNegative(ceil);
   }
 }
 
@@ -257,9 +267,11 @@ psu_frame_gap = 1.0;
 module PsuMountLayerFrame(bl, tr, ix) {
   gap0 = [1,1] * (psu_frame_gap + psu_initial_layer_width*(ix+0));
   gap1 = [1,1] * (psu_frame_gap + psu_initial_layer_width*(ix+1));
-  difference(){
-    rectfromto(bl-gap1, tr+gap1);
-    rectfromto(bl-gap0, tr+gap0);
+  linextr(0, psu_initial_layer_thick) {
+    difference(){
+      rectfromto(bl-gap1, tr+gap1);
+      rectfromto(bl-gap0, tr+gap0);
+    }
   }
 }
 
@@ -273,8 +285,7 @@ module PsuMountTestFullLayerFrame(ix) {
 module PsuMountTestFullMain() { ////toplevel
   ceil = psu_test_ceil;
 
-  linextr(0, psu_initial_layer_thick)
-    PsuMountTestFullLayerFrame(2);
+  PsuMountTestFullLayerFrame(2);
   
   difference(){
     translate([0,0, ceil])
@@ -282,8 +293,6 @@ module PsuMountTestFullMain() { ////toplevel
 
     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();
       }
@@ -292,8 +301,8 @@ module PsuMountTestFullMain() { ////toplevel
 }
 
 module PsuMountTestFullOneLayer(ix) {
+  PsuMountTestFullLayerFrame(ix);
   linextr(0, psu_initial_layer_thick) {
-    PsuMountTestFullLayerFrame(ix);
     translate([0, psu_y]) children();
   }
 }