|
1 | | -# NOTE: This library is unmaintained and deprecated. |
| 1 | +## NOTE: This library is unmaintained and deprecated. |
2 | 2 |
|
3 | | -Hull.js is a JavaScript library that builds concave hull by set of points. |
4 | | - |
5 | | -## Examples |
| 3 | +<details> |
| 4 | + <summary>Click to expand library description</summary> |
6 | 5 |
|
7 | | -See live examples <a target="_blank" href="http://andriiheonia.github.io/hull/">here</a>. |
| 6 | +JavaScript library that builds concave hull by set of points. |
8 | 7 |
|
9 | | -## Usage |
| 8 | +Usage: |
10 | 9 |
|
11 | 10 | var points = [ [236, 126], [234, 115], [238, 109], [247, 102], ... ]; |
12 | 11 | hull(points, 50); // returns points of the hull (in clockwise order) |
13 | 12 |
|
14 | | -## Params |
| 13 | +Params: |
15 | 14 |
|
16 | 15 | * 1st param - array of coordinates in format: `[[x1, y1], [x2, y2], ..., [xn, yn]]`. |
17 | 16 | * 2nd param - concavity. `1` - thin shape. `Infinity` - convex hull. By default `20`. |
18 | 17 | * 3rd param - points format. For example: `['.lng', '.lat']` if you have `{lng: x, lat: y}` points. By default you can use `[x, y]` points. |
19 | 18 |
|
20 | | -## How it works |
21 | | - |
22 | | -<details> |
23 | | - <summary>Expand</summary> |
24 | | - |
25 | | -Let's see step by step what happens when you call `hull()` function: |
26 | | - |
27 | | -<ol> |
28 | | - <li> |
29 | | - <div>Hull.js takes your source points of the shape:</div> |
30 | | - <div><img src="https://raw.githubusercontent.com/andriiheonia/hull/master/readme-imgs/0.png" /></div> |
31 | | - </li> |
32 | | - <li> |
33 | | - <div>Builds convex hull:</div> |
34 | | - <div><img src="https://raw.githubusercontent.com/andriiheonia/hull/master/readme-imgs/1.png" /></div> |
35 | | - </li> |
36 | | - <li> |
37 | | - <div>After that, the edges flex inward (according to the `concavity` param). For example:</div> |
38 | | - <div> |
39 | | - <img src="https://raw.githubusercontent.com/andriiheonia/hull/master/readme-imgs/2_1.png" /> |
40 | | - `concavity = 80`<br/> |
41 | | - <img src="https://raw.githubusercontent.com/andriiheonia/hull/master/readme-imgs/2_2.png" /> |
42 | | - `concavity = 40`<br/> |
43 | | - <img src="https://raw.githubusercontent.com/andriiheonia/hull/master/readme-imgs/2_3.png" /> |
44 | | - `concavity = 20` |
45 | | - </div> |
46 | | - </li> |
47 | | -</ol> |
48 | | - |
49 | | -</details> |
50 | | - |
51 | 19 | ## NPM package |
52 | 20 |
|
53 | | -Since version 1.0.7 this library is not hosted on npmjs.com. You can still use [GitHub URL](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#github-urls) as a dependency to fetch the latest version, but keep in mind that the entire library is deprecated and there are no plans to maintain it. |
| 21 | +It is still possible to fetch the latest version of the library by using [GitHub URL](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#github-urls) as a dependency, but **since the entire library is now deprecated, it is recommended to look for alternative solutions**. |
54 | 22 |
|
55 | 23 | Publishing this library to the public NPM registry under a different name and encouraging other users using unmaintained package is not recommended. |
56 | 24 |
|
57 | | -## Development |
58 | | - |
59 | | - npm install # install dependencies |
60 | | - npm run test # run tests and build file for debugging in browser |
61 | | - npm run watch # watch ./src dir and automatically rebuild file for debugging |
62 | | - |
63 | | -## TypeScript |
64 | | - |
65 | | -You can install <a target="_blank" href="https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hull.js">third-party TypeScript definitions</a> via `npm install --save @types/hull.js`. |
66 | | - |
67 | 25 | ## Related papers |
68 | 26 |
|
| 27 | +<details> |
| 28 | + <summary>Expand</summary> |
| 29 | + |
69 | 30 | * <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>. |
70 | 31 | * <a target="_blank" href="http://www.cs.jhu.edu/~misha/Fall05/09.13.05.pdf">Computational Geometry: Convex Hulls</a>. |
71 | 32 | * <a target="_blank" href="https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain">Andrew's monotone chain convex hull algorithm</a>. |
72 | 33 | * <a target="_blank" href="http://bryceboe.com/2006/10/23/line-segment-intersection-algorithm/">Line Segment Intersection Algorithm</a>. |
73 | 34 | * <a target="_blank" href="http://allenchou.net/2013/07/cross-product-of-2d-vectors/">Game Math: "Cross Product" of 2D Vectors</a>. |
74 | 35 | * <a target="_blank" href="http://users.livejournal.com/_winnie/237714.html">Угол между двумя векторами</a>. |
75 | 36 | * <a target="_blank" href="http://habrahabr.ru/post/105882/">Когда не нужна тригонометрия</a>. |
| 37 | +</details> |
76 | 38 |
|
77 | 39 | ## Changelog |
78 | 40 |
|
79 | 41 | <details> |
80 | 42 | <summary>Expand</summary> |
81 | 43 |
|
| 44 | +### 1.0.13 - 08.02.2025 |
| 45 | +- Prepare for archiving: remove helper files, examples, and most of documentation. |
82 | 46 | ### 1.0.12 - 26.01.2025 |
83 | 47 | - Some cleanup and deprecation. |
84 | 48 | ### 1.0.11 - 11.12.2024 |
|
0 commit comments