Simplified Tersoff–Hamann/WKB tunneling relation: current decays exponentially with the vacuum gap and scales linearly with bias,
I(x,y) = C · V · exp(−2κ·d(x,y))
d(x,y) = z_tip(x,y) − h(x,y)
Constant current: the feedback loop adjusts z_tip at every point until I always equals I_set. Solving the equation above shows the gap d then stops depending on (x,y) at all — it becomes a single constant everywhere — so z_tip(x,y) = d_const + h(x,y) traces the true topography almost exactly, regardless of κ or V.
Constant height: z_tip is frozen at z_set+Δz for the whole scan, so the measured image is really I(x,y) itself — an exponentially distorted view of h(x,y). Small bumps read as huge current spikes, and if the local gap collapses below ~0.15 Å the tip physically crashes into the surface (flagged in red).
Surface height h(x,y) is synthesized from reciprocal-lattice cosine sums (three 120°-spaced waves for the hexagonal case, two orthogonal waves for the square case) — the standard way to generate a periodic atomic corrugation without summing individual atoms.