@thi.ng/geom-splines 2.3.39 → 2.3.41
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/cubic-arc.d.ts +1 -1
- package/cubic-closest-point.d.ts +1 -1
- package/cubic-from-breakpoints.d.ts +20 -2
- package/cubic-from-breakpoints.js +2 -2
- package/cubic-from-controlpoints.d.ts +2 -2
- package/cubic-hobby.d.ts +1 -1
- package/cubic-quadratic.d.ts +1 -1
- package/cubic-split.d.ts +2 -2
- package/cubic-tangent.d.ts +1 -1
- package/package.json +10 -10
- package/point-at.d.ts +2 -2
- package/quadratic-closest-point.d.ts +1 -1
- package/quadratic-split.d.ts +2 -2
- package/quadratic-tangent.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-04-
|
|
3
|
+
- **Last updated**: 2025-04-16T11:11:14Z
|
|
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.
|
|
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
### [2.3.41](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-splines@2.3.41) (2025-04-16)
|
|
15
|
+
|
|
16
|
+
#### ♻️ Refactoring
|
|
17
|
+
|
|
18
|
+
- minor internal optimizations (vector ops) ([08c58f6](https://github.com/thi-ng/umbrella/commit/08c58f6))
|
|
19
|
+
|
|
14
20
|
## [2.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-splines@2.3.0) (2024-06-21)
|
|
15
21
|
|
|
16
22
|
#### 🚀 Features
|
package/cubic-arc.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
|
12
12
|
* @param start - start angle (radians)
|
|
13
13
|
* @param end - end angle (radians)
|
|
14
14
|
*/
|
|
15
|
-
export declare const cubicFromArc: (pos: ReadonlyVec, r: ReadonlyVec, axis: number, start: number, end: number) => Vec[][];
|
|
15
|
+
export declare const cubicFromArc: (pos: ReadonlyVec, r: ReadonlyVec, axis: number, start: number, end: number) => Vec<number>[][];
|
|
16
16
|
//# sourceMappingURL=cubic-arc.d.ts.map
|
package/cubic-closest-point.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
|
16
16
|
* @param iter - iterations
|
|
17
17
|
* @param eps - epsilon value
|
|
18
18
|
*/
|
|
19
|
-
export declare const closestPointCubic: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, out?: Vec, res?: number, iter?: number, eps?: number) => Vec
|
|
19
|
+
export declare const closestPointCubic: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, out?: Vec, res?: number, iter?: number, eps?: number) => Vec<number>;
|
|
20
20
|
//# sourceMappingURL=cubic-closest-point.d.ts.map
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* 2D only. Reconstructs given polygon as sequence of cubic curve segments. The
|
|
4
|
+
* end points of each segment are the original polygon vertices. See
|
|
5
|
+
* {@link openCubicFromBreakPoints} for open polyline version.
|
|
6
|
+
*
|
|
7
|
+
* @param points
|
|
8
|
+
* @param t
|
|
9
|
+
* @param uniform
|
|
10
|
+
*/
|
|
11
|
+
export declare const closedCubicFromBreakPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec<number>[][];
|
|
12
|
+
/**
|
|
13
|
+
* 2D only. Reconstructs given polygon as sequence of cubic curve segments. The
|
|
14
|
+
* end points of each segment are the original polygon vertices. See
|
|
15
|
+
* {@link closedCubicFromBreakPoints} for closed polygon version.
|
|
16
|
+
*
|
|
17
|
+
* @param points
|
|
18
|
+
* @param t
|
|
19
|
+
* @param uniform
|
|
20
|
+
*/
|
|
21
|
+
export declare const openCubicFromBreakPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec<number>[][];
|
|
4
22
|
//# sourceMappingURL=cubic-from-breakpoints.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cornerBisector } from "@thi.ng/vectors/bisect";
|
|
2
2
|
import { corner2 } from "@thi.ng/vectors/clockwise";
|
|
3
3
|
import { direction2 } from "@thi.ng/vectors/direction";
|
|
4
|
-
import {
|
|
4
|
+
import { dist2 } from "@thi.ng/vectors/dist";
|
|
5
5
|
import { maddN2 } from "@thi.ng/vectors/maddn";
|
|
6
6
|
import { mulN, mulN2 } from "@thi.ng/vectors/muln";
|
|
7
7
|
import { perpendicularCW } from "@thi.ng/vectors/perpendicular";
|
|
@@ -11,7 +11,7 @@ const __buildSegments = (tangents, t, uniform) => {
|
|
|
11
11
|
for (let i = 0, num = tangents.length - 1; i < num; i++) {
|
|
12
12
|
const [a, na] = tangents[i];
|
|
13
13
|
const [b, nb] = tangents[i + 1];
|
|
14
|
-
const d = uniform ? t : t *
|
|
14
|
+
const d = uniform ? t : t * dist2(a, b);
|
|
15
15
|
res.push([a, maddN2([], na, d, a), maddN2([], nb, -d, b), b]);
|
|
16
16
|
}
|
|
17
17
|
return res;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
2
|
-
export declare const closedCubicFromControlPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec[][];
|
|
3
|
-
export declare const openCubicFromControlPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec[][];
|
|
2
|
+
export declare const closedCubicFromControlPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec<number>[][];
|
|
3
|
+
export declare const openCubicFromControlPoints: (points: ReadonlyVec[], t?: number, uniform?: boolean) => Vec<number>[][];
|
|
4
4
|
//# sourceMappingURL=cubic-from-controlpoints.d.ts.map
|
package/cubic-hobby.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ import { type ReadonlyVec, type Vec } from "@thi.ng/vectors";
|
|
|
16
16
|
* @param closed
|
|
17
17
|
* @param omega
|
|
18
18
|
*/
|
|
19
|
-
export declare const cubicHobby2: (points: ReadonlyVec[], closed?: boolean, omega?: number) => Vec[][];
|
|
19
|
+
export declare const cubicHobby2: (points: ReadonlyVec[], closed?: boolean, omega?: number) => Vec<number>[][];
|
|
20
20
|
//# sourceMappingURL=cubic-hobby.d.ts.map
|
package/cubic-quadratic.d.ts
CHANGED
|
@@ -24,5 +24,5 @@ export declare const cubicFromQuadratic: FnU3<ReadonlyVec, Vec[]>;
|
|
|
24
24
|
* @param d
|
|
25
25
|
* @param gamma
|
|
26
26
|
*/
|
|
27
|
-
export declare const quadraticFromCubic: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, gamma?: number) => Vec[][];
|
|
27
|
+
export declare const quadraticFromCubic: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, gamma?: number) => Vec<number>[][];
|
|
28
28
|
//# sourceMappingURL=cubic-quadratic.d.ts.map
|
package/cubic-split.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
2
|
-
export declare const cubicSplitAt: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec[][];
|
|
3
|
-
export declare const splitCubicNearPoint: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, res?: number, iter?: number) => import("@thi.ng/vectors").Vec[][];
|
|
2
|
+
export declare const cubicSplitAt: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec<number>[][];
|
|
3
|
+
export declare const splitCubicNearPoint: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, res?: number, iter?: number) => import("@thi.ng/vectors").Vec<number>[][];
|
|
4
4
|
//# sourceMappingURL=cubic-split.d.ts.map
|
package/cubic-tangent.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
2
|
-
export declare const cubicTangentAt: (out: Vec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, t: number, len?: number) => Vec
|
|
2
|
+
export declare const cubicTangentAt: (out: Vec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, t: number, len?: number) => Vec<number>;
|
|
3
3
|
//# sourceMappingURL=cubic-tangent.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom-splines",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.41",
|
|
4
4
|
"description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.11.
|
|
43
|
-
"@thi.ng/checks": "^3.7.
|
|
44
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
45
|
-
"@thi.ng/geom-resample": "^3.0.
|
|
46
|
-
"@thi.ng/math": "^5.11.
|
|
47
|
-
"@thi.ng/vectors": "^
|
|
42
|
+
"@thi.ng/api": "^8.11.26",
|
|
43
|
+
"@thi.ng/checks": "^3.7.6",
|
|
44
|
+
"@thi.ng/geom-arc": "^2.1.174",
|
|
45
|
+
"@thi.ng/geom-resample": "^3.0.41",
|
|
46
|
+
"@thi.ng/math": "^5.11.26",
|
|
47
|
+
"@thi.ng/vectors": "^8.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"esbuild": "^0.25.2",
|
|
51
|
-
"typedoc": "^0.28.
|
|
52
|
-
"typescript": "^5.8.
|
|
51
|
+
"typedoc": "^0.28.2",
|
|
52
|
+
"typescript": "^5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"2d",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
],
|
|
150
150
|
"tag": "bezier"
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "c464b6948f92cba90c2ea75b59203dad894fb450\n"
|
|
153
153
|
}
|
package/point-at.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Same as thi.ng/vectors/mixCubic
|
|
3
3
|
*/
|
|
4
|
-
export declare const cubicPointAt: (out: import("@thi.ng/vectors").Vec | null, a: import("@thi.ng/vectors").ReadonlyVec, b: import("@thi.ng/vectors").ReadonlyVec, c: import("@thi.ng/vectors").ReadonlyVec, d: import("@thi.ng/vectors").ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec
|
|
4
|
+
export declare const cubicPointAt: (out: import("@thi.ng/vectors").Vec | null, a: import("@thi.ng/vectors").ReadonlyVec, b: import("@thi.ng/vectors").ReadonlyVec, c: import("@thi.ng/vectors").ReadonlyVec, d: import("@thi.ng/vectors").ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec<number>;
|
|
5
5
|
/**
|
|
6
6
|
* Same as thi.ng/vectors/mixQuadratic
|
|
7
7
|
*/
|
|
8
|
-
export declare const quadraticPointAt: (out: import("@thi.ng/vectors").Vec | null, a: import("@thi.ng/vectors").ReadonlyVec, b: import("@thi.ng/vectors").ReadonlyVec, c: import("@thi.ng/vectors").ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec
|
|
8
|
+
export declare const quadraticPointAt: (out: import("@thi.ng/vectors").Vec | null, a: import("@thi.ng/vectors").ReadonlyVec, b: import("@thi.ng/vectors").ReadonlyVec, c: import("@thi.ng/vectors").ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec<number>;
|
|
9
9
|
//# sourceMappingURL=point-at.d.ts.map
|
|
@@ -15,5 +15,5 @@ import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
|
15
15
|
* @param iter - iterations
|
|
16
16
|
* @param eps - epsilon value
|
|
17
17
|
*/
|
|
18
|
-
export declare const closestPointQuadratic: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, out?: Vec, res?: number, iter?: number, eps?: number) => Vec
|
|
18
|
+
export declare const closestPointQuadratic: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, out?: Vec, res?: number, iter?: number, eps?: number) => Vec<number>;
|
|
19
19
|
//# sourceMappingURL=quadratic-closest-point.d.ts.map
|
package/quadratic-split.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
2
|
-
export declare const quadraticSplitAt: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec[][];
|
|
3
|
-
export declare const quadraticSplitNearPoint: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, res?: number, iter?: number) => import("@thi.ng/vectors").Vec[][];
|
|
2
|
+
export declare const quadraticSplitAt: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, t: number) => import("@thi.ng/vectors").Vec<number>[][];
|
|
3
|
+
export declare const quadraticSplitNearPoint: (p: ReadonlyVec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, res?: number, iter?: number) => import("@thi.ng/vectors").Vec<number>[][];
|
|
4
4
|
//# sourceMappingURL=quadratic-split.d.ts.map
|
package/quadratic-tangent.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
|
|
2
|
-
export declare const quadraticTangentAt: (out: Vec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, t: number, len?: number) => Vec
|
|
2
|
+
export declare const quadraticTangentAt: (out: Vec, a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, t: number, len?: number) => Vec<number>;
|
|
3
3
|
//# sourceMappingURL=quadratic-tangent.d.ts.map
|