$fn=64; // --- Parameters --- rail_width = 20.5; // Inner width (slightly oversized for clearance) rail_height = 20.5; // Inner height wall_thickness = 3.0; // Wall thickness of the connector insertion_depth = 35; // How far the rail inserts into each side screw_hole_dia = 4.0; // Diameter of the securing screw holes // --- Derived Dimensions --- outer_w = rail_width + (wall_thickness * 2); outer_h = rail_height + (wall_thickness * 2); arm_length = outer_w + insertion_depth; // --- Main Geometry --- difference() { // Outer Shell (L-Shape) union() { // X-Axis Arm cube([arm_length, outer_w, outer_h]); // Y-Axis Arm cube([outer_w, arm_length, outer_h]); } // Inner Hollow Cutouts for Rails union() { // X-Axis Cutout translate([wall_thickness, wall_thickness, wall_thickness]) cube([arm_length, rail_width, rail_height]); // Y-Axis Cutout translate([wall_thickness, wall_thickness, wall_thickness]) cube([rail_width, arm_length, rail_height]); } // Securing Screw Holes // X-Arm Top/Bottom Hole translate([outer_w + (insertion_depth / 2), outer_w / 2, -1]) cylinder(d=screw_hole_dia, h=outer_h + 2); // X-Arm Side Hole translate([outer_w + (insertion_depth / 2), -1, outer_h / 2]) rotate([-90, 0, 0]) cylinder(d=screw_hole_dia, h=outer_w + 2); // Y-Arm Top/Bottom Hole translate([outer_w / 2, outer_w + (insertion_depth / 2), -1]) cylinder(d=screw_hole_dia, h=outer_h + 2); // Y-Arm Side Hole translate([-1, outer_w + (insertion_depth / 2), outer_h / 2]) rotate([0, 90, 0]) cylinder(d=screw_hole_dia, h=outer_w + 2); }