$fn=64; // --- PARAMETERS --- length = 200; // Total length of the raceway base_width = 30; // Outer width of the base base_height = 15; // Height of the base wall_thickness = 1.6; // Wall thickness (optimal for 0.4mm nozzle) snap_radius = 0.8; // Radius of the snap fit ridges clearance = 0.2; // Tolerance for the snap fit // Derived Lid Parameters lid_inner_width = base_width + (2 * snap_radius) + (2 * clearance); lid_outer_width = lid_inner_width + (2 * wall_thickness); lid_cavity_depth = 4.5; lid_height = wall_thickness + lid_cavity_depth; // --- RENDER --- // Place base and lid side-by-side for easy 3D printing raceway_base(); translate([base_width + 15, 0, 0]) raceway_lid(); // --- MODULES --- module raceway_base() { union() { difference() { // Main channel body cube([base_width, length, base_height]); // Inner hollow translate([wall_thickness, -1, wall_thickness]) cube([base_width - (2 * wall_thickness), length + 2, base_height]); // Mounting screw holes with countersink for (y = [30, length/2, length-30]) { // Screw shaft translate([base_width/2, y, -0.1]) cylinder(h=wall_thickness + 0.2, d=4.5); // Countersink translate([base_width/2, y, wall_thickness - 1.2]) cylinder(h=1.3, d1=4.5, d2=8); } } // Left snap ridge (outward facing) translate([0, 0, base_height - 2.5]) rotate([-90, 0, 0]) cylinder(h=length, r=snap_radius); // Right snap ridge (outward facing) translate([base_width, 0, base_height - 2.5]) rotate([-90, 0, 0]) cylinder(h=length, r=snap_radius); } } module raceway_lid() { // Printed upside down for support-free printing union() { difference() { // Main lid body cube([lid_outer_width, length, lid_height]); // Inner cavity translate([wall_thickness, -1, wall_thickness]) cube([lid_inner_width, length + 2, lid_cavity_depth + 1]); } // Left snap ridge (inward facing) translate([wall_thickness, 0, wall_thickness + 3.5]) rotate([-90, 0, 0]) cylinder(h=length, r=snap_radius); // Right snap ridge (inward facing) translate([wall_thickness + lid_inner_width, 0, wall_thickness + 3.5]) rotate([-90, 0, 0]) cylinder(h=length, r=snap_radius); } }