Skip to content

Commit

Permalink
[orx-shapes] Refactor package layout
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Jan 23, 2024
1 parent 78ba51c commit 8fbb106
Show file tree
Hide file tree
Showing 54 changed files with 138 additions and 91 deletions.
2 changes: 1 addition & 1 deletion orx-easing/src/jvmDemo/kotlin/DemoEasings01.kt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion orx-image-fit/src/jvmDemo/kotlin/DemoImageFit01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion orx-mesh-generators/src/jvmDemo/kotlin/DemoAll.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions orx-shapes/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions orx-shapes/src/commonMain/kotlin/adjust/extensions/TangentAngle.kt
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.openrndr.extra.shapes
package org.openrndr.extra.shapes.primitives

import org.openrndr.math.*
import org.openrndr.shape.ShapeContour
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.openrndr.extra.shapes
package org.openrndr.extra.shapes.primitives

import org.openrndr.shape.Rectangle
import kotlin.math.round
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Loading

0 comments on commit 8fbb106

Please sign in to comment.