Say I have a method of calculating the minimum distance between two finite line segments in three-dimensional space. How might I adapt this method to provide the minimum distance between the surfaces of two hollow tubes of radii $R_1$ & $R_2$ and respective lengths $L_1$ & $L_2$?
At the limit of having long hollow tubes, where the point of closest approach is near their respective mid-points, the simpler line segment to line segment distance suffices. However, how does one handle the case where the tubes fail to have the same slope and the point of closest approach is near one or the other tube's end?
Note - There are no circular 'end-caps' on the tubes referenced in this problem.