@thi.ng/geom 5.2.14 → 6.0.0
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 +2 -1
- package/package.json +4 -4
- package/tessellate.d.ts +3 -2
- package/tessellate.js +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-
|
|
3
|
+
- **Last updated**: 2023-11-01T11:05:34Z
|
|
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
|
+
# [6.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@6.0.0) (2023-11-01)
|
|
13
|
+
|
|
14
|
+
#### 🛑 Breaking changes
|
|
15
|
+
|
|
16
|
+
- update tessellate() for groups, update return type ([1bb1752](https://github.com/thi-ng/umbrella/commit/1bb1752))
|
|
17
|
+
- BREAKING CHANGE: update tessellate() for groups, update return type to Iterable
|
|
18
|
+
|
|
12
19
|
### [5.2.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/geom@5.2.13) (2023-10-27)
|
|
13
20
|
|
|
14
21
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ For Node.js REPL:
|
|
|
200
200
|
const geom = await import("@thi.ng/geom");
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 12.
|
|
203
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 12.77 KB
|
|
204
204
|
|
|
205
205
|
## Dependencies
|
|
206
206
|
|
|
@@ -255,6 +255,7 @@ directory are using this package:
|
|
|
255
255
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/imgui/imgui-all.png" width="240"/> | Canvas based Immediate Mode GUI components | [Demo](https://demo.thi.ng/umbrella/imgui/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/imgui) |
|
|
256
256
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/geom/geom-isoline.png" width="240"/> | Animated sine plasma effect visualized using contour lines | [Demo](https://demo.thi.ng/umbrella/iso-plasma/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/iso-plasma) |
|
|
257
257
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/kmeans-viz.jpg" width="240"/> | k-means clustering visualization | [Demo](https://demo.thi.ng/umbrella/kmeans-viz/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/kmeans-viz) |
|
|
258
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
|
|
258
259
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/poisson/poisson.jpg" width="240"/> | 2D Poisson-disc sampler with procedural gradient map | [Demo](https://demo.thi.ng/umbrella/poisson-circles/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poisson-circles) |
|
|
259
260
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
|
|
260
261
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@thi.ng/geom-resample": "^2.3.6",
|
|
54
54
|
"@thi.ng/geom-splines": "^2.2.59",
|
|
55
55
|
"@thi.ng/geom-subdiv-curve": "^2.1.84",
|
|
56
|
-
"@thi.ng/geom-tessellate": "^2.1.
|
|
56
|
+
"@thi.ng/geom-tessellate": "^2.1.85",
|
|
57
57
|
"@thi.ng/hiccup": "^5.0.4",
|
|
58
58
|
"@thi.ng/hiccup-svg": "^5.0.30",
|
|
59
59
|
"@thi.ng/math": "^5.7.1",
|
|
60
|
-
"@thi.ng/matrices": "^2.2.
|
|
60
|
+
"@thi.ng/matrices": "^2.2.5",
|
|
61
61
|
"@thi.ng/random": "^3.6.11",
|
|
62
62
|
"@thi.ng/strings": "^3.6.3",
|
|
63
63
|
"@thi.ng/transducers": "^8.8.7",
|
|
@@ -398,5 +398,5 @@
|
|
|
398
398
|
],
|
|
399
399
|
"year": 2013
|
|
400
400
|
},
|
|
401
|
-
"gitHead": "
|
|
401
|
+
"gitHead": "351014d081cee85803950eb6751c5a02dca2efbd\n"
|
|
402
402
|
}
|
package/tessellate.d.ts
CHANGED
|
@@ -8,12 +8,13 @@ import type { Vec } from "@thi.ng/vectors";
|
|
|
8
8
|
* more details.
|
|
9
9
|
*
|
|
10
10
|
* @remarks
|
|
11
|
-
* Implemented for all shapes supported by {@link vertices}.
|
|
11
|
+
* Implemented for all shapes supported by {@link vertices}. For groups, every
|
|
12
|
+
* child shape will be tessellated individually.
|
|
12
13
|
*
|
|
13
14
|
* @param shape
|
|
14
15
|
* @param tessellators
|
|
15
16
|
*/
|
|
16
|
-
export declare const tessellate: import("@thi.ng/defmulti").MultiFn2<IShape<IShape<any>>, Tessellator[], Vec[]
|
|
17
|
+
export declare const tessellate: import("@thi.ng/defmulti").MultiFn2<IShape<IShape<any>>, Tessellator[], Iterable<Vec[]>>;
|
|
17
18
|
/**
|
|
18
19
|
* Alias for thi.ng/geom-tessellate
|
|
19
20
|
* [`earCut2`](https://docs.thi.ng/umbrella/geom-tessellate/functions/earCut2.html)
|
package/tessellate.js
CHANGED
|
@@ -6,6 +6,8 @@ import { quadFan } from "@thi.ng/geom-tessellate/quad-fan";
|
|
|
6
6
|
import { rimTris } from "@thi.ng/geom-tessellate/rim-tris";
|
|
7
7
|
import { tessellate as _tessellate } from "@thi.ng/geom-tessellate/tessellate";
|
|
8
8
|
import { triFan } from "@thi.ng/geom-tessellate/tri-fan";
|
|
9
|
+
import { mapcat } from "@thi.ng/transducers/mapcat";
|
|
10
|
+
import { Group } from "./api/group.js";
|
|
9
11
|
import { __dispatch } from "./internal/dispatch.js";
|
|
10
12
|
import { vertices } from "./vertices.js";
|
|
11
13
|
/**
|
|
@@ -16,13 +18,15 @@ import { vertices } from "./vertices.js";
|
|
|
16
18
|
* more details.
|
|
17
19
|
*
|
|
18
20
|
* @remarks
|
|
19
|
-
* Implemented for all shapes supported by {@link vertices}.
|
|
21
|
+
* Implemented for all shapes supported by {@link vertices}. For groups, every
|
|
22
|
+
* child shape will be tessellated individually.
|
|
20
23
|
*
|
|
21
24
|
* @param shape
|
|
22
25
|
* @param tessellators
|
|
23
26
|
*/
|
|
24
27
|
export const tessellate = defmulti(__dispatch, {}, {
|
|
25
28
|
[DEFAULT]: ($, fns) => _tessellate(vertices($), fns),
|
|
29
|
+
group: ($, fns) => mapcat((x) => _tessellate(vertices(x), fns), $.children),
|
|
26
30
|
});
|
|
27
31
|
/**
|
|
28
32
|
* Alias for thi.ng/geom-tessellate
|