From 99bd0514b47b82dfff6e40163e94b34b8755180c Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Fri, 21 Oct 2022 11:56:55 +0200 Subject: [PATCH] Fix demos --- orx-shapes/build.gradle.kts | 2 ++ orx-triangulation/README.md | 10 ++++++++++ orx-triangulation/src/demo/kotlin/DemoDelaunay02.kt | 9 +++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/orx-shapes/build.gradle.kts b/orx-shapes/build.gradle.kts index 89ec5801..01a1aa24 100644 --- a/orx-shapes/build.gradle.kts +++ b/orx-shapes/build.gradle.kts @@ -59,6 +59,8 @@ kotlin { implementation(project(":orx-camera")) implementation(project(":orx-color")) implementation(project(":orx-triangulation")) + implementation(project(":orx-shapes")) + implementation(project(":orx-noise")) } } } diff --git a/orx-triangulation/README.md b/orx-triangulation/README.md index a65142d4..4e6eeb71 100644 --- a/orx-triangulation/README.md +++ b/orx-triangulation/README.md @@ -78,3 +78,13 @@ Edwin Jakobs / [@edwinRNDR](https://github.com/edwinRNDR) [source code](src/demo/kotlin/DemoVoronoi01.kt) ![DemoVoronoi01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi01Kt.png) + +### DemoVoronoi02 +[source code](src/demo/kotlin/DemoVoronoi02.kt) + +![DemoVoronoi02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi02Kt.png) + +### DemoVoronoi03 +[source code](src/demo/kotlin/DemoVoronoi03.kt) + +![DemoVoronoi03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-triangulation/images/DemoVoronoi03Kt.png) diff --git a/orx-triangulation/src/demo/kotlin/DemoDelaunay02.kt b/orx-triangulation/src/demo/kotlin/DemoDelaunay02.kt index 28902ba8..d37d403e 100644 --- a/orx-triangulation/src/demo/kotlin/DemoDelaunay02.kt +++ b/orx-triangulation/src/demo/kotlin/DemoDelaunay02.kt @@ -1,6 +1,7 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.noise.poissonDiskSampling +import org.openrndr.extra.noise.scatter import org.openrndr.extra.triangulation.delaunayTriangulation import org.openrndr.math.Vector2 import org.openrndr.shape.Rectangle @@ -13,11 +14,11 @@ fun main() { } program { val frame = Rectangle.fromCenter(Vector2(400.0), 600.0, 600.0) - val points = poissonDiskSampling(frame, 50.0).map { it + frame.corner } + val points = frame.scatter(50.0) val delaunay = points.delaunayTriangulation() val halfedges = delaunay.halfedges() - val hull = delaunay.hull() + //val hull = delaunay.hull() extend { drawer.clear(ColorRGBa.BLACK) @@ -26,8 +27,8 @@ fun main() { drawer.stroke = ColorRGBa.PINK drawer.contours(halfedges) - drawer.stroke = ColorRGBa.GREEN - drawer.contour(hull) + //drawer.stroke = ColorRGBa.GREEN + //drawer.contour(hull) } } }