Last active
December 5, 2025 17:46
-
-
Save adonishi/12ae67f7946b739bb79bbc9c33b534f8 to your computer and use it in GitHub Desktop.
Version 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include <BOSL2/std.scad> | |
| include <BOSL2/walls.scad> | |
| /* [Panel settings] */ | |
| // panel width: 254 = 10 inch | |
| panel_width=254; | |
| // panel height: 44.5: 1U, 89: 2U | |
| panel_height=44.5; | |
| // panel thickness: 3 (shelf thickness in "Misc") | |
| panel_thick=3; | |
| /* [Shelf 1 (Left)] */ | |
| shelf_type1=1; // [1: shelf - Hex, 2: shelf - solid, 3: shelf - thinning_wall, 4: window only, 5: disable] | |
| // width of window/shelf | |
| window_width1=100; // 1.0 [::non-negative] | |
| // height of window/shelf | |
| window_height1=28 ; //[::non-negative] | |
| // depth of shelf | |
| shelf_depth1=100; //[::non-negative float] | |
| // generate top bar for more strength | |
| enable_top_bar1=false; | |
| // bottom foot height between window and shelf bottom. (0 to disable) | |
| bottom_foot_height1=0; // .5 | |
| /* [Shelf 2] */ | |
| shelf_type2=5; // [1: shelf - Hex, 2: shelf - solid, 3: shelf - thinning_wall, 4: window only, 5: disable] | |
| // width of window/shelf | |
| window_width2=36; //[::non-negative] | |
| // height of window/shelf | |
| window_height2=22; //[::non-negative] | |
| // depth of shelf | |
| shelf_depth2=100; //[::non-negative] | |
| // generate top bar for more strength | |
| enable_top_bar2=false; | |
| // bottom foot height between window and shelf bottom. (0 to disable) | |
| bottom_foot_height2 = 0; // .5 | |
| /* [Shelf 3] */ | |
| shelf_type3=5; // [1: shelf - Hex, 2: shelf - solid, 3: shelf - thinning_wall, 4: window only, 5: disable] | |
| // width of window/shelf | |
| window_width3=36; //[::non-negative] | |
| // height of window/shelf | |
| window_height3=22; //[::non-negative] | |
| // depth of shelf | |
| shelf_depth3=100; //[::non-negative] | |
| // generate top bar for more strength | |
| enable_top_bar3=false; | |
| // bottom foot height between window and shelf bottom. (0 to disable) | |
| bottom_foot_height3 = 0; // .5 | |
| /* [Shelf 4] */ | |
| shelf_type4=5; // [1: shelf - Hex, 2: shelf - solid, 3: shelf - thinning_wall, 4: window only, 5: disable] | |
| // width of window/shelf | |
| window_width4=36; //[::non-negative] | |
| // height of window/shelf | |
| window_height4=22; //[::non-negative] | |
| // depth of shelf | |
| shelf_depth4=100; //[::non-negative] | |
| // generate top bar for more strength | |
| enable_top_bar4=false; | |
| // bottom foot height between window and shelf bottom. (0 to disable) | |
| bottom_foot_height4 = 0; // .5 | |
| /* [Shelf 5 (Right)] */ | |
| shelf_type5=5; // [1: shelf - Hex, 2: shelf - solid, 3: shelf - thinning_wall, 4: window only, 5: disable] | |
| // width of window/shelf | |
| window_width5=36; //[::non-negative] | |
| // height of window/shelf | |
| window_height5=22; //[::non-negative] | |
| // depth of shelf | |
| shelf_depth5=100; //[::non-negative] | |
| // generate top bar for more strength | |
| enable_top_bar5=false; | |
| // bottom foot height between window and shelf bottom. (0 to disable) | |
| bottom_foot_height5 = 0; // .5 | |
| /* [misc] */ | |
| // shelf wall thickness | |
| wall_thick=3; | |
| // stopper (triangles at the end of shelf) height & width | |
| stopper_size=6; //[::non-negative] | |
| // depth of top bar, if top bar enabled. | |
| top_bar_depth = 20; | |
| // to enhance strength, enable curve between panel and shelf | |
| enable_curve = true; | |
| /* [misc - hex wall settings] */ | |
| hex_strut=4; | |
| hex_spacing=15; | |
| // solid frame around hex pattern (bottom only) | |
| hex_bottom_frame=10; | |
| /* [Hidden] */ | |
| // note: '+ 0' to disable parameter settings on makerworld. | |
| half_wall_thick=wall_thick/2; | |
| hole_width=13 + 0; | |
| hole_height=6.5 + 0; | |
| hole_x_offset=hole_width/2+1.5; | |
| hole_y_offset=6.35 + 0; // 6.35: from 1U panel spec. | |
| is_shelf1 = shelf_type1<5 && window_width1 > 0 && window_height1 > 0; | |
| is_shelf2 = shelf_type2<5 && window_width2 > 0 && window_height2 > 0; | |
| is_shelf3 = shelf_type3<5 && window_width3 > 0 && window_height3 > 0; | |
| is_shelf4 = shelf_type4<5 && window_width4 > 0 && window_height4 > 0; | |
| is_shelf5 = shelf_type5<5 && window_width5 > 0 && window_height5 > 0; | |
| all_shelf_count = (is_shelf1 ? 1 : 0) + | |
| (is_shelf2 ? 1 : 0) + | |
| (is_shelf3 ? 1 : 0) + | |
| (is_shelf4 ? 1 : 0) + | |
| (is_shelf5 ? 1 : 0); | |
| all_shelf_width = (is_shelf1 ? window_width1 : 0) + | |
| (is_shelf2 ? window_width2 : 0) + | |
| (is_shelf3 ? window_width3 : 0) + | |
| (is_shelf4 ? window_width4 : 0) + | |
| (is_shelf5 ? window_width5 : 0); | |
| assert(panel_width > all_shelf_width, "sum of window width must be less than panel width"); | |
| panel_width_without_hole = panel_width - (1.5 + hole_width)*2; | |
| width_rest_of_hole_shelf = panel_width_without_hole - all_shelf_width; | |
| width_between_shelf = width_rest_of_hole_shelf / (all_shelf_count + 1); | |
| shelf1_x_pos = panel_width/2 - hole_width - width_between_shelf; | |
| shelf2_x_pos = shelf1_x_pos - (is_shelf1 ? window_width1 + width_between_shelf : 0); | |
| shelf3_x_pos = shelf2_x_pos - (is_shelf2 ? window_width2 + width_between_shelf : 0); | |
| shelf4_x_pos = shelf3_x_pos - (is_shelf3 ? window_width3 + width_between_shelf : 0); | |
| shelf5_x_pos = shelf4_x_pos - (is_shelf4 ? window_width4 + width_between_shelf : 0); | |
| module panel_hole() { | |
| cuboid([hole_width, hole_height, panel_thick+1], rounding=3, edges=["Z"]); | |
| } | |
| module panel_and_window() { | |
| translate([0, 0, -panel_thick/2]) { // note: for easy placement, panel is placed under z=0 plane. | |
| difference(){ | |
| half_width=panel_width/2; | |
| half_height=panel_height/2; | |
| // body | |
| cuboid([panel_width, panel_height, panel_thick], rounding=4, edges=["Z"]); | |
| // 4 holes | |
| top_hole_x_pos=half_width-hole_x_offset; | |
| top_hole_y_pos=half_height-hole_y_offset; | |
| translate([top_hole_x_pos, top_hole_y_pos, 0]) panel_hole(); | |
| translate([top_hole_x_pos, -top_hole_y_pos, 0]) panel_hole(); | |
| translate([-top_hole_x_pos, top_hole_y_pos, 0]) panel_hole(); | |
| translate([-top_hole_x_pos, -top_hole_y_pos, 0]) panel_hole(); | |
| // panel windows | |
| if (is_shelf1) { | |
| translate([shelf1_x_pos - window_width1/2, 0, 0]) | |
| cuboid([window_width1, window_height1, panel_thick+1]); | |
| } | |
| if (is_shelf2) { | |
| translate([shelf2_x_pos - window_width2/2, 0, 0]) | |
| cuboid([window_width2, window_height2, panel_thick+1]); | |
| } | |
| if (is_shelf3) { | |
| translate([shelf3_x_pos - window_width3/2, 0, 0]) | |
| cuboid([window_width3, window_height3, panel_thick+1]); | |
| } | |
| if (is_shelf4) { | |
| translate([shelf4_x_pos - window_width4/2, 0, 0]) | |
| cuboid([window_width4, window_height4, panel_thick+1]); | |
| } | |
| if (is_shelf5) { | |
| translate([shelf5_x_pos - window_width5/2, 0, 0]) | |
| cuboid([window_width5, window_height5, panel_thick+1]); | |
| } | |
| } | |
| } | |
| } | |
| module shelf(type, shape, enable_top_bar) { | |
| window_width = shape[0]; | |
| window_height = shape[1]; | |
| shelf_depth = shape[2]; | |
| half_window_width = window_width/2; | |
| half_window_height = window_height/2; | |
| half_shelf_depth = shelf_depth/2; | |
| side_height = window_height + (enable_top_bar ? wall_thick*2 : wall_thick); | |
| side_y_offset = enable_top_bar ? 0 : -half_wall_thick; | |
| side_frame = (window_height>22) ? 5 : | |
| (window_height>17) ? 3 : 1; | |
| is_side_curve = enable_curve && width_between_shelf > 5*2; | |
| is_bottom_curve = enable_curve && (panel_height-window_height-wall_thick) > 16; | |
| // bottom shelf | |
| if (type == 1) { // hex | |
| translate([0, -half_window_height-half_wall_thick, half_shelf_depth]) | |
| hex_panel([window_width, shelf_depth, wall_thick], hex_strut, hex_spacing, frame=hex_bottom_frame, orient=FRONT); | |
| } else if (type == 2) { // solid | |
| translate([0, -half_window_height-half_wall_thick, half_shelf_depth]) | |
| cuboid([window_width, shelf_depth, wall_thick], orient=FRONT); | |
| } else if (type == 3) { // thinning_wall | |
| translate([0, -half_window_height-half_wall_thick, half_shelf_depth]) | |
| thinning_wall(h=window_width, l=shelf_depth, thick=wall_thick, spin=90, orient=LEFT, braces=true); | |
| } | |
| if (is_bottom_curve) { | |
| translate([0, -half_window_height-wall_thick, 0]) | |
| fillet(l=window_width, r=5, spin=270, orient=LEFT); | |
| } | |
| // left panel | |
| if (type == 1) { // hex | |
| translate([half_window_width + half_wall_thick, side_y_offset, half_shelf_depth]) | |
| diff() | |
| hex_panel([shelf_depth, side_height, wall_thick], hex_strut, hex_spacing, frame = side_frame, orient=LEFT) | |
| edge_mask([BOTTOM], except=[LEFT]) | |
| rounding_edge_mask(l=shelf_depth,r=3); | |
| } else if (type == 2) { // solid | |
| translate([half_window_width + half_wall_thick, side_y_offset, half_shelf_depth]) | |
| diff() | |
| cuboid([shelf_depth, side_height, wall_thick], orient=LEFT) | |
| edge_mask([BOTTOM], except=[LEFT]) | |
| rounding_edge_mask(l=shelf_depth,r=3); | |
| } else if (type == 3) { // thinning_wall | |
| translate([half_window_width + half_wall_thick, side_y_offset, half_shelf_depth]) | |
| thinning_wall(h=shelf_depth, l=side_height, thick=wall_thick, orient=UP, braces=true); | |
| } | |
| if (is_side_curve) { | |
| translate([half_window_width+wall_thick, -half_wall_thick, 0]) | |
| fillet(l=window_height-3, r=5, orient=FRONT); | |
| } | |
| // right panel | |
| if (type == 1) { // hex | |
| translate([-half_window_width - half_wall_thick, side_y_offset, half_shelf_depth]) | |
| diff() | |
| hex_panel([shelf_depth, side_height, wall_thick], hex_strut, hex_spacing, frame = side_frame, orient=RIGHT) | |
| edge_mask([BOTTOM], except=[RIGHT]) | |
| rounding_edge_mask(l=shelf_depth,r=3); | |
| } else if (type == 2) { // solid | |
| translate([-half_window_width - half_wall_thick, side_y_offset, half_shelf_depth]) | |
| diff() | |
| cuboid([shelf_depth, side_height, wall_thick], orient=RIGHT) | |
| edge_mask([BOTTOM], except=[RIGHT]) | |
| rounding_edge_mask(l=shelf_depth,r=3); | |
| } else if (type == 3) { // thinning_wall | |
| translate([-half_window_width - half_wall_thick, side_y_offset, half_shelf_depth]) | |
| thinning_wall(h=shelf_depth, l=side_height, thick=wall_thick, orient=DOWN, braces=true); | |
| } | |
| if (is_side_curve) { | |
| translate([-half_window_width-wall_thick, -half_wall_thick, 0]) | |
| fillet(l=window_height-3, r=5, spin=90, orient=FRONT); | |
| } | |
| // top bar | |
| if (enable_top_bar) { | |
| translate([0, half_window_height+half_wall_thick, top_bar_depth/2]) { | |
| cuboid([window_width, top_bar_depth, wall_thick], orient=FRONT) | |
| if (is_bottom_curve) { | |
| translate([0, -top_bar_depth/2, -half_wall_thick]) | |
| fillet(l=window_width, r=5, orient=RIGHT); | |
| } | |
| } | |
| } | |
| // stopper | |
| translate([-half_window_width, -half_window_height, shelf_depth]) | |
| wedge([1,stopper_size,stopper_size], orient=RIGHT); | |
| translate([half_window_width, -half_window_height, shelf_depth-1]) | |
| wedge([1,stopper_size,stopper_size], orient=LEFT); | |
| } | |
| // main | |
| panel_and_window(); | |
| if (is_shelf1) { | |
| if (shelf_type1 < 4) { | |
| shape1 = [window_width1, window_height1 + bottom_foot_height1, shelf_depth1]; | |
| translate([shelf1_x_pos - window_width1/2, -bottom_foot_height1/2, 0]) | |
| shelf(shelf_type1, shape1, enable_top_bar1); | |
| } | |
| } | |
| if (is_shelf2) { | |
| if (shelf_type2 < 4) { | |
| shape2 = [window_width2, window_height2 + bottom_foot_height2, shelf_depth2]; | |
| translate([shelf2_x_pos - window_width2/2, -bottom_foot_height2/2, 0]) | |
| shelf(shelf_type2, shape2, enable_top_bar2); | |
| } | |
| } | |
| if (is_shelf3) { | |
| if (shelf_type3 < 4) { | |
| shape3 = [window_width3, window_height3 + bottom_foot_height3, shelf_depth3]; | |
| translate([shelf3_x_pos - window_width3/2, -bottom_foot_height3/2, 0]) | |
| shelf(shelf_type3, shape3, enable_top_bar3); | |
| } | |
| } | |
| if (is_shelf4) { | |
| if (shelf_type4 < 4) { | |
| shape4 = [window_width4, window_height4 + bottom_foot_height4, shelf_depth4]; | |
| translate([shelf4_x_pos - window_width4/2, -bottom_foot_height4/2, 0]) | |
| shelf(shelf_type4, shape4, enable_top_bar4); | |
| } | |
| } | |
| if (is_shelf5) { | |
| if (shelf_type5 < 4) { | |
| shape5 = [window_width5, window_height5 + bottom_foot_height5, shelf_depth5]; | |
| translate([shelf5_x_pos - window_width5/2, -bottom_foot_height5/2, 0]) | |
| shelf(shelf_type5, shape5, enable_top_bar5); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment