home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!lrz-muenchen.de!regent!har
- From: har@regent.e-technik.tu-muenchen.dbp.de (Hans Ranke)
- Subject: Re: Polygon-polygon intersection
- Message-ID: <har.726414217@regent.e-technik.tu-muenchen.de>
- Sender: news@regent.e-technik.tu-muenchen.de (News System)
- Organization: Technical University of Munich, Germany
- References: <7418@tivoli.UUCP> <1993Jan4.195436.2889@cis.uab.edu>
- Date: Thu, 7 Jan 1993 13:43:37 GMT
- Lines: 28
-
- sloan@cis.uab.edu (Kenneth Sloan) writes:
-
- >In article <7418@tivoli.UUCP> twb@tivoli.com (Tom Bereiter) writes:
- >>I'm looking for an efficient test for whether two 2D polygons intersect.
- >>The brute force approach seems to be: do a point-in-polygon test for each
- >>point of polyA in polyB, but if that says false you still have to check for
- >>line intersections. This feels like the sort of problem, like area of
- >>a polygon, which has a non-obvious trivial answer.
- >>
- >Sorry, but I don't think there is a "non-obvious trivial answer". In
- >the final analysis, I think you need:
-
- > *for all Va - is Va inside Pb
- > *for all Vb - is Vb inside Pa
- > *for all Ea - does Ea interect any Eb
-
- I think it is sufficient to test
-
- *for only one Va - is Va inside Pb
- *for only one Vb - is Vb inside Pa
- *for all Ea - does Ea interect any Eb
-
- Assuming that the polygons are not self-intersecting,
- the edge intersection test can be done in O(nlogn)
- using sweep line techniques.
-
- --
- Hans Ranke ranke@regent.e-technik.tu-muenchen.de
-