$fn = 64; /* * Stepped Slot Wrench Rail (Metric 8-19mm) * Holds 12 wrenches, stepped height, angled slots. */ // --- Parameters --- num_wrenches = 12; // 8mm to 19mm start_size = 8; // Starting metric size spacing = 22; // Distance between slots base_width = 40; // Width of the rail min_height = 20; // Height at the smallest wrench max_height = 50; // Height at the largest wrench min_slot_width = 4.0; // Slot width for 8mm max_slot_width = 8.5; // Slot width for 19mm slot_depth = 18; // Depth of the slots slot_angle = 25; // Degrees to tilt the wrench back margin = 15; // Flange length for mounting flange_height = 8; // Height of mounting flanges difference() { // Main Body union() { // Left Mounting Flange translate([-margin, 0, 0]) cube([margin + 0.1, base_width, flange_height]); // Stepped Rail Sections for(i = [0 : num_wrenches - 1]) { h = min_height + (max_height - min_height) * (i / (num_wrenches - 1)); translate([i * spacing, 0, 0]) cube([spacing + 0.1, base_width, h]); } // Right Mounting Flange translate([num_wrenches * spacing - 0.1, 0, 0]) cube([margin + 0.1, base_width, flange_height]); } // Subtractions for(i = [0 : num_wrenches - 1]) { h = min_height + (max_height - min_height) * (i / (num_wrenches - 1)); w = min_slot_width + (max_slot_width - min_slot_width) * (i / (num_wrenches - 1)); // Main Wrench Slot translate([i * spacing + spacing/2, base_width/2, h]) rotate([-slot_angle, 0, 0]) translate([-w/2, -base_width, -slot_depth]) cube([w, base_width * 2, slot_depth + 30]); // Slot Lead-in (Slightly wider at the top for easy insertion) translate([i * spacing + spacing/2, base_width/2, h]) rotate([-slot_angle, 0, 0]) translate([-(w + 1.5)/2, -base_width, -2]) cube([w + 1.5, base_width * 2, 30]); // Metric Size Labels (Front face) translate([i * spacing + spacing/2, 1, h - 13]) rotate([90, 0, 0]) linear_extrude(2) text(str(start_size + i), size=6, halign="center", valign="center", font="Arial:style=Bold"); } // Left Mounting Hole (Counterbored) translate([-margin/2, base_width/2, -1]) { cylinder(h = flange_height + 2, d = 4.5); translate([0, 0, 5]) cylinder(h = flange_height, d = 9); } // Right Mounting Hole (Counterbored) translate([num_wrenches * spacing + margin/2, base_width/2, -1]) { cylinder(h = flange_height + 2, d = 4.5); translate([0, 0, 5]) cylinder(h = flange_height, d = 9); } }