[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Polygon combiner plugin



The answer was enlightening, though I'd have to do a lot more thinking about
why it doesn't matter, if some polygons are intersecting.

If a polygone is complex, i.e. has holes, the cast ray will pass an odd number of edges, if the start point is inside the polygon. Numerically difficult is the
case, if the ray scratches a corner. I assume, your ray is an axe-direction
and you sort the edges before checking hits or something. So if an interval-test
shows, that it's a corner and you are lucky to have a minimal delta from
previous edge-sorting, you may slightly offset the start point along an edge
and rerun the test (the sorting delta is a bound for the offset?).

Hm - many polygons are axe-aligned, so a ray in a rather random direction
is much less likely to produce corner cases. Otoh, when using an axe-aligned
ray, the intersection test for an edge degenerates to an interval-inclusion and
a true intersection only if this hits, so rotating the input beforehand
(say  1 rad) may be desirable ;-)

Thanks, Armin


Peter Clifton wrote:
On Mon, 2010-06-07 at 11:21 +0200, Armin Faltl wrote:
Peter Clifton wrote:
The plugin now works to construct a tree ordered by "containership" -
and processes the relevant contours in an appropriate order so outer
contours are processed before inner ones.
How do you determine containership?

Now you're asking me a HARD question.... ;)


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user