From 610064c9f4b670f15467067241842e0926d680f8 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sun, 15 Nov 2020 13:20:26 +0100 Subject: [PATCH] Bump to OPENRNDR 0.3.45-rc.2 --- build.gradle | 2 +- .../src/demo/kotlin/DemoContour01.kt | 19 +++++++++ .../src/demo/kotlin/DemoContour02.kt | 41 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 openrndr-demos/src/demo/kotlin/DemoContour01.kt create mode 100644 openrndr-demos/src/demo/kotlin/DemoContour02.kt diff --git a/build.gradle b/build.gradle index 9348771f..34cb15c8 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ def openrndrUseSnapshot = false apply plugin: 'org.jetbrains.dokka' project.ext { - openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.45-rc.2" + openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.45-rc.3" kotlinVersion = "1.4.0" spekVersion = "2.0.12" libfreenectVersion = "0.5.7-1.5.4" diff --git a/openrndr-demos/src/demo/kotlin/DemoContour01.kt b/openrndr-demos/src/demo/kotlin/DemoContour01.kt new file mode 100644 index 00000000..45693f2a --- /dev/null +++ b/openrndr-demos/src/demo/kotlin/DemoContour01.kt @@ -0,0 +1,19 @@ +import org.openrndr.application +import org.openrndr.color.ColorRGBa +import org.openrndr.shape.Circle + +/** + * a simple demo that tests heavy stroke weights on tiny geometry + * + * This was made to assist in resolving https://github.com/openrndr/openrndr/issues/164 + */ +fun main() = application { + program { + val c = Circle(200.0, 200.0, 10.0).contour + extend { + drawer.strokeWeight = mouse.position.y + drawer.stroke = ColorRGBa.PINK + drawer.contour(c) + } + } +} \ No newline at end of file diff --git a/openrndr-demos/src/demo/kotlin/DemoContour02.kt b/openrndr-demos/src/demo/kotlin/DemoContour02.kt new file mode 100644 index 00000000..7ca4113b --- /dev/null +++ b/openrndr-demos/src/demo/kotlin/DemoContour02.kt @@ -0,0 +1,41 @@ +import org.openrndr.application +import org.openrndr.color.ColorRGBa +import org.openrndr.draw.LineJoin +import org.openrndr.math.Vector2 +import org.openrndr.shape.ShapeContour +import org.openrndr.shape.contour + +/** + * a simple demo that tests line joins + * + * This was made to assist in resolving https://github.com/openrndr/openrndr/issues/162 + */ + +fun arc(start: Vector2, end: Vector2, radius: Double): ShapeContour { + return contour { + moveTo(start) + arcTo(radius, radius, 0.0, false, false, end) + } +} + +fun main() = application { + configure { + width = 800 + height = 800 + } + program { + val center = Vector2(width / 2.0, height / 2.0) + val extra = Vector2(75.0, 75.0) + + extend { + drawer.clear(ColorRGBa.PINK) + + drawer.lineJoin = LineJoin.BEVEL + + drawer.strokeWeight = 40.0 + drawer.contour(arc(center - extra, center - extra - extra, 75.0)) + drawer.contour(arc(center, center + extra, 75.0 / 2.0)) + drawer.contour(arc(center + extra + extra, center + extra, 75.0 / 2.0)) + } + } +} \ No newline at end of file