Giter Club home page Giter Club logo

Comments (6)

mbostock avatar mbostock commented on May 13, 2024

I’ve reduced the test case down to four points that reliably reproduce the error. If I nudge any one of the points by a tiny amount, I’m able to compute the diagram successfully:

screen shot 2016-05-20 at 10 40 06 am

The failure is probably because there are collinear or cocircular points. Such a configuration of points has multiple valid Delaunay triangulations, as described in d3/d3#1895. This has been a problem in the past (see gorhill/Javascript-Voronoi#12). It was partially fixed by updating the port (d3/d3#1538), but I’m pretty sure we still don’t handle cocircular points correctly. As @jasondavies says, “I think a reasonable fix is to pick an arbitrary Delaunay triangulation in this situation.” But it’ll be some work to figure out how to implement that suggestion.

There was a pull request a while back that’s related (d3/d3#2238). But I haven’t had time to investigate it in detail and see if that’s an appropriate fix. I’ll try to look now.

from d3-voronoi.

mbostock avatar mbostock commented on May 13, 2024

Yeah, that fix just replaces the crash with an infinite loop, which is worse. 😁

from d3-voronoi.

mbostock avatar mbostock commented on May 13, 2024

Oops, I found something obviously wrong, and fixing it fixed this bug. I’m also testing some other changes which might make the code more reliable, but at least for your example, the above commit solves the problem.

from d3-voronoi.

mbostock avatar mbostock commented on May 13, 2024

screen shot 2016-05-20 at 12 29 37 pm

from d3-voronoi.

twhitbeck avatar twhitbeck commented on May 13, 2024

Excellent! thanks for looking into it

from d3-voronoi.

mbostock avatar mbostock commented on May 13, 2024

Fixed in 0.3.3.

from d3-voronoi.

Related Issues (20)

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.