Sign in to follow this  
lephyrius

Polygon triangulation library that handles holes?

Recommended Posts

I want to know if there is a free polygon triangulation library that handles holes inside polygons. I want it to be small and not like CGAL or WildMagic more like GPC library. The only problem with GPC is that it creates triangle strip not only triangles.

Share this post


Link to post
Share on other sites
Quote:
Original post by lephyrius
I want to know if there is a free polygon triangulation library that handles holes inside polygons. I want it to be small and not like CGAL or WildMagic more like GPC library. The only problem with GPC is that it creates triangle strip not only triangles.
This may not be what you're looking for, but the GLU library tesselator can handle arbitrary polygons (including those with holes), and IINM it can be used independently of an OpenGL context (that is, you don't have to be using OpenGL for your graphics system in order to make use of the GLU tesselator).

Again though, it may not meet your needs, as it does require linking to the entire GLU library.

Share this post


Link to post
Share on other sites
Quote:
Original post by lephyrius
The only problem with GPC is that it creates triangle strip not only triangles.

Unpacking triangle strips (or fans) to other reasonable data structures appears very easy and cheap: why is it unacceptable for you? What data structures are you using for the input polygons and for the output triangles?

Share this post


Link to post
Share on other sites
Quote:
Original post by LorenzoGatti
Unpacking triangle strips (or fans) to other reasonable data structures appears very easy and cheap: why is it unacceptable for you? What data structures are you using for the input polygons and for the output triangles?


Im using a list of outer contour vertices and inner contours as input. I want pure triangle list with indices when i insert them in a VBO to render them. I will also use the triangles for collision detection. The thing with GPC is that I got the feeling that it wouldn't produce optimal triangles.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this