← Jake Popham · part one: continuous fields

Subvoxel interfaces from signed distance functions

The grid is the grid — intervals, pixels, voxels. The question is what each cell stores: a label, or a distance.

misfit, labels
misfit, SDF
interface offset, labels
interface offset, SDF

Discretizing a categorical field — rock type, phase, material — fixes a grid of cells: intervals in 1D, pixels and voxels up the dimensions. The representation question is what payload each cell carries. The naive answer is the category itself, one label per cell — and a label has no notion of where inside a cell an interface sits, so every boundary quantizes to the grid, and moving the true interface changes nothing until it crosses a cell midpoint. Drag the shift slider and watch the label row snap while the truth glides.

The same cells can instead carry a much richer payload for the same storage: a sample of the signed distance function φ — positive in one class, negative in the other — with labels reconstructed as the sign of the interpolated φ. One number per cell now encodes subvoxel information: an interface between two samples of opposite sign sits at the zero crossing, recovered from the two distances, not rounded to the grid. In 1D a distance function is piecewise linear (|φ′| = 1 almost everywhere), so linear interpolation places resolved interfaces essentially exactly — the offset stat drops to zero at any resolution.

What the distance payload does not buy is content below the grid: the band scenario, once narrower than a cell and clear of every sample, leaves all stored distances positive, and no sign change means no band — the same failure as the labels. Seeing inside a cell needs more than values; part one's derivative trick applies to φ like any other field, and its slopes recover exactly this case.

The 2D version puts the interface at an angle to the grid — the label staircase against the marching-squares contour.