[orx-shapes] Refactor package layout

This commit is contained in:
Edwin Jakobs
2024-01-23 09:38:43 +01:00
parent 78ba51ca85
commit 8fbb106823
54 changed files with 138 additions and 91 deletions

View File

@@ -0,0 +1,37 @@
package bezierpatch
import org.openrndr.application
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
import org.openrndr.extra.shapes.bezierpatches.bezierPatches
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 c0 = Circle(width / 3.0, height / 2.0, 150.0).contour
val bp0 = bezierPatch(c0)
val c1 = Circle(2.0*width / 3.0, height / 2.0, 150.0).contour
val bp1 = bezierPatch(c1)
extend {
drawer.bezierPatches(listOf(bp0, bp1))
}
}
}
}