6 psu_sz = psu_sz_nom + [ 0.11, 0.44 ] + [ 0.25, 0.25 ];
8 psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
9 0.55 * 0.5 * 25.4, // from centreline
13 psu_th_for_clamp = 1.50;
15 psu_hole_dia = 2.5 - 0.3;
16 psu_connector_z = 2.9 + 0.1;
17 psu_connector_z_overlap = 0.15;
18 psu_connector_depth = 6.25;
19 psu_connector_w = 8.0 + 0.5;
22 psu_clamp_th = 4.0 + 0.75;
26 psu_board_clamp_ovlp = 4.5;
27 psu_board_nutbox = nutbox_data_M3;
30 psu_board_support_wall = 2;
31 psu_board_support_ovlp = 4.5;
32 psu_board_support_ovlp_ceil = 2;
33 psu_board_support_z = 2;
35 psu_baffle_gap = 1.0 + 0.5;
37 psu_y = +psu_sz[1]/2 + psu_usb_protr;
39 psu_usba_v_apart = 7.0;
40 psu_usba_v_from_edge = 4.86;
41 psu_usba_v_space_below = 1.5;
42 psu_usba_v_space_w = 1.7;
43 psu_usba_v_space_l = 3.0;
47 // ----- calculated -----
49 psu_z = NutBox_h_base(psu_board_nutbox);
50 psu_z_down = psu_z + 0.1;
51 psu_fix_sz = NutBox_outer_size(psu_board_nutbox);
52 psu_board_nutbox_y = psu_sz[1]/2 + psu_board_nutbox[0]/2;
54 module PsuBoardRepresentation(){
55 linear_extrude(height= psu_th)
56 square(center=true, [psu_sz[0],psu_sz[1]]);
59 module PsuRepresentation(){
60 PsuBoardRepresentation();
61 translate([0, -psu_sz[1]/2, -psu_connector_z])
62 linear_extrude(height= psu_connector_z + psu_connector_z_overlap)
63 rectfromto([ -psu_connector_w/2, -10 ],
64 [ +psu_connector_w/2, psu_connector_depth ]);
67 module AtPsuMountCorner(mx,my){
70 translate(-0.5 * [psu_sz[0], psu_sz[1], 0]
71 -1 * [0,0, psu_z_down])
75 module PsuMountCornerExtrude(mx,my, plus_z=psu_board_support_z){
76 AtPsuMountCorner(mx,my){
77 linear_extrude(height= psu_z_down + plus_z, convexity=10) {
83 module PsuUsbAVSpacePlan(){
84 for (x= [-1,+1] * psu_usba_v_apart/2) {
85 translate([x, -psu_usba_v_from_edge ]) {
87 for (y= [-1,+1] * 0.5 * (psu_usba_v_space_l - psu_usba_v_space_w)) {
89 circle(r= psu_usba_v_space_w);
96 module PsuMountPositiveMain(){
99 PsuMountCornerExtrude(mx,my){
100 rectfromto(-[1,1]*psu_board_support_wall,
101 +[1,1]*psu_board_support_ovlp);
104 // mount above at plug end
105 PsuMountCornerExtrude(mx,0, psu_th + psu_board_support_wall){
106 rectfromto(-[1,1]*psu_board_support_wall,
107 [psu_board_support_ovlp,
108 psu_board_support_ovlp_ceil]);
111 translate([0,0, -psu_z_down])
112 linear_extrude(psu_z_down - psu_baffle_gap, convexity=10)
116 module PsuMountNegative(){
117 axis = [0, -psu_sz[1]/2, psu_th];
120 rotate([atan(2 * psu_board_support_z / psu_sz[1]),
123 PsuBoardRepresentation();
126 module PsuMountPositive(){
129 PsuMountPositiveMain();
130 linextr_y_xz(-psu_y, psu_sz[1]*2) square(100, center=true);
135 PsuBoardRepresentation();
136 translate([0,0,5]) PsuBoardRepresentation();
138 translate([-20,0,-20]) cube(40);
142 PsuMountCornerExtrude(mx,1){
143 translate([psu_sz[0]/2 - psu_hole_pos[1],
145 + psu_board_gap * [1,1] )
146 circle(r= psu_hole_dia/2);
150 translate([0, psu_board_nutbox_y, 0])
152 NutBox(psu_board_nutbox, psu_z_down);
153 translate([0, psu_sz[1]/2, 0])
154 linextr(-psu_usba_v_space_below, +10)
159 module PsuClamp(){ ////toplevel
160 rotate([180,0,0]) difference(){
161 linear_extrude(height=psu_clamp_th + psu_th_for_clamp, convexity=5) {
164 circle(r = psu_fix_sz/2);
165 translate([ -psu_board_nutbox[0]/2, 0])
166 square(center=true, [ psu_board_clamp_ovlp*2, psu_clamp_w ]);
168 circle(r = psu_board_nutbox[0]/2);
171 translate([0,0,-1]) linear_extrude(height=psu_th_for_clamp+1) {
172 translate([ -psu_board_nutbox[0]/2 + psu_clamp_gap, 0 ])
174 translate([0,-20]) square(40);
178 translate([0, -psu_board_nutbox[0]/2])
184 module PsuLedWindowsPlan(){
186 PsuLedWindowsPlanCore();
191 module PsuMountDemo() { ////toplevel
192 ceil = psu_test_ceil;
194 translate([0, psu_y, psu_z]) {
202 color("yellow") translate([0,0, -psu_z - ceil])
203 linear_extrude(height=0.4, convexity=10)
206 color("blue") translate([0,0, -psu_z - ceil])
207 linear_extrude(height=0.4, convexity=10)
210 translate([0, psu_board_nutbox_y, 10])
217 module PsuMountTest() { ////toplevel
218 ceil = psu_test_ceil;
223 translate([0, psu_y, psu_z])
226 linextr_x_yz(-(psu_sz[0]/2 + 5),
229 rectfromto([0, -ceil], [psu_sz[1] + 10, psu_z + 10]);
230 rectfromto([ceil,0], 400*[1,1]);
233 translate([0, psu_y, psu_z]) {
238 translate([0, psu_y, psu_z]) {
245 psu_multicolour_gap = 0.075;
246 psu_initial_layer_thick = 0.400;
247 psu_initial_layer_width = 0.750;
248 psu_window_ledge = 0.50; // each side
250 module PsuMountTestFullLayerFrame(ix) {
251 sz = psu_sz*2 + [1,1]*psu_initial_layer_width*(3+ix);
252 translate([0, psu_y]) difference(){
253 square(center=true, sz + psu_multicolour_gap*2*[1,1]);
254 square(center=true, sz);
259 module PsuMountTestFullMain() { ////toplevel
260 ceil = psu_test_ceil;
262 linextr(0, psu_initial_layer_thick)
263 PsuMountTestFullLayerFrame(2);
266 translate([0,0, ceil])
269 translate([0, psu_y, 0]) {
270 linextr(-1, psu_initial_layer_thick) {
271 offset(delta=psu_window_ledge + psu_multicolour_gap)
273 offset(delta=psu_multicolour_gap)
280 module PsuMountTestFullOneLayer(ix) {
281 linextr(0, psu_initial_layer_thick) {
282 PsuMountTestFullLayerFrame(ix);
283 translate([0, psu_y]) children();
287 module PsuMountTestFullText() { ////toplevel
288 PsuMountTestFullOneLayer(0)
289 offset(delta=psu_window_ledge)
292 module PsuMountTestFullWindows() { ////toplevel
293 PsuMountTestFullOneLayer(1)
297 module PsuMountTestFullDemo() { ////toplevel
298 color("blue") PsuMountTestFullMain();
299 color("yellow") PsuMountTestFullText();
300 %PsuMountTestFullWindows();