3 psu_sz_nom = [ 11.43*2, 36.20 ];
6 include <adafruit-powerboost-common.scad>
8 psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
9 0.55 * 0.5 * 25.4, // from centreline
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 = 9.4;
19 psu_led_low_sz_x = 4.5;
20 psu_led_low_min_y = -1.5;
21 psu_led_low_max_y = 3.25;
23 psu_led_baffle_th = 0.8;
24 psu_led_baffle_ends = 1.5;
26 psu_baffle_th = [ 0.8, 3.5 ];
27 psu_innerend_led_depth = 7;
29 psu_led_legend_line = 0.75;
31 psu_led_legend_battery_l = 6.0;
32 psu_led_legend_battery_w = 4.0;
33 psu_led_legend_battery_nub_l = 0.75;
34 psu_led_legend_battery_nub_w = 1.5;
36 psu_led_legend_power_dia = 5.0;
38 psu_led_legend_gap = 1.25;
40 // ----- calculated -----
42 psu_led_legend_battery_edge = psu_led_legend_line;
44 psu_led_legend_power_tick_l =
45 psu_led_legend_power_dia * 0.65;
46 psu_led_legend_power_tick_dy = psu_led_legend_line;
48 psu_led_legend_power_sz_y =
49 psu_led_legend_power_dia/2 + psu_led_legend_power_tick_l/2
50 - psu_led_legend_power_tick_dy;
52 psu_innerend_led_x_midder = - psu_hole_pos[1] - psu_hole_dia/2;
54 module PsuLedBafflePlan(){
55 AtPsuMountCorner(0,0) {
56 translate([ (psu_led_chrg_min_x + psu_led_chrg_max_x)/2,
57 psu_led_usbend_y_min + psu_led_chrg_both_sz_y/2 ])
59 [ psu_led_chrg_max_x - psu_led_chrg_min_x
60 + psu_led_baffle_ends*2,
65 module PsuLedWindowsPlanCore(){
68 // Two LEDs one side of inlet connector
69 // "Full" (near edge) and "Chrg" (inner)
70 AtPsuMountCorner(0,0) {
71 translate([0, psu_led_usbend_y_min ])
72 rectfromto([ psu_led_chrg_min_x, 0 ],
74 psu_led_chrg_both_sz_y ]);
77 // One LED, "Low", other side of inlet connector
78 AtPsuMountCorner(1,0) {
79 translate([0, psu_led_usbend_y_min ])
86 // One LED, PWR, near outlet USB pads
87 AtPsuMountCorner(0,1){
89 [psu_sz[0]/2 + psu_innerend_led_x_midder,
90 psu_innerend_led_depth]);
96 module PsuLedLegendBattery(percent=50){
97 e = psu_led_legend_battery_edge;
98 empty_l = (100-percent)/100 * (psu_led_legend_battery_l - e*2);
101 square([psu_led_legend_battery_l,
102 psu_led_legend_battery_w], center=true);
103 translate([psu_led_legend_battery_l/2, 0])
104 square([psu_led_legend_battery_nub_l*2,
105 psu_led_legend_battery_nub_w], center=true);
108 translate([-(psu_led_legend_battery_l/2-e),
109 -(psu_led_legend_battery_w/2-e)])
110 square([empty_l, psu_led_legend_battery_w - e*2]);
114 module PsuLedLegendPowerSymbol(){
116 tick_mid = [0, psu_led_legend_power_dia/2 - psu_led_legend_power_tick_dy];
118 cut_slope = ( psu_led_legend_gap + psu_led_legend_line/2 ) / tick_mid[1];
119 cut_y = psu_led_legend_power_dia + 1;
122 square([psu_led_legend_line, psu_led_legend_power_tick_l], center=true);
125 circle(r= psu_led_legend_power_dia/2);
126 circle(r= psu_led_legend_power_dia/2 - psu_led_legend_line);
129 [-cut_y * cut_slope, cut_y],
130 [ cut_y * cut_slope, cut_y]]);
132 if(0) translate(tick_mid)
133 square([psu_led_legend_line, psu_led_legend_power_tick_l]
134 + [psu_led_legend_gap*2, 0.1],
139 module PsuLedLegendsPlan(){
140 translate([psu_led_legend_power_dia/2
141 + psu_innerend_led_x_midder
142 + psu_led_legend_gap,
144 - psu_innerend_led_depth/2
147 PsuLedLegendPowerSymbol();
150 translate([-psu_sz[0]/2
151 + psu_led_legend_battery_l/2
153 + psu_led_legend_gap,
155 + psu_led_usbend_y_min
156 + psu_led_chrg_both_sz_y * 0.5
158 psu_led_legend_battery_w + psu_led_legend_gap,
159 psu_led_chrg_both_sz_y * 0.5
162 PsuLedLegendBattery(full ? 100 : 50);
165 translate([psu_sz[0]/2
166 - psu_led_legend_battery_nub_l
167 - psu_led_legend_battery_l/2,
170 + psu_led_usbend_y_min
172 + psu_led_legend_battery_w/2
174 PsuLedLegendBattery(0);