문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top