Giter Club home page Giter Club logo

hatcher's Introduction

hatcher

A React component that renders hatched lines over an area.

hatcher's People

Watchers

James Cloos avatar Erik Hermansen avatar

hatcher's Issues

Turf polygon slice algorithm.

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.

image

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.

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.