Polygon visibility (source code)

= Polygon visibility

Two points of a filled simple <polygon> $P$, including its boundary, are mutually visible when their joining closed <line segment> lies entirely in $P$. The visible region from $p$ is $\{q\in P:[p,q]\subseteq P\}$. A segment crossing even a small exterior gap breaks visibility.

Every pair of points in a <convex polygon> is visible by the definition of <convexity>. In a nonconvex polygon, an inward corner can block a segment although both endpoints lie inside. A point sees the whole polygon precisely when it belongs to the <kernel of a polygon>. Thus a nonempty kernel permits one stationary point observer to see the entire filled region.

Visibility depends on the filled-region and boundary convention, rather than only on graph adjacency between polygon vertices. It is used in geometric path planning and coverage, where the whole intervening segment must be checked for obstruction.