[orx-shapes] Add demo descriptions

This commit is contained in:
Abe Pazos
2025-10-29 09:52:31 +01:00
parent c3bb7d415f
commit 8990a6cf64
11 changed files with 99 additions and 0 deletions

View File

@@ -4,6 +4,16 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.primitives.Arc
/**
* Shows how to create an `Arc` centered on the window. The start and end angles of the arc increase 36 degrees
* per second, resulting in an animated effect.
*
* The `contour` property of the arc is used for rendering.
*
* The start, mid and end points of the arc are queried using it's `position()` method
* to draw small circles at those locations.
*
*/
fun main() = application {
configure {
width = 720

View File

@@ -6,6 +6,16 @@ import org.openrndr.extra.shapes.primitives.Net
import org.openrndr.shape.Circle
import kotlin.math.sin
/**
* Shows how to create and render a [Net]: a structure
* that connects two points with a circle in between,
* forming a string-like shape.
*
* The main circle moves following an invisible infinite sign,
* formed by a pair of sine functions. The moving circle is connected to
* two smaller static circles via a [Net], rendered as a white
* contour with a stroke weight 2 pixels wide.
*/
fun main() = application {
program {
extend {

View File

@@ -6,6 +6,10 @@ import org.openrndr.extra.shapes.primitives.Pulley
import org.openrndr.math.Vector2
import org.openrndr.shape.Circle
/**
* Demonstrates how to create and render a [Pulley]: a system defined by two circles
* connected by their outer tangents.
*/
fun main() = application {
configure {
width = 720
@@ -14,6 +18,7 @@ fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.strokeWeight = 8.0
drawer.stroke = ColorRGBa.WHITE
drawer.fill = ColorRGBa.PINK
val pulley = Pulley(