{"name":"hull.js","version":"1.0.2","keywords":["geometry","concave-hull","math","alpha-shape","algorithm"],"author":{"name":"Andrii Heonia","email":"a.heonia@gmail.com"},"license":"BSD","_id":"hull.js@1.0.2","maintainers":[{"name":"andriiheonia","email":"a.heonia@gmail.com"}],"homepage":"https://github.com/AndriiHeonia/hull","bugs":{"url":"https://github.com/AndriiHeonia/hull/issues"},"dist":{"shasum":"1e7c4b10990e2ee491234b9ec100321aa2b0899a","tarball":"http://registry-npm.ywwl.com/hull.js/download/hull.js-1.0.2.tgz","fileCount":20,"integrity":"sha512-C1VJyrSnWqU7tp3T3QzViEdopHLm/G5ocnk8zBuS5BROaleDMBePvmgc7VdeNxR4BOzq/nzxkLFUS1L8S/wXTA==","signatures":[{"sig":"MEUCICmVWRANJ6ZtCM1wjdn6MI9545pc2uZ+ssOb5LqyD7/TAiEAvVCy9coeAb1MOeM/hceoWM8A4wh3Pzwr5QxGiVdMELU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":98860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2twvCRA9TVsSAnZWagAAPLIP/3UMv0/brri3QBDF47gP\nHBXAyMEv5Gvanf/Kx8aRe9C5DDa1vbddsFPrVsSCc0hGgcFBJmlmE+/odhJF\nRdd3gzTL+5dcukAcWIDOoYhuM2VQiP5jthocjnwE/uL+kSgnjNrTYKAoSTFx\nMoskuLUHTtYdCQN2YaOGUMrCEZAL01p8Aw6irXcEH3oqp1IQ4WIv2EqeGPhT\nmEMNlsS1g4QgN/wM32+Q1E7K4S8JYs0pMg3f23F4PQwb3mzGpF3SXme5UXbM\njcayxQ+GY+fMVQ8GluXP2MTXpCzVoeLAEeE2NaHWcUeBs/8Piiabd4VRu+SG\n2IX/SAH5dhX8Q67Mn4sShM5ZJf8OHVtL1xIOu3DSkqUgjlZa7U8vdEgCtKYD\nINDC7PDGaW9pqJXs5tfzCV5S0RH/BaQf/p6KJOaR3Tcn/lgFdw5Hd3tmlj0R\nf9oJtSaSn9ZBO9BOKGySsWtfNvdFRcmbeSw0nPmUPMFas8e3LsJmiLhlnteH\n6OlBfcztnMWZ7zm+FQLiv9B7hbYACiLPhxmEYetr8i5BPbncCDHrGfClvL8y\nmebjTn2RU8rvWp2RghK4oDtuj4tt6Pj9AelZhQh5F39EVH2d+LR+DCa5nd97\nJWubEridAYMmF6kOyznn6PTeKRzLdEvip81RcGipghqAOXhf7XIRlMXLdyHS\nbt/V\r\n=Ex5d\r\n-----END PGP SIGNATURE-----\r\n","size":56761,"noattachment":false,"key":"/hull.js/-/hull.js-1.0.2.tgz"},"main":"./src/hull.js","gitHead":"7ec0908f2f82f1d8b5c3f68ba42078f476d75fa1","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.14.12","description":"JavaScript library that builds concave hulls (shapes) by set of points","directories":{},"_nodeVersion":"14.16.1","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.2_1632650691023_0.34027860235723506","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":1632650691200,"_cnpm_publish_time":1632650691200,"dist-tags":{"latest":"1.0.6"}}