// Last edited on 2020-04-05 21:43:08 by jstolfi #macro straight_tube( xlo, xhi, orad, th, eps ) // A piece of straight tube. // {xlo,xhi} Min and max X of tube. // {orad} Outer radius of tube. // {th} Thickness of walls. // {eps} Fudge radial displacement of walls. // The tube axis is the X axis. The tube extends // in X from {xlo} to {xhi}. The walls are // displaced inwards by {eps}. #local tau = 0.01*(xhi-xlo); // Displacement for ends of borer. #local obj = difference{ cylinder{ < xlo, 0, 0 >, < xhi, 0, 0 >, orad - eps } cylinder{ < xlo-tau, 0, 0 >, < xhi+tau, 0, 0 >, orad - th + eps } } obj #end