I want to determine whether a given triangle intersects a tetrahedron. I do not want to compute the solution polygon(if it exists) itself. Is there any library/package/published practical algorithm which can be used to solve this problem directly(unlike my attempt below)?
I think as a last resort I will have to use standard polygon-polygon intersection algorithm implementations to solve this problem indirectly.
My attempt on this problem:
I thought of breaking it into the problem of polygon-polygon intersection. So for each triangular face(say T1) of the tetrahedron and the given triangle T2, I thought of doing the following:
- Compute intersection(a line) between planes corresponding to each triangle, say
L1. - For each triangle:
- For each edge of the triangle say
L2, compute point of intersectionPbetweenL1andL2. - Test(maybe using parametric form) of
L2, if the point lies on the edgeL2.
- For each edge of the triangle say
If for both triangles T1 and T2, there exists at least one edge on which the intersection point P lies, then it implies that the triangles(and hence the given tetrahedron and the triangle T2) do intersect.