$fn = 64; // --- Parameters --- num_slots = 6; slot_spacing = 35; slot_width = 8; slot_depth = 25; shelf_depth = 40; back_height = 35; thickness = 4.5; hole_diameter = 4.5; rack_width = num_slots * slot_spacing; // --- Main Object --- difference() { union() { // Back mounting plate cube([rack_width, thickness, back_height]); // Horizontal shelf // Overlapped slightly into the back plate to ensure manifold geometry translate([0, thickness - 0.1, back_height - thickness]) cube([rack_width, shelf_depth + 0.1, thickness]); // Support gussets gusset(0); // Left gusset((rack_width / 2) - (thickness / 2)); // Center gusset(rack_width - thickness); // Right } // Screwdriver slots for (i = [0 : num_slots - 1]) { x_pos = (i * slot_spacing) + (slot_spacing / 2); translate([x_pos, thickness + shelf_depth - slot_depth, back_height - thickness - 1]) slot_cutout(); } // Mounting holes mount_hole(slot_spacing / 2); mount_hole(rack_width - (slot_spacing / 2)); } // --- Modules --- module gusset(x_pos) { translate([x_pos, thickness - 0.1, 0]) hull() { // Base against back plate cube([thickness, 0.1, back_height]); // Tip under the front of the shelf translate([0, shelf_depth - 0.1, back_height - thickness]) cube([thickness, 0.1, thickness]); } } module slot_cutout() { // Back rounded edge of the slot cylinder(d=slot_width, h=thickness + 2); // Straight channel translate([-slot_width / 2, 0, 0]) cube([slot_width, slot_depth + 5, thickness + 2]); // Flared opening to easily slide screwdrivers in translate([0, slot_depth, 0]) hull() { translate([-slot_width / 2, 0, 0]) cube([slot_width, 0.1, thickness + 2]); translate([-slot_width * 1.5, 5, 0]) cube([slot_width * 3, 0.1, thickness + 2]); } } module mount_hole(x_pos) { translate([x_pos, -1, back_height / 2]) rotate([-90, 0, 0]) { // Main screw hole cylinder(d=hole_diameter, h=thickness + 2); // Countersink for screw head translate([0, 0, thickness - 1.5]) cylinder(d1=hole_diameter, d2=hole_diameter * 2.5, h=3); } }