@thi.ng/geom-clip-line 2.1.7 → 2.1.8
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 +2 -2
- package/clip-poly.d.ts +3 -3
- package/clip-poly.js +3 -3
- package/liang-barsky.d.ts +8 -8
- package/liang-barsky.js +8 -8
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ This package has been extracted from the former (now obsolete)
|
|
|
36
36
|
|
|
37
37
|
### Related packages
|
|
38
38
|
|
|
39
|
-
- [@thi.ng/geom-clip-poly](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-poly) - 2D
|
|
39
|
+
- [@thi.ng/geom-clip-poly](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-poly) - 2D polygon clipping / offsetting (Sutherland-Hodgeman, Grainer-Hormann)
|
|
40
40
|
|
|
41
41
|
## Installation
|
|
42
42
|
|
|
@@ -114,4 +114,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
114
114
|
|
|
115
115
|
## License
|
|
116
116
|
|
|
117
|
-
© 2013 -
|
|
117
|
+
© 2013 - 2022 Karsten Schmidt // Apache Software License 2.0
|
package/clip-poly.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
|
4
4
|
* `b` with the given polygon. Returns an array of segments where the
|
|
5
5
|
* line is inside the polygon.
|
|
6
6
|
*
|
|
7
|
-
* @param a
|
|
8
|
-
* @param b
|
|
9
|
-
* @param pts
|
|
7
|
+
* @param a -
|
|
8
|
+
* @param b -
|
|
9
|
+
* @param pts -
|
|
10
10
|
*/
|
|
11
11
|
export declare const clipLinePoly: (a: ReadonlyVec, b: ReadonlyVec, pts: ReadonlyVec[]) => Vec[][] | undefined;
|
|
12
12
|
export declare const clipLineSegmentPoly: (a: ReadonlyVec, b: ReadonlyVec, pts: ReadonlyVec[]) => Vec[][] | undefined;
|
package/clip-poly.js
CHANGED
|
@@ -7,9 +7,9 @@ import { direction } from "@thi.ng/vectors/direction";
|
|
|
7
7
|
* `b` with the given polygon. Returns an array of segments where the
|
|
8
8
|
* line is inside the polygon.
|
|
9
9
|
*
|
|
10
|
-
* @param a
|
|
11
|
-
* @param b
|
|
12
|
-
* @param pts
|
|
10
|
+
* @param a -
|
|
11
|
+
* @param b -
|
|
12
|
+
* @param pts -
|
|
13
13
|
*/
|
|
14
14
|
export const clipLinePoly = (a, b, pts) => {
|
|
15
15
|
const isecs = intersectRayPolylineAll(a, direction([], a, b), pts, true).isec;
|
package/liang-barsky.d.ts
CHANGED
|
@@ -24,14 +24,14 @@ export declare const liangBarsky2: (a: ReadonlyVec, b: ReadonlyVec, min: Readonl
|
|
|
24
24
|
/**
|
|
25
25
|
* Same as {@link liangBarsky2} but for non-vector arguments.
|
|
26
26
|
*
|
|
27
|
-
* @param ax
|
|
28
|
-
* @param ay
|
|
29
|
-
* @param bx
|
|
30
|
-
* @param by
|
|
31
|
-
* @param minx
|
|
32
|
-
* @param miny
|
|
33
|
-
* @param maxx
|
|
34
|
-
* @param maxy
|
|
27
|
+
* @param ax -
|
|
28
|
+
* @param ay -
|
|
29
|
+
* @param bx -
|
|
30
|
+
* @param by -
|
|
31
|
+
* @param minx -
|
|
32
|
+
* @param miny -
|
|
33
|
+
* @param maxx -
|
|
34
|
+
* @param maxy -
|
|
35
35
|
*/
|
|
36
36
|
export declare const liangBarsky2Raw: FnU8<number, Tuple<number, 6> | undefined>;
|
|
37
37
|
//# sourceMappingURL=liang-barsky.d.ts.map
|
package/liang-barsky.js
CHANGED
|
@@ -31,14 +31,14 @@ export const liangBarsky2 = (a, b, min, max, ca = [], cb = []) => {
|
|
|
31
31
|
/**
|
|
32
32
|
* Same as {@link liangBarsky2} but for non-vector arguments.
|
|
33
33
|
*
|
|
34
|
-
* @param ax
|
|
35
|
-
* @param ay
|
|
36
|
-
* @param bx
|
|
37
|
-
* @param by
|
|
38
|
-
* @param minx
|
|
39
|
-
* @param miny
|
|
40
|
-
* @param maxx
|
|
41
|
-
* @param maxy
|
|
34
|
+
* @param ax -
|
|
35
|
+
* @param ay -
|
|
36
|
+
* @param bx -
|
|
37
|
+
* @param by -
|
|
38
|
+
* @param minx -
|
|
39
|
+
* @param miny -
|
|
40
|
+
* @param maxx -
|
|
41
|
+
* @param maxy -
|
|
42
42
|
*/
|
|
43
43
|
export const liangBarsky2Raw = (ax, ay, bx, by, minx, miny, maxx, maxy) => {
|
|
44
44
|
const dx = bx - ax;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-clip-line",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "2D line clipping (Liang-Barsky)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/geom-isec": "^2.1.
|
|
39
|
-
"@thi.ng/vectors": "^7.
|
|
37
|
+
"@thi.ng/api": "^8.3.4",
|
|
38
|
+
"@thi.ng/geom-isec": "^2.1.8",
|
|
39
|
+
"@thi.ng/vectors": "^7.5.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@microsoft/api-extractor": "^7.19.
|
|
43
|
-
"@thi.ng/testament": "^0.2.
|
|
42
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
43
|
+
"@thi.ng/testament": "^0.2.4",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"tools": "^0.0.1",
|
|
46
|
-
"typedoc": "^0.22.
|
|
47
|
-
"typescript": "^4.
|
|
46
|
+
"typedoc": "^0.22.13",
|
|
47
|
+
"typescript": "^4.6.2"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"2d",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
],
|
|
85
85
|
"year": 2013
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
|
|
88
88
|
}
|