From 1bc06881cec07ceaafc0b98310b2424feda5f354 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Sun, 29 May 2016 21:12:15 +0000 Subject: toroidal duct --- diff --git a/fanduct.scad b/fanduct.scad index a843023..41048bf 100644 --- a/fanduct.scad +++ b/fanduct.scad @@ -34,17 +34,19 @@ module fanduct(type=type) { // *** duct is all around! module duct(what) { if(what=="in") { + sh = fanduct_w+2*fanduct_shell; sv = fanduct_h+2*fanduct_shell; + smax = max(sh,sv); rotate_extrude($fn=smooth_f) - translate([fanduct_ir,0]) - square([fanduct_w+2*fanduct_shell,fanduct_h+2*fanduct_shell]); + translate([sh/2+fanduct_ir,sv/2]) + scale([sh/smax,sv/smax]) + circle(d=smax,$fn=4*smax); }else if(what=="out") { + sh = fanduct_w; sv = fanduct_h; + smax = max(sh,sv); rotate_extrude($fn=smooth_f) - translate([fanduct_ir+fanduct_shell,fanduct_shell]) - union() { - square([fanduct_w,fanduct_h/2]); - translate([fanduct_w/2,fanduct_h-fanduct_w/2]) - rotate([0,0,90]) circle(d=fanduct_w,$fn=36); - } + translate([sh/2+fanduct_shell+fanduct_ir,sv/2+fanduct_shell]) + scale([sh/smax,sv/smax]) + circle(d=smax,$fn=4*smax); } } -- cgit v0.9.0.2