Looking for a polygon intersection lib

648 views
Skip to first unread message

Chris Olsen

unread,
Feb 12, 2012, 1:58:15 AM2/12/12
to golan...@googlegroups.com
Hey everyone,

Does anyone know of any libraries that can determine whether intersection exists for two convex polygons?

I haven't found anything, but I am pretty new to golang so I might not be looking in the right places.

Thanks for the help.

Christoph

unread,
Feb 12, 2012, 6:33:33 AM2/12/12
to golang-nuts

Chris Olsen

unread,
Feb 22, 2012, 7:51:03 PM2/22/12
to golan...@googlegroups.com
Thanks for the help.  It does seem that it should do the trick.

Michael Jones

unread,
Feb 22, 2012, 8:11:56 PM2/22/12
to Chris Olsen, golan...@googlegroups.com
Chris, if you mean precisely what you wrote, then you are in the simplest case of polygon intersection.

1. bounding box outcodes let you quickly reject clearly disjoint cases from potentially contains and intersects cases.

2. both being convex means that picking an arbitrary vertex in each polygon, and decomposing each polygon as triangles from that vertex, leads to a double iteration on simple triangle/triangle intersection.


On Wed, Feb 22, 2012 at 4:51 PM, Chris Olsen <olsen...@gmail.com> wrote:
Thanks for the help.  It does seem that it should do the trick.



--
Michael T. Jones | Chief Technology Advocate  | m...@google.com |  +1 650-335-5765

Chris Olsen

unread,
Feb 22, 2012, 11:52:25 PM2/22/12
to golan...@googlegroups.com, Chris Olsen
Hey Michael,

You are right in that the intersection is the simplest case.  I was looking for something to do a quick test on some geo-marked areas, but I think I might just use this as an excuse to play around with Go a little more.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages