Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question
    
Sorry, but what do you mean by 'perpendicular to axis'? –  M.B. Jun 1 '12 at 0:12
    
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$.) –  Nicholas Bishop Jun 1 '12 at 0:14
    
but WHICH axis do you mean? –  tomasz Jun 1 '12 at 0:15
    
An arbitrary one — $axis$ is meant to be a new variable here. –  Nicholas Bishop Jun 1 '12 at 0:18

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Thanks, that looks like a good solution. –  Nicholas Bishop Jun 1 '12 at 0:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.