// --- Parameters --- $fn = 100; // Smoothness of curves // Dimensions inlet_od = 40; inlet_id = 35; vertical_height = 10; // The "few mm" height before the turn bend_radius = 20; // Center-line radius of the elbow horizontal_total = 70; // Internal Taper specs taper1_len = 10; taper1_id_end = 30; taper2_id_end = 32.1; taper2_len = horizontal_total - taper1_len; // Outer Taper specs final_od = 36; // Ensures ~2-3mm wall thickness (36 - 32.1 = 3.9mm) // --- Modules --- // Helper to create a tapered cylinder (cone) module tapered_cylinder(h, r1, r2) { cylinder(h = h, r1 = r1, r2 = r2); } module adapter() { difference() { // 1. OUTER SHELL union() { // Vertical section cylinder(h = vertical_height, d = inlet_od); // Elbow section translate([0, 0, vertical_height]) rotate_extrude(angle = 90) translate([bend_radius, 0, 0]) circle(d = inlet_od); // Horizontal sections (Outer Taper) translate([0, bend_radius, vertical_height + bend_radius]) rotate([0, 90, 0]) { // Gradual OD taper from 40mm to final_od over the full 70mm tapered_cylinder(horizontal_total, inlet_od/2, final_od/2); } } // 2. INNER VOID (The Hole) union() { // Vertical void translate([0, 0, -1]) // slight offset for clean cut cylinder(h = vertical_height + 1, d = inlet_id); // Elbow void translate([0, 0, vertical_height]) rotate_extrude(angle = 90) translate([bend_radius, 0, 0]) circle(d = inlet_id); // Horizontal voids (Internal Tapers) translate([0, bend_radius, vertical_height + bend_radius]) rotate([0, 90, 0]) { // First Taper: 35mm -> 30mm over 10mm tapered_cylinder(taper1_len, inlet_id/2, taper1_id_end/2); // Second Taper: 30mm -> 32.1mm over 60mm translate([0, 0, taper1_len]) tapered_cylinder(taper2_len, taper1_id_end/2, taper2_id_end/2); } } } } // Execute adapter();