// Inlet variables inlet_length = 250; // 100.5 raggio grande, 200mm lunghezza inlet_radius = 200; inlet_throat_radius = 100; inlet_thickness = 0.25; inlet_segments = 30; // Number of stacked layers (higher = smoother) inlet_curve_factor = 2; // Controls how aggressively the walls curve module inlet() { difference() { union() { for (i = [0:inlet_segments-1]) { h = inlet_length / inlet_segments; t = i / (inlet_segments-1); // Apply power function for curvature r1 = inlet_throat_radius + (inlet_radius - inlet_throat_radius) * pow(t, inlet_curve_factor); r2 = inlet_throat_radius + (inlet_radius - inlet_throat_radius) * pow((i+1) / (inlet_segments-1), inlet_curve_factor); translate([0, 0, i * h]) cylinder(h = h, r1 = r1, r2 = r2, $fn = 75); } } // Inner subtraction (to maintain thickness) union() { for (i = [0:inlet_segments-1]) { h = inlet_length / inlet_segments; t = i / (inlet_segments-1); r1 = (inlet_throat_radius + (inlet_radius - inlet_throat_radius) * pow(t, inlet_curve_factor)) - inlet_thickness; r2 = (inlet_throat_radius + (inlet_radius - inlet_throat_radius) * pow((i+1) / (inlet_segments-1), inlet_curve_factor)) - inlet_thickness; translate([0, 0, i * h]) cylinder(h = h, r1 = r1, r2 = r2, $fn = 75); } } } } // Rotate for correct orientation rotate([0, -90, 0]) inlet(); // Outlet variables outlet_length = 350; outlet_radius = 165; outlet_throat_radius = 100; outlet_thickness = 0.25; outlet_segments = 20; // Number of stacked layers (higher = smoother) outlet_curve_factor = 1.5; // Controls how aggressively the walls curve module outlet() { difference() { union() { for (i = [0:outlet_segments-1]) { h = outlet_length / outlet_segments; t = i / (outlet_segments-1); // Apply power function for curvature r1 = outlet_throat_radius + (outlet_radius - outlet_throat_radius) * pow(t, outlet_curve_factor); r2 = outlet_throat_radius + (outlet_radius - outlet_throat_radius) * pow((i+1) / (outlet_segments-1), outlet_curve_factor); translate([0, 0, i * h]) cylinder(h = h, r1 = r1, r2 = r2, $fn = 75); } } // Inner subtraction (to maintain thickness) union() { for (i = [0:outlet_segments-1]) { h = outlet_length / outlet_segments; t = i / (outlet_segments-1); r1 = (outlet_throat_radius + (outlet_radius - outlet_throat_radius) * pow(t, outlet_curve_factor)) - outlet_thickness; r2 = (outlet_throat_radius + (outlet_radius - outlet_throat_radius) * pow((i+1) / (outlet_segments-1), outlet_curve_factor)) - outlet_thickness; translate([0, 0, i * h]) cylinder(h = h, r1 = r1, r2 = r2, $fn = 75); } } } } // Rotate for correct orientation rotate([0, 90, 0]) outlet();