// --- Parameters --- /* [Primary Dimensions] */ initial_segment_height = 20; // "Goes up a few mm" (adjust for your mount) run_length = 70; // The long section after the turn bend_radius = 15; // Radius of the curve for the "turn" /* [Inner Geometry] */ id_start = 35; // Inner Diameter at start (through elbow) id_mid = 30; // ID after first taper (at 10mm mark) id_end = 32.1; // Final opening ID /* [Outer Geometry] */ od_initial = 40; // Outer Diameter of initial section wall_min = 2.5; // Min wall thickness (ensures at least 2-3mm) /* [Quality Settings] */ $fn = 100; // Resolution of the curves // --- Modules & Calculations --- // A helper to create a tapered cylinder base on inner/outer diameter over a specific length module taper_segment(len, id_start, id_end, od=40) { difference() { cylinder(h = len, d = od); // Outer shell cylinder(h = len, d1 = id_start, d2 = id_end); // Inner bore } } module assembly() { union() { // 1. The Initial Straight Section // This is the "up" section before the right turn. color("cyan") translate([0, 0, 0]) cylinder(h = initial_segment_height, d = od_initial); // 2. The Bend (The Right Turn) // We use a translated/rotated cylinder to create the "elbow". // This creates a smooth transition into the horizontal run. color("orange") translate([0, 0, initial_segment_height]) rotate([0, 90, 0]) // Rotate to turn "right" (depending on how you view it) cylinder(h = bend_radius * 2, d = od_initial); // 3. The Run Section (70mm) // This is handled in two parts because of the varying inner taper. color("green") translate([bend_radius, -run_length, initial_segment_height]) rotate([0, 0, 90]) // Rotate to lay horizontally difference() { // The Outer Shell (Gradual outward curve/conic) // We use a slightly tapered outer diameter if desired, here kept steady // but the inner geometry handles the specific taper logic. cylinder(h = run_length, d = od_initial); // The Inner Bore Transitions // Part A: First 10mm (35 -> 30) translate([0, 0, 0]) cylinder(h = 10, d1 = id_start, d2 = id_mid); // Part B: Remaining 60mm (30 -> 32.1) translate([10, 0, 0]) cylinder(h = 60, d1 = id_mid, d2 = id_end); } } } // Execute assembly();