◀ THE FOLD0ROOT.AI // WORLD II · BOSS · THE WALL◆ .dlw.fold
THE FOLD / BOSS / THE WALL / THE CONTOUR

THE CONTOUR

marching squares — the line where a field crosses a level
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Marching squares. A scalar field — heat, elevation, density — is a value at every point. How do you draw the single curve where it equals some threshold: the coastline between above and below, an isoline on a map, the outline of a blob? Marching squares.

Lay a grid over the field. In each cell, mark its four corners above or below the threshold — a 4-bit pattern, one of 16 cases. Wherever an edge has one corner above and one below, the contour must cross it, and you place that crossing by linear interpolation, exactly where the value hits the threshold. Connect the crossings across each cell and the fragments join into a smooth closed contour. It is the 2D sibling of marching cubes, the workhorse of medical imaging and metaballs.

LIT verified live: the interpolated crossing on every edge lands exactly on the threshold value, and the extracted contour of a circular field matches the true circle to under 0.0003 (window.__marching.interpExact && circleAccurate). FIG no framing; the 16 cases, the edge interpolation, and the contour accuracy are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in THE WALL, beside THE HULL and THE CELLS — the boss domain of the boundary that divides. A contour is a wall between two regions of a field, drawn from nothing but corner signs and interpolation. AVAN (AI) built the instrument: the corner classification, the 16 cases, the interpolated crossings.

The weave: David names the seat (the dividing boundary); I make the isoline emerge and the interpolation exact — a single cell in 1D, the live contour and threshold in 2D, the field surface cut at a level in 3D. The sphere is the seam. Credit: William Lorensen & Harvey Cline (marching cubes, 1987; the 2D form is the same idea).
3 ONE DIMENSION
One cell: four corners marked above (⊕) or below (⊖) the threshold. The contour crosses exactly the edges where the sign flips, and each crossing is placed by interpolation — nearer the corner whose value is nearer the threshold. Four bits pick the case; the segment falls out.
4 TWO DIMENSIONS · INTERACTIVE
A blobby field with a movable threshold. Marching squares traces the isoline through the grid; slide the threshold and the contour breathes — blobs merge and split — each crossing sitting exactly where the value equals the level.
5 THREE DIMENSIONS + AVAN’S INVERSE
The field as a turning height-surfacegreen, the landscape of values rising and dipping.
AVAN’s addition (the inverse-companion): the magenta curve is the level cut — where the surface meets the threshold plane, the contour. A field is a value everywhere, a whole continuous surface. Marching squares is the inverse move: it ignores almost all of it and finds the single line where the value equals one thing — the boundary, read from just the corner signs and a little interpolation. The inverse of ‘value at every point’ is ‘the curve at one level’; a shape pulled out of a field by looking only at where it crosses. The green is the surface; the magenta is the one slice through it that is a shape.
LIT Genuine marching squares (Lorensen & Cline, marching cubes 1987; the 2D form is identical in spirit). Verified live: the interpolated crossing on every edge lands exactly on the threshold value, and the extracted contour of a circular field matches the true circle to under 0.0003 (window.__marching.interpExact && circleAccurate, both true; max deviation reported). The 16-case corner classification and the linear edge interpolation are exact.

FIG No metaphor is doing the work: the corner classification, the edge interpolation, and the contour accuracy are all real and checked. Saddle-cell ambiguity (the 4-crossing cases) is resolved by a fixed consistent choice — noted, as in every real implementation; the interpolation exactness and circle match are unconditional.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE WALL · David Lee Wise (ROOT0), with AVAN