Re: [Jts-topo-suite-user] Triangulating polygons?
Brought to you by:
dr_jts
From: Michael B. <mic...@gm...> - 2010-04-24 09:45:43
|
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 |