The point inclusion tests for polygons, in other words the point-in-polygon (PIP) algorithms, are fundamental tools for many scientific fields related to computational geometry, and they have been studied for a long time. The PIP algorithms get direct or indirect geometric definition of a polygonal entity, and validate its containment of a given point. The PIP algorithms, which are working directly on the geometric entities, derive linear boundary definitions for the edges of the polygons. Moreover, almost all direct test methods rely on the two-point form of the line equation to partition the space into half-spaces. Voronoi tessellations use an alternate approach for half-space partitioning. Instead of line equation, distance comparison between generator points is used to accomplish the same task. Voronoi tessellations consist of convex polygons, which are defined between generator points. Therefore, Voronoi tessellations have become an inspiration for us to develop a new approach of the PIP testing, specialized for convex polygons. The equations, essential to the conversion of a convex polygon to a Voronoi polygon, are derived. As a reference, a very standard convex PIP testing algorithm, \textit{the sign of offset}, is selected for comparison. For generalization of the comparisons, \textit{the ray crossing} algorithm is used as another reference. All algorithms are implemented as vector and matrix operations without any branching. This enabled us to benefit from the CPU optimizations of the underlying linear algebra libraries. Experimentation showed that, our proposed algorithm can have comparable performance characteristics with the reference algorithms. Moreover, it has simplicity, both from a geometric representation and the mental model.
翻译:对多边形的点包含测试,换句话说,对多边形的点(polygon)算法,是许多与计算几何有关的科学领域的基本工具,并且已经进行了长期研究。 PIP算法对多边形实体有直接或间接的几何定义,并验证其对某一点的封闭性。PIP算法,直接在几何实体上运作,为多边形边缘产生线性边界定义。此外,几乎所有直接测试方法都依赖于线性方程式的两点形式,将空间分隔为半空。Voronoi 电算法分支对半空分配使用替代方法。相对于线性方方程,使用发电机点之间的距离比较来完成同一任务。Voronooooix 运算法,因此,Voronoioi 电流模型已经成为我们开发一种新方法的参考,对矩形多边形矩阵进行专门化的比较,对于将一个直径直线性矩阵运算法的参照,对于一个直径直线性矩阵运算法的比较性运算法是用来测试的。