Overview
Marching Squares classifies each grid cell by whether its corners are above an isovalue, then emits contour segments from a lookup table.
Extracts 2D contour lines from a scalar grid using cell case tables.
Compact metadata for implementation and discovery.
Marching Squares classifies each grid cell by whether its corners are above an isovalue, then emits contour segments from a lookup table.
Quick facts
Runtime and memory behavior at a glance.
Best
O(cells)
Average
O(cells)
Worst
O(cells)
Space
O(segments)
p = p1 + ((iso - v1) / (v2 - v1)) * (p2 - p1)Finds where the contour crosses an edge between scalar samples.
Draw the input shapes, active tests, and generated geometric result.
Marching Squares should be used with the assumptions and tradeoffs of contour Extraction in mind.
What each reference supports for this entry.
Computational geometry textbook support for Marching Squares's geometric model, data structures, and robustness concerns.
Open sourceAlgorithm catalog support for Marching Squares's problem context, known alternatives, and practical selection tradeoffs.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
It emits contour segments based on interpolated grid-edge crossings.
Marching Squares is the 2D analogue of Marching Cubes.