Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hamoid committed Jan 19, 2024
1 parent f82efdc commit cd7d78b
Show file tree
Hide file tree
Showing 136 changed files with 348 additions and 138 deletions.
15 changes: 8 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
kotlin = "1.9.21"
openrndr = "0.4.3"
orx = "0.4.3"
kotlin = "1.9.22"
openrndr = "0.4.4"
orx = "0.4.4"
orml = "0.4.1"

slf4j = "2.0.9"
log4j = "2.22.0"
jackson = "2.16.0"
slf4j = "2.0.11"
log4j = "2.22.1"
jackson = "2.16.1"

[libraries]
kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" }
Expand All @@ -20,7 +20,7 @@ jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-datab
jackson-json = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version.ref = "jackson" }

kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.7.3" }
kotlin-logging = { group = "io.github.microutils", name = "kotlin-logging", version = "3.0.5" }
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version = "6.0.2" }
junit = { group = "junit", name = "junit", version = "4.13.2" }
jsoup = { group = "org.jsoup", name = "jsoup", version = "1.17.1" }
gson = { group = "com.google.code.gson", name = "gson", version = "2.10.1" }
Expand All @@ -32,3 +32,4 @@ shadow = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
runtime = { id = "org.beryx.runtime", version = "1.13.0" }
gitarchive-tomarkdown = { id = "org.openrndr.extra.gitarchiver.tomarkdown", version.ref = "orx" }
versions = { id = "com.github.ben-manes.versions", version = "0.50.0" }

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
44 changes: 44 additions & 0 deletions src/main/kotlin/examples/30_Drawing/C150_CurvesAndShapes006.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
import kotlin.math.cos
import kotlin.math.sin

fun main() {
application {
program {
val c = Pulley(Circle(Vector2.ZERO, 30.0), Circle(Vector2.ONE * 120.0, 60.0)).contour
val cr = c.rectified()

extend {
drawer.clear(ColorRGBa.WHITE)
drawer.fill = null

// Go from 0.0 to 1.0 in two seconds
// slowing down at both ends
val t = cos(kotlin.math.PI * (seconds % 2.0) / 2.0) * 0.5 + 0.5

drawer.translate(150.0, 100.0)
drawer.contour(c)
// Note how segment length affects the speed
drawer.circle(c.position(t), 5.0)

drawer.translate(270.0, 0.0)
drawer.contour(c)
// The rectified contour provides a smooth animation
drawer.circle(cr.position(t), 5.0)
}
}
}
}

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.LineJoin
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.Pulley
import org.openrndr.extra.shapes.hobbyCurve
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

package examples.`04_Drawing`
package examples.`30_Drawing`

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.rgb
import org.openrndr.draw.font.loadFace
import org.openrndr.draw.loadFont
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.shape.LineSegment

import org.openrndr.shape.Rectangle
import org.openrndr.writer
Expand Down
Loading

0 comments on commit cd7d78b

Please sign in to comment.