Computing the minimum distance between two hollow tubes provided a method for computing the minimum distance between finite line segments

804 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

For each tube, its point of closest approach can be on its curved surface, or on one of its two rims -- three possibilities. So there are nine possibilities for the two tubes combined. I think the simplest solution is to try all nine (rejecting curved-surface solutions that are off the end of the tube) and pick the smallest. For this you need three different algorithms:

  1. Closest approach of two infinite cylinders;
  2. Closest approach of two circles in $\mathbb R^3$;
  3. Closest approach of a circle and an infinite cylinder.

As far as I can see, none of these is made easier by knowing the distance between two finite line segments.

Edited to add: I just realised that Algorithm 3 must return all local minima (there may be two of them), in case the global minimum is off the end of the tube.

2
On

My intuition says to start by evaluating the case where both cylinders have radius 0. This would give you a jumping off point. After that, you'd be able to narrow down some decent neighborhoods by sheer reason. Then, I'd parametrize the surfaces of the cylinders as vector functions in x, y and z. I think -- and this is just intuition here -- that and answer should pop out, if not by logic as I said before, then by using Lagrange multipliers constrained to the neighborhoods you found with 2 vector functions in x, y and z. Just a thought.