diff --git a/readme.md b/readme.md index 96b460b..f806491 100644 --- a/readme.md +++ b/readme.md @@ -5970,6 +5970,7 @@ Simple tube or ring ### Modules | Module | Description | |:--- |:--- | +| `rectangular_tube(size, center = true, thickness = 1, fillet = 0.5)` | Create a retangular tube with filleted corners | | `ring(or, ir)` | Create a ring with specified external and internal radii | | `tube(or, ir, h, center = true)` | Create a tube with specified external and internal radii and height `h` | | `woven_tube(or, ir, h, center= true, colour = grey(30)` | Create a woven tube with specified external and internal radii, height `h`, colours, warp and weft | diff --git a/tests/png/tube.png b/tests/png/tube.png index 6ace38d..9749a8c 100644 Binary files a/tests/png/tube.png and b/tests/png/tube.png differ 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..b362d77 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) { //! Create a retangular tube with filleted corners + 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); + } +}