Cut triangle with circle

Started by
4 comments, last by MarkS_ 12 years, 5 months ago
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]
Advertisement
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 :lol:.

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

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


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 :D


Let me know if you find a flaw in there :lol:.


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

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.
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.

This topic is closed to new replies.

Advertisement