home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!dog.ee.lbl.gov!hellgate.utah.edu!lanl!newshost.lanl.gov!hinker
- From: hinker@acl.lanl.gov (Paul J. Hinker)
- Newsgroups: comp.graphics
- Subject: Polygon (or point) within an arbitrary polygon
- Message-ID: <HINKER.92Nov19081251@cocker.acl.lanl.gov>
- Date: 19 Nov 92 15:12:51 GMT
- Sender: news@newshost.lanl.gov
- Reply-To: Paul J. Hinker <hinker@acl.lanl.gov>
- Organization: Advanced Computing Lab, LANL, NM
- Lines: 34
-
-
- Let me start out by saying that I've very much enjoyed the recent
- threads concerning point in a triangle and convexity of a polygon
- since they both relate directly to some things I've been working on.
-
- I would like to take the point in a triangle question a step
- further and ask if there is an efficient way to decide whether or not
- a polygon (or point for that matter) is contained by another polygon.
-
- The problem goes like this :
-
- I have Polygon1 and Polygon2 described by their respective vertice
- lists and bounding boxes and I would like to find out whether or not
- Polygon1 *contains* Polygon2. Nothing else is known about either
- polygon.
-
- My first thought was to place a point outside Polygon1 and check to
- see if a segment drawn between it and Polygon2 intersects any of the
- segments that make up Polygon1. This method is easily foiled.
-
- Next I thought that if I triangulated Polygon1 I could check each
- of the generated triangles to see if they contained the point in
- question.
-
- This last method seems to work well but it is very slow. The test
- is carried out many thousands (hundreds of thousands) of times.
-
- Thanks in advance for any pointers,
-
- --
- Paul Hinker hinker@acl.lanl.gov /// If it works, it's not state-of-the-art
- MS B287 505-665-6396 /// --Hansen's Law
- Los Alamos National Labs ACL \\\/// All our stuff is broke
- Los Alamos, NM 87545 \XX/ --Forslund's Corollary
-