$fn=64; // Parameters length = 100; // Total length of the raceway width = 30; // Outer width of the base height = 20; // Height of the base wall_thickness = 2; // Thickness of the walls tolerance = 0.2; // Tolerance for the snap fit snap_depth = 0.8; // Depth of the snap ridges // Layout parts side-by-side, oriented flat for 3D printing translate([-width/2 - 5, 0, 0]) rotate([-90, 0, 0]) raceway_base(); translate([width/2 + 5, 0, 0]) rotate([-90, 0, 0]) raceway_lid(); module raceway_base() { linear_extrude(height = length) { union() { // Main U-channel difference() { translate([-width/2, 0]) square([width, height]); translate([-width/2 + wall_thickness, wall_thickness]) square([width - 2*wall_thickness, height]); } // Left snap ridge (with 0.1mm overlap for manifold union) translate([-width/2 + 0.1, height - 4]) polygon([[0,0], [-snap_depth - 0.1, 1], [0, 2]]); // Right snap ridge translate([width/2 - 0.1, height - 4]) polygon([[0,0], [snap_depth + 0.1, 1], [0, 2]]); } } } module raceway_lid() { lid_inner_w = width + 2*tolerance; lid_outer_w = lid_inner_w + 2*wall_thickness; lid_leg_h = 6; linear_extrude(height = length) { union() { // Main lid body difference() { translate([-lid_outer_w/2, 0]) square([lid_outer_w, lid_leg_h + wall_thickness]); // Hollow out the inside of the lid translate([-lid_inner_w/2, wall_thickness]) square([lid_inner_w, lid_leg_h + 1]); } // Left snap catch (with 0.1mm overlap for manifold union) translate([-lid_inner_w/2 - 0.1, wall_thickness + 2 + tolerance]) polygon([[0,0], [snap_depth + 0.1, 1], [0, 2]]); // Right snap catch translate([lid_inner_w/2 + 0.1, wall_thickness + 2 + tolerance]) polygon([[0,0], [-snap_depth - 0.1, 1], [0, 2]]); } } }