chiark / gitweb /
adafruit-powerboost: battery legend wip
[reprap-play.git] / adafruit-powerboost-1000.scad
1 // -*- C -*-
2
3 psu_sz_nom = [ 11.43*2, 36.20 ];
4
5 //// toplevels-from:
6 include <adafruit-powerboost-common.scad>
7
8 psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
9                  0.55 * 0.5 * 25.4, // from centreline
10                  ];
11
12 psu_led_low_x = 4;
13
14 psu_led_usbend_y_min = 4.5;
15 psu_led_chrg_min_x = -1.0;
16 psu_led_chrg_max_x = 3.0;
17 psu_led_chrg_both_sz_y = 7.0;
18
19 psu_led_low_sz_x = 4.5;
20 psu_led_low_min_y = -1.5;
21 psu_led_low_max_y = 2.5;
22
23 psu_led_baffle_th = 0.8;
24 psu_led_baffle_ends = 1.5;
25
26 psu_baffle_th = [ 0.8, 3.5 ];
27 psu_innerend_led_depth = 7;
28
29 psu_led_legend_battery_l = 6.0;
30 psu_led_legend_battery_w = 4.0;
31 psu_led_legend_battery_edge = 0.75;
32 psu_led_legend_battery_nub_l = 0.75;
33 psu_led_legend_battery_nub_w = 1.5;
34
35 // ----- calculated -----
36
37 module PsuLedBafflePlan(){
38   AtPsuMountCorner(0,0) {
39     translate([ (psu_led_chrg_min_x + psu_led_chrg_max_x)/2,
40                psu_led_usbend_y_min + psu_led_chrg_both_sz_y/2 ])
41       square(center=true,
42              [ psu_led_chrg_max_x - psu_led_chrg_min_x
43                + psu_led_baffle_ends*2,
44                psu_led_baffle_th ]);
45   }
46 }
47
48 module PsuLedWindowsPlanCore(){
49   difference(){
50     union(){
51       // Two LEDs one side of inlet connector
52       // "Full" (near edge) and "Chrg" (inner)
53       AtPsuMountCorner(0,0) {
54         translate([0, psu_led_usbend_y_min ])
55           rectfromto([ psu_led_chrg_min_x, 0 ],
56                      [ psu_led_chrg_max_x,
57                        psu_led_chrg_both_sz_y ]);
58       }
59
60       // One LED, "Low", other side of inlet connector
61       AtPsuMountCorner(1,0) {
62         translate([0, psu_led_usbend_y_min ])
63           rectfromto([ 0,
64                        psu_led_low_min_y ],
65                      [ psu_led_low_sz_x,
66                        psu_led_low_max_y ]);
67       }
68
69       // One LED, PWR, near outlet USB pads
70       AtPsuMountCorner(0,1){
71         rectfromto([0,0],
72                    [psu_sz[0]/2 - psu_hole_pos[1] - psu_hole_dia/2,
73                     psu_innerend_led_depth]);
74       }
75     }
76   }
77 }
78
79 module PsuLedLegendBattery(percent=50){
80   e = psu_led_legend_battery_edge;
81   full_l = percent/100 * (psu_led_legend_battery_l - e*2);
82   difference(){
83     union(){
84       square([psu_led_legend_battery_l,
85               psu_led_legend_battery_w], center=true);
86       translate([psu_led_legend_battery_l/2, 0])
87         square([psu_led_legend_battery_nub_l*2,
88                 psu_led_legend_battery_nub_w], center=true);
89     }
90     translate([-(psu_led_legend_battery_l/2-e),
91                -(psu_led_legend_battery_w/2-e)])
92       square([full_l, psu_led_legend_battery_w - e*2]);
93   }
94 }  
95
96 module PsuLedLegendsPlan(){
97   PsuLedLegendBattery();
98 //  mirror([1,0])
99 //    text("\u2300\u23fb", font="Noto Regular");
100 }