Nesting of Touching Polygons
Carsten R. Seemann, Peter F. Stadler, Marc Hellmuth
TL;DR
The paper addresses nesting of polygons with non-overlapping interiors that may touch, extending a prior sweep-line framework to accommodate boundary contacts. It introduces maximal outstretched segments and a parity-based sweep-line mechanism to determine inside/outside relationships, and develops an ordering scheme that allows building the nesting forest in $O(n+N\log N)$ time, where $n$ is the total number of vertices and $N$ the total number of maximal outstretched segments. The main contributions are the generalization to touching polygons, the formalization of segment parities and sweep-adjacency, and the concrete algorithm and analysis showing asymptotic optimality in common cases such as convex polygons. The approach enables efficient nesting computation for complex polygon sets and lays groundwork for extensions to touching point localization and connected-component nesting.
Abstract
Polygons are cycles embedded into the plane; their vertices are associated with $x$- and $y$-coordinates and the edges are straight lines. Here, we consider a set of polygons with pairwise non-overlapping interior that may touch along their boundaries. Ideas of the sweep line algorithm by Bajaj and Dey for non-touching polygons are adapted to accommodate polygons that share boundary points. The algorithms established here achieves a running time of $\mathcal{O}(n+N\log N)$, where $n$ is the total number of vertices and $N<n$ is the total number of "maximal outstretched segments" of all polygons. It is asymptotically optimal if the number of maximal outstretched segments per polygon is bounded. In particular, this is the case for convex polygons.
