5
votes

I have a few 1000s triangles connected in a 2D mesh grid. It represents water flow. This grid is a delaunay triangulation. I need to merge the triangles back into a minimal amount of simple polygons such that each polygon is constraint not to have interior holes. The output polygons should be the same shape.

Is there a known algorithm for accomplishing this?

1
Can you do BFS with checking if the next triangle is in the same plane with the rest of polygon? (if it is, mark it is traversed and add it to the polygon, otherwise do nothing) There might be a problem with this, but I don't see it straight awayglebm

1 Answers

0
votes

answering my own question :)

I found the best way to do this is to use polygon union methods similar to disjoint subset merging. Here's a blog post on a fast implementation by taking advantage of spatial indices

http://lin-ear-th-inking.blogspot.com/2007/11/fast-polygon-merging-in-jts-using.html