Merge pull request #817 from revarbat/revarbat_dev

Revarbat dev
This commit is contained in:
Revar Desmera 2022-03-29 18:52:48 -07:00 committed by GitHub
commit 08bf83d2d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,14 +1540,16 @@ 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));
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() {