From 77e06cdb9975cd832ae0b2a69e3c0acc01932dec Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Thu, 18 Jan 2024 07:24:54 +0100 Subject: [PATCH] [orx-shapes] Fix Tunni demos --- buildSrc/src/main/kotlin/CollectScreenShots.kt | 4 ++-- orx-shapes/src/commonMain/kotlin/tunni/README.md | 10 ++++++++++ .../kotlin/tunni/TunniContourEdgeExtensions.kt | 5 +---- .../src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt | 3 +-- .../src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt | 5 ----- 5 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 orx-shapes/src/commonMain/kotlin/tunni/README.md diff --git a/buildSrc/src/main/kotlin/CollectScreenShots.kt b/buildSrc/src/main/kotlin/CollectScreenShots.kt index 0413f542..b9d6dacc 100644 --- a/buildSrc/src/main/kotlin/CollectScreenShots.kt +++ b/buildSrc/src/main/kotlin/CollectScreenShots.kt @@ -8,7 +8,6 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.kotlin.dsl.register import org.gradle.process.ExecOperations -import org.gradle.work.Incremental import org.gradle.work.InputChanges import java.io.File import java.net.URLClassLoader @@ -48,7 +47,8 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() { } try { - val cp = (runtimeDependencies.get().map { it.toURI().toURL() } + inputDir.get().asFile.toURI() + val classParentDir = change.file.parentFile + val cp = (runtimeDependencies.get().map { it.toURI().toURL() } + classParentDir.toURI() .toURL()).toTypedArray() val ucl = URLClassLoader(cp) val klass = ucl.loadClass(klassName) diff --git a/orx-shapes/src/commonMain/kotlin/tunni/README.md b/orx-shapes/src/commonMain/kotlin/tunni/README.md new file mode 100644 index 00000000..43676207 --- /dev/null +++ b/orx-shapes/src/commonMain/kotlin/tunni/README.md @@ -0,0 +1,10 @@ +# orx-shapes / tunni + +Tunni point and line extensions for `Segment` + +# References + + * https://www.youtube.com/watch?v=ee9j3M_qkn8 + * https://help.fontlab.com/fontlab-vi/Tunni-Lines/ + * https://github.com/OliverLeenders/Tunni-Lines + * https://simoncozens.github.io/beziers.py/source/beziers.path.html diff --git a/orx-shapes/src/commonMain/kotlin/tunni/TunniContourEdgeExtensions.kt b/orx-shapes/src/commonMain/kotlin/tunni/TunniContourEdgeExtensions.kt index 024ab769..2e2ced8a 100644 --- a/orx-shapes/src/commonMain/kotlin/tunni/TunniContourEdgeExtensions.kt +++ b/orx-shapes/src/commonMain/kotlin/tunni/TunniContourEdgeExtensions.kt @@ -1,10 +1,7 @@ -package tunni +package org.openrndr.extra.shapes.tunni import org.openrndr.extra.shapes.adjust.ContourAdjusterEdge import org.openrndr.extra.shapes.adjust.ContourEdge -import org.openrndr.extra.shapes.tunni.tunniLine -import org.openrndr.extra.shapes.tunni.tunniPoint -import org.openrndr.extra.shapes.tunni.withTunniPoint import org.openrndr.math.Vector2 import org.openrndr.shape.LineSegment import org.openrndr.shape.Segment diff --git a/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt b/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt index 69f5ec20..6c622e52 100644 --- a/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniAdjuster01.kt @@ -1,10 +1,9 @@ -package tunni -import contour import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.shapes.adjust.adjustContour import org.openrndr.extra.shapes.tunni.tunniLine +import org.openrndr.extra.shapes.tunni.withTunniLine import org.openrndr.shape.Circle import kotlin.math.cos diff --git a/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt b/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt index 048dbce8..099de913 100644 --- a/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/tunni/DemoTunniPoint01.kt @@ -1,5 +1,3 @@ -package tunni - import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.shapes.tunni.tunniLine @@ -19,7 +17,6 @@ fun main() { drawer.fill = null for (s in c.segments) { val tp = s.tunniPoint - println(tp) drawer.circle(tp, 10.0) val sc = s.cubic drawer.lineSegment(sc.control[0], sc.control[1]) @@ -27,9 +24,7 @@ fun main() { drawer.segment(s.withTunniLine(s.tunniLine.position(0.5) + s.tunniLine.normal * cos(seconds) * 40.0)) } - drawer.contour(c) - } } }