Comments (8)
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.
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.
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.
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.
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.
@Fil Do you plan to open a MR to integrate your changes? 😊
from polybooljs.
@Fil Does polygon-clipping
implement this sorted array solution you are suggesting?
from polybooljs.
Related Issues (20)
- algorithm comparison
- Suggestion: Area HOT 1
- union result is wrong
- polybool java HOT 1
- Union completely ignoring some polygons HOT 4
- Holes (again) HOT 2
- Feature Request: a way to cleanup polygons with zero-length segments HOT 1
- I made a demo game based on polybooljs, looking for performance improvements. HOT 1
- Hello, the performance of this library is very low, and the calculation is very slow. When can we have an optimized version? HOT 1
- Consider adding line segments HOT 2
- Zero length segments created HOT 1
- Yet another Java implementation HOT 3
- Cut polygon by line HOT 2
- getting intersection points HOT 2
- About porting the libary to antoher languages HOT 1
- Polygon subtraction creates degenerate result polygon HOT 3
- python port HOT 5
- Adapt code for polyline clipping.
- Geometric meaning of epsilon?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polybooljs.