5 psu_sz = [ 21.7, 36.0 ] + [ 0.25, 0.25 ];
8 psu_th_for_clamp = 1.50;
10 psu_hole_pos = [ 2.05, // from back edge of psu_sz[0]
11 0.55 * 0.5 * 25.4, // from centreline
13 psu_hole_dia = 2.5 - 0.3;
14 psu_baffle_gap = 1.0 + 0.5;
15 psu_baffle_cnr_y = 7.45; // from connector end
16 psu_baffle_th = [ 0.8, 3.5 ];
17 psu_connector_z = 2.9 + 0.1;
18 psu_connector_z_overlap = 0.15;
19 psu_connector_depth = 6.25;
20 psu_connector_w = 8.0 + 0.5;
22 psu_usbend_led_x = 4.5;
23 psu_innerend_led_depth = 10;
25 psu_clamp_th = 4.0 + 0.75;
29 psu_board_clamp_ovlp = 4.5;
30 psu_board_support_wall = 2;
31 psu_board_nutbox = nutbox_data_M3;
33 psu_y = +psu_sz[1]/2 + psu_usb_protr;
35 // ----- calculated -----
37 psu_usbend_led_depth = psu_baffle_cnr_y*2 - psu_usbend_led_x;
39 psu_z = NutBox_h_base(psu_board_nutbox);
40 psu_z_down = psu_z + 0.1;
43 module PsuBoardRepresentation(){
44 linear_extrude(height= psu_th)
45 square(center=true, [psu_sz[0],psu_sz[1]]);
48 module PsuRepresentation(){
49 PsuBoardRepresentation();
50 translate([0, -psu_sz[1]/2, -psu_connector_z])
51 linear_extrude(height= psu_connector_z + psu_connector_z_overlap)
52 rectfromto([ -psu_connector_w/2, -10 ],
53 [ +psu_connector_w/2, psu_connector_depth ]);
56 module AtPsuMountCorner(mx,my){
59 translate(-0.5 * [psu_sz[0], psu_sz[1], 0]
60 -1 * [0,0, psu_z_down])
64 module PsuMountCornerExtrude(mx,my, plus_z=board_support_z){
65 AtPsuMountCorner(mx,my){
66 linear_extrude(height= psu_z_down + plus_z, convexity=10) {
72 module PsuLedBafflePlan(){
73 baffle_tr = [0, psu_baffle_cnr_y]
74 + 0.5 * [psu_baffle_th[1], psu_baffle_th[0]];
75 translate([0, -psu_sz[1]/2]) {
77 rectfromto([-psu_baffle_th[1]/2, 0],
79 rectfromto([-psu_sz[0]/2 - psu_board_support_wall *2,
80 baffle_tr[1] - psu_baffle_th[0]],
86 module PsuLedWindowsPlan(){
89 AtPsuMountCorner(1,0) {
90 rectfromto([ -(psu_board_support_wall + 0.1),
93 +psu_usbend_led_depth ]);
95 AtPsuMountCorner(0,0) {
96 sz = psu_baffle_cnr_y - psu_board_support_wall - psu_baffle_th[0];
97 translate([0, psu_baffle_cnr_y])
98 rectfromto([ -(psu_board_support_wall + 0.1),
103 AtPsuMountCorner(0,1){
105 [psu_sz[0]/2 - psu_hole_pos[1] - psu_hole_dia/2,
106 psu_innerend_led_depth]);
110 translate([0, -psu_sz[1]/2])
111 square(center=true, [psu_baffle_th[1], psu_sz[1]]);;
115 module PsuMountPositiveMain(){
118 PsuMountCornerExtrude(mx,my){
119 rectfromto(-[1,1]*psu_board_support_wall,
120 +[1,1]*board_support_ovlp);
123 // mount above at plug end
124 PsuMountCornerExtrude(mx,0, psu_th + psu_board_support_wall){
125 rectfromto(-[1,1]*psu_board_support_wall,
127 board_support_ovlp_ceil]);
130 translate([0,0, -psu_z_down])
131 linear_extrude(psu_z_down - psu_baffle_gap, convexity=10)
135 module PsuMountNegative(){
136 axis = [0, -psu_sz[1]/2, psu_th];
139 rotate([atan(2 * board_support_z / psu_sz[1]),
142 PsuBoardRepresentation();
145 module PsuMountPositive(){
148 PsuMountPositiveMain();
149 linextr_y_xz(-psu_y, psu_sz[1]*2) square(100, center=true);
154 PsuBoardRepresentation();
155 translate([0,0,5]) PsuBoardRepresentation();
157 translate([-20,0,-20]) cube(40);
161 PsuMountCornerExtrude(mx,1){
162 translate([psu_sz[0]/2 - psu_hole_pos[1],
164 + board_gap * [1,1] )
165 circle(r= psu_hole_dia/2);
168 translate([0, psu_sz[1]/2 + psu_board_nutbox[0]/2, 0])
170 NutBox(psu_board_nutbox, psu_z_down);
173 module PsuClamp(){ ////toplevel
174 rotate([180,0,0]) difference(){
175 linear_extrude(height=psu_clamp_th + psu_th_for_clamp, convexity=5) {
178 circle(r = fix_sz/2);
179 translate([ -psu_board_nutbox[0]/2, 0])
180 square(center=true, [ psu_board_clamp_ovlp*2, psu_clamp_w ]);
182 circle(r = psu_board_nutbox[0]/2);
185 translate([0,0,-1]) linear_extrude(height=psu_th_for_clamp+1) {
186 translate([ -psu_board_nutbox[0]/2 + psu_clamp_gap, 0 ])
188 translate([0,-20]) square(40);
193 module PsuMountDemo(ceil = 2.5) { ////toplevel
194 translate([0, psu_y, psu_z]) {
197 color("yellow") translate([0,0, -psu_z - ceil])
198 linear_extrude(height=0.4, convexity=10)