@thi.ng/geom-clip-poly 2.1.37 → 2.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +7 -10
- package/index.d.ts +4 -4
- package/index.js +4 -4
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/geom-clip-poly)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -20,7 +20,7 @@ This project is part of the
|
|
|
20
20
|
|
|
21
21
|
## About
|
|
22
22
|
|
|
23
|
-
2D polygon clipping / offsetting (Sutherland-Hodgeman, Grainer-Hormann)
|
|
23
|
+
2D polygon clipping / offsetting (Sutherland-Hodgeman, Grainer-Hormann)
|
|
24
24
|
|
|
25
25
|
Current implementations are based on [toxiclibs](http://toxiclibs.org)
|
|
26
26
|
(Java) and Clojure versions [thi.ng/geom-clj](http://thi.ng/geom-clj).
|
|
@@ -51,11 +51,8 @@ ES module import:
|
|
|
51
51
|
|
|
52
52
|
For Node.js REPL:
|
|
53
53
|
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
node --experimental-repl-await
|
|
57
|
-
|
|
58
|
-
> const geomClipPoly = await import("@thi.ng/geom-clip-poly");
|
|
54
|
+
```js
|
|
55
|
+
const geomClipPoly = await import("@thi.ng/geom-clip-poly");
|
|
59
56
|
```
|
|
60
57
|
|
|
61
58
|
Package sizes (brotli'd, pre-treeshake): ESM: 321 bytes
|
|
@@ -75,7 +72,7 @@ TODO
|
|
|
75
72
|
|
|
76
73
|
## Authors
|
|
77
74
|
|
|
78
|
-
Karsten Schmidt
|
|
75
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
79
76
|
|
|
80
77
|
If this project contributes to an academic publication, please cite it as:
|
|
81
78
|
|
|
@@ -90,4 +87,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
90
87
|
|
|
91
88
|
## License
|
|
92
89
|
|
|
93
|
-
© 2013 - 2022 Karsten Schmidt // Apache
|
|
90
|
+
© 2013 - 2022 Karsten Schmidt // Apache License 2.0
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
2
2
|
/**
|
|
3
|
-
* Extended version of Sutherland-Hodgeman convex polygon clipping
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Extended version of Sutherland-Hodgeman convex polygon clipping supporting
|
|
4
|
+
* any convex boundary polygon (not only rects). Returns new array of clipped
|
|
5
|
+
* vertices.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm
|
|
8
8
|
*
|
|
9
9
|
* @param pts - subject poly vertices
|
|
10
10
|
* @param bounds - clipping boundary vertices
|
package/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { centroid } from "@thi.ng/geom-poly-utils/centroid";
|
|
|
3
3
|
import { EPS } from "@thi.ng/math/api";
|
|
4
4
|
import { corner2 } from "@thi.ng/vectors/clockwise";
|
|
5
5
|
/**
|
|
6
|
-
* Extended version of Sutherland-Hodgeman convex polygon clipping
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Extended version of Sutherland-Hodgeman convex polygon clipping supporting
|
|
7
|
+
* any convex boundary polygon (not only rects). Returns new array of clipped
|
|
8
|
+
* vertices.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm
|
|
11
11
|
*
|
|
12
12
|
* @param pts - subject poly vertices
|
|
13
13
|
* @param bounds - clipping boundary vertices
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-clip-poly",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.39",
|
|
4
4
|
"description": "2D polygon clipping / offsetting (Sutherland-Hodgeman, Grainer-Hormann)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/geom-isec": "^2.1.
|
|
38
|
-
"@thi.ng/geom-poly-utils": "^2.3.
|
|
39
|
-
"@thi.ng/math": "^5.3.
|
|
40
|
-
"@thi.ng/vectors": "^7.5.
|
|
37
|
+
"@thi.ng/geom-isec": "^2.1.39",
|
|
38
|
+
"@thi.ng/geom-poly-utils": "^2.3.23",
|
|
39
|
+
"@thi.ng/math": "^5.3.17",
|
|
40
|
+
"@thi.ng/vectors": "^7.5.28"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-extractor": "^7.33.
|
|
44
|
-
"@thi.ng/testament": "^0.3.
|
|
43
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
44
|
+
"@thi.ng/testament": "^0.3.7",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
46
|
"tools": "^0.0.1",
|
|
47
|
-
"typedoc": "^0.23.
|
|
48
|
-
"typescript": "^4.
|
|
47
|
+
"typedoc": "^0.23.22",
|
|
48
|
+
"typescript": "^4.9.4"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"2d",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
],
|
|
84
84
|
"year": 2013
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
87
87
|
}
|