I have 2 cylinders in 3d space. Of each cylinder, I know the origin, the diameter and the normal vector (normal to the circle that defines the cylinder).
Now i wrapp a rope from one cylinder to the other. I know the direction of the wrapp on each cylinder and also the height, where the rope touches each cylinder. Here's a picture of what i'm trying to say:
Rope wrapped around 2 cylinders
The rope is allways wrapped perpendicular on the cylinder, so its actually only 2 circles in space.
I dont know how i would calculate that. My approach was first (remember, the cylinders dont have to be on the same plane, nor look in the same direction) to look at the plane of the first circle, and project the other circle on the same plane. Then i can calcualte the tangents of the circle and the projected ellipse. After that, I intersect the plane, that is formed by the tangent and the normal vector of the first circle, with the second circle. This gives me the starting and endpoint of the rope on each cylinder. Here are some pictures of that:
Tangent of circle 1 and projected ellipse of circle 2
Solution of tangent plane intersected with second circle
But the problem with that is, it doesn't work, when the cylinders are 90° degrees to each other because then, the circle gets projected as a line.
First of all, I'm looking for an idea on how to solve that. But if you have some equations, I would also be really happy.
Thanks for your help
David
Just to explain how I did it in the end:
Do that until the residium gets really small
Here's a picture
Notice the picture shows an easy case where this iteration is not need. But that is only because it's easier to draw that way. This algorithm works allways. No matter the orientation of the cylinders to each other.