[orx-marching-squares] Add orx-marching-squares module

This commit is contained in:
Edwin Jakobs
2023-02-02 18:24:07 +01:00
parent 4422f114ba
commit 5038fd0fc3
9 changed files with 265 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.marchingsquares.findContours
import org.openrndr.math.Vector2
fun main() {
application {
configure {
width = 720
height = 720
}
program {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = ColorRGBa.PINK
fun f(v: Vector2) = v.distanceTo(drawer.bounds.center) - 200.0
val segments = findContours(::f, drawer.bounds, 16.0)
drawer.lineSegments(segments)
}
}
}
}