@thi.ng/geom 3.4.3 → 3.4.6
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/package.json +27 -27
- package/plane.js +3 -3
- package/scale.js +2 -2
- package/tangent-at.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2022-08-
|
|
3
|
+
- **Last updated**: 2022-08-06T15:22:27Z
|
|
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
|
+
### [3.4.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@3.4.6) (2022-08-06)
|
|
13
|
+
|
|
14
|
+
#### ⏱ Performance improvements
|
|
15
|
+
|
|
16
|
+
- update vector fns ([d8726c9](https://github.com/thi-ng/umbrella/commit/d8726c9))
|
|
17
|
+
|
|
12
18
|
## [3.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@3.4.0) (2022-06-28)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,36 +36,36 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@thi.ng/api": "^8.3.9",
|
|
39
|
-
"@thi.ng/arrays": "^2.3.
|
|
40
|
-
"@thi.ng/associative": "^6.2.
|
|
41
|
-
"@thi.ng/checks": "^3.2.
|
|
42
|
-
"@thi.ng/defmulti": "^2.1.
|
|
39
|
+
"@thi.ng/arrays": "^2.3.3",
|
|
40
|
+
"@thi.ng/associative": "^6.2.3",
|
|
41
|
+
"@thi.ng/checks": "^3.2.4",
|
|
42
|
+
"@thi.ng/defmulti": "^2.1.11",
|
|
43
43
|
"@thi.ng/equiv": "^2.1.9",
|
|
44
|
-
"@thi.ng/errors": "^2.1.
|
|
45
|
-
"@thi.ng/geom-api": "^3.3.
|
|
46
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
47
|
-
"@thi.ng/geom-clip-line": "^2.1.
|
|
48
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
49
|
-
"@thi.ng/geom-closest-point": "^2.1.
|
|
50
|
-
"@thi.ng/geom-hull": "^2.1.
|
|
51
|
-
"@thi.ng/geom-isec": "^2.1.
|
|
52
|
-
"@thi.ng/geom-poly-utils": "^2.3.
|
|
53
|
-
"@thi.ng/geom-resample": "^2.1.
|
|
54
|
-
"@thi.ng/geom-splines": "^2.1.
|
|
55
|
-
"@thi.ng/geom-subdiv-curve": "^2.1.
|
|
56
|
-
"@thi.ng/geom-tessellate": "^2.1.
|
|
57
|
-
"@thi.ng/hiccup": "^4.2.
|
|
58
|
-
"@thi.ng/hiccup-svg": "^4.3.
|
|
44
|
+
"@thi.ng/errors": "^2.1.10",
|
|
45
|
+
"@thi.ng/geom-api": "^3.3.5",
|
|
46
|
+
"@thi.ng/geom-arc": "^2.1.22",
|
|
47
|
+
"@thi.ng/geom-clip-line": "^2.1.22",
|
|
48
|
+
"@thi.ng/geom-clip-poly": "^2.1.22",
|
|
49
|
+
"@thi.ng/geom-closest-point": "^2.1.19",
|
|
50
|
+
"@thi.ng/geom-hull": "^2.1.19",
|
|
51
|
+
"@thi.ng/geom-isec": "^2.1.22",
|
|
52
|
+
"@thi.ng/geom-poly-utils": "^2.3.6",
|
|
53
|
+
"@thi.ng/geom-resample": "^2.1.22",
|
|
54
|
+
"@thi.ng/geom-splines": "^2.1.22",
|
|
55
|
+
"@thi.ng/geom-subdiv-curve": "^2.1.22",
|
|
56
|
+
"@thi.ng/geom-tessellate": "^2.1.22",
|
|
57
|
+
"@thi.ng/hiccup": "^4.2.13",
|
|
58
|
+
"@thi.ng/hiccup-svg": "^4.3.7",
|
|
59
59
|
"@thi.ng/math": "^5.3.5",
|
|
60
|
-
"@thi.ng/matrices": "^2.1.
|
|
61
|
-
"@thi.ng/random": "^3.3.
|
|
62
|
-
"@thi.ng/strings": "^3.3.
|
|
63
|
-
"@thi.ng/transducers": "^8.3.
|
|
64
|
-
"@thi.ng/vectors": "^7.5.
|
|
60
|
+
"@thi.ng/matrices": "^2.1.19",
|
|
61
|
+
"@thi.ng/random": "^3.3.5",
|
|
62
|
+
"@thi.ng/strings": "^3.3.9",
|
|
63
|
+
"@thi.ng/transducers": "^8.3.10",
|
|
64
|
+
"@thi.ng/vectors": "^7.5.11"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@microsoft/api-extractor": "^7.25.0",
|
|
68
|
-
"@thi.ng/testament": "^0.2.
|
|
68
|
+
"@thi.ng/testament": "^0.2.11",
|
|
69
69
|
"rimraf": "^3.0.2",
|
|
70
70
|
"tools": "^0.0.1",
|
|
71
71
|
"typedoc": "^0.22.17",
|
|
@@ -380,5 +380,5 @@
|
|
|
380
380
|
"thi.ng": {
|
|
381
381
|
"year": 2013
|
|
382
382
|
},
|
|
383
|
-
"gitHead": "
|
|
383
|
+
"gitHead": "01b7a47077d88c2aefe77650ce3340040bae00ee\n"
|
|
384
384
|
}
|
package/plane.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { dot3 } from "@thi.ng/vectors/dot";
|
|
2
|
-
import {
|
|
2
|
+
import { normalize3 } from "@thi.ng/vectors/normalize";
|
|
3
3
|
import { orthoNormal3 } from "@thi.ng/vectors/ortho-normal";
|
|
4
4
|
import { Plane } from "./api/plane.js";
|
|
5
|
-
export const plane = (normal, w, attribs) => new Plane(
|
|
5
|
+
export const plane = (normal, w, attribs) => new Plane(normalize3(null, normal), w, attribs);
|
|
6
6
|
export const planeWithPoint = (normal, p, attribs) => {
|
|
7
|
-
normal =
|
|
7
|
+
normal = normalize3(null, normal);
|
|
8
8
|
return new Plane(normal, dot3(normal, p), attribs);
|
|
9
9
|
};
|
|
10
10
|
export const planeFrom3Points = (a, b, c, attribs) => planeWithPoint(orthoNormal3([], a, b, c), a, attribs);
|
package/scale.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defmulti } from "@thi.ng/defmulti/defmulti";
|
|
|
3
3
|
import { unsupported } from "@thi.ng/errors/unsupported";
|
|
4
4
|
import { mul2, mul3 } from "@thi.ng/vectors/mul";
|
|
5
5
|
import { mulN2, mulN3 } from "@thi.ng/vectors/muln";
|
|
6
|
-
import {
|
|
6
|
+
import { normalize2 } from "@thi.ng/vectors/normalize";
|
|
7
7
|
import { AABB } from "./api/aabb.js";
|
|
8
8
|
import { Circle } from "./api/circle.js";
|
|
9
9
|
import { Cubic } from "./api/cubic.js";
|
|
@@ -98,7 +98,7 @@ export const scale = defmulti(__dispatch, {}, {
|
|
|
98
98
|
quadratic: tx(Quadratic),
|
|
99
99
|
ray: ($, delta) => {
|
|
100
100
|
delta = __asVec(delta);
|
|
101
|
-
return new Ray(mul2([], $.pos, delta),
|
|
101
|
+
return new Ray(mul2([], $.pos, delta), normalize2(null, mul2([], $.dir, delta)), __copyAttribs($));
|
|
102
102
|
},
|
|
103
103
|
rect: ($, delta) => {
|
|
104
104
|
delta = __asVec(delta);
|
package/tangent-at.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cubicTangentAt } from "@thi.ng/geom-splines/cubic-tangent";
|
|
|
4
4
|
import { quadraticTangentAt } from "@thi.ng/geom-splines/quadratic-tangent";
|
|
5
5
|
import { cossin } from "@thi.ng/math/angle";
|
|
6
6
|
import { HALF_PI, TAU } from "@thi.ng/math/api";
|
|
7
|
-
import {
|
|
7
|
+
import { direction2 } from "@thi.ng/vectors/direction";
|
|
8
8
|
import { __dispatch } from "./internal/dispatch.js";
|
|
9
9
|
import { vertices } from "./vertices.js";
|
|
10
10
|
/**
|
|
@@ -32,7 +32,7 @@ export const tangentAt = defmulti(__dispatch, {
|
|
|
32
32
|
}, {
|
|
33
33
|
circle: (_, t) => cossin(TAU * t + HALF_PI),
|
|
34
34
|
cubic: ({ points }, t) => cubicTangentAt([], points[0], points[1], points[2], points[3], t),
|
|
35
|
-
line: ({ points }) =>
|
|
35
|
+
line: ({ points }) => direction2([], points[0], points[1]),
|
|
36
36
|
poly: ($, t) => new Sampler($.points, true).tangentAt(t),
|
|
37
37
|
polyline: ($, t) => new Sampler($.points).tangentAt(t),
|
|
38
38
|
quadratic: ({ points }, t) => quadraticTangentAt([], points[0], points[1], points[2], t),
|