Slicing a field at a level
A scalar field assigns every point a value — height, density, distance. Pick a threshold and the plane splits in two: cells above, cells below. The boundary between them is the level set, and sliding the threshold sweeps a whole family of shapes hiding in one field, like a tide line moving up and down a beach.
Slide the level and watch the coastline move.
Marching the squares
To trace that boundary, sample the field on a grid and walk cell by cell. Each cell has four corners, each corner is either above or below the level — sixteen possible patterns, and each pattern says exactly which edges the contour must cross. Look up the case, draw the little segment, move on. The whole outline assembles itself.
Drag the blob around and watch each cell pick its case.
Where exactly on the edge?
The case says which edges are crossed; it doesn't say where. Snap every crossing to the edge midpoint and the contour comes out lumpy, quantised to the grid. But the corner values tell you more: if one corner reads −2 and the other +6, the zero sits a quarter of the way along. Interpolate each crossing and the same coarse grid yields a smooth, faithful curve.
Toggle between midpoints and interpolation.
Many levels make a map
Nothing says you must extract only one level. Trace the same field at a stack of values and you get the familiar language of contour maps — nested rings climbing a hill, lines crowding together where the field changes fastest, spreading out where it's flat. Steepness becomes spacing; the whole terrain becomes legible at a glance.
Drag the peaks around; change how many levels are drawn.
The contour studio
A live field of blobs — some adding, some carving — and the full extraction pipeline on top: choose the level to slice at, the grid resolution to sample with, and whether to see the machinery or just the result. Coarsen the grid and watch the curve degrade gracefully; sweep the level and watch islands split and merge. This is the metaball workflow every sculpting and scanning tool is built on.