@thi.ng/geom-splines 2.1.20 → 2.1.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-08-01T14:53:59Z
3
+ - **Last updated**: 2022-08-07T15:28:01Z
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.22](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-splines@2.1.22) (2022-08-06)
13
+
14
+ #### ⏱ Performance improvements
15
+
16
+ - update vector fns ([3fcfc51](https://github.com/thi-ng/umbrella/commit/3fcfc51))
17
+
12
18
  ### [2.1.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-splines@2.1.8) (2022-03-11)
13
19
 
14
20
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -63,7 +63,7 @@ node --experimental-repl-await
63
63
  > const geomSplines = await import("@thi.ng/geom-splines");
64
64
  ```
65
65
 
66
- Package sizes (gzipped, pre-treeshake): ESM: 2.58 KB
66
+ Package sizes (gzipped, pre-treeshake): ESM: 2.59 KB
67
67
 
68
68
  ## Dependencies
69
69
 
@@ -1,18 +1,18 @@
1
1
  import { cornerBisector } from "@thi.ng/vectors/bisect";
2
2
  import { corner2 } from "@thi.ng/vectors/clockwise";
3
- import { direction } from "@thi.ng/vectors/direction";
3
+ import { direction2 } from "@thi.ng/vectors/direction";
4
4
  import { dist } from "@thi.ng/vectors/dist";
5
- import { maddN } from "@thi.ng/vectors/maddn";
6
- import { mulN } from "@thi.ng/vectors/muln";
5
+ import { maddN2 } from "@thi.ng/vectors/maddn";
6
+ import { mulN, mulN2 } from "@thi.ng/vectors/muln";
7
7
  import { perpendicularCW } from "@thi.ng/vectors/perpendicular";
8
- import { set } from "@thi.ng/vectors/set";
8
+ import { set2 } from "@thi.ng/vectors/set";
9
9
  const buildSegments = (tangents, t, uniform) => {
10
10
  const res = [];
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
14
  const d = uniform ? t : t * dist(a, b);
15
- res.push([a, maddN([], na, d, a), maddN([], nb, -d, b), b]);
15
+ res.push([a, maddN2([], na, d, a), maddN2([], nb, -d, b), b]);
16
16
  }
17
17
  return res;
18
18
  };
@@ -23,23 +23,23 @@ export const closedCubicFromBreakPoints = (points, t = 1 / 3, uniform = false) =
23
23
  const b = points[j];
24
24
  const c = points[(j + 1) % num];
25
25
  const n = mulN(null, perpendicularCW(null, cornerBisector([], a, b, c)), corner2(a, b, c));
26
- tangents.push([set([], b), n]);
26
+ tangents.push([set2([], b), n]);
27
27
  }
28
28
  tangents.push(tangents[0]);
29
29
  return buildSegments(tangents, t, uniform);
30
30
  };
31
31
  export const openCubicFromBreakPoints = (points, t = 1 / 3, uniform = false) => {
32
32
  const tangents = [
33
- [points[0], direction([], points[0], points[1])],
33
+ [points[0], direction2([], points[0], points[1])],
34
34
  ];
35
35
  const num = points.length - 1;
36
36
  for (let i = 1; i < num; i++) {
37
37
  const a = points[i - 1];
38
38
  const b = points[i];
39
39
  const c = points[i + 1];
40
- const n = mulN(null, perpendicularCW(null, cornerBisector([], a, b, c)), corner2(a, b, c));
41
- tangents.push([set([], b), n]);
40
+ const n = mulN2(null, perpendicularCW(null, cornerBisector([], a, b, c)), corner2(a, b, c));
41
+ tangents.push([set2([], b), n]);
42
42
  }
43
- tangents.push([points[num], direction([], points[num - 1], points[num])]);
43
+ tangents.push([points[num], direction2([], points[num - 1], points[num])]);
44
44
  return buildSegments(tangents, t, uniform);
45
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/geom-splines",
3
- "version": "2.1.20",
3
+ "version": "2.1.23",
4
4
  "description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@thi.ng/api": "^8.3.9",
38
- "@thi.ng/checks": "^3.2.3",
39
- "@thi.ng/geom-api": "^3.3.3",
40
- "@thi.ng/geom-arc": "^2.1.20",
41
- "@thi.ng/geom-resample": "^2.1.20",
38
+ "@thi.ng/checks": "^3.2.4",
39
+ "@thi.ng/geom-api": "^3.3.6",
40
+ "@thi.ng/geom-arc": "^2.1.23",
41
+ "@thi.ng/geom-resample": "^2.1.23",
42
42
  "@thi.ng/math": "^5.3.5",
43
- "@thi.ng/vectors": "^7.5.9"
43
+ "@thi.ng/vectors": "^7.5.12"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.25.0",
47
- "@thi.ng/testament": "^0.2.10",
47
+ "@thi.ng/testament": "^0.2.11",
48
48
  "rimraf": "^3.0.2",
49
49
  "tools": "^0.0.1",
50
50
  "typedoc": "^0.22.17",
@@ -144,5 +144,5 @@
144
144
  "geom-subdiv-curve"
145
145
  ]
146
146
  },
147
- "gitHead": "976ccd698cedaa60dcef2e69030a5eb98898cc4a\n"
147
+ "gitHead": "0eeb5054111cea51f4714b013dda8700ade3cd54\n"
148
148
  }