[orx-shapes] Fix Tunni demos

This commit is contained in:
Edwin Jakobs
2024-01-18 07:24:54 +01:00
parent 1e0630483e
commit 77e06cdb99
5 changed files with 14 additions and 13 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)
}
}
}