diff --git a/orx-easing/src/jvmDemo/kotlin/DemoEasings01.kt b/orx-easing/src/jvmDemo/kotlin/DemoEasings01.kt index 23b8656ee..2d929665e 100644 --- a/orx-easing/src/jvmDemo/kotlin/DemoEasings01.kt +++ b/orx-easing/src/jvmDemo/kotlin/DemoEasings01.kt @@ -1,8 +1,8 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.loadFont -import org.openrndr.extra.shapes.grid import org.openrndr.extra.easing.Easing +import org.openrndr.extra.shapes.primitives.grid import org.openrndr.math.Vector2 import org.openrndr.math.map diff --git a/orx-image-fit/src/jvmDemo/kotlin/DemoImageFit01.kt b/orx-image-fit/src/jvmDemo/kotlin/DemoImageFit01.kt index 0e469b1d6..131248c18 100644 --- a/orx-image-fit/src/jvmDemo/kotlin/DemoImageFit01.kt +++ b/orx-image-fit/src/jvmDemo/kotlin/DemoImageFit01.kt @@ -6,7 +6,7 @@ import org.openrndr.draw.loadFont import org.openrndr.draw.renderTarget import org.openrndr.extra.imageFit.FitMethod import org.openrndr.extra.imageFit.imageFit -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid /** * Tests `drawer.imageFit()` with all FitMethods for portrait and landscape images. diff --git a/orx-mesh-generators/src/jvmDemo/kotlin/DemoAll.kt b/orx-mesh-generators/src/jvmDemo/kotlin/DemoAll.kt index 2602ceba0..625d7d20f 100644 --- a/orx-mesh-generators/src/jvmDemo/kotlin/DemoAll.kt +++ b/orx-mesh-generators/src/jvmDemo/kotlin/DemoAll.kt @@ -3,7 +3,7 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.* import org.openrndr.extra.meshgenerators.* -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid import org.openrndr.math.Vector2 import org.openrndr.math.Vector3 import org.openrndr.shape.Rectangle diff --git a/orx-shapes/build.gradle.kts b/orx-shapes/build.gradle.kts index 8f8a95fcf..f9792335d 100644 --- a/orx-shapes/build.gradle.kts +++ b/orx-shapes/build.gradle.kts @@ -16,15 +16,11 @@ kotlin { implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) implementation(libs.kotlin.coroutines) - } - } - - val jvmMain by getting { - dependencies { implementation(project(":orx-triangulation")) } } + val jvmTest by getting { dependencies { implementation(libs.kotest.assertions) diff --git a/orx-shapes/src/commonMain/kotlin/adjust/extensions/TangentAngle.kt b/orx-shapes/src/commonMain/kotlin/adjust/extensions/TangentAngle.kt new file mode 100644 index 000000000..a55ebcb7e --- /dev/null +++ b/orx-shapes/src/commonMain/kotlin/adjust/extensions/TangentAngle.kt @@ -0,0 +1,19 @@ +package org.openrndr.extra.shapes.adjust.extensions + +import org.openrndr.extra.shapes.adjust.ContourAdjusterVertex +import org.openrndr.extra.shapes.vertex.ContourVertex +import kotlin.math.acos + +val ContourVertex.angleBetweenTangents: Double + get() { + return if (tangentIn != null && tangentOut != null) { + acos(tangentIn!!.normalized.dot(tangentOut!!.normalized)) + } else { + 0.0 + } + } + +val ContourAdjusterVertex.angleBetweenTangents: Double + get() { + return ContourVertex(contourAdjuster.contour, segmentIndex()).angleBetweenTangents + } \ No newline at end of file diff --git a/orx-shapes/src/jvmMain/kotlin/AlphaShape.kt b/orx-shapes/src/commonMain/kotlin/alphashape/AlphaShape.kt similarity index 99% rename from orx-shapes/src/jvmMain/kotlin/AlphaShape.kt rename to orx-shapes/src/commonMain/kotlin/alphashape/AlphaShape.kt index 3cf1fe1b2..127b38764 100644 --- a/orx-shapes/src/jvmMain/kotlin/AlphaShape.kt +++ b/orx-shapes/src/commonMain/kotlin/alphashape/AlphaShape.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.alphashape import org.openrndr.extra.triangulation.Delaunay import org.openrndr.math.Vector2 diff --git a/orx-shapes/src/commonMain/kotlin/Arrangement.kt b/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt similarity index 99% rename from orx-shapes/src/commonMain/kotlin/Arrangement.kt rename to orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt index f4e166893..d4cc50c68 100644 --- a/orx-shapes/src/commonMain/kotlin/Arrangement.kt +++ b/orx-shapes/src/commonMain/kotlin/arrangement/Arrangement.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.arrangement import org.openrndr.extra.kdtree.buildKDTree import org.openrndr.extra.kdtree.vector2Mapper diff --git a/orx-shapes/src/commonMain/kotlin/BezierPatch.kt b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch.kt similarity index 99% rename from orx-shapes/src/commonMain/kotlin/BezierPatch.kt rename to orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch.kt index c133f2371..c1f172245 100644 --- a/orx-shapes/src/commonMain/kotlin/BezierPatch.kt +++ b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.bezierpatches import org.openrndr.color.AlgebraicColor import org.openrndr.color.ColorRGBa diff --git a/orx-shapes/src/commonMain/kotlin/BezierPatch3D.kt b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch3D.kt similarity index 99% rename from orx-shapes/src/commonMain/kotlin/BezierPatch3D.kt rename to orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch3D.kt index d60d406cb..8e548ca79 100644 --- a/orx-shapes/src/commonMain/kotlin/BezierPatch3D.kt +++ b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatch3D.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.bezierpatches import org.openrndr.color.AlgebraicColor import org.openrndr.color.ColorRGBa diff --git a/orx-shapes/src/commonMain/kotlin/drawers/BezierPatchDrawer.kt b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatchDrawer.kt similarity index 98% rename from orx-shapes/src/commonMain/kotlin/drawers/BezierPatchDrawer.kt rename to orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatchDrawer.kt index d3480ec96..7dc436fb9 100644 --- a/orx-shapes/src/commonMain/kotlin/drawers/BezierPatchDrawer.kt +++ b/orx-shapes/src/commonMain/kotlin/bezierpatches/BezierPatchDrawer.kt @@ -1,9 +1,7 @@ -package org.openrndr.extra.shapes.drawers +package org.openrndr.extra.shapes.bezierpatches import org.openrndr.color.ColorRGBa import org.openrndr.draw.* -import org.openrndr.extra.shapes.BezierPatchBase -import org.openrndr.extra.shapes.BezierPatch3DBase import org.openrndr.internal.Driver import org.openrndr.math.Vector2 diff --git a/orx-shapes/src/commonMain/kotlin/HobbyCurve.kt b/orx-shapes/src/commonMain/kotlin/hobbycurve/HobbyCurve.kt similarity index 99% rename from orx-shapes/src/commonMain/kotlin/HobbyCurve.kt rename to orx-shapes/src/commonMain/kotlin/hobbycurve/HobbyCurve.kt index dcd589755..f0e6a89ec 100644 --- a/orx-shapes/src/commonMain/kotlin/HobbyCurve.kt +++ b/orx-shapes/src/commonMain/kotlin/hobbycurve/HobbyCurve.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.hobbycurve // Code adapted from http://weitz.de/hobby/ import org.openrndr.math.Vector2 diff --git a/orx-shapes/src/commonMain/kotlin/Arc.kt b/orx-shapes/src/commonMain/kotlin/primitives/Arc.kt similarity index 96% rename from orx-shapes/src/commonMain/kotlin/Arc.kt rename to orx-shapes/src/commonMain/kotlin/primitives/Arc.kt index c74eace80..8c88ac4f1 100644 --- a/orx-shapes/src/commonMain/kotlin/Arc.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/Arc.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.* import org.openrndr.shape.ShapeContour diff --git a/orx-shapes/src/commonMain/kotlin/Circle.kt b/orx-shapes/src/commonMain/kotlin/primitives/Circle.kt similarity index 96% rename from orx-shapes/src/commonMain/kotlin/Circle.kt rename to orx-shapes/src/commonMain/kotlin/primitives/Circle.kt index 8babb2248..6a3f5f349 100644 --- a/orx-shapes/src/commonMain/kotlin/Circle.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/Circle.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.Polar import org.openrndr.math.Vector2 diff --git a/orx-shapes/src/commonMain/kotlin/Net.kt b/orx-shapes/src/commonMain/kotlin/primitives/Net.kt similarity index 98% rename from orx-shapes/src/commonMain/kotlin/Net.kt rename to orx-shapes/src/commonMain/kotlin/primitives/Net.kt index b0ccd1373..302b3ac18 100644 --- a/orx-shapes/src/commonMain/kotlin/Net.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/Net.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.LinearType import org.openrndr.math.Polar diff --git a/orx-shapes/src/commonMain/kotlin/Pulley.kt b/orx-shapes/src/commonMain/kotlin/primitives/Pulley.kt similarity index 97% rename from orx-shapes/src/commonMain/kotlin/Pulley.kt rename to orx-shapes/src/commonMain/kotlin/primitives/Pulley.kt index f47161b9f..b736b5477 100644 --- a/orx-shapes/src/commonMain/kotlin/Pulley.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/Pulley.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.LinearType import org.openrndr.math.Polar diff --git a/orx-shapes/src/commonMain/kotlin/RectangleGrid.kt b/orx-shapes/src/commonMain/kotlin/primitives/RectangleGrid.kt similarity index 98% rename from orx-shapes/src/commonMain/kotlin/RectangleGrid.kt rename to orx-shapes/src/commonMain/kotlin/primitives/RectangleGrid.kt index c31faf0d7..3acf1f7c9 100644 --- a/orx-shapes/src/commonMain/kotlin/RectangleGrid.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/RectangleGrid.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.shape.Rectangle import kotlin.math.round diff --git a/orx-shapes/src/commonMain/kotlin/RegularPolygon.kt b/orx-shapes/src/commonMain/kotlin/primitives/RegularPolygon.kt similarity index 98% rename from orx-shapes/src/commonMain/kotlin/RegularPolygon.kt rename to orx-shapes/src/commonMain/kotlin/primitives/RegularPolygon.kt index be60f8d87..8c796690b 100644 --- a/orx-shapes/src/commonMain/kotlin/RegularPolygon.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/RegularPolygon.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.Vector2 import org.openrndr.math.asRadians diff --git a/orx-shapes/src/commonMain/kotlin/RegularStar.kt b/orx-shapes/src/commonMain/kotlin/primitives/RegularStar.kt similarity index 98% rename from orx-shapes/src/commonMain/kotlin/RegularStar.kt rename to orx-shapes/src/commonMain/kotlin/primitives/RegularStar.kt index a085cf2fa..e4190fa63 100644 --- a/orx-shapes/src/commonMain/kotlin/RegularStar.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/RegularStar.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.Vector2 import org.openrndr.math.asRadians diff --git a/orx-shapes/src/commonMain/kotlin/RoundedRectangle.kt b/orx-shapes/src/commonMain/kotlin/primitives/RoundedRectangle.kt similarity index 97% rename from orx-shapes/src/commonMain/kotlin/RoundedRectangle.kt rename to orx-shapes/src/commonMain/kotlin/primitives/RoundedRectangle.kt index df4986de2..18f4afa0a 100644 --- a/orx-shapes/src/commonMain/kotlin/RoundedRectangle.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/RoundedRectangle.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.draw.Drawer import org.openrndr.math.Vector2 diff --git a/orx-shapes/src/commonMain/kotlin/Tear.kt b/orx-shapes/src/commonMain/kotlin/primitives/Tear.kt similarity index 96% rename from orx-shapes/src/commonMain/kotlin/Tear.kt rename to orx-shapes/src/commonMain/kotlin/primitives/Tear.kt index 872378dc2..e66f9955c 100644 --- a/orx-shapes/src/commonMain/kotlin/Tear.kt +++ b/orx-shapes/src/commonMain/kotlin/primitives/Tear.kt @@ -1,4 +1,4 @@ -package org.openrndr.extra.shapes +package org.openrndr.extra.shapes.primitives import org.openrndr.math.LinearType import org.openrndr.math.Polar diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoAlphaShape.kt b/orx-shapes/src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt similarity index 89% rename from orx-shapes/src/jvmDemo/kotlin/DemoAlphaShape.kt rename to orx-shapes/src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt index 94a828096..8cdd122a4 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoAlphaShape.kt +++ b/orx-shapes/src/jvmDemo/kotlin/alphashape/DemoAlphaShape.kt @@ -1,6 +1,8 @@ +package alphashape + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.AlphaShape +import org.openrndr.extra.shapes.alphashape.AlphaShape import org.openrndr.math.Vector2 import kotlin.random.Random diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoArrangement01.kt b/orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt similarity index 95% rename from orx-shapes/src/jvmDemo/kotlin/DemoArrangement01.kt rename to orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt index dc0e6a190..8fd46962b 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoArrangement01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement01.kt @@ -1,8 +1,10 @@ +package arrangement + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.color.spaces.ColorOKHSVa -import org.openrndr.extra.shapes.Arrangement -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.arrangement.Arrangement +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import org.openrndr.math.Vector2 import org.openrndr.shape.Circle import org.openrndr.shape.LineSegment diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoArrangement02.kt b/orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt similarity index 94% rename from orx-shapes/src/jvmDemo/kotlin/DemoArrangement02.kt rename to orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt index 370273f32..b7c2636fd 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoArrangement02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/arrangement/DemoArrangement02.kt @@ -1,11 +1,13 @@ +package arrangement + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.isolated import org.openrndr.extra.color.spaces.ColorOKHSVa import org.openrndr.extra.noise.poissonDiskSampling -import org.openrndr.extra.shapes.Arrangement -import org.openrndr.extra.shapes.BoundedFace -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.arrangement.Arrangement +import org.openrndr.extra.shapes.arrangement.BoundedFace +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import kotlin.random.Random fun main() = application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch01.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch01.kt similarity index 95% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch01.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch01.kt index 4936d4e02..3d5ecba88 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch01.kt @@ -1,7 +1,8 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.shape.LineSegment import org.openrndr.shape.ShapeContour diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch02.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch02.kt similarity index 91% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch02.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch02.kt index 07ad18213..f3b2f19f3 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch02.kt @@ -1,7 +1,8 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.shape.Circle import org.openrndr.shape.ShapeContour diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch03.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch03.kt similarity index 89% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch03.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch03.kt index cda47d749..60f0175aa 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch03.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch03.kt @@ -1,9 +1,10 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch -import org.openrndr.extra.shapes.distort -import org.openrndr.extra.shapes.regularStarRounded +import org.openrndr.extra.shapes.bezierpatches.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.distort +import org.openrndr.extra.shapes.primitives.regularStarRounded import org.openrndr.math.transforms.transform import org.openrndr.shape.Circle import org.openrndr.shape.ShapeContour diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch04.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch04.kt similarity index 93% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch04.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch04.kt index 73bd2da95..2bd588c08 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch04.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch04.kt @@ -1,7 +1,8 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.shape.Circle /** diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch05.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch05.kt similarity index 93% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch05.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch05.kt index 95e837e73..8bb1a5d8d 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatch05.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatch05.kt @@ -1,10 +1,9 @@ +package bezierpatch + import org.openrndr.WindowMultisample import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.draw.BufferMultisample -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch -import org.openrndr.extra.shapes.drawers.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.extra.camera.Orbital import org.openrndr.math.Vector3 import org.openrndr.shape.Segment3D diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer01.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt similarity index 88% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer01.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt index 929c240d0..6d24ef5f7 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer01.kt @@ -1,8 +1,8 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch -import org.openrndr.extra.shapes.drawers.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.shape.Circle fun main() { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer02.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt similarity index 93% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer02.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt index b22f31a85..edcb91c95 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer02.kt @@ -1,10 +1,10 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.loadFont -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.color.spaces.toOKLABa -import org.openrndr.extra.shapes.bezierPatch -import org.openrndr.extra.shapes.drawers.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch import org.openrndr.shape.Circle fun main() { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer03.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt similarity index 91% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer03.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt index 43969ee76..663b8e9e8 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatchDrawer03.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatchDrawer03.kt @@ -1,12 +1,11 @@ +package bezierpatch + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.isolated -import org.openrndr.draw.loadFont -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch -import org.openrndr.extra.shapes.drawers.bezierPatch -import org.openrndr.extra.shapes.grid import org.openrndr.extra.color.spaces.toOKLABa +import org.openrndr.extra.shapes.bezierpatches.bezierPatch +import org.openrndr.extra.shapes.primitives.grid import org.openrndr.math.Vector2 import org.openrndr.math.Vector3 import org.openrndr.math.min diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatches01.kt b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatches01.kt similarity index 78% rename from orx-shapes/src/jvmDemo/kotlin/DemoBezierPatches01.kt rename to orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatches01.kt index e5ae2f7dc..8ff4d1a0c 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoBezierPatches01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/bezierpatch/DemoBezierPatches01.kt @@ -1,11 +1,10 @@ +package bezierpatch + import org.openrndr.application -import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatch +import org.openrndr.extra.shapes.bezierpatches.bezierPatches import org.openrndr.shape.Circle import org.openrndr.shape.ShapeContour -import org.openrndr.extra.shapes.drawers.bezierPatch -import org.openrndr.extra.shapes.drawers.bezierPatches /** * Shows how to create a [bezierPatch] out of a diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve01.kt b/orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt similarity index 87% rename from orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve01.kt rename to orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt index 7d031ec55..6c9878451 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve01.kt @@ -1,6 +1,8 @@ +package hobbycurve + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import org.openrndr.math.Vector2 fun main() = application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve02.kt b/orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt similarity index 84% rename from orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve02.kt rename to orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt index 6b5d97aac..4a9bf2846 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoHobbyCurve02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/hobbycurve/DemoHobbyCurve02.kt @@ -1,7 +1,9 @@ +package hobbycurve + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.AlphaShape -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.alphashape.AlphaShape +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import org.openrndr.math.Vector2 import kotlin.random.Random diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoArc01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoArc01.kt similarity index 89% rename from orx-shapes/src/jvmDemo/kotlin/DemoArc01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoArc01.kt index 0aa25c89e..97f85b804 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoArc01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoArc01.kt @@ -1,6 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.Arc +import org.openrndr.extra.shapes.primitives.Arc fun main() { application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoNet01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoNet01.kt similarity index 93% rename from orx-shapes/src/jvmDemo/kotlin/DemoNet01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoNet01.kt index 04e219649..91a772c28 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoNet01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoNet01.kt @@ -1,6 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.Net +import org.openrndr.extra.shapes.primitives.Net import org.openrndr.shape.Circle import kotlin.math.sin diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoPulley01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoPulley01.kt similarity index 90% rename from orx-shapes/src/jvmDemo/kotlin/DemoPulley01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoPulley01.kt index c43961cf4..f51a8178b 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoPulley01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoPulley01.kt @@ -1,6 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.Pulley +import org.openrndr.extra.shapes.primitives.Pulley import org.openrndr.math.Vector2 import org.openrndr.shape.Circle diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt similarity index 91% rename from orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt index 9e64f1f4e..ede599e32 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid01.kt @@ -1,6 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid fun main() { application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid02.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt similarity index 94% rename from orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid02.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt index 560d228de..0cfc247fb 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRectangleGrid02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRectangleGrid02.kt @@ -1,7 +1,9 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.noise.Random -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid fun main() { application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRegularPolygon.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt similarity index 90% rename from orx-shapes/src/jvmDemo/kotlin/DemoRegularPolygon.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt index 5b7a65fd5..b92821904 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRegularPolygon.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularPolygon.kt @@ -1,8 +1,9 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.isolated -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.regularPolygon +import org.openrndr.extra.shapes.primitives.regularPolygon import org.openrndr.math.map import kotlin.math.cos diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRegularStar01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt similarity index 86% rename from orx-shapes/src/jvmDemo/kotlin/DemoRegularStar01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt index 3fb3e5900..46722157a 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRegularStar01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar01.kt @@ -1,7 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.regularStar +import org.openrndr.extra.shapes.primitives.regularStar import kotlin.math.cos import kotlin.math.sin diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRegularStar02.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt similarity index 92% rename from orx-shapes/src/jvmDemo/kotlin/DemoRegularStar02.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt index 461355ab9..d1454ed31 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRegularStar02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRegularStar02.kt @@ -1,7 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.regularStar +import org.openrndr.extra.shapes.primitives.regularStar import org.openrndr.math.Vector2 import org.openrndr.shape.contains import kotlin.math.cos diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRoundedRectangle.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt similarity index 81% rename from orx-shapes/src/jvmDemo/kotlin/DemoRoundedRectangle.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt index 38e594d53..47090782d 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRoundedRectangle.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoRoundedRectangle.kt @@ -1,7 +1,8 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extensions.SingleScreenshot -import org.openrndr.extra.shapes.RoundedRectangle +import org.openrndr.extra.shapes.primitives.RoundedRectangle import kotlin.math.cos fun main() = application { diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoSplit01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoSplit01.kt similarity index 97% rename from orx-shapes/src/jvmDemo/kotlin/DemoSplit01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoSplit01.kt index c7022290f..f065113b6 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoSplit01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoSplit01.kt @@ -1,3 +1,5 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.color.presets.MEDIUM_PURPLE diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoTear01.kt b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoTear01.kt similarity index 92% rename from orx-shapes/src/jvmDemo/kotlin/DemoTear01.kt rename to orx-shapes/src/jvmDemo/kotlin/primitives/DemoTear01.kt index 5cd15903d..a87dfba19 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoTear01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/primitives/DemoTear01.kt @@ -1,7 +1,9 @@ +package primitives + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.noise.scatter -import org.openrndr.extra.shapes.Tear +import org.openrndr.extra.shapes.primitives.Tear import org.openrndr.math.Vector2 import org.openrndr.shape.Circle import kotlin.random.Random diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour01.kt b/orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt similarity index 92% rename from orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour01.kt rename to orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt index 81f44f674..d5843e185 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour01.kt @@ -1,7 +1,9 @@ +package rectify + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.noise.scatter -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import org.openrndr.extra.shapes.rectify.rectified import kotlin.random.Random diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour02.kt b/orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt similarity index 93% rename from orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour02.kt rename to orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt index cf613faf4..907192a36 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoRectifiedContour02.kt +++ b/orx-shapes/src/jvmDemo/kotlin/rectify/DemoRectifiedContour02.kt @@ -1,7 +1,9 @@ +package rectify + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.extra.noise.scatter -import org.openrndr.extra.shapes.hobbyCurve +import org.openrndr.extra.shapes.hobbycurve.hobbyCurve import org.openrndr.extra.shapes.rectify.rectified import kotlin.random.Random diff --git a/orx-shapes/src/jvmDemo/kotlin/DemoText01.kt b/orx-shapes/src/jvmDemo/kotlin/text/DemoText01.kt similarity index 98% rename from orx-shapes/src/jvmDemo/kotlin/DemoText01.kt rename to orx-shapes/src/jvmDemo/kotlin/text/DemoText01.kt index ec4407450..35bc617f6 100644 --- a/orx-shapes/src/jvmDemo/kotlin/DemoText01.kt +++ b/orx-shapes/src/jvmDemo/kotlin/text/DemoText01.kt @@ -1,3 +1,5 @@ +package text + import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.font.loadFace diff --git a/orx-shapes/src/jvmTest/kotlin/TestChamferCorners.kt b/orx-shapes/src/jvmTest/kotlin/TestChamferCorners.kt index 63c667683..4eedff2b2 100644 --- a/orx-shapes/src/jvmTest/kotlin/TestChamferCorners.kt +++ b/orx-shapes/src/jvmTest/kotlin/TestChamferCorners.kt @@ -2,7 +2,7 @@ import io.kotest.core.spec.style.DescribeSpec import io.kotest.matchers.equals.shouldBeEqual import org.openrndr.extra.shapes.operators.bevelCorners import org.openrndr.extra.shapes.operators.roundCorners -import org.openrndr.extra.shapes.regularPolygon +import org.openrndr.extra.shapes.primitives.regularPolygon import org.openrndr.shape.Circle import org.openrndr.shape.contour diff --git a/orx-shapes/src/jvmTest/kotlin/TestRegularPolygon.kt b/orx-shapes/src/jvmTest/kotlin/TestRegularPolygon.kt index c88ce713c..3d53e705d 100644 --- a/orx-shapes/src/jvmTest/kotlin/TestRegularPolygon.kt +++ b/orx-shapes/src/jvmTest/kotlin/TestRegularPolygon.kt @@ -1,9 +1,9 @@ import io.kotest.core.spec.style.DescribeSpec import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.equals.shouldBeEqual -import org.openrndr.extra.shapes.regularPolygon -import org.openrndr.extra.shapes.regularPolygonBeveled -import org.openrndr.extra.shapes.regularPolygonRounded +import org.openrndr.extra.shapes.primitives.regularPolygon +import org.openrndr.extra.shapes.primitives.regularPolygonBeveled +import org.openrndr.extra.shapes.primitives.regularPolygonRounded import org.openrndr.shape.Winding class TestRegularPolygon : DescribeSpec({ diff --git a/orx-shapes/src/jvmTest/kotlin/TestRegularStar.kt b/orx-shapes/src/jvmTest/kotlin/TestRegularStar.kt index b278e6882..09bc9c630 100644 --- a/orx-shapes/src/jvmTest/kotlin/TestRegularStar.kt +++ b/orx-shapes/src/jvmTest/kotlin/TestRegularStar.kt @@ -1,10 +1,9 @@ import io.kotest.core.spec.style.DescribeSpec import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.equals.shouldBeEqual -import org.openrndr.extra.shapes.regularPolygonBeveled -import org.openrndr.extra.shapes.regularPolygonRounded -import org.openrndr.extra.shapes.regularStar -import org.openrndr.extra.shapes.regularStarRounded +import org.openrndr.extra.shapes.primitives.regularPolygonBeveled +import org.openrndr.extra.shapes.primitives.regularStar +import org.openrndr.extra.shapes.primitives.regularStarRounded import org.openrndr.shape.Winding class TestRegularStar : DescribeSpec({ diff --git a/orx-shapes/src/jvmTest/kotlin/TestRoundedRectangle.kt b/orx-shapes/src/jvmTest/kotlin/TestRoundedRectangle.kt index 86d710799..6efee0b0f 100644 --- a/orx-shapes/src/jvmTest/kotlin/TestRoundedRectangle.kt +++ b/orx-shapes/src/jvmTest/kotlin/TestRoundedRectangle.kt @@ -1,7 +1,7 @@ import io.kotest.core.spec.style.DescribeSpec import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.equals.shouldBeEqual -import org.openrndr.extra.shapes.* +import org.openrndr.extra.shapes.primitives.RoundedRectangle import org.openrndr.shape.Winding class TestRoundedRectangle : DescribeSpec({ diff --git a/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi02.kt b/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi02.kt index 866782bbf..427347f75 100644 --- a/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi02.kt +++ b/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi02.kt @@ -1,6 +1,6 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid import org.openrndr.extra.triangulation.delaunayTriangulation import org.openrndr.shape.Circle diff --git a/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi03.kt b/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi03.kt index ba58afa72..ddd7a932f 100644 --- a/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi03.kt +++ b/orx-triangulation/src/jvmDemo/kotlin/DemoVoronoi03.kt @@ -1,6 +1,6 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa -import org.openrndr.extra.shapes.grid +import org.openrndr.extra.shapes.primitives.grid import org.openrndr.extra.triangulation.delaunayTriangulation import org.openrndr.math.Vector2 import org.openrndr.math.Vector3