findContours

fun findContours(f: (Vector2) -> Double, area: Rectangle, cellSize: Double, useInterpolation: Boolean = true): List<ShapeContour>(source)

Find contours for a function f using the marching squares algorithm. A contour is found when f(x) crosses zero.

Return

a list of ShapeContour instances

Parameters

f

the function

area

a rectangular area in which the function should be evaluated

cellSize

the size of the cells, smaller size gives higher resolution

useInterpolation

intersection points will be interpolated if true, default true