Converting a polygon with holes into multiple simple polygons without holes

Viewed 2136

I am dealing with IfcFace. I'm given a simple polygon with holes and I need to convert it into multiple simple polygons without holes for my CAD to further process it. A little demo ilustration:

enter image description here

My best approach is to do a constrained delaunay triangulation and rejoin the triangles into bigger polygons. Like so: enter image description here But the delaunay triangulation and even more the constraining part tends to fail for difficult input because of floating point precision and algorithmic instabilities. My input sometimes generates triangles with height 1e-8 and base length 1.

Are there better more robust algorithms to achieve this conversion?

2 Answers
Related