A React component that renders hatched lines over an area.
erikh2000 / hatcher Goto Github PK
View Code? Open in Web Editor NEWReact component that draws hatch lines over an area.
React component that draws hatch lines over an area.
I took a crack at writing a polygon slice function. The implementation is found here...
https://github.com/erikh2000/hatcher/blob/master/src/turf-slice.js
A nice thing about the algorithm is that is allows slice lines with multiple segments and works with complex polygons containing holes. It is easily extendable to slice through multiple polygons at a time.
There is one caveat to using it, which is understandably a dealbreaker for including it in Turf. The slice line needs to have endpoints that, to say it sloppily, are clear of the polygon it intends to slice. This is because the algorithm depends on extending the slice line into a set of 2 polygonal masks. See the attached image below that explains a case that causes unexpected slice results. I don't see any easy way to fix it other than to ask callers to define slice lines that are outside the convex hull of the polygon they want to slice.
Anyhow, not expecting a resolution to this issue, but I'm posting it here in case anyone wants to use the code as-is or knows some elegant solution to the caveat described.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.