$fn=64; // --- Parameters --- // SAE Sizes: 1/16, 5/64, 3/32, 1/8, 5/32, 3/16, 1/4, 5/16, 3/8 // Converted to mm with ~0.4mm clearance for easy drop-in insertion hole_diams = [2.0, 2.4, 2.8, 3.6, 4.4, 5.2, 6.8, 8.4, 10.0]; num_keys = len(hole_diams); spacing = 18; width = 30; min_height = 15; max_height = 45; bottom_thickness = 5; total_length = num_keys * spacing; difference() { // Main body with angled top profile hull() { translate([0, 0, 0]) cube([0.1, width, min_height]); translate([total_length - 0.1, 0, 0]) cube([0.1, width, max_height]); } // Allen key holes and chamfers for (i = [0 : num_keys - 1]) { x_pos = i * spacing + (spacing / 2); // Main shaft hole translate([x_pos, width / 2, bottom_thickness]) cylinder(h = max_height, d = hole_diams[i]); // Calculate approximate top surface height at this hole's X position surface_z = min_height + (max_height - min_height) * (x_pos / total_length); // Chamfer for easier tool insertion translate([x_pos, width / 2, surface_z - 2]) cylinder(h = 5, d1 = hole_diams[i], d2 = hole_diams[i] + 4); } }