@thi.ng/geom-sdf 0.4.1 → 0.4.3

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**: 2024-05-08T18:24:32Z
3
+ - **Last updated**: 2024-06-29T09:28:36Z
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,13 @@ 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
+ ### [0.4.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-sdf@0.4.2) (2024-06-21)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - remove geom-api dep, update imports ([9b6464d](https://github.com/thi-ng/umbrella/commit/9b6464d))
17
+ - enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
18
+
12
19
  ## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom-sdf@0.4.0) (2024-05-08)
13
20
 
14
21
  #### 🚀 Features
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
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
  > [!NOTE]
10
- > This is one of 192 standalone projects, maintained as part
10
+ > This is one of 189 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
  >
@@ -176,7 +176,6 @@ Package sizes (brotli'd, pre-treeshake): ESM: 3.76 KB
176
176
  - [@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti)
177
177
  - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
178
178
  - [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom)
179
- - [@thi.ng/geom-api](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-api)
180
179
  - [@thi.ng/geom-isoline](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-isoline)
181
180
  - [@thi.ng/geom-poly-utils](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-poly-utils)
182
181
  - [@thi.ng/geom-resample](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-resample)
package/as-polygons.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { NumericArray } from "@thi.ng/api";
2
- import type { Polygon } from "@thi.ng/geom";
3
- import type { AABBLike } from "@thi.ng/geom-api";
2
+ import type { AABBLike, Polygon } from "@thi.ng/geom";
4
3
  import type { ReadonlyVec } from "@thi.ng/vectors";
5
4
  import type { SDFn } from "./api.js";
6
5
  /**
package/as-sdf.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { MultiFn1 } from "@thi.ng/defmulti";
2
- import type { IShape } from "@thi.ng/geom-api";
2
+ import type { IShape } from "@thi.ng/geom";
3
3
  import type { SDFn } from "./api.js";
4
4
  /**
5
5
  * Takes an
6
- * [`IShape`](https://docs.thi.ng/umbrella/geom-api/interfaces/IShape.html)
6
+ * [`IShape`](https://docs.thi.ng/umbrella/geom/interfaces/IShape.html)
7
7
  * instance (possibly a tree, e.g. via
8
8
  * [`group()`](https://docs.thi.ng/umbrella/geom/functions/group.html)) and
9
9
  * converts it into a {@link SDFn}.
@@ -27,9 +27,9 @@ import type { SDFn } from "./api.js";
27
27
  * For shapes which need to be converted to polygons/polylines, the
28
28
  * {@link SDFAttribs.samples} attribute can be used to control the resulting
29
29
  * number of vertices. If not specified
30
- * [`DEFAULT_SAMPLES`](https://docs.thi.ng/umbrella/geom-api/variables/DEFAULT_SAMPLES.html)
30
+ * [`DEFAULT_SAMPLES`](https://docs.thi.ng/umbrella/geom-resample/variables/DEFAULT_SAMPLES.html)
31
31
  * will be used (which can be globally set via
32
- * [`setDefaultSamples()`](https://docs.thi.ng/umbrella/geom-api/functions/setDefaultSamples.html)).
32
+ * [`setDefaultSamples()`](https://docs.thi.ng/umbrella/geom-resample/functions/setDefaultSamples.html)).
33
33
  */
34
34
  export declare const asSDF: MultiFn1<IShape, SDFn>;
35
35
  //# sourceMappingURL=as-sdf.d.ts.map
package/dist.js CHANGED
@@ -8,6 +8,7 @@ import { distSq2 } from "@thi.ng/vectors/distsq";
8
8
  import { dot2 } from "@thi.ng/vectors/dot";
9
9
  import { every3 } from "@thi.ng/vectors/every";
10
10
  import { maddN2 } from "@thi.ng/vectors/maddn";
11
+ import { mag2 } from "@thi.ng/vectors/mag";
11
12
  import { magSq2 } from "@thi.ng/vectors/magsq";
12
13
  import { max2 } from "@thi.ng/vectors/max";
13
14
  import { mul2 } from "@thi.ng/vectors/mul";
@@ -22,7 +23,6 @@ const t3 = [];
22
23
  const t4 = [];
23
24
  const t5 = [];
24
25
  const { abs, cos, min, max, sign, sin, sqrt } = Math;
25
- const mag2 = (v) => sqrt(magSq2(v));
26
26
  const distCircle2 = (p, radius) => mag2(p) - radius;
27
27
  const distBox2 = (p, halfSize) => {
28
28
  const d = sub2(null, abs2(t1, p), halfSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/geom-sdf",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "2D Signed Distance Field creation from @thi.ng/geom shapes, conversions, sampling, combinators",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
12
12
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/geom-sdf#readme",
13
+ "homepage": "https://thi.ng/geom-sdf",
14
14
  "funding": [
15
15
  {
16
16
  "type": "github",
@@ -36,24 +36,23 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.2",
40
- "@thi.ng/checks": "^3.6.4",
41
- "@thi.ng/defmulti": "^3.0.39",
42
- "@thi.ng/errors": "^2.5.7",
43
- "@thi.ng/geom": "^7.0.1",
44
- "@thi.ng/geom-api": "^4.0.10",
45
- "@thi.ng/geom-isoline": "^2.1.127",
46
- "@thi.ng/geom-poly-utils": "^2.4.0",
47
- "@thi.ng/geom-resample": "^2.3.53",
48
- "@thi.ng/math": "^5.10.13",
49
- "@thi.ng/transducers": "^9.0.5",
50
- "@thi.ng/vectors": "^7.10.31"
39
+ "@thi.ng/api": "^8.11.4",
40
+ "@thi.ng/checks": "^3.6.6",
41
+ "@thi.ng/defmulti": "^3.0.41",
42
+ "@thi.ng/errors": "^2.5.9",
43
+ "@thi.ng/geom": "^8.0.1",
44
+ "@thi.ng/geom-isoline": "^2.1.129",
45
+ "@thi.ng/geom-poly-utils": "^3.0.1",
46
+ "@thi.ng/geom-resample": "^3.0.1",
47
+ "@thi.ng/math": "^5.11.1",
48
+ "@thi.ng/transducers": "^9.0.7",
49
+ "@thi.ng/vectors": "^7.11.1"
51
50
  },
52
51
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.43.2",
54
- "esbuild": "^0.21.1",
52
+ "@microsoft/api-extractor": "^7.47.0",
53
+ "esbuild": "^0.21.5",
55
54
  "typedoc": "^0.25.13",
56
- "typescript": "^5.4.5"
55
+ "typescript": "^5.5.2"
57
56
  },
58
57
  "keywords": [
59
58
  "2d",
@@ -128,5 +127,5 @@
128
127
  "status": "alpha",
129
128
  "year": 2022
130
129
  },
131
- "gitHead": "41bd769068da804eeace622ec7db50e4d48f1dc9\n"
130
+ "gitHead": "7b950c112fba0b2e7c450765b15624c3382f1354\n"
132
131
  }
package/sample.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Fn, NumericArray } from "@thi.ng/api";
2
- import type { AABBLike } from "@thi.ng/geom-api";
2
+ import type { AABBLike } from "@thi.ng/geom";
3
3
  import type { ReadonlyVec, Vec } from "@thi.ng/vectors";
4
4
  import type { SDFn } from "./api.js";
5
5
  /**