← Jake Popham · 1D version

Subpixel interfaces in 2D

Same cells, same count — a label per cell staircases every diagonal, a distance per cell redraws it exactly.

true field
labels, one per cell
sdf, one distance per node
misfit, labels
misfit, SDF
interface offset, labels
interface offset, SDF

The 2D version of the payload comparison, with the interface cutting diagonally so the grid can never line up with it. A label per cell yields the familiar staircase: the reconstruction can only place boundaries on cell edges, the misclassified wedges (red) alternate along the true line, and dragging the shift slider makes the staircase snap from one quantized position to the next while the truth glides underneath.

Storing instead one signed distance per node — the same storage count — and taking the zero contour of the bilinear interpolant (marching squares) redraws the interface through the cells' interiors at subpixel accuracy. For a straight diagonal line the recovered contour is essentially exact at any grid resolution and every angle; for the disc, curvature costs a little sagitta error per cell but the contour stays smooth where the labels stay blocky. The stripe shows the shared failure from 1D surviving in 2D: where the stripe thins below the node spacing and slips between nodes, both payloads lose it — values can't see inside a cell, whatever they measure. That is the jets' job.