chiark / gitweb /
adafruit-powerboost: provide psu_fix_sz
[reprap-play.git] / adafruit-powerboost-common.scad
index a98f42763b4403e47d7c591ab2faa9e35f1edd59..7fc3b976c649504a22a9d1bbd2378e6e35742214 100644 (file)
@@ -5,6 +5,10 @@ include <utils.scad>
 
 psu_sz  = psu_sz_nom + [ 0.11, 0.44 ] + [ 0.25, 0.25 ];
 
+psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
+                0.55 * 0.5 * 25.4, // from centreline
+                ];
+
 psu_th = 1.70 + 0.25;
 psu_th_for_clamp = 1.50;
 
@@ -36,6 +40,7 @@ psu_y = +psu_sz[1]/2 + psu_usb_protr;
 
 psu_z = NutBox_h_base(psu_board_nutbox);
 psu_z_down = psu_z + 0.1;
+psu_fix_sz = NutBox_outer_size(psu_board_nutbox);
 
 module PsuBoardRepresentation(){
   linear_extrude(height= psu_th)
@@ -129,7 +134,7 @@ module PsuClamp(){ ////toplevel
     linear_extrude(height=psu_clamp_th + psu_th_for_clamp, convexity=5) {
       difference(){
        hull(){
-         circle(r = fix_sz/2);
+         circle(r = psu_fix_sz/2);
          translate([ -psu_board_nutbox[0]/2, 0])
            square(center=true, [ psu_board_clamp_ovlp*2, psu_clamp_w ]);
        }
@@ -153,10 +158,41 @@ module PsuLedWindowsPlan(){
 
 module PsuMountDemo(ceil = 2.5) { ////toplevel
   translate([0, psu_y, psu_z]) {
-    PsuMountPositive();
+    difference(){
+      PsuMountPositive();
+      linextr(-20, 0.1)
+       PsuLedWindowsPlan();
+    }
     %PsuMountNegative();
     color("yellow") translate([0,0, -psu_z - ceil])
       linear_extrude(height=0.4, convexity=10)
       PsuLedWindowsPlan();
   }
 }
+
+module PsuMountTest(ceil = 2.5) { ////toplevel
+  $fs = 0.1;
+  $fa = 3;
+  difference(){
+    union(){
+      translate([0, psu_y, psu_z])
+       PsuMountPositive();
+      difference(){
+       linextr_x_yz(-(psu_sz[0]/2 + 5),
+                    +(psu_sz[0]/2 + 5)){
+         difference(){
+           rectfromto([-ceil, -ceil], [psu_sz[1] + 10, psu_z + 10]);
+           rectfromto([0,0], 400*[1,1]);
+         }
+       }
+       translate([0, psu_y, psu_z]) {
+         PsuMountNegative();
+       }
+      }
+    }
+    translate([0, psu_y, psu_z]) {
+      linextr(-10, 0.1)
+       PsuLedWindowsPlan();
+    }
+  }
+}