$fn=64; // --- Parameters --- num_slots = 12; slot_spacing = 30; shelf_depth = 45; shelf_thickness = 12; backplate_height = 60; backplate_thickness = 8; wedge_width = 6; rack_length = (num_slots * slot_spacing) + 10; // Mounting hole parameters mount_hole_dia = 5; mount_hole_head = 10; // --- Main Model --- difference() { // 1. Solid Body union() { // Backplate cube([rack_length, backplate_thickness, backplate_height]); // Shelf translate([0, 0, backplate_height - shelf_thickness]) cube([rack_length, shelf_depth + backplate_thickness, shelf_thickness]); // Support Wedges (Ends and evenly distributed) for (x = [ 0, (4 * slot_spacing) + 5 - wedge_width/2, (8 * slot_spacing) + 5 - wedge_width/2, rack_length - wedge_width ]) { translate([x, backplate_thickness - 0.1, 0]) support_wedge(wedge_width, shelf_depth - 5, backplate_height - shelf_thickness + 0.1); } } // 2. Subtractions (Slots and Holes) // Screwdriver Slots (Graduated sizes for a complete set) for (i = [1 : num_slots]) { // Calculate graduated sizes: 4 small, 4 medium, 4 large hole_dia = 10 + floor((i - 1) / 4) * 4; // 10mm, 14mm, 18mm slot_width = 6 + floor((i - 1) / 4) * 2; // 6mm, 8mm, 10mm x_pos = (i - 0.5) * slot_spacing + 5; y_pos = backplate_thickness + shelf_depth - 18; z_pos = backplate_height - shelf_thickness - 1; translate([x_pos, y_pos, z_pos]) { // Main resting hole cylinder(h = shelf_thickness + 2, d = hole_dia); // Front U-slot opening translate([-slot_width/2, 0, 0]) cube([slot_width, 40, shelf_thickness + 2]); // Top countersink/chamfer for easy insertion translate([0, 0, shelf_thickness + 1 - 3]) cylinder(h = 3.1, d1 = hole_dia, d2 = hole_dia + 6); } } // Wall Mounting Holes mount_y = backplate_height - shelf_thickness - 20; for (x = [20, rack_length / 2, rack_length - 20]) { translate([x, backplate_thickness + 1, mount_y]) rotate([90, 0, 0]) { // Screw shaft cylinder(h = backplate_thickness + 2, d = mount_hole_dia); // Screw head countersink translate([0, 0, backplate_thickness - 3]) cylinder(h = 4.1, d = mount_hole_head); } } } // --- Helper Modules --- module support_wedge(w, d, h) { hull() { // Back wall alignment cube([w, 0.1, h]); // Top shelf alignment translate([0, 0, h - 0.1]) cube([w, d, 0.1]); } }