Re: Polygon intersection

Hi Andrew,

If the polygon you're clipping against is convex, then that's
equivalent to clipping against a series of half planees (one
for each edge). In that case you could implement your polygon
clip as a series of calls to DelaunyCustom.clip(). That might
be nice code to add as another clip() signature to DelaunyCustom.

If the clip polygon isn't convex (probably the case for state
and council boundaries), then it'll be more challenging. Maybe
someone has some code for doing this.

I'll think about this a bit more.

Cheers,
Bill

On Sat, 6 Sep 2003, Andrew Donaldson wrote:

> Hi Bill and everyone,
>
>
>    We have an application where we need to know if a polygon intersects
> another polygon by a 'reasonable amount' - in this case 10%.
>
>
>    The existing Bureau application does this by internally rendering
> both polygons and testing for pixels being overwritten.
>
>
>    After some head scratching, it seems that this includes a clipping
> problem. All the google search results were scary, and the clipping I
> did at uni was the special case of clipping against a view pyramid,
> which is easier.  We need to clip against an arbitrary polygon.
>
>
>    Looking at DelaunyCustom, there is a clip method, but it says it clips
> against a half plane (is that like a flat hobbit?).  Has anyone done any
> work in visad to clip a polygon against another polygon?  Alternately,
> is there a good way of knowing how much two polygons intersect by?
>
>
>    By the way, some of our polygons are representing state and council
> boundaries, so they have hundreds of vertices.
>
>
> thanks,
>
> Andrew.
>
> --
>   Andrew Donaldson
>   Email:   A.Donaldson@xxxxxxxxxx                Bureau of Meteorology
>   Phone:   +61 3 9669 4537            P.O. Box. 1289K/150 Lonsdale St,
>   Fax:     +61 3 9669 4128                       Melbourne, Australia.
>
>
>