openrndr / orx

A growing library of assorted data structures, algorithms and utilities for OPENRNDR
https://openrndr.org
BSD 2-Clause "Simplified" License
119 stars 35 forks source link

orx-shapes does not declare Delaunator dependency #282

Closed jbellis closed 4 months ago

jbellis commented 1 year ago

Operating System

Everything

OPENRNDR version

0.4.1

ORX version

0.4.1

Java version (if applicable)

No response

Describe the bug

Using AlphaShape from orx-shapes results in a class not found error for Delaunator. Adding the dependency to my own build file fixes it:

                // orx-shapes requires this but does not correctly declare it
                implementation("com.github.ricardomatias:delaunator:1.0.2")

Steps to reproduce the bug

No response

hamoid commented 4 months ago

Thank you for reporting this!

It seems to be resolved (we are now at 0.4.4 -> 0.4.5). I cloned openrndr-template, entered the following program...

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.AlphaShape
import org.openrndr.math.Vector2
import kotlin.random.Random

fun main() = application {
    program {
        val points = List(40) {
            Vector2(
                Random.nextDouble(width*0.25, width*0.75),
                Random.nextDouble(height*0.25, height*0.75)
            )
        }
        val alphaShape = AlphaShape(points)
        val c = alphaShape.createContour()
        extend {
            drawer.fill = ColorRGBa.PINK
            drawer.contour(c)
            drawer.fill = ColorRGBa.WHITE
            drawer.circles(points, 4.0)
        }
    }
}

...and it runs successfully. Please re-open if still an issue.