1
$\begingroup$

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?)

$\endgroup$
4
  • $\begingroup$ Sorry, but what do you mean by 'perpendicular to axis'? $\endgroup$
    – M.B.
    Commented Jun 1, 2012 at 0:12
  • $\begingroup$ The circle is in 3D, so giving its center and radius isn't enough to fully describe it (that would be a sphere.) By saying 'perpendicular to $axis$', I mean that the circle's points lie on the plane with $axis$ as its normal (and passing through point $c$.) $\endgroup$ Commented Jun 1, 2012 at 0:14
  • $\begingroup$ but WHICH axis do you mean? $\endgroup$
    – tomasz
    Commented Jun 1, 2012 at 0:15
  • $\begingroup$ An arbitrary one — $axis$ is meant to be a new variable here. $\endgroup$ Commented Jun 1, 2012 at 0:18

1 Answer 1

3
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Thanks, that looks like a good solution. $\endgroup$ Commented Jun 1, 2012 at 0:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .