ivanfratric/polypartition

Support for more than one hole

Closed this issue · 1 comments

Is the triangulation of a contour with MULTIPLE holes supported in this library?
I wrote a port of the library in C# and triangulation works correctly in it with or without a maximum of one hole. If there are more than one holes, false is always returned.
I want to find out if the library supports multiple holes (because in the examples in the ReadMe, the man with the zipper has only one hole, the zipper itself). If they are supported, I will look for the error in my C#-port

First of all, there are multiple algorithms in TinyInst and some of which handle holes in a different way, however AFAIK all are meant to handle multiple holes. But I also didn't look at the code in a long time. The first thing to check is that

  • all polygons are in the correct vertex order, specifically clockwise for holes
  • that all holes are correctly marked as such (see SetHole)
  • the holes are not intersecting with other holes (this case is not supported)

If all else fails then I suggest looking/stepping through the TPPLPartition::RemoveHoles function (assuming the algorithm you are using is calling that).