Practical Point-in-Polygon Tests Using CSG Representations of Polygons
We investigate the use of a constructive solid geometry (CSG) representation in testing if a query point falls inside a polygon; in particular, we use a CSG tree whose leaves correspond to halfplanes defined by edges and whose internal nodes are intersections or unions of the regions defined by their subtrees. By preprocessing polygons into this representation, we obtain a linear-space data structure for point-in-polygon tests that has a tight inner loop that can prune unnecessary edge tests during evaluation. We experiment with opportunities to optimize the pruning by permuting children of nodes. The resulting test is less memory-intensive than grid methods and faster than existing one-shot methods. It also extends to ray-shooting in 3-space.
KeywordsGrid Method Trapezoid Method Boolean Formula Current Edge Random Polygon
Unable to display preview. Download preview PDF.
- 1.Franklin Antonio. Faster line segment intersection. In David Kirk, editor, Graphics Gems III, chapter 1.4, pages 199–202. Academic Press, Boston, MA, USA, 1992.Google Scholar
- 2.Didier Badouel. An efficient ray-polygon intersection. In Andrew S. Glassner, editor, Graphics Gems, pages 390–393. Academic Press, Boston, MA, 1990.Google Scholar
- 6.David Dobkin, Leonidas Guibas, John Hershberger, and Jack Snoeyink. An effcient algorithm for finding the CSG representation of a simple polygon. In John Dill, editor, Computer Graphics (SIGGRAPH’ 88 Proceedings), volume 22, pages 31–40, August 1988.Google Scholar
- 7.Chris Green. Simple, fast triangle intersection. Ray Tracing News, 6(1), 1993. ftp://ftp.princeton.edu/pub/Graphics/RTNews.
- 9.Eric Haines. Point in polygon strategies. In Paul S. Heckbert, editor, Graphics Gems IV, chapter 1.4, pages 24–46. Academic Press, Boston, MA, USA, 1994.Google Scholar
- 10.Franco P. Preparata and Micheal Ian Shamos. Computational Geometry: An Introduction. Springer-Verlag, Berlin, Germany, 1985.Google Scholar
- 13.John Spackman. Simple, fast triangle intersection, part II. Ray Tracing News, 6(2), 1993. ftp://ftp.princeton.edu/pub/Graphics/RTNews.
- 14.Jorge Stolfi. Oriented Projective Geometry: A Framework for Geometric Computations. Academic Press, 1991.Google Scholar