From 0dfec1e8ffa63869a569b787163ab2e747d631d5 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 29 Mar 2022 15:50:08 -0700 Subject: [PATCH 1/2] Change default anchor for tube() to CENTER. --- shapes3d.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shapes3d.scad b/shapes3d.scad index cbae66b..8ac9365 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -1547,7 +1547,7 @@ module tube( assert(ir1 <= r1, "Inner radius is larger than outer radius."); assert(ir2 <= r2, "Inner radius is larger than outer radius."); sides = segs(max(r1,r2)); - anchor = get_anchor(anchor, center, BOT, BOT); + anchor = get_anchor(anchor, center, BOT, CENTER); attachable(anchor,spin,orient, r1=r1, r2=r2, l=h) { zrot(realign? 180/sides : 0) { difference() { From 241ce402c0dd9cd7533cd21d3a4396898d618dec Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 29 Mar 2022 16:29:58 -0700 Subject: [PATCH 2/2] Made tube() anchor CENTER by default. --- shapes3d.scad | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shapes3d.scad b/shapes3d.scad index 8ac9365..f072427 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -1500,7 +1500,7 @@ module zcyl( // --- // od = Outer diameter of tube. // id = Inner diameter of tube. -// wall = horizontal thickness of tube wall. Default 0.5 +// wall = horizontal thickness of tube wall. Default 1 // or1 = Outer radius of bottom of tube. Default: value of r) // or2 = Outer radius of top of tube. Default: value of r) // od1 = Outer diameter of bottom of tube. @@ -1540,10 +1540,12 @@ module tube( orr2 = get_radius(r1=or2, r=or, d1=od2, d=od, dflt=undef); irr1 = get_radius(r1=ir1, r=ir, d1=id1, d=id, dflt=undef); irr2 = get_radius(r1=ir2, r=ir, d1=id2, d=id, dflt=undef); + wall = default(wall, 1); r1 = default(orr1, u_add(irr1,wall)); r2 = default(orr2, u_add(irr2,wall)); ir1 = default(irr1, u_sub(orr1,wall)); ir2 = default(irr2, u_sub(orr2,wall)); + assert(all_defined([r1, r2, ir1, ir2]), "Must specify two of inner radius/diam, outer radius/diam, and wall width."); assert(ir1 <= r1, "Inner radius is larger than outer radius."); assert(ir2 <= r2, "Inner radius is larger than outer radius."); sides = segs(max(r1,r2));