wo80 / Triangle.NET

C# / .NET version of Jonathan Shewchuk's Triangle mesh generator.
472 stars 85 forks source link

Hole cutting across segments - hole not fully removed #49

Closed andypoly closed 1 month ago

andypoly commented 1 month ago

It seems cutting out holes is rather limited if the boundary extends across segments as then only the section defined by the hole point is an actual hole - the rest is generated geometry, including outside a polygon boundary! Is this a simple limitation of Triangle.NET and is there an easy way to make it cut out across segments and make the whole hole countour get removed?

image

wo80 commented 1 month ago

Is this a simple limitation of Triangle.NET and is there an easy way to make it cut out across segments and make the whole hole countour get removed?

Yes, it's a known limitation. You might want to take a look at #17 and https://gist.github.com/wo80/fe9b40925cdfdafedad935457c4768dd . The approach is to not care about holes, but using a RegionIterator to set labels for regions that shouldn't be processed.