@thi.ng/geom-closest-point 2.1.127 → 2.1.128
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 +7 -1
- package/README.md +1 -1
- package/box.js +3 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-21T19:34:38Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [2.1.128](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-closest-point@2.1.128) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
17
|
+
|
|
12
18
|
### [2.1.124](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-closest-point@2.1.124) (2024-04-20)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 193 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/box.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { clamp } from "@thi.ng/math/interval";
|
|
2
2
|
import { setC2, setC3 } from "@thi.ng/vectors/setc";
|
|
3
3
|
const closestPointRect = (p, bmin, bmax, out = []) => {
|
|
4
|
-
const [minID, minW] =
|
|
4
|
+
const [minID, minW] = __closestBoxEdge(p, bmin, bmax, 4);
|
|
5
5
|
return minID === 0 ? setC2(out, minW, clamp(p[1], bmin[1], bmax[1])) : setC2(out, clamp(p[0], bmin[0], bmax[0]), minW);
|
|
6
6
|
};
|
|
7
7
|
const closestPointAABB = (p, bmin, bmax, out = []) => {
|
|
8
|
-
const [minID, minW] =
|
|
8
|
+
const [minID, minW] = __closestBoxEdge(p, bmin, bmax, 6);
|
|
9
9
|
return minID === 0 ? setC3(
|
|
10
10
|
out,
|
|
11
11
|
minW,
|
|
@@ -23,7 +23,7 @@ const closestPointAABB = (p, bmin, bmax, out = []) => {
|
|
|
23
23
|
minW
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const __closestBoxEdge = (p, bmin, bmax, n) => {
|
|
27
27
|
let minD = Infinity;
|
|
28
28
|
let minID;
|
|
29
29
|
let minW;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-closest-point",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.128",
|
|
4
4
|
"description": "2D / 3D closest point / proximity helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/geom-closest-point",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/math": "^5.
|
|
41
|
-
"@thi.ng/vectors": "^7.
|
|
39
|
+
"@thi.ng/api": "^8.11.3",
|
|
40
|
+
"@thi.ng/math": "^5.11.0",
|
|
41
|
+
"@thi.ng/vectors": "^7.11.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
-
"esbuild": "^0.21.
|
|
44
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
45
|
+
"esbuild": "^0.21.5",
|
|
46
46
|
"typedoc": "^0.25.13",
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.5.2"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"2d",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
],
|
|
104
104
|
"year": 2018
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
107
107
|
}
|