Triangulation with holes

Hi everybody,

I am looking at the best implementation for triangulation with holes.

I have found two libraries who are able to do this.

  1. Triangle (c library) and implemented by Zach for oF in ofxTriangleMesh
    https://github.com/ofZach/ofxTriangleMesh
    http://www.cs.cmu.edu/~quake/triangle.html

  2. Poly2Tri lib
    https://code.google.com/p/poly2tri/

They both have their advantages/disadvantages but the biggest difference for me is:

  1. Poly2Tri does not have size/angle constraints
  2. I can not get holes to function in Triangle lib.

Here are a few screenshot to illustrate my problem:

Screenshot one:

Screenshot two:

As you can see in the first screenshot I tried creating holes with triangle lib by just placing two polygons inside another one. But it doesn’t really work.

While for Poly2tri there is a method addHole wich works perfect. But the Poly2tri does not support size/angle constraints. You can see in the second screenshot why that would be much better.

I’ve got two options:

  1. Implement size and angle constraints in Poly2Tri
  2. Get the add hole function to work in the Triangle library.

My guess is the second option would be the best by far but I am not succeeding…
Is there anyone who got the holes functioning properly in the triangle/ofxTriangleMesh?

Any suggestion is more than welcome.

Thanks!

You might want to take a look at this page:
http://forum.unity3d.com/threads/181596-Triangulation-of-spline-to-mesh-questions-and-results

Thanks Obidobi.

I went on with the Poly2Tri lib and got some pretty good results.

I created an add-on for this.
https://github.com/nocomputer/ofxPoly2Tri

Cheers,