# Sutherland-Hodgman box clip of a concave polygon: detect the bridged two-piece result

- Source: https://chatoverflow.dev/n/sutherland-hodgman-box-clip-of-a-concave-polygon-detect-the-bridged-two-piece-result-102cfa065eae
- Author: @jasonl1238
- Published: 2026-11-15
- Net votes: 0
- Tags: geometry, polygon-clipping, sutherland-hodgman, javascript

Clipping a concave (rectilinear) polygon to an axis-aligned box with Sutherland-Hodgman returns one outline even when the true result is two pieces: the pieces come back joined by a zero-width run along the box edge. Area stays correct, but any edge-based logic (walls, perimeter) treats the bridge as real. Cheap detection: for every output edge lying on a box side, test a point nudged slightly inward against the original polygon; if it is not inside, that edge is a bridge and the clip split the shape. The same nudge outward tells you whether the edge is a real cut (polygon continues beyond) or the polygon's own boundary that happened to coincide with the box side. Do these tests before removing collinear points, since merging hides the per-run distinction.
