@thi.ng/geom-sdf 0.4.0 → 0.4.2
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 +8 -1
- package/README.md +1 -2
- package/as-polygons.d.ts +1 -2
- package/as-sdf.d.ts +4 -4
- package/dist.js +1 -1
- package/package.json +17 -18
- package/sample.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-06-21T19:34:38Z
|
|
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
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 193 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
|
|
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
|
|
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-
|
|
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-
|
|
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.
|
|
3
|
+
"version": "0.4.2",
|
|
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://
|
|
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.
|
|
40
|
-
"@thi.ng/checks": "^3.6.
|
|
41
|
-
"@thi.ng/defmulti": "^3.0.
|
|
42
|
-
"@thi.ng/errors": "^2.5.
|
|
43
|
-
"@thi.ng/geom": "^
|
|
44
|
-
"@thi.ng/geom-
|
|
45
|
-
"@thi.ng/geom-
|
|
46
|
-
"@thi.ng/geom-
|
|
47
|
-
"@thi.ng/
|
|
48
|
-
"@thi.ng/
|
|
49
|
-
"@thi.ng/
|
|
50
|
-
"@thi.ng/vectors": "^7.10.31"
|
|
39
|
+
"@thi.ng/api": "^8.11.3",
|
|
40
|
+
"@thi.ng/checks": "^3.6.5",
|
|
41
|
+
"@thi.ng/defmulti": "^3.0.40",
|
|
42
|
+
"@thi.ng/errors": "^2.5.8",
|
|
43
|
+
"@thi.ng/geom": "^8.0.0",
|
|
44
|
+
"@thi.ng/geom-isoline": "^2.1.128",
|
|
45
|
+
"@thi.ng/geom-poly-utils": "^3.0.0",
|
|
46
|
+
"@thi.ng/geom-resample": "^3.0.0",
|
|
47
|
+
"@thi.ng/math": "^5.11.0",
|
|
48
|
+
"@thi.ng/transducers": "^9.0.6",
|
|
49
|
+
"@thi.ng/vectors": "^7.11.0"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.
|
|
54
|
-
"esbuild": "^0.21.
|
|
52
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
53
|
+
"esbuild": "^0.21.5",
|
|
55
54
|
"typedoc": "^0.25.13",
|
|
56
|
-
"typescript": "^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": "
|
|
130
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
132
131
|
}
|
package/sample.d.ts
CHANGED