# Cut triangle with circle

This topic is 2899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've got a triangle (black) and a circle-shaped n-gon (red).

Question:
How do I get the triangles covering the yellow area?

I tried calculating the triangle-circle-intersections to do something with them but then I noticed that there might be cases with no intersections at all.

[attachment=6090:trianglesWithCircles.gif]

##### Share on other sites
I'm not sure, but from looking at your picture I think a good place to start would be:

• For every edge of the triangle, intersect the n-gon for the first vertex to the second vertex and the other way around. If there's an intersection and the intersection point does not overlap with an existing vertex of the n-gon, add the intersection point to the n-gon.
• For every edge of the n-gon that lies within the triangle, look for a triangle vertex that makes up a non-intersecting triangle.
• For every edge of the triangle that does not intersect with the n-gon, look for a n-gon vertex that makes up a non-intersecting triangle.
Let me know if you find a flaw in there .

##### Share on other sites

I've got a triangle (black) and a circle-shaped n-gon (red).

Question:
How do I get the triangles covering the yellow area?

I tried calculating the triangle-circle-intersections to do something with them but then I noticed that there might be cases with no intersections at all.

[attachment=6090:trianglesWithCircles.gif]

I don't have any experience with this kind of problem myself, but perhaps this article will point you in the right direction.

-Josh

##### Share on other sites

I don't have any experience with this kind of problem myself, but perhaps this article will point you in the right direction.

-Josh

perfect key word
thanks

Let me know if you find a flaw in there .

I'll try this first and if it does not work for some reason I'll head on to csg

##### Share on other sites

I'll try this first and if it does not work for some reason I'll head on to csg

Great, please let us know if it worked or not. Just to clarify my first post, the order of the list is of importance and when I say non-intersecting triangle I also mean not intersecting with previously generated triangles.

##### Share on other sites
You'll probably want to focus your search more towards Boolean operations than CSG. CSG is a rendering algorithm that can be accomplished without any actual geometry, like in the 3D modeler POV-Ray. Boolean operations can generate an object that can be rendered as a CSG object, but not necessarily the other way around.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 9
• 11
• 15
• 21