X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=adafruit-powerboost-common.scad;h=b62643ac8ba297a2ad25efca633c980c1d2e860a;hb=ba7c5b240dcdab5fa3f4e3f7823bb828551471f0;hp=2fe3ce14cc2df19e869893e41e5348cf4cc1c952;hpb=3f0dcf5f65da3d3e05efa1d06d075d66b3ac65d3;p=reprap-play.git diff --git a/adafruit-powerboost-common.scad b/adafruit-powerboost-common.scad index 2fe3ce1..b62643a 100644 --- a/adafruit-powerboost-common.scad +++ b/adafruit-powerboost-common.scad @@ -12,7 +12,7 @@ psu_hole_pos = [ 2.05, // from back edge of psu_sz[0] psu_th = 1.70 + 0.25; psu_th_for_clamp = 1.50; -psu_hole_dia = 2.5 - 0.3; +psu_hole_dia = 2.5 - 0.5; psu_connector_z = 2.9 + 0.1; psu_connector_z_overlap = 0.15; psu_connector_depth = 6.25; @@ -51,6 +51,10 @@ psu_z_down = psu_z + 0.1; psu_fix_sz = NutBox_outer_size(psu_board_nutbox); psu_board_nutbox_y = psu_sz[1]/2 + psu_board_nutbox[0]/2; +psu_mount_outer_sz_x = psu_sz[0] + psu_board_support_wall * 2; // centred +psu_mount_outer_sz_y = psu_y + max(psu_board_support_wall, // at psu_y + psu_board_nutbox_y + psu_fix_sz/2); + module PsuBoardRepresentation(){ linear_extrude(height= psu_th) square(center=true, [psu_sz[0],psu_sz[1]]); @@ -188,6 +192,33 @@ module PsuLedWindowsPlan(){ } } +module PsuLedWindowsWindows(ceil){ + translate([0,0, -psu_z - ceil]) + linextr(0, psu_initial_layer_thick) + offset(delta=psu_window_ledge) + PsuLedWindowsPlan(); +} + +module PsuFirstLayerNegative(ceil){ + translate([0, 0, -psu_z - ceil]) + linextr(-1, psu_initial_layer_thick) + children(); +} + +module PsuMountWindowsNegative(ceil){ + linextr(-10, 0.1) + PsuLedWindowsPlan(); + PsuFirstLayerNegative(ceil) + offset(delta= psu_window_ledge + psu_multicolour_gap) + PsuLedWindowsPlan(); +} + +module PsuLedLegendsNegative(ceil){ + PsuFirstLayerNegative(ceil) + offset(delta= psu_multicolour_gap) + PsuLedLegendsPlan(); +} + module PsuMountDemo() { ////toplevel ceil = psu_test_ceil; @@ -223,21 +254,25 @@ module PsuMountTest() { ////toplevel translate([0, psu_y, psu_z]) PsuMountPositive(); difference(){ - linextr_x_yz(-(psu_sz[0]/2 + 5), - +(psu_sz[0]/2 + 5)){ + + // rectangular box with wall + linextr_x_yz(-psu_mount_outer_sz_x/2, + +psu_mount_outer_sz_x/2) { difference(){ - rectfromto([0, -ceil], [psu_sz[1] + 10, psu_z + 10]); + rectfromto([0, -ceil], + [psu_mount_outer_sz_y, psu_z + 10]); rectfromto([ceil,0], 400*[1,1]); } } + translate([0, psu_y, psu_z]) { PsuMountNegative(); } } } translate([0, psu_y, psu_z]) { - linextr(-10, 0.1) - PsuLedWindowsPlan(); + PsuMountWindowsNegative(ceil); + PsuLedLegendsNegative(ceil); } } } @@ -247,49 +282,56 @@ psu_initial_layer_thick = 0.400; psu_initial_layer_width = 0.750; psu_window_ledge = 0.50; // each side -module PsuMountTestFullLayerFrame(ix) { - sz = psu_sz*2 + [1,1]*psu_initial_layer_width*(3+ix); - translate([0, psu_y]) difference(){ - square(center=true, sz + psu_multicolour_gap*2*[1,1]); - square(center=true, sz); +psu_frame_gap = 1.0; + +module PsuMountLayerFrame(bl, tr, ix) { + gap0 = [1,1] * (psu_frame_gap + psu_initial_layer_width*(ix+0)); + gap1 = [1,1] * (psu_frame_gap + psu_initial_layer_width*(ix+1)); + linextr(0, psu_initial_layer_thick) { + difference(){ + rectfromto(bl-gap1, tr+gap1); + rectfromto(bl-gap0, tr+gap0); + } } } +module PsuMountTestFullLayerFrame(ix) { + PsuMountLayerFrame([-0.5 * psu_mount_outer_sz_x, 0], + [+0.5 * psu_mount_outer_sz_x, + psu_mount_outer_sz_y], + ix); +} module PsuMountTestFullMain() { ////toplevel ceil = psu_test_ceil; - linextr(0, psu_initial_layer_thick) - PsuMountTestFullLayerFrame(2); + PsuMountTestFullLayerFrame(2); difference(){ translate([0,0, ceil]) PsuMountTest(); - - translate([0, psu_y, 0]) { - linextr(-1, psu_initial_layer_thick) { - offset(delta=psu_window_ledge + psu_multicolour_gap) - PsuLedWindowsPlan(); - offset(delta=psu_multicolour_gap) - PsuLedLegendsPlan(); - } - } } } module PsuMountTestFullOneLayer(ix) { + PsuMountTestFullLayerFrame(ix); linextr(0, psu_initial_layer_thick) { - PsuMountTestFullLayerFrame(ix); - children(); + translate([0, psu_y]) children(); } } module PsuMountTestFullText() { ////toplevel PsuMountTestFullOneLayer(0) - offset(delta=psu_window_ledge) PsuLedLegendsPlan(); } module PsuMountTestFullWindows() { ////toplevel - PsuMountTestFullOneLayer(1) - PsuLedWindowsPlan(); + PsuMountTestFullLayerFrame(1); + translate([0, psu_y, psu_z + psu_test_ceil]) + PsuLedWindowsWindows(psu_test_ceil); +} + +module PsuMountTestFullDemo() { ////toplevel + color("blue") PsuMountTestFullMain(); + color("yellow") PsuMountTestFullText(); + %PsuMountTestFullWindows(); }