Skip to content

Commit ac27f3e

Browse files
authored
Merge pull request #84 from fe60/master
2 parents 55a1137 + 3df7d3a commit ac27f3e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

shapes.scad

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,20 @@ module tube(
12191219
zrot(realign? 180/sides : 0) {
12201220
difference() {
12211221
cylinder(h=h, r1=r1, r2=r2, center=true, $fn=sides);
1222-
cylinder(h=h+0.05, r1=ir1, r2=ir2, center=true);
1222+
if (ir1 == ir2) {
1223+
cylinder(h=h+2, r1=ir1, r2=ir2, center=true);
1224+
} else {
1225+
cylinder(h=h+2, r=min(ir1,ir2), center=true);
1226+
diff = abs(ir1-ir2);
1227+
diff2 = diff*(h+1)/h;
1228+
if (ir1 > ir2) {
1229+
zmove(-0.5)
1230+
cylinder(h=h+1, r1=ir2+diff2, r2=ir2, center=true);
1231+
} else {
1232+
zmove(0.5)
1233+
cylinder(h=h+1, r1=ir1, r2=ir1+diff2, center=true);
1234+
}
1235+
}
12231236
}
12241237
}
12251238
}

0 commit comments

Comments
 (0)