chiark / gitweb /
adafruit-powerboost: wip common
[reprap-play.git] / adafruit-powerboost-500.scad
1 // -*- C -*-
2
3 psu_sz  = [ 21.7, 36.0 ] + [ 0.25, 0.25 ];
4
5 include <adafruit-powerboost-common.scad>
6
7 psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
8                  0.55 * 0.5 * 25.4, // from centreline
9                  ];
10
11 psu_baffle_gap = 1.0 + 0.5;
12 psu_baffle_cnr_y = 7.45; // from connector end
13 psu_baffle_th = [ 0.8, 3.5 ];
14 psu_usbend_led_x = 4.5;
15 psu_innerend_led_depth = 10;
16
17 // ----- calculated -----
18
19 psu_usbend_led_depth = psu_baffle_cnr_y*2 - psu_usbend_led_x;
20
21
22 module PsuLedBafflePlan(){
23   baffle_tr = [0, psu_baffle_cnr_y]
24     + 0.5 * [psu_baffle_th[1], psu_baffle_th[0]];
25   translate([0, -psu_sz[1]/2]) {
26     mirror([1,0,0]) {
27       rectfromto([-psu_baffle_th[1]/2, 0],
28                  baffle_tr);
29       rectfromto([-psu_sz[0]/2 - psu_board_support_wall *2,
30                   baffle_tr[1] - psu_baffle_th[0]],
31                  baffle_tr);
32     }
33   }
34 }
35
36 module PsuLedWindowsPlanCore(){
37   difference(){
38     union(){
39       AtPsuMountCorner(1,0) {
40         rectfromto([ -(psu_board_support_wall + 0.1),
41                      +psu_usbend_led_x ],
42                    [ psu_sz[0]/2,
43                      +psu_usbend_led_depth ]);
44       }
45       AtPsuMountCorner(0,0) {
46         sz = psu_baffle_cnr_y - psu_board_support_wall - psu_baffle_th[0];
47         translate([0, psu_baffle_cnr_y])
48           rectfromto([ -(psu_board_support_wall + 0.1),
49                        -sz/2 ],
50                      [ psu_sz[0]/2,
51                        +sz/2 ]);
52       }
53       AtPsuMountCorner(0,1){
54         rectfromto([0,0],
55                    [psu_sz[0]/2 - psu_hole_pos[1] - psu_hole_dia/2,
56                      psu_innerend_led_depth]);
57       }
58     }
59     translate([0, -psu_sz[1]/2])
60       square(center=true, [psu_baffle_th[1], psu_sz[1]]);;
61   }
62 }
63
64 module PsuLedWindowsPlan(){
65   difference(){
66     PsuLedWindowsPlanCore();
67     PsuLedBafflePlan();
68   }
69 }
70