$fn = 64; // --- Parameters --- rail_length = 300; rail_width = 35; rail_thickness = 15; dovetail_top_width = 15; dovetail_bottom_width = 25; dovetail_depth = 7; hole_diameter = 4.5; countersink_diameter = 9.5; countersink_depth = 4.5; hole_positions = [30, 90, 150, 210, 270]; // --- Module --- module wall_rail() { difference() { // Main body translate([0, -rail_width/2, 0]) cube([rail_length, rail_width, rail_thickness]); // Dovetail slot cut translate([-1, 0, rail_thickness - dovetail_depth]) rotate([90, 0, 90]) linear_extrude(rail_length + 2) polygon([ [-dovetail_bottom_width/2, -0.01], [dovetail_bottom_width/2, -0.01], [dovetail_top_width/2, dovetail_depth + 0.1], [-dovetail_top_width/2, dovetail_depth + 0.1] ]); // Mounting holes for (x = hole_positions) { // Main screw shaft translate([x, 0, -1]) cylinder(d=hole_diameter, h=rail_thickness + 2); // Countersink for screw head translate([x, 0, rail_thickness - dovetail_depth - countersink_depth]) cylinder(d1=hole_diameter, d2=countersink_diameter, h=countersink_depth + 0.01); // Clearance above countersink to ensure flush seating translate([x, 0, rail_thickness - dovetail_depth]) cylinder(d=countersink_diameter, h=dovetail_depth + 1); } } } // --- Render --- wall_rail();