$fn = 64; // --- Parameters --- shelf_width = 200; shelf_depth = 150; shelf_thickness = 25; bracket_width = 140; bracket_depth = 12; bracket_height = 15; prong_length = 85; prong_diameter = 12; prong_spacing = 90; clearance = 0.4; // Tolerance for slip fit screw_diameter = 4.5; screw_head_diameter = 9.0; screw_head_depth = 4.0; // --- Shelf Body --- module floating_shelf() { difference() { // Main body with rounded front corners hull() { translate([-shelf_width/2, 0, 0]) cube([shelf_width, 1, shelf_thickness]); translate([-shelf_width/2 + 5, shelf_depth - 5, 0]) cylinder(r=5, h=shelf_thickness); translate([shelf_width/2 - 5, shelf_depth - 5, 0]) cylinder(r=5, h=shelf_thickness); } // Cutout for the wall bracket base plate translate([-bracket_width/2 - clearance, -0.1, shelf_thickness/2 - bracket_height/2 - clearance]) cube([bracket_width + clearance*2, bracket_depth + 0.1, bracket_height + clearance*2]); // Cutouts for the prongs for (x = [-prong_spacing/2, prong_spacing/2]) { translate([x, bracket_depth - 0.1, shelf_thickness/2]) rotate([-90, 0, 0]) cylinder(h=prong_length + clearance + 0.1, d=prong_diameter + clearance*2); } } } // --- Wall Bracket --- module wall_bracket() { difference() { union() { // Bracket base plate translate([-bracket_width/2, 0, shelf_thickness/2 - bracket_height/2]) cube([bracket_width, bracket_depth, bracket_height]); // Prongs with chamfered tips for easy insertion for (x = [-prong_spacing/2, prong_spacing/2]) { translate([x, bracket_depth, shelf_thickness/2]) rotate([-90, 0, 0]) { cylinder(h=prong_length - 2, d=prong_diameter); translate([0, 0, prong_length - 2]) cylinder(h=2, d1=prong_diameter, d2=prong_diameter - 2); } } } // Mounting screw holes for (x = [-bracket_width/2 + 15, 0, bracket_width/2 - 15]) { translate([x, -0.1, shelf_thickness/2]) rotate([-90, 0, 0]) { // Screw shaft cylinder(h=bracket_depth + 0.2, d=screw_diameter); // Screw head countersink translate([0, 0, bracket_depth - screw_head_depth + 0.1]) cylinder(h=screw_head_depth + 0.2, d1=screw_diameter, d2=screw_head_diameter); } } } } // --- Print Layout --- // Positioned flat on the build plate, separated for easy printing floating_shelf(); translate([0, -120, 0]) wall_bracket();