revarbat / BOSL

The Belfry OpenScad Library - A library of tools, shapes, and helpers to make OpenScad easier to use.
https://github.com/revarbat/BOSL/wiki
BSD 2-Clause "Simplified" License
557 stars 62 forks source link

[BUG] tube - inner diameters are not perfect if id1 does not equal id2 #83

Closed fe60 closed 3 years ago

fe60 commented 3 years ago

Describe the bug To get a well defined difference, the inner part of a tube is cut out by making the height slightly larger (0.05mm) than the one of the solid [1]. As a result the inner diameters of a tube are not perfect, as soon as d1 does not equal d2. This leads to the little edge at z=0 shown in the screenshot.

[1] https://github.com/revarbat/BOSL/blob/master/shapes.scad#L1220

Code To Reproduce Bug

include <BOSL/constants.scad>
use <BOSL/shapes.scad>
$fn=60;
difference() {
    cyl(d=5, h=6);
    tube(od1=10, id1=5, od2=10, id2=2, h=4, align=V_UP);
}

Expected behavior Perfect dimensions for all inner diameters.

Screenshots ImperfectTube

fe60 commented 3 years ago

Fixed with #84 / 3df7d3a.