-
Notifications
You must be signed in to change notification settings - Fork 37
/
DemoBezierPatchDrawer01.kt
37 lines (33 loc) · 1.23 KB
/
DemoBezierPatchDrawer01.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package bezierpatch
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
import org.openrndr.shape.Circle
fun main() {
application {
program {
extend {
drawer.clear(ColorRGBa.PINK)
val bp = bezierPatch(
Circle(width/2.0, height/2.0, 200.0).contour
).withColors(
listOf(
listOf(ColorRGBa.PINK, ColorRGBa.RED, ColorRGBa.BLACK, ColorRGBa.BLUE),
listOf(ColorRGBa.RED, ColorRGBa.BLACK, ColorRGBa.BLUE, ColorRGBa.GREEN),
listOf(ColorRGBa.PINK, ColorRGBa.RED, ColorRGBa.WHITE, ColorRGBa.GREEN),
listOf(ColorRGBa.BLACK, ColorRGBa.WHITE, ColorRGBa.BLACK, ColorRGBa.BLUE),
)
)
drawer.bezierPatch(bp)
drawer.fill = null
drawer.contour(bp.contour)
for (i in 0 until 10) {
drawer.contour(bp.horizontal(i/9.0))
}
for (i in 0 until 10) {
drawer.contour(bp.vertical(i/9.0))
}
}
}
}
}