Re: [Jts-topo-suite-user] Triangulating polygons?
Brought to you by:
dr_jts
From: Michael B. <mic...@gm...> - 2010-04-26 12:12:57
|
Hi Martin, Ian, I've now extended the code to add holes to the shell by scanning from bottom to top. The new code (EarClipping3.java) successfully processes the MEP (Martin's Evil Polygon)... POLYGON ((50 440, 50 50, 510 50, 510 440, 280 240, 50 440), (105 230, 443 228, 106 208, 105 230), (280 210, 260 190, 310 190, 280 210)) Finding these ears... POLYGON ((50 50, 260 190, 310 190, 50 50)) POLYGON ((280 210, 260 190, 106 208, 280 210)) POLYGON ((280 210, 106 208, 443 228, 280 210)) POLYGON ((310 190, 280 210, 443 228, 310 190)) POLYGON ((50 50, 310 190, 443 228, 50 50)) POLYGON ((106 208, 260 190, 50 50, 106 208)) POLYGON ((105 230, 106 208, 50 50, 105 230)) POLYGON ((105 230, 50 50, 50 440, 105 230)) POLYGON ((105 230, 50 440, 280 240, 105 230)) POLYGON ((443 228, 105 230, 280 240, 443 228)) POLYGON ((443 228, 280 240, 510 440, 443 228)) POLYGON ((443 228, 510 440, 510 50, 443 228)) POLYGON ((50 50, 443 228, 510 50, 50 50)) Feeling pretty pleased about that :-) I've commented the code enough (I hope) to make clear what it's doing. I haven't yet tried to do anything about 'improving' the triangulation. Michael |