[Math] 3D intersection point between circle and triangle

3dcirclestriangles

Given a 3D triangle with vertices $(v0, v1, v2)$ and a 3D circle of radius $r$, centered at $c$, and lying in the plane perpendicular to $axis$, how can I test for intersection points between them? Note that I'm only interested in the circle's boundary (i.e. it's not a filled-in disk.)

I could approximate it by subdividing the circle into $n$ line segments and doing line/triangle intersection tests for each, but I figure a direct solution should be faster.

Perhaps a circle/plane test can help (followed by a test to see if the intersections are inside the triangle), but I'm not sure how to do that in 3D (and if the the circle lies on the plane too, giving infinitely many intersections, how to test if any of those lie inside the triangle?)

Best Answer

The simplest solution I can think of is:

  1. Find the line of intersection of the plane of the circle and the plane of the triangle
  2. Find intersections of the circle and the line (if any).
  3. Check if any of those points (if they exist) lies within the triangle.

I don't think the details should be very hard to work out.

Now I noticed that there's the case where the circle and the triangle are coplanar, which is really a different task altogether. In this case the separate solution would be: find intersections between the border of the triangle (if any, it's a matter of some quadratic equations and linear inequalities), then all intersections with the full triangle are some of the arcs between the intersections with the border. To see which, just test one point within each arc.

Related Question