Skip to main content

Function: marchingSquares()

marchingSquares(values, xs, ys, iso): ContourSegment[]

Defined in: src/mobjects/graphing/marchingSquares.ts:103

Extract the iso-contour segments of a sampled scalar field.

Parameters​

values​

number[][]

Grid values indexed values[iy][ix], dimensions (ys.length) x (xs.length).

xs​

number[]

The x coordinate of each grid column, length nx + 1.

ys​

number[]

The y coordinate of each grid row, length ny + 1.

iso​

number = 0

The contour level. A corner is "set" when its value is above iso.

Returns​

ContourSegment[]