1.00
Sources and simplifications
- The field is the simplest metaball sum, f = Σ r²/d², sampled at the grid corners. Its value at a source is capped so samples stay finite.
- Inside means f ≥ iso. The terrain height is a monotone function of f, so the waterline on the terrain is exactly the true iso-contour. The ribbon on the water is what marching squares recovers from the samples alone.
- The saddle cases (5 and 10) are resolved by the mean of the four corners (the centre bob). The asymptotic decider [3] uses the bilinear saddle value instead; it can disagree with the mean on rare cells.
- Corners exactly at iso count as inside, the same in every cell, so neighbouring cells always agree on a shared edge and the segments join.
- Contours that leave the grid stay open at the border. Every contour inside the grid closes.
- Only the march is slowed down for reading: a real implementation does all 1,024 cells of the fine grid in well under a millisecond.
Sources:
- [1] Marching squares (Wikipedia): the 16 cases, linear interpolation and the saddle ambiguity
- [2] Lorensen & Cline, Marching cubes: a high resolution 3D surface construction algorithm, SIGGRAPH 1987
- [3] Nielson & Hamann, The asymptotic decider: resolving the ambiguity in marching cubes, IEEE Visualization 1991
- [4] Blinn, A generalization of algebraic surface drawing (metaballs), ACM TOG 1982