@thi.ng/geom-clip-line 2.2.1 → 2.2.3
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 +1 -1
- package/liang-barsky.d.ts +9 -10
- package/liang-barsky.js +9 -10
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ This project is part of the
|
|
|
20
20
|
|
|
21
21
|
## About
|
|
22
22
|
|
|
23
|
-
2D line clipping (Liang-Barsky)
|
|
23
|
+
2D line clipping (Liang-Barsky). This is a support package for [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom).
|
|
24
24
|
|
|
25
25
|
Current implementation is based on [toxiclibs](http://toxiclibs.org)
|
|
26
26
|
(Java) and Clojure version [thi.ng/geom-clj](http://thi.ng/geom-clj).
|
package/liang-barsky.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { FnU8, Tuple } from "@thi.ng/api";
|
|
2
2
|
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
3
3
|
/**
|
|
4
|
-
* Performs Liang-Barsky clipping of the line segment with endpoints
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* outside the rect.
|
|
4
|
+
* Performs Liang-Barsky clipping of the line segment with endpoints `a`, `b`
|
|
5
|
+
* against the clipping rect defined by `min` and `max`. The optional `ca` and
|
|
6
|
+
* `cb` vectors can be given to store the result (clipped points). If omitted
|
|
7
|
+
* creates new vectors. Returns a tuple of `[ca, cb, a, b]`, where the latter
|
|
8
|
+
* two values represent the normalized distances of the clipped points relative
|
|
9
|
+
* to original given line segment. Returns `undefined` iff the line lies
|
|
10
|
+
* completely outside the rect.
|
|
12
11
|
*
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
12
|
+
* - https://en.wikipedia.org/wiki/Liang%E2%80%93Barsky_algorithm
|
|
13
|
+
* - https://github.com/thi-ng/c-thing/blob/develop/src/geom/clip/liangbarsky.c
|
|
15
14
|
*
|
|
16
15
|
* @param a - line endpoint
|
|
17
16
|
* @param b - line endpoint
|
package/liang-barsky.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Performs Liang-Barsky clipping of the line segment with endpoints
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* outside the rect.
|
|
2
|
+
* Performs Liang-Barsky clipping of the line segment with endpoints `a`, `b`
|
|
3
|
+
* against the clipping rect defined by `min` and `max`. The optional `ca` and
|
|
4
|
+
* `cb` vectors can be given to store the result (clipped points). If omitted
|
|
5
|
+
* creates new vectors. Returns a tuple of `[ca, cb, a, b]`, where the latter
|
|
6
|
+
* two values represent the normalized distances of the clipped points relative
|
|
7
|
+
* to original given line segment. Returns `undefined` iff the line lies
|
|
8
|
+
* completely outside the rect.
|
|
10
9
|
*
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
10
|
+
* - https://en.wikipedia.org/wiki/Liang%E2%80%93Barsky_algorithm
|
|
11
|
+
* - https://github.com/thi-ng/c-thing/blob/develop/src/geom/clip/liangbarsky.c
|
|
13
12
|
*
|
|
14
13
|
* @param a - line endpoint
|
|
15
14
|
* @param b - line endpoint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-clip-line",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "2D line clipping (Liang-Barsky)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.6.
|
|
38
|
-
"@thi.ng/geom-isec": "^2.1.
|
|
39
|
-
"@thi.ng/vectors": "^7.5.
|
|
37
|
+
"@thi.ng/api": "^8.6.2",
|
|
38
|
+
"@thi.ng/geom-isec": "^2.1.40",
|
|
39
|
+
"@thi.ng/vectors": "^7.5.29"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@microsoft/api-extractor": "^7.33.7",
|
|
43
|
-
"@thi.ng/testament": "^0.3.
|
|
43
|
+
"@thi.ng/testament": "^0.3.8",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"tools": "^0.0.1",
|
|
46
46
|
"typedoc": "^0.23.22",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
],
|
|
85
85
|
"year": 2013
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "bc6f7f5e2765bb96fe64db804eaf4b2443b47fc6\n"
|
|
88
88
|
}
|