chiark / gitweb /
rpi-mount: copy from other repo
[reprap-play.git] / adafruit-powerboost-common.scad
index fd632449084766324aebbdaa8691aa11348e0a4a..b62643ac8ba297a2ad25efca633c980c1d2e860a 100644 (file)
@@ -192,9 +192,31 @@ module PsuLedWindowsPlan(){
   }
 }
 
-module PsuMountWindowsNegative(){
+module PsuLedWindowsWindows(ceil){
+  translate([0,0, -psu_z - ceil])
+    linextr(0, psu_initial_layer_thick)
+    offset(delta=psu_window_ledge)
+    PsuLedWindowsPlan();
+}
+
+module PsuFirstLayerNegative(ceil){
+  translate([0, 0, -psu_z - ceil])
+    linextr(-1, psu_initial_layer_thick)
+    children();
+}
+
+module PsuMountWindowsNegative(ceil){
   linextr(-10, 0.1)
     PsuLedWindowsPlan();
+  PsuFirstLayerNegative(ceil)
+    offset(delta= psu_window_ledge + psu_multicolour_gap)
+    PsuLedWindowsPlan();
+}
+
+module PsuLedLegendsNegative(ceil){
+  PsuFirstLayerNegative(ceil)
+    offset(delta= psu_multicolour_gap)
+    PsuLedLegendsPlan();
 }
 
 module PsuMountDemo() { ////toplevel
@@ -248,8 +270,10 @@ module PsuMountTest() { ////toplevel
        }
       }
     }
-    translate([0, psu_y, psu_z])
-      PsuMountWindowsNegative();
+    translate([0, psu_y, psu_z]) {
+      PsuMountWindowsNegative(ceil);
+      PsuLedLegendsNegative(ceil);
+    }
   }
 }
 
@@ -263,9 +287,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);
+    }
   }
 }
 
@@ -279,27 +305,17 @@ 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])
       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();
-      }
-    }
   }
 }
 
 module PsuMountTestFullOneLayer(ix) {
+  PsuMountTestFullLayerFrame(ix);
   linextr(0, psu_initial_layer_thick) {
-    PsuMountTestFullLayerFrame(ix);
     translate([0, psu_y]) children();
   }
 }
@@ -309,9 +325,9 @@ module PsuMountTestFullText() { ////toplevel
     PsuLedLegendsPlan();
 }
 module PsuMountTestFullWindows() { ////toplevel
-  PsuMountTestFullOneLayer(1)
-    offset(delta=psu_window_ledge)
-    PsuLedWindowsPlan();
+  PsuMountTestFullLayerFrame(1);
+  translate([0, psu_y, psu_z + psu_test_ceil])
+    PsuLedWindowsWindows(psu_test_ceil);
 }
 
 module PsuMountTestFullDemo() { ////toplevel