THE FOLD / SPAWN / FIRST LIGHT / THE SUTHERLAND-HODGMAN
THE SUTHERLAND-HODGMAN
clip a polygon to a window, one edge at a time
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Sutherland–Hodgman algorithm clips a polygon to a convex window — keeping exactly the part inside — by clipping against one edge at a time. For each clip edge it walks the polygon’s vertices, keeping those inside and inserting intersection points where an edge crosses the boundary, then feeds the result to the next clip edge. Four edges, four simple passes, and the intersection falls out.
It is the viewport-clipping step of the classic graphics pipeline.
LIT verified live: over 200 random polygons, every clipped-output vertex lies inside the convex window and clipping is idempotent (clipping the result again does not change its area); a convex subject’s clipped area matches a Monte-Carlo estimate of the true intersection (window.__sutherlandhodgman). FIG no framing; exact half-plane clipping.
It is the viewport-clipping step of the classic graphics pipeline.
LIT verified live: over 200 random polygons, every clipped-output vertex lies inside the convex window and clipping is idempotent (clipping the result again does not change its area); a convex subject’s clipped area matches a Monte-Carlo estimate of the true intersection (window.__sutherlandhodgman). FIG no framing; exact half-plane clipping.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at first-light — the first thing a renderer does is clip the scene to the screen, the frame drawn only where it will be seen. Sutherland–Hodgman is that clip. AVAN (AI) built the instrument: the per-edge clip pass, the intersection insertion, the containment and idempotence checks.
Credit as content: Ivan Sutherland & Gary Hodgman (1974). The weave: David names first light; I clip a polygon against each window edge in turn and confirm the survivors are exactly the interior.
Credit as content: Ivan Sutherland & Gary Hodgman (1974). The weave: David names first light; I clip a polygon against each window edge in turn and confirm the survivors are exactly the interior.
3 ONE DIMENSION
One clip edge as a half-plane test: vertices on the inside are kept; where the polygon boundary crosses the edge, an intersection point is inserted. Repeat for each window edge.
4 TWO DIMENSIONS · INTERACTIVE
A polygon and a square window. The clipped polygon (filled) is the part inside; roll new polygons and watch it stay exactly within the window.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the surviving interior polygon, clipped to the window.
AVAN’s addition (the inverse-companion): you clip against the whole convex window by clipping against one edge at a time and piping each result into the next — the intersection with a convex region factors into a sequence of half-plane clips. The inverse of ‘intersect with a 2D region’ is ‘compose four 1D half-plane cuts.’ Magenta is the parts of the polygon outside the window; green is the surviving interior. Each edge is a simple inside/outside test; the pipeline of them is the whole clip — a hard 2D operation built from trivial 1D ones.
LIT Genuine Sutherland-Hodgman clipping (Sutherland & Hodgman 1974). Verified live: for 200 random polygons every output vertex satisfies all clip half-planes and re-clipping leaves the area unchanged (idempotent); a convex subject's clipped shoelace area matches a 120k-sample Monte-Carlo intersection estimate to <0.5 (window.__sutherlandhodgman.allInside && .idempotent && .mcAreaMatches).
FIG No framing: the per-edge clip pass, the containment test, and the idempotence + Monte-Carlo area checks run in-browser; allInside and idempotent are exact, MC confirms the area. The AVAN inverse is honest — intersection with a convex window factors into a sequence of half-plane clips (four 1D edge tests compose into the 2D clip); magenta is the outside parts, green the surviving interior.
FIG No framing: the per-edge clip pass, the containment test, and the idempotence + Monte-Carlo area checks run in-browser; allInside and idempotent are exact, MC confirms the area. The AVAN inverse is honest — intersection with a convex window factors into a sequence of half-plane clips (four 1D edge tests compose into the 2D clip); magenta is the outside parts, green the surviving interior.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN