Hi everybody,
I am looking at the best implementation for triangulation with holes.
I have found two libraries who are able to do this.
-
Triangle (c library) and implemented by Zach for oF in ofxTriangleMesh
https://github.com/ofZach/ofxTriangleMesh
http://www.cs.cmu.edu/~quake/triangle.html -
Poly2Tri lib
https://code.google.com/p/poly2tri/
They both have their advantages/disadvantages but the biggest difference for me is:
- Poly2Tri does not have size/angle constraints
- 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:
- Implement size and angle constraints in Poly2Tri
- 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!