## Intersection problem

### Intersection problem

Has anyone any fast / clever ways to determine the intersection status of
two arbitrary cylinders? I am fairly sure there aren't analytic solutions,
but maybe there is some rapidly convergent iterative scheme?

Here's hoping...
--
Julian Gold
Senior Software Engineer
Pepper's Ghost Production

### Intersection problem

> Has anyone any fast / clever ways to determine the intersection status of
> two arbitrary cylinders? I am fairly sure there aren't analytic solutions,
> but maybe there is some rapidly convergent iterative scheme?

A starting point might be to take the axes of the cylinders as two lines
in space and see if their closest points are nearer than the sum of the
radii. If not, the cylinders do not intersect and you don't have to do any
further tests..
If these infinite lines are nearer then you have to check that the points
on each line which are nearest to the other line actually lie within the
cylinders.

What exactly is this calculation for?

-lks
www.chu.cam.ac.uk/home/lk213/

### Intersection problem

Quote:>Has anyone any fast / clever ways to determine the intersection status of
>two arbitrary cylinders? I am fairly sure there aren't analytic
solutions,
>but maybe there is some rapidly convergent iterative scheme?

>Here's hoping...
>--
>Julian Gold

Of course there is an analytic solution, may be not simple but there is.
Here some clues:
Let's suppose for a moment that the two cylinders are of infinite length.
Compute the distance between the two axis of the cylinders (you'll
find the answer to how to do that in the FAQ or some geomtry book).
Let's call L1 the first axis and L2 the second axis, both 3d lines
in 3d space. Let's call A and B points belonging to L1 and L2
respectively such that distance(A,B)=distance(L1,L2).
We know that the line AB is perpendicular to L1 and to L2.
Let's call R1 the radius of the cylinder based on L1 and R2 the
radius based on L2. if d<=R1+R2 there is an intersection.

The problem gets a little more complicate if the two cylinders are
of finite size but I let you figure out this one.

Enjoy,
Eric

Perhaps some of you nice people could lend me a hand.  In attempting to
create and intersection object in POVRay 3.0 for PPC, I ran into some very
intersting and unusual problems.  I had a box object of large x and y, but
a depth (z) of 1.  I wanted to create this box minus a pyramid shaped object
created by a freeware modeller (I forgot the name, sorry).  Either object by
itself would render perfectly, in the exact position that I desired, etc.
However, when I tried the difference{box {blah} object{pyramid{blah}}}
command, the two objects decided to leave the scene.  Gone....nada....  ANy
ideas as to why this happened?  I would appreciate the help.  Oh, by the way,
when I replaced the pyramid object with a sphere or cube, the difference
worked exactly as expected....weird...

Chris Buley