$fn = 64; // --- Parameters --- arm_length = 200; // Length of the horizontal shelf support wall_length = 150; // Length of the vertical wall mount width = 30; // Width of the bracket thickness = 8; // Thickness of the main arms gusset_thickness = 6; // Thickness of the center support brace hole_dia = 5.5; // Diameter of the screw holes head_dia = 10.5; // Diameter of the screw head (countersink) countersink_depth = 4.5; // Depth of the countersink // --- Main Assembly --- difference() { bracket_body(); // Wall mounting holes (vertical arm) // Staggered bottom holes to allow easy screwdriver access past the gusset wall_hole(wall_length - 20, width / 2); // Top center wall_hole(35, 7); // Bottom offset 1 wall_hole(35, width - 7); // Bottom offset 2 // Shelf mounting holes (horizontal arm) // Staggered back holes to allow easy screwdriver access past the gusset shelf_hole(arm_length - 20, width / 2); // Front center shelf_hole(45, 7); // Back offset 1 shelf_hole(45, width - 7); // Back offset 2 } // --- Modules --- module bracket_body() { union() { // Horizontal arm (shelf support) cube([arm_length - width/2, thickness, width]); translate([arm_length - width/2, 0, width/2]) rotate([-90, 0, 0]) cylinder(h = thickness, d = width); // Vertical arm (wall mount) cube([thickness, wall_length - width/2, width]); translate([0, wall_length - width/2, width/2]) rotate([0, 90, 0]) cylinder(h = thickness, d = width); // Inside corner reinforcement fillet translate([thickness - 0.1, thickness - 0.1, 0]) difference() { cube([6.1, 6.1, width]); translate([6.1, 6.1, -1]) cylinder(h = width + 2, r = 6); } // Center diagonal brace (gusset) translate([0, 0, (width - gusset_thickness) / 2]) linear_extrude(gusset_thickness) polygon([ [thickness - 1, thickness - 1], [arm_length - width, thickness - 1], [thickness - 1, wall_length - width] ]); } } module wall_hole(y, z) { // Drills through the X axis (vertical arm) from inside out translate([thickness + 0.01, y, z]) rotate([0, -90, 0]) { cylinder(h = thickness + 2, d = hole_dia); // Countersink for screw head cylinder(h = countersink_depth, d1 = head_dia, d2 = hole_dia); } } module shelf_hole(x, z) { // Drills through the Y axis (horizontal arm) from bottom up translate([x, -0.01, z]) rotate([-90, 0, 0]) { cylinder(h = thickness + 2, d = hole_dia); // Countersink for screw head cylinder(h = countersink_depth, d1 = head_dia, d2 = hole_dia); } }