{"name":"hull.js","version":"1.0.0","keywords":["geometry","concave-hull","math","alpha-shape","algorithm"],"author":{"name":"Andrii Heonia","email":"a.heonia@gmail.com"},"license":"BSD","_id":"hull.js@1.0.0","maintainers":[{"name":"andriiheonia","email":"a.heonia@gmail.com"}],"homepage":"https://github.com/AndriiHeonia/hull","bugs":{"url":"https://github.com/AndriiHeonia/hull/issues"},"dist":{"shasum":"509bf09384a9959c6f8b9c66abe07056f6f25f8d","tarball":"http://registry-npm.ywwl.com/hull.js/download/hull.js-1.0.0.tgz","fileCount":36,"integrity":"sha512-JwKyla57UJdor52LI17jJ00aRzwYZUrq/V+WkOSQoF0ZuBz1NBwAyI7VzDmSFSPqUrgVJc3HCvqnMQzUW6Ku9w==","signatures":[{"sig":"MEYCIQCzn+stMP7Z+2/PqJDvotzOri1EO70PDPRl3Efl7SyZ8wIhAJER0zC82ILJYex87alm+7Lm+RpefSSYE3s9atXXI008","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17013144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFlHpCRA9TVsSAnZWagAAWzcP/AkJXNyJvONapdTkzzeq\nJEMXaCloHyxXugVJQl8r3og0u/FzYaHE8hUor/tF9wjiqi/2kBVqlBy5sW6U\nMNO6nryRuXkXllH+NLzZlZ3rUF1C9wx6GQYaNV4gJnLb1uNe7GuaaWb5r65u\no8AG80G/W5A1Oxs3OP1d0T74ulbVhSbI3qXH0fJZ92bIAQku/BPbEplVZuuq\nc5VRIbzKp4j/DXG3tkmt+ioBETvJlMq/yY/pxetLxKbkU9iXqUCuLapLm4xk\nDEOkppznpyGUhJK3gBmREpzjw8LSh4qGA6kEnoU0TBjxvbDoE9t1OKTTtCA+\nqTB9y0yEGujuweXJH6Nm/C0/TpI0MMxVYUFarIKYFPQyGvyEDBeuthmG6MC4\nTRnNKxA6cOn14bR2w9wfyiZz60CkRe7/6Gf+qns1p6zkwCW+nZcYuDvhqkHE\nioR+ltPWSQKl3V+TWwSv80y6AcotntTfrfVL4VHGOGuoDqQe64Bc9lwEWX29\nOpwJhzvQlw44R3Iam3d1mhQCDwz86Is/sfnUnIF86KVhM7tVAJC7XcdHBoBC\njh8kW6AXQDHunj0Io1rk1+8kR0nnQITvKCe8h3kt13LfcFJBCnoaqdQd4m6y\nA4ieGwFPL9+MVtv3y9WwgCoUGjAszUEUYmbHXiGqwdwF/R7J6iBW5tIrk3ZQ\nSb9Q\r\n=+qhV\r\n-----END PGP SIGNATURE-----\r\n","size":5453226,"noattachment":false,"key":"/hull.js/-/hull.js-1.0.0.tgz"},"main":"./src/hull.js","gitHead":"1ce2b416d538dd62b904f32b89cdec2fe7525cb9","scripts":{"test":"./node_modules/jshint/bin/jshint src/intersect.js && ./node_modules/jshint/bin/jshint src/grid.js && ./node_modules/jshint/bin/jshint src/hull.js && ./node_modules/.bin/mocha -R spec && ./node_modules/browserify/bin/cmd.js ./src/hull.js --standalone hull > ./dist/hull.js","watch":"./node_modules/nodemon/bin/nodemon.js --watch src --exec \"./node_modules/browserify/bin/cmd.js ./src/hull.js --standalone hull > ./dist/hull.js\""},"_npmUser":{"name":"andriiheonia","email":"a.heonia@gmail.com"},"deprecated":"This package is unmaintained and vulnerable. Do not use it.","repository":{"url":"git://github.com/AndriiHeonia/hull.git","type":"git"},"_npmVersion":"6.4.1","description":"JavaScript library that builds concave hulls (shapes) by set of points","directories":{},"_nodeVersion":"10.15.3","jshintConfig":{"node":true,"forin":false,"esversion":6},"_hasShrinkwrap":false,"devDependencies":{"mocha":"~6.0.2","jshint":"~2.10.2","nodemon":"~1.18.0","browserify":"~16.2.3"},"_npmOperationalInternal":{"tmp":"tmp/hull.js_1.0.0_1561743848233_0.4319615710791396","host":"s3://npm-registry-packages"},"readme":"Hull.js is a JavaScript library that builds concave hull by the set of points.\n\n## Examples\n\nSee live examples <a target=\"_blank\" href=\"http://andriiheonia.github.io/hull/\">here</a>.\n\n## Usage\n\n\tvar points = [ [236, 126], [234, 115], [238, 109], [247, 102], ... ];\n\thull(points, 50); // returns points of the hull (in clockwise order)\n\n## Params\n* 1st param - array of coordinates in format: `[[x1, y1], [x2, y2], ..., [xn, yn]]`;\n* 2nd param - concavity. `1` - thin shape. `Infinity` - convex hull. By default `20`;\n* 3rd param - points format. For example: `['.lng', '.lat']` if you have `{lng: x, lat: y}` points. By default you can use `[x, y]` points.\n\n## How it works\n\nLet's see step by step what happens when you call `hull()` function:\n\n<ol>\n    <li>\n        <div>Hull.js takes your source points of the shape:</div>\n        <div><img src=\"https://raw.githubusercontent.com/AndriiHeonia/hull/master/readme-imgs/0.png\" /></div>\n    </li>\n    <li>\n        <div>Builds convex hull:</div>\n        <div><img src=\"https://raw.githubusercontent.com/AndriiHeonia/hull/master/readme-imgs/1.png\" /></div>\n    </li>\n    <li>\n        <div>After that, the edges flex inward (according to the `concavity` param). For example:</div>\n        <div>\n            <img src=\"https://raw.githubusercontent.com/AndriiHeonia/hull/master/readme-imgs/2_1.png\" />\n            `concavity = 80`<br/>\n            <img src=\"https://raw.githubusercontent.com/AndriiHeonia/hull/master/readme-imgs/2_2.png\" />\n            `concavity = 40`<br/>\n            <img src=\"https://raw.githubusercontent.com/AndriiHeonia/hull/master/readme-imgs/2_3.png\" />\n            `concavity = 20`\n        </div>\n    </li>\n</ol>\n\n## Limitations\nThis library relies on ES6. The ES6 features used are:\n- `new Set(null)`, `Set#add`, `Set#has`\n- `let`, `const`\n- `Math.trunc` (if available)\n\nYou may use [polyfills](https://www.npmjs.com/package/core-js) for `Set` and compile with [babel](https://babeljs.io/) to continue to support old browsers.\n\n## Development\n\tnpm install     # install dependencies\n\tnpm test        # build dist file and run tests\n\tnpm run watch   # watch ./src dir and rebuild dist file\n\n## Contribute\n\nIf you want to get involved with Hull.js development, just use <a href=\"https://guides.github.com/introduction/flow/index.html\" target=\"_blank\">github flow</a> and feel free to contribute!\n\n## To-do\n\n* think about holes;\n* think about automatic `concavity` adjustment based on density.\n\n## Related papers\n\n* <a target=\"_blank\" href=\"http://www.it.uu.se/edu/course/homepage/projektTDB/ht13/project10/Project-10-report.pdf\">Implementation of a fast and efficient concave hull algorithm</a>;\n* <a target=\"_blank\" href=\"http://www.cs.jhu.edu/~misha/Fall05/09.13.05.pdf\">Computational Geometry: Convex Hulls</a>;\n* <a target=\"_blank\" href=\"https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain\">Andrew's monotone chain convex hull algorithm</a>;\n* <a target=\"_blank\" href=\"http://bryceboe.com/2006/10/23/line-segment-intersection-algorithm/\">Line Segment Intersection Algorithm</a>;\n* <a target=\"_blank\" href=\"http://allenchou.net/2013/07/cross-product-of-2d-vectors/\">Game Math: \"Cross Product\" of 2D Vectors</a>;\n* <a target=\"_blank\" href=\"http://users.livejournal.com/_winnie/237714.html\">Угол между двумя векторами</a>;\n* <a target=\"_blank\" href=\"http://habrahabr.ru/post/105882/\">Когда не нужна тригонометрия</a>.\n\n## Changelog\n\n### 1.0.6 — 12.04.2024\n- Exclude \"readme-imgs\" folder from NPM package.\n### 1.0.5 — 08.02.2024\n- Minor fixes (readme, copyrights).\n### 1.0.4 — 17.10.2023\n- Remove unused travis file and update readme.\n### 1.0.3 — 05.11.2022\n- Fix issue with formatting when users pass less than 4 points as an input.\n- Remove bower.json, as Bower itself is deprecated.\n### 1.0.2 — 26.09.2021\n- Clean up .gitignore.\n- Add \"debug\" folder to .npmignore to reduce tarball size.\n### 1.0.1 — 24.10.2020\n- Introduce fix that avoids hitting stack size limit on large arrays.\n### 1.0.0 — 28.06.2019\n- Change language level to ES6.\n- Performance improvements.\n### 0.2.11 — 05.05.2019\n- Return the first point as the last point when fewer than 4 unique points are provided.\n### 0.2.10 — 04.09.2016\n- Fix missing \"var\" declaration.\n### 0.2.9 — 28.07.2016\n- Fix modification of the initial array.\n- Add filtration of the duplicates.\n### 0.2.8 — 01.04.2016\n- Add edgeSkipList to increase performance of the highly accurate shapes (with the small `concavity` number) + refactoring.\n### 0.2.7 — 01.05.2015\n- Fix bower.json.\n### 0.2.6 — 01.05.2015\n- Fix bower.json.\n### 0.2.5 — 01.05.2015\n- Bower support.\n### 0.2.4 — 23.03.2015\n- Minor fixes (copyrights).\n### 0.2.3 — 04.02.2015\n- Minor fixes (readme, package.json).\n### 0.2.2 — 04.02.2015\n- Configurable point formats, now you can use points like `{x: 10, y: 10}` and `{lat: 52, lng: 82}`.\n### 0.2.1 — 21.10.2014\n- Some minor updates (doc, package.json, etc.).\n### 0.2.0 — 20.10.2014\n- Second version with better performance inspired by <a href=\"http://www.it.uu.se/edu/course/homepage/projektTDB/ht13/project10/Project-10-report.pdf\" target=\"_blank\">this</a> article.\n### 0.1.0 — 06.09.2014\n- First version based on Delaunay triangulation.\n","publish_time":1561743848739,"_cnpm_publish_time":1561743848739,"dist-tags":{"latest":"1.0.6"}}