New orx-axidraw (#356)

This commit is contained in:
Abe Pazos
2025-09-02 06:52:20 +02:00
committed by GitHub
parent 15dad438b9
commit 02afa415a9
13 changed files with 1038 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.axidraw.Axidraw
import org.openrndr.extra.axidraw.PaperOrientation
import org.openrndr.extra.axidraw.PaperSize
import org.openrndr.extra.axidraw.configure
import org.openrndr.extra.gui.WindowedGUI
import org.openrndr.extra.noise.uniform
import org.openrndr.extra.shapes.primitives.grid
/**
* Demonstrates:
* - How to create layers via `group` and give each layer
* a unique pen height and pen speed.
*
*/
fun main() = application {
program {
val axi = Axidraw(this, PaperSize.A5, PaperOrientation.PORTRAIT)
axi.resizeWindow(100.0)
val gui = WindowedGUI()
gui.add(axi)
axi.clear()
axi.draw {
fill = null
axi.bounds.grid(4, 6).flatten().forEach {
group {
circle(it.center, 50.0)
}.configure(
penHeight = Int.uniform(30, 60),
penSpeed = Int.uniform(20, 50)
)
}
}
extend(gui)
extend {
drawer.clear(ColorRGBa.WHITE)
axi.display(drawer)
}
}
}