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

  2. Poly2Tri lib

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.


You might want to take a look at this page:

Thanks Obidobi.

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

I created an add-on for this.