Giter VIP home page Giter VIP logo

Comments (8)

Fil avatar Fil commented on July 2, 2024 2

I've opened a PR with the code change, and updated the demo notebook which was broken (because the temporary build file had disappeared).

from polybooljs.

lgpmichael2 avatar lgpmichael2 commented on July 2, 2024 1

Just wanted to mention I've pulled and used this and it works very well. Speed for working with polygons with thousands of vertices has gone from 25 seconds to less than 2 seconds. THANKS for this.

I only found it after I dug into the code and thought "hrm, linked lists are very slow, I'll change it to a sorted array" and then went to check if there was a newer code version and, hey, what's this PR... I was very happy you'd saved me the work!

from polybooljs.

Fil avatar Fil commented on July 2, 2024 1

You can also check out https://github.com/mfogel/polygon-clipping — I found it to be quite robust, and fast; see https://observablehq.com/@fil/hello-polygon-clipping for example usage.

from polybooljs.

velipso avatar velipso commented on July 2, 2024

wow, cool!

this looks great, do you have a summary of the results? I see a CSV table in the link provided, but not sure how to read it

I looked at the code, it makes sense why it would be faster, since it isn't going straight through the list, but is instead searching for the best spot

from polybooljs.

Fil avatar Fil commented on July 2, 2024

The table was an initial measurement of things, to get a sense of where time was spent. I should remove it. In my test with lots of polygons the computation is about 50x faster than the original—but we should have a real benchmark. Note that the improvement is O(n/ln n), so growing as the polygons become more complex.

from polybooljs.

Peque avatar Peque commented on July 2, 2024

@Fil Do you plan to open a MR to integrate your changes? 😊

from polybooljs.

Peque avatar Peque commented on July 2, 2024

@Fil Does polygon-clipping implement this sorted array solution you are suggesting?

from polybooljs.

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.