@thi.ng/geom 8.3.13 → 8.3.14
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/README.md +2 -2
- package/as-cubic.js +2 -2
- package/internal/error.js +2 -2
- package/package.json +31 -30
- package/path-builder.js +2 -2
- package/scale.js +2 -2
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 214 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
|
>
|
|
@@ -451,7 +451,7 @@ For Node.js REPL:
|
|
|
451
451
|
const geom = await import("@thi.ng/geom");
|
|
452
452
|
```
|
|
453
453
|
|
|
454
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 17.
|
|
454
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 17.53 KB
|
|
455
455
|
|
|
456
456
|
## Dependencies
|
|
457
457
|
|
package/as-cubic.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defmulti } from "@thi.ng/defmulti/defmulti";
|
|
2
|
-
import {
|
|
2
|
+
import { unsupportedOp } from "@thi.ng/errors/unsupported";
|
|
3
3
|
import {
|
|
4
4
|
closedCubicFromBreakPoints,
|
|
5
5
|
openCubicFromBreakPoints
|
|
@@ -120,7 +120,7 @@ const asCubic = defmulti(
|
|
|
120
120
|
const __polyCubic = (ctor, { points, attribs }, opts, conversions) => {
|
|
121
121
|
opts = { mode: "default", uniform: false, scale: 1 / 3, ...opts };
|
|
122
122
|
const fn = conversions[opts.mode];
|
|
123
|
-
if (!fn)
|
|
123
|
+
if (!fn) unsupportedOp(`conversion mode: ${opts.mode}`);
|
|
124
124
|
return fn(points, opts.scale, opts.uniform).map(
|
|
125
125
|
(pts) => new ctor(pts, __attribs(opts, attribs))
|
|
126
126
|
);
|
package/internal/error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unsupportedOp } from "@thi.ng/errors/unsupported";
|
|
2
2
|
import { Arc } from "../api/arc.js";
|
|
3
|
-
const __ensureNoArc = (x) => x instanceof Arc &&
|
|
3
|
+
const __ensureNoArc = (x) => x instanceof Arc && unsupportedOp("path must not contain arcs, use normalizedPath() first");
|
|
4
4
|
export {
|
|
5
5
|
__ensureNoArc
|
|
6
6
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.14",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/thi-ng/umbrella.git"
|
|
11
|
+
"url": "git+https://github.com/thi-ng/umbrella.git",
|
|
12
|
+
"directory": "packages/geom"
|
|
12
13
|
},
|
|
13
14
|
"homepage": "https://thi.ng/geom",
|
|
14
15
|
"funding": [
|
|
@@ -40,33 +41,33 @@
|
|
|
40
41
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@thi.ng/adjacency": "^3.0.
|
|
44
|
-
"@thi.ng/api": "^8.12.
|
|
45
|
-
"@thi.ng/arrays": "^2.14.
|
|
46
|
-
"@thi.ng/checks": "^3.8.
|
|
47
|
-
"@thi.ng/defmulti": "^3.0.
|
|
48
|
-
"@thi.ng/equiv": "^2.1.
|
|
49
|
-
"@thi.ng/errors": "^2.6.
|
|
50
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
51
|
-
"@thi.ng/geom-clip-line": "^2.3.
|
|
52
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
53
|
-
"@thi.ng/geom-closest-point": "^2.1.
|
|
54
|
-
"@thi.ng/geom-hull": "^2.1.
|
|
55
|
-
"@thi.ng/geom-isec": "^4.0.
|
|
56
|
-
"@thi.ng/geom-poly-utils": "^3.1.
|
|
57
|
-
"@thi.ng/geom-resample": "^3.0.
|
|
58
|
-
"@thi.ng/geom-splines": "^2.3.
|
|
59
|
-
"@thi.ng/geom-subdiv-curve": "^3.0.
|
|
60
|
-
"@thi.ng/geom-tessellate": "^3.0.
|
|
61
|
-
"@thi.ng/hiccup": "^5.3.
|
|
62
|
-
"@thi.ng/hiccup-svg": "^5.5.
|
|
63
|
-
"@thi.ng/math": "^5.15.
|
|
64
|
-
"@thi.ng/matrices": "^3.0.
|
|
65
|
-
"@thi.ng/object-utils": "^1.3.
|
|
66
|
-
"@thi.ng/random": "^4.1.
|
|
67
|
-
"@thi.ng/strings": "^3.9.
|
|
68
|
-
"@thi.ng/transducers": "^9.6.
|
|
69
|
-
"@thi.ng/vectors": "^8.6.
|
|
44
|
+
"@thi.ng/adjacency": "^3.0.69",
|
|
45
|
+
"@thi.ng/api": "^8.12.14",
|
|
46
|
+
"@thi.ng/arrays": "^2.14.7",
|
|
47
|
+
"@thi.ng/checks": "^3.8.4",
|
|
48
|
+
"@thi.ng/defmulti": "^3.0.90",
|
|
49
|
+
"@thi.ng/equiv": "^2.1.104",
|
|
50
|
+
"@thi.ng/errors": "^2.6.3",
|
|
51
|
+
"@thi.ng/geom-arc": "^2.1.209",
|
|
52
|
+
"@thi.ng/geom-clip-line": "^2.3.166",
|
|
53
|
+
"@thi.ng/geom-clip-poly": "^2.1.208",
|
|
54
|
+
"@thi.ng/geom-closest-point": "^2.1.204",
|
|
55
|
+
"@thi.ng/geom-hull": "^2.1.204",
|
|
56
|
+
"@thi.ng/geom-isec": "^4.0.76",
|
|
57
|
+
"@thi.ng/geom-poly-utils": "^3.1.13",
|
|
58
|
+
"@thi.ng/geom-resample": "^3.0.76",
|
|
59
|
+
"@thi.ng/geom-splines": "^2.3.76",
|
|
60
|
+
"@thi.ng/geom-subdiv-curve": "^3.0.83",
|
|
61
|
+
"@thi.ng/geom-tessellate": "^3.0.83",
|
|
62
|
+
"@thi.ng/hiccup": "^5.3.37",
|
|
63
|
+
"@thi.ng/hiccup-svg": "^5.5.25",
|
|
64
|
+
"@thi.ng/math": "^5.15.3",
|
|
65
|
+
"@thi.ng/matrices": "^3.0.35",
|
|
66
|
+
"@thi.ng/object-utils": "^1.3.6",
|
|
67
|
+
"@thi.ng/random": "^4.1.39",
|
|
68
|
+
"@thi.ng/strings": "^3.9.35",
|
|
69
|
+
"@thi.ng/transducers": "^9.6.23",
|
|
70
|
+
"@thi.ng/vectors": "^8.6.20"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"esbuild": "^0.27.2",
|
|
@@ -533,5 +534,5 @@
|
|
|
533
534
|
"tag": "geometry",
|
|
534
535
|
"year": 2013
|
|
535
536
|
},
|
|
536
|
-
"gitHead": "
|
|
537
|
+
"gitHead": "4bd1b9d8ae52ba32b90a1b9a55d329c708ca7865\n"
|
|
537
538
|
}
|
package/path-builder.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { peek } from "@thi.ng/arrays/peek";
|
|
2
|
-
import {
|
|
2
|
+
import { unsupportedOp } from "@thi.ng/errors/unsupported";
|
|
3
3
|
import { eqDelta } from "@thi.ng/math/eqdelta";
|
|
4
4
|
import { add } from "@thi.ng/vectors/add";
|
|
5
5
|
import { copy } from "@thi.ng/vectors/copy";
|
|
@@ -130,7 +130,7 @@ class PathBuilder {
|
|
|
130
130
|
return this;
|
|
131
131
|
}
|
|
132
132
|
arcTo(p, r, xaxis, xl, clockwise, relative = false) {
|
|
133
|
-
if (!this.ctors.a)
|
|
133
|
+
if (!this.ctors.a) unsupportedOp("arcs");
|
|
134
134
|
if (eqDelta(r[0], 0) || eqDelta(r[1], 0)) {
|
|
135
135
|
return this.lineTo(p, relative);
|
|
136
136
|
}
|
package/scale.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNumber } from "@thi.ng/checks/is-number";
|
|
2
2
|
import { defmulti } from "@thi.ng/defmulti/defmulti";
|
|
3
|
-
import {
|
|
3
|
+
import { unsupportedOp } from "@thi.ng/errors/unsupported";
|
|
4
4
|
import { mul, mul2, mul3 } from "@thi.ng/vectors/mul";
|
|
5
5
|
import { mulN2, mulN3 } from "@thi.ng/vectors/muln";
|
|
6
6
|
import { normalize2, normalize3 } from "@thi.ng/vectors/normalize";
|
|
@@ -120,7 +120,7 @@ const scale = defmulti(
|
|
|
120
120
|
mulN3([], $.pos, delta),
|
|
121
121
|
$.r * delta,
|
|
122
122
|
__copyAttribs($.attribs)
|
|
123
|
-
) :
|
|
123
|
+
) : unsupportedOp("can't non-uniformly scale sphere"),
|
|
124
124
|
text: ($, delta) => new Text(
|
|
125
125
|
mul2([], $.pos, __asVec(delta)),
|
|
126
126
|
$.body,
|