[orx-marching-squares] Change findContours to return List<ShapeContour>

This commit is contained in:
Edwin Jakobs
2023-02-02 22:03:51 +01:00
parent 9019e7e7ea
commit 5e6123c958
5 changed files with 65 additions and 18 deletions

View File

@@ -16,8 +16,9 @@ fun main() {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = ColorRGBa.PINK
fun f(v: Vector2) = cos((v.distanceTo(drawer.bounds.center) / 100.0) * 2 * PI)
val segments = findContours(::f, drawer.bounds.offsetEdges(32.0), 16.0)
drawer.lineSegments(segments)
val contours = findContours(::f, drawer.bounds.offsetEdges(-24.0), 16.0)
drawer.fill = null
drawer.contours(contours)
}
}
}