Fixes and move to jvmDemo (#286)

This commit is contained in:
Vechro
2023-01-15 16:27:19 +02:00
committed by GitHub
parent e27f7eb4cb
commit 47d4293a57
117 changed files with 75 additions and 310 deletions

View File

@@ -0,0 +1,38 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.shapes.bezierPatch
import org.openrndr.shape.Circle
import org.openrndr.shape.ShapeContour
/**
* Shows how to create a [bezierPatch] out of a
* closed [ShapeContour] with 4 curved segments.
*
* Calling [Circle.contour] is one way of producing
* such a contour with vertices at the cardinal points
* but one can manually create any other 4-segment closed contour
* to use in bezier patches.
*/
fun main() {
application {
configure {
width = 800
height = 800
}
program {
val c = Circle(width / 2.0, height / 2.0, 350.0).contour
val bp = bezierPatch(c)
extend {
drawer.clear(ColorRGBa.PINK)
drawer.stroke = ColorRGBa.BLACK
for (i in 0..10) {
drawer.contour(bp.horizontal(i / 10.0))
drawer.contour(bp.vertical(i / 10.0))
}
}
}
}
}