Giter Site home page Giter Site logo

Comments (11)

gorhill avatar gorhill commented on August 30, 2024

I like your idea of returning the neighbouring cells, makes complete sense. However regarding the random neighbour feature, this strikes me as too much of application-specific, not a "natural" feature, so I will remove this one after the merge.

from javascript-voronoi.

morgajel avatar morgajel commented on August 30, 2024

Makes perfect sense; it was easy enough to implement inside or outside of the library.

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

Ok I finally merged your GetNeighbourIDs(), but I mistakenly merged everything else which I did not want until I understand well what you propose. I also like your idea of finding which Voronoi cell is under a specific vertex, except I want to look more closely at your implementation.

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

Re "Unsure what to do on corners/edges which could be in 2 or more cells":

Well, we are dealing with mathematical objects here: points have no dimension, lines have no thickness, so there is really no issue. My concern is how to lookup efficiently a cell given a point. I need to give some more thoughts to this.

from javascript-voronoi.

morgajel avatar morgajel commented on August 30, 2024

ok, so it looks like I screwed up my commits and you might have gotten
caught between them.

The first one added 2 new functions- getNeighborIDs and getRandomNeighborID

  • you wanted to get rid of getRandomNeighborID.

The second commit (which we haven't discussed) was adding the ability to
track corners- I accidentally pushed this and it got caught in the mix and
half implemented.

Beyond that, I had a feature request to find a cell when provided
coordinates, however I have no clue on how to implement that.

Sorry for the confusion.

On Tue, Jan 22, 2013 at 1:23 PM, Raymond Hill [email protected]:

Re "Unsure what to do on corners/edges which could be in 2 or more cells":

Well, we are dealing with mathematical objects here: points have no
dimension, lines have no thickness, so there is really no issue. My concern
is how to lookup efficiently a cell given a point. I need to give some more
thoughts to this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-12558357.

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

I looked a bit further and I will implement your idea of "cell at point" idea, it makes good sense to be part of the interface. The way I see it now it is a straightforward binary search, which I can easily implement by not throwing away the sorted array of sites I use in the main Fortune loop. (so there is zero cost on performance.)

from javascript-voronoi.

morgajel avatar morgajel commented on August 30, 2024

that's excellent news! I can't wait to give it a try.

On Tue, Jan 22, 2013 at 5:39 PM, Raymond Hill [email protected]:

I looked a bit further and I will implement your idea of "cell at point"
idea, it makes good sense to be part of the interface. The way I see it now
it is a straightforward binary search, which I can easily implement by not
throwing away the sorted array of sites I use in the main Fortune loop. (so
there is zero cost on performance.)


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-12571056.

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

Hmm, it will take a bit longer to do, it is not as straightforward as I naively thought first. I don't think I will have time to do it before the end of next week, at least this will give me time to ponder the best way to implement this.

from javascript-voronoi.

morgajel avatar morgajel commented on August 30, 2024

OK. Let me know if I can be of any help.
On Jan 23, 2013 8:08 PM, "Raymond Hill" [email protected] wrote:

Hmm, it will take a bit longer to do, it is not as straightforward as I
naively thought first. I don't think I will have time to do it before the
end of next week, at least this will give me time to ponder the best way to
implement this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-12632167.

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

The naive thinking was to think that a unidimensional data structure would allow me to efficiently lookup two-dimensional elements. Nonsense. For efficiency, need a quadtree data structure. And there happens to be one implementation in JS there: https://github.com/mikechambers/ExamplesByMesh/tree/master/JavaScript/QuadTree and a great demo of it there: http://www.mikechambers.com/blog/2011/03/21/javascript-quadtree-implementation/

from javascript-voronoi.

gorhill avatar gorhill commented on August 30, 2024

Ok, on second thought, I rather have the user himself implement, or preferably reuse whatever implementation of quadtree (or treemap) is available out there. I wrote a demo reusing one implementation from Mike Chambers (https://github.com/mikechambers/ExamplesByMesh/tree/master/JavaScript/QuadTree ), so that a user can have an idea how to proceed:

http://www.raymondhill.net/voronoi/rhill-voronoi-demo4.php

So whatever new quadtree or whatever treemap implementation comes along, a user will be free to choose whatever suits him best, rather than have one specific implementation, which might not be suitable for all cases, hard-coded in this project.

from javascript-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.