Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons

This paper provides a full theoretical and experimental analysis of a serial algorithm for the point-in-polygon test, which requires less running time than previous algorithms and can handle all degenerate cases. The serial algorithm can quickly determine whether a point is inside or outside a polygon and accurately determine the contours of input polygon. It describes all degenerate cases and simultaneously provides a corresponding solution to each degenerate case to ensure the stability and reliability. This also creates the prerequisites and basis for our novel boolean operations algorithm that inherits all the benefits of the serial algorithm. Using geometric probability and straight-line equation F(P) = (yi − yi+1)(xp − xi)− (yi − yp)(xi+1 − xi), it optimizes our two algorithms that avoid the division operation and do not need to compute any intersection points. Our algorithms are applicable to any polygon that may be self-intersecting or with holes nested to any level of depth. They do not have to sort the vertices clockwise or counterclockwise beforehand. Consequently, they process all edges one by one in any order for input polygons. This allows a parallel implementation of each algorithm to be made very easily. We also prove several theorems guaranteeing the correctness of algorithms. To speed up the operations, we assign each vector a number code and derive two iterative formulas using differential calculus. However, the experimental results as well as the theoretical proof show that our serial algorithm for the point-in-polygon test is optimal and the time complexities of all algorithms are linear. Our methods can be extended to three-dimensional space, in particular, they can be applied to 3D printing to improve its performance.

[1]  Francisco R. Feito-Higueruela,et al.  A new algorithm for computing Boolean operations on polygons , 2009, Comput. Geosci..

[2]  Peter R. Atherton,et al.  Hidden surface removal using polygon area sorting , 1977, SIGGRAPH.

[3]  Michael Galetzka,et al.  A correct even-odd algorithm for the point-in-polygon (PIP) problem for complex polygons , 2012, ArXiv.

[4]  Juan José Jiménez-Delgado,et al.  Robust and Optimized Algorithms for the Point‐in‐Polygon Inclusion Test without Pre‐processing , 2009, Comput. Graph. Forum.

[5]  Gershon Elber,et al.  Global Solutions of Well-Constrained Transcendental Systems Using Expression Trees and a Single Solution Test , 2010, GMP.

[6]  Borut Zalik,et al.  Point-in-polygon tests for geometric buffers , 2005, Comput. Geosci..

[7]  R. D. Andreev Algorithm for Clpping Arbitrary Polygons , 1989, Comput. Graph. Forum.

[8]  Francisco R. Feito-Higueruela,et al.  Boolean operations on general planar polygons , 2000, Comput. Graph..

[9]  Francisco R. Feito-Higueruela,et al.  The multi-L-REP decomposition and its application to a point-in-polygon inclusion test , 2006, Comput. Graph..

[10]  C. T. Shaw,et al.  Automated procedures for Boolean operations on finite element meshes , 1997 .

[11]  Jun-Hai Yong,et al.  A point-in-polygon method based on a quasi-closest point , 2010, Comput. Geosci..

[12]  Kevin Weiler Polygon comparison using a graph representation , 1980, SIGGRAPH '80.

[13]  Wencheng Wang,et al.  2D point-in-polygon test by classifying edges into layers , 2005, Comput. Graph..

[14]  Bala R. Vatti A generic solution to polygon clipping , 1992, CACM.

[15]  Bert Jüttler,et al.  Computing roots of polynomials by quadratic clipping , 2007, Comput. Aided Geom. Des..

[16]  Antonio J. Rueda,et al.  EL-REP: A New 2D Geometric Decomposition Scheme and Its Applications. , 2011, IEEE transactions on visualization and computer graphics.

[17]  Kai Hormann,et al.  The point in polygon problem for arbitrary polygons , 2001, Comput. Geom..

[18]  Eric Haines,et al.  Point in Polygon Strategies , 1994, Graphics Gems.

[19]  Günther Greiner,et al.  Efficient clipping of arbitrary polygons , 1998, TOGS.

[20]  Franco P. Preparata,et al.  Plane-sweep algorithms for intersecting geometric figures , 1982, CACM.

[21]  Tomoyuki Nishita,et al.  Curve intersection using Bézier clipping , 1990, Comput. Aided Des..

[22]  Ari Rappoport,et al.  An efficient algorithm for line and polygon clipping , 1991, The Visual Computer.

[23]  Francisco R. Feito-Higueruela,et al.  Geometric modelling based on simplicial chains , 1998, Comput. Graph..

[24]  Gershon Elber,et al.  Solving piecewise polynomial constraint systems with decomposition and a subdivision-based solver , 2017, Comput. Aided Des..

[25]  Matthew B Hoy 3D Printing: Making Things at the Library , 2013, Medical reference services quarterly.

[26]  Jun-Hai Yong,et al.  A new algorithm for Boolean operations on general polygons , 2005, Comput. Graph..

[27]  Amitava Datta,et al.  A fast trapezoidation technique for planar polygons , 2002, Comput. Graph..