@thi.ng/geom-splines 2.2.12 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-11-30T22:27:37Z
3
+ - **Last updated**: 2022-12-20T16:33:11Z
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.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![geom-splines](https://media.thi.ng/umbrella/banners-20220914/thing-geom-splines.svg?82ae0eac)
3
+ # ![@thi.ng/geom-splines](https://media.thi.ng/umbrella/banners-20220914/thing-geom-splines.svg?82ae0eac)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/geom-splines.svg)](https://www.npmjs.com/package/@thi.ng/geom-splines)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/geom-splines.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -24,7 +24,7 @@ This project is part of the
24
24
 
25
25
  ## About
26
26
 
27
- nD cubic & quadratic curve analysis, conversion, interpolation, splitting. This is a support package for [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom).
27
+ nD cubic & quadratic curve analysis, conversion, interpolation, splitting
28
28
 
29
29
  Current implementations partially based on
30
30
  [toxiclibs](http://toxiclibs.org) (Java) and Clojure version of
@@ -56,11 +56,8 @@ ES module import:
56
56
 
57
57
  For Node.js REPL:
58
58
 
59
- ```text
60
- # with flag only for < v16
61
- node --experimental-repl-await
62
-
63
- > const geomSplines = await import("@thi.ng/geom-splines");
59
+ ```js
60
+ const geomSplines = await import("@thi.ng/geom-splines");
64
61
  ```
65
62
 
66
63
  Package sizes (brotli'd, pre-treeshake): ESM: 2.38 KB
@@ -126,7 +123,7 @@ each vertex corner, taking into the convexity of each poly vertex.
126
123
 
127
124
  ## Authors
128
125
 
129
- Karsten Schmidt
126
+ - [Karsten Schmidt](https://thi.ng)
130
127
 
131
128
  If this project contributes to an academic publication, please cite it as:
132
129
 
@@ -141,4 +138,4 @@ If this project contributes to an academic publication, please cite it as:
141
138
 
142
139
  ## License
143
140
 
144
- &copy; 2016 - 2022 Karsten Schmidt // Apache Software License 2.0
141
+ &copy; 2016 - 2022 Karsten Schmidt // Apache License 2.0
package/cubic-arc.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
2
2
  /**
3
- * Converts elliptic arc into a 1-4 cubic curve segments, depending on
4
- * arc's angle range.
3
+ * Converts elliptic arc into a 1-4 cubic curve segments, depending on arc's
4
+ * angle range.
5
5
  *
6
6
  * Partially based on:
7
- * {@link https://github.com/chromium/chromium/blob/develop/third_party/blink/renderer/core/svg/svg_path_parser.cc#L253}
7
+ * https://github.com/chromium/chromium/blob/develop/third_party/blink/renderer/core/svg/svg_path_parser.cc#L253
8
8
  *
9
9
  * @param pos - ellipse center
10
10
  * @param r - ellipse radii
package/cubic-arc.js CHANGED
@@ -5,11 +5,11 @@ import { roundEps } from "@thi.ng/math/prec";
5
5
  import { magSq2 } from "@thi.ng/vectors/magsq";
6
6
  import { cubicFromLine } from "./cubic-line.js";
7
7
  /**
8
- * Converts elliptic arc into a 1-4 cubic curve segments, depending on
9
- * arc's angle range.
8
+ * Converts elliptic arc into a 1-4 cubic curve segments, depending on arc's
9
+ * angle range.
10
10
  *
11
11
  * Partially based on:
12
- * {@link https://github.com/chromium/chromium/blob/develop/third_party/blink/renderer/core/svg/svg_path_parser.cc#L253}
12
+ * https://github.com/chromium/chromium/blob/develop/third_party/blink/renderer/core/svg/svg_path_parser.cc#L253
13
13
  *
14
14
  * @param pos - ellipse center
15
15
  * @param r - ellipse radii
package/cubic-bounds.js CHANGED
@@ -2,8 +2,7 @@ import { mixCubic } from "@thi.ng/math/mix";
2
2
  /**
3
3
  * Computes cubic spline bounds for a single vector component.
4
4
  *
5
- * Based on:
6
- * {@link http://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm}
5
+ * Based on: http://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm
7
6
  *
8
7
  * @param min - min accumulator
9
8
  * @param max - max accumulator
@@ -1,12 +1,11 @@
1
1
  import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
2
2
  /**
3
- * Performs recursive search for closest point to `p` on cubic curve
4
- * defined by control points `a`,`b`,`c`,`d`. The `res` and `recur`
5
- * params are used to control the recursion behavior. If `eps` is given,
6
- * the search is terminated as soon as a point with a shorter *squared*
7
- * distance than `eps` is found.
3
+ * Performs recursive search for closest point to `p` on cubic curve defined by
4
+ * control points `a`,`b`,`c`,`d`. The `res` and `recur` params are used to
5
+ * control the recursion behavior. If `eps` is given, the search is terminated
6
+ * as soon as a point with a shorter *squared* distance than `eps` is found.
8
7
  *
9
- * {@link @thi.ng/math#minError}
8
+ * [`minError()`](https://docs.thi.ng/umbrella/math/functions/minError.html)
10
9
  *
11
10
  * @param p - query point
12
11
  * @param a - control point 1
@@ -2,13 +2,12 @@ import { minError } from "@thi.ng/math/min-error";
2
2
  import { distSq } from "@thi.ng/vectors/distsq";
3
3
  import { mixCubic } from "@thi.ng/vectors/mix-cubic";
4
4
  /**
5
- * Performs recursive search for closest point to `p` on cubic curve
6
- * defined by control points `a`,`b`,`c`,`d`. The `res` and `recur`
7
- * params are used to control the recursion behavior. If `eps` is given,
8
- * the search is terminated as soon as a point with a shorter *squared*
9
- * distance than `eps` is found.
5
+ * Performs recursive search for closest point to `p` on cubic curve defined by
6
+ * control points `a`,`b`,`c`,`d`. The `res` and `recur` params are used to
7
+ * control the recursion behavior. If `eps` is given, the search is terminated
8
+ * as soon as a point with a shorter *squared* distance than `eps` is found.
10
9
  *
11
- * {@link @thi.ng/math#minError}
10
+ * [`minError()`](https://docs.thi.ng/umbrella/math/functions/minError.html)
12
11
  *
13
12
  * @param p - query point
14
13
  * @param a - control point 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/geom-splines",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -21,7 +21,7 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
@@ -34,21 +34,21 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1",
38
- "@thi.ng/checks": "^3.3.4",
39
- "@thi.ng/geom-api": "^3.3.20",
40
- "@thi.ng/geom-arc": "^2.1.38",
41
- "@thi.ng/geom-resample": "^2.1.38",
42
- "@thi.ng/math": "^5.3.15",
43
- "@thi.ng/vectors": "^7.5.26"
37
+ "@thi.ng/api": "^8.6.1",
38
+ "@thi.ng/checks": "^3.3.5",
39
+ "@thi.ng/geom-api": "^3.3.22",
40
+ "@thi.ng/geom-arc": "^2.1.40",
41
+ "@thi.ng/geom-resample": "^2.1.40",
42
+ "@thi.ng/math": "^5.3.17",
43
+ "@thi.ng/vectors": "^7.5.28"
44
44
  },
45
45
  "devDependencies": {
46
- "@microsoft/api-extractor": "^7.33.5",
47
- "@thi.ng/testament": "^0.3.6",
46
+ "@microsoft/api-extractor": "^7.33.7",
47
+ "@thi.ng/testament": "^0.3.7",
48
48
  "rimraf": "^3.0.2",
49
49
  "tools": "^0.0.1",
50
- "typedoc": "^0.23.20",
51
- "typescript": "^4.8.4"
50
+ "typedoc": "^0.23.22",
51
+ "typescript": "^4.9.4"
52
52
  },
53
53
  "keywords": [
54
54
  "2d",
@@ -144,5 +144,5 @@
144
144
  "geom-subdiv-curve"
145
145
  ]
146
146
  },
147
- "gitHead": "5178ea1d7f4b2de86cf5101bdd73f6567518c0bd\n"
147
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
148
148
  }
@@ -1,12 +1,11 @@
1
1
  import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
2
2
  /**
3
- * Performs recursive search for closest point to `p` on quadratic curve
4
- * defined by control points `a`,`b`,`c`. The `res` and `recur` params
5
- * are used to control the recursion behavior. If `eps` is given, the
6
- * search is terminated as soon as a point with a shorter *squared*
7
- * distance than `eps` is found.
3
+ * Performs recursive search for closest point to `p` on quadratic curve defined
4
+ * by control points `a`,`b`,`c`. The `res` and `recur` params are used to
5
+ * control the recursion behavior. If `eps` is given, the search is terminated
6
+ * as soon as a point with a shorter *squared* distance than `eps` is found.
8
7
  *
9
- * {@link @thi.ng/math#minError}
8
+ * [`minError()`](https://docs.thi.ng/umbrella/math/functions/minError.html)
10
9
  *
11
10
  * @param p - query point
12
11
  * @param a - control point 1
@@ -2,13 +2,12 @@ import { minError } from "@thi.ng/math/min-error";
2
2
  import { distSq } from "@thi.ng/vectors/distsq";
3
3
  import { mixQuadratic } from "@thi.ng/vectors/mix-quadratic";
4
4
  /**
5
- * Performs recursive search for closest point to `p` on quadratic curve
6
- * defined by control points `a`,`b`,`c`. The `res` and `recur` params
7
- * are used to control the recursion behavior. If `eps` is given, the
8
- * search is terminated as soon as a point with a shorter *squared*
9
- * distance than `eps` is found.
5
+ * Performs recursive search for closest point to `p` on quadratic curve defined
6
+ * by control points `a`,`b`,`c`. The `res` and `recur` params are used to
7
+ * control the recursion behavior. If `eps` is given, the search is terminated
8
+ * as soon as a point with a shorter *squared* distance than `eps` is found.
10
9
  *
11
- * {@link @thi.ng/math#minError}
10
+ * [`minError()`](https://docs.thi.ng/umbrella/math/functions/minError.html)
12
11
  *
13
12
  * @param p - query point
14
13
  * @param a - control point 1