Giter VIP home page Giter VIP logo

Comments (4)

mourner avatar mourner commented on June 18, 2024

Interesting! Might be a bug — will look at it next week.

from delaunator-rs.

mourner avatar mourner commented on June 18, 2024

The reference implementation (Delaunator in JavaScript) works fine on that input, so must be something off in the port.

from delaunator-rs.

Roughsketch avatar Roughsketch commented on June 18, 2024

I've been getting the same issue while trying out this library. It makes it impossible to use for my purpose since it involves lots of calls with moving points. It seems I can only loop a few thousand times on average before it hits this and crashes.

From what I can tell the cause is on line 232:

delaunator-rs/src/lib.rs

Lines 230 to 235 in 82ddbdb

let mut e = hull.start;
loop {
if hull.tri[e] == bl {
hull.tri[e] = a;
break;
}

e at this point will be -1, or EMPTY, and instead of handling the empty value it instead tries to index into the slice. I do not know enough about the algorithm to know what is causing this, so I'm not sure if a simple empty check would suffice.

from delaunator-rs.

andreesteve avatar andreesteve commented on June 18, 2024

@mourner - whenever you get some time, do you think you could do a package release on crates.io with this fix? I use this crate on my library and I'd love to be able to reference the package version with this fix. Let me know if I can help in any way. Thank you!

from delaunator-rs.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.