Re: [Jts-topo-suite-user] Triangulating polygons?
Brought to you by:
dr_jts
From: Martin D. <mtn...@te...> - 2010-04-24 16:31:56
|
Yes, you'll have to work with the coordinates directly, since the ring will usually be invalid. That's ok - it's faster than using difference anyway. I can't visualize a situation where no ear can be found. Can you post an example? Michael Bedward wrote: > On 24 April 2010 14:44, Martin Davis <mtn...@te...> wrote: > >> Ok, great. Let us know how it goes. >> >> > > Made some progress and then got stuck. I'll describe what I've done so > far and then the next idea. > > Get shell coords list > For each hole list: > Get hole coords > Find closest hole - shell vertices > Insert hole coords into shell coords list as: > {shell coords} {join} {hole coords} {join} {remaining shell coords} > > I'm working with a list of coordinates because the self-intersecting > shell is no longer a valid polygon so I can't use the difference > method to subtract ears. That's OK because removing an ear just > involves removing one coordinate from the shell. > > It works well up to a point but then ends up in configurations where > no valid ear can be found because of the order of coordinates being > tested. > > Perhaps the method of joining holes to shell can be improved ? > > In the meantime I'm falling back to a dumber algorithm: > > 1. triangulate ignoring holes > 2. for each ear found in step 1, if it overlaps holes, subtract them > and re-triangulate > > Michael > > ------------------------------------------------------------------------------ > _______________________________________________ > Jts-topo-suite-user mailing list > Jts...@li... > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > > |