mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-06 12:19:47 +00:00
commit
08bf83d2d2
1 changed files with 4 additions and 2 deletions
|
@ -1500,7 +1500,7 @@ module zcyl(
|
||||||
// ---
|
// ---
|
||||||
// od = Outer diameter of tube.
|
// od = Outer diameter of tube.
|
||||||
// id = Inner 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)
|
// or1 = Outer radius of bottom of tube. Default: value of r)
|
||||||
// or2 = Outer radius of top of tube. Default: value of r)
|
// or2 = Outer radius of top of tube. Default: value of r)
|
||||||
// od1 = Outer diameter of bottom of tube.
|
// 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);
|
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);
|
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);
|
irr2 = get_radius(r1=ir2, r=ir, d1=id2, d=id, dflt=undef);
|
||||||
|
wall = default(wall, 1);
|
||||||
r1 = default(orr1, u_add(irr1,wall));
|
r1 = default(orr1, u_add(irr1,wall));
|
||||||
r2 = default(orr2, u_add(irr2,wall));
|
r2 = default(orr2, u_add(irr2,wall));
|
||||||
ir1 = default(irr1, u_sub(orr1,wall));
|
ir1 = default(irr1, u_sub(orr1,wall));
|
||||||
ir2 = default(irr2, u_sub(orr2,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(ir1 <= r1, "Inner radius is larger than outer radius.");
|
||||||
assert(ir2 <= r2, "Inner radius is larger than outer radius.");
|
assert(ir2 <= r2, "Inner radius is larger than outer radius.");
|
||||||
sides = segs(max(r1,r2));
|
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) {
|
attachable(anchor,spin,orient, r1=r1, r2=r2, l=h) {
|
||||||
zrot(realign? 180/sides : 0) {
|
zrot(realign? 180/sides : 0) {
|
||||||
difference() {
|
difference() {
|
||||||
|
|
Loading…
Reference in a new issue