From bd2ea3f28430cf57e1f8b18b58ef0ec5c2a46fae Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sun, 17 Jan 2021 16:34:09 +0000 Subject: [PATCH] Added a rectangular tube. --- tests/tube.scad | 3 +++ utils/tube.scad | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/tests/tube.scad b/tests/tube.scad index bba1441..3e8bf5a 100644 --- a/tests/tube.scad +++ b/tests/tube.scad @@ -27,6 +27,9 @@ module tubes() { translate([50, 10]) tube(10, 8, 30); + + translate([100, 10]) + rectangular_tube([10, 20, 30]); } tubes(); diff --git a/utils/tube.scad b/utils/tube.scad index 98417a9..de0ee71 100644 --- a/utils/tube.scad +++ b/utils/tube.scad @@ -68,3 +68,11 @@ module woven_tube(or, ir, h, center= true, colour = grey(30), colour2, warp = 2, } } } + +module rectangular_tube(size, center = true, thickness = 1, fillet = 0.5) { + extrude_if(size.z, center = center) + difference() { + rounded_square([size.x, size.y], fillet); + rounded_square([size.x - 2 * thickness, size.y - 2 * thickness], fillet); + } +}