@thi.ng/geom 4.0.0 → 4.0.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 +1 -1
- package/README.md +7 -10
- package/api/text.d.ts +3 -2
- package/api/text.js +3 -2
- package/as-polygon.d.ts +2 -1
- package/as-polygon.js +2 -1
- package/as-polyline.d.ts +2 -1
- package/as-polyline.js +2 -1
- package/classify-point.d.ts +3 -3
- package/classify-point.js +3 -3
- package/clip-convex.d.ts +3 -2
- package/clip-convex.js +3 -2
- package/convex-hull.d.ts +2 -1
- package/convex-hull.js +2 -1
- package/edges.d.ts +1 -1
- package/edges.js +1 -1
- package/internal/bounds.d.ts +2 -2
- package/internal/bounds.js +2 -2
- package/intersects.d.ts +1 -1
- package/intersects.js +1 -1
- package/offset.d.ts +2 -1
- package/offset.js +2 -1
- package/package.json +34 -34
- package/scatter.d.ts +4 -2
- package/scatter.js +4 -2
- package/simplify.d.ts +4 -2
- package/simplify.js +4 -2
- package/subdiv-curve.d.ts +5 -3
- package/subdiv-curve.js +5 -3
- package/tessellate.d.ts +4 -2
- package/tessellate.js +4 -2
- package/vertices.d.ts +2 -1
- package/vertices.js +2 -1
- package/with-attribs.d.ts +3 -2
- package/with-attribs.js +3 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/geom)
|
|
6
6
|

|
|
7
|
-
[](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.
|
|
@@ -27,7 +27,7 @@ For the Clojure version, please visit: [thi.ng/geom-clj](https://thi.ng/geom-clj
|
|
|
27
27
|
|
|
28
28
|
## About
|
|
29
29
|
|
|
30
|
-
Functional, polymorphic API for 2D geometry types & SVG generation
|
|
30
|
+
Functional, polymorphic API for 2D geometry types & SVG generation
|
|
31
31
|
|
|
32
32
|
This project is a partially ported from the [Clojure version of the same
|
|
33
33
|
name](http://thi.ng/geom-clj). All polymorphic operations built on
|
|
@@ -182,11 +182,8 @@ ES module import:
|
|
|
182
182
|
|
|
183
183
|
For Node.js REPL:
|
|
184
184
|
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
node --experimental-repl-await
|
|
188
|
-
|
|
189
|
-
> const geom = await import("@thi.ng/geom");
|
|
185
|
+
```js
|
|
186
|
+
const geom = await import("@thi.ng/geom");
|
|
190
187
|
```
|
|
191
188
|
|
|
192
189
|
Package sizes (brotli'd, pre-treeshake): ESM: 11.98 KB
|
|
@@ -257,7 +254,7 @@ TODO
|
|
|
257
254
|
|
|
258
255
|
## Authors
|
|
259
256
|
|
|
260
|
-
Karsten Schmidt
|
|
257
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
261
258
|
|
|
262
259
|
If this project contributes to an academic publication, please cite it as:
|
|
263
260
|
|
|
@@ -272,4 +269,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
272
269
|
|
|
273
270
|
## License
|
|
274
271
|
|
|
275
|
-
© 2013 - 2022 Karsten Schmidt // Apache
|
|
272
|
+
© 2013 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api/text.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import type { Vec } from "@thi.ng/vectors";
|
|
|
3
3
|
/**
|
|
4
4
|
* Basic stub for text elements. Currently, only a minimal set of geometry
|
|
5
5
|
* operations are implemented for this type, however this type implements
|
|
6
|
-
*
|
|
7
|
-
* text elements in {@link Group}s with
|
|
6
|
+
* [`IToHiccup`](https://docs.thi.ng/umbrella/api/interfaces/IToHiccup.html) and
|
|
7
|
+
* so is useful as wrapper for inclusion of text elements in {@link Group}s with
|
|
8
|
+
* other shape types.
|
|
8
9
|
*/
|
|
9
10
|
export declare class Text implements IHiccupShape {
|
|
10
11
|
pos: Vec;
|
package/api/text.js
CHANGED
|
@@ -3,8 +3,9 @@ import { __copyAttribs } from "../internal/copy.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Basic stub for text elements. Currently, only a minimal set of geometry
|
|
5
5
|
* operations are implemented for this type, however this type implements
|
|
6
|
-
*
|
|
7
|
-
* text elements in {@link Group}s with
|
|
6
|
+
* [`IToHiccup`](https://docs.thi.ng/umbrella/api/interfaces/IToHiccup.html) and
|
|
7
|
+
* so is useful as wrapper for inclusion of text elements in {@link Group}s with
|
|
8
|
+
* other shape types.
|
|
8
9
|
*/
|
|
9
10
|
export class Text {
|
|
10
11
|
constructor(pos, body, attribs) {
|
package/as-polygon.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { IShape, SamplingOpts } from "@thi.ng/geom-api";
|
|
|
3
3
|
import { Polygon } from "./api/polygon.js";
|
|
4
4
|
/**
|
|
5
5
|
* Converts given shape into a {@link Polygon}, optionally using provided
|
|
6
|
-
*
|
|
6
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html)
|
|
7
|
+
* or number of target vertices.
|
|
7
8
|
*
|
|
8
9
|
* @remarks
|
|
9
10
|
* Currently implemented for:
|
package/as-polygon.js
CHANGED
|
@@ -5,7 +5,8 @@ import { __dispatch } from "./internal/dispatch.js";
|
|
|
5
5
|
import { vertices } from "./vertices.js";
|
|
6
6
|
/**
|
|
7
7
|
* Converts given shape into a {@link Polygon}, optionally using provided
|
|
8
|
-
*
|
|
8
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html)
|
|
9
|
+
* or number of target vertices.
|
|
9
10
|
*
|
|
10
11
|
* @remarks
|
|
11
12
|
* Currently implemented for:
|
package/as-polyline.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { IShape, SamplingOpts } from "@thi.ng/geom-api";
|
|
|
3
3
|
import { Polyline } from "./api/polyline.js";
|
|
4
4
|
/**
|
|
5
5
|
* Converts given shape into a {@link Polyline}, optionally using provided
|
|
6
|
-
*
|
|
6
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html)
|
|
7
|
+
* or number of target vertices.
|
|
7
8
|
*
|
|
8
9
|
* @remarks
|
|
9
10
|
* Currently implemented for:
|
package/as-polyline.js
CHANGED
|
@@ -6,7 +6,8 @@ import { __dispatch } from "./internal/dispatch.js";
|
|
|
6
6
|
import { vertices } from "./vertices.js";
|
|
7
7
|
/**
|
|
8
8
|
* Converts given shape into a {@link Polyline}, optionally using provided
|
|
9
|
-
*
|
|
9
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html)
|
|
10
|
+
* or number of target vertices.
|
|
10
11
|
*
|
|
11
12
|
* @remarks
|
|
12
13
|
* Currently implemented for:
|
package/classify-point.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
|
14
14
|
* - {@link Sphere}
|
|
15
15
|
* - {@link Triangle}
|
|
16
16
|
*
|
|
17
|
-
* The
|
|
18
|
-
* feature set (incl. support for more shapes) to perform
|
|
19
|
-
* function.
|
|
17
|
+
* The [thi.ng/geom-sdf](https://thi.ng/thi.ng/geom-sdf) package provides a much
|
|
18
|
+
* more comprehensive feature set (incl. support for more shapes) to perform
|
|
19
|
+
* similar checks as this function.
|
|
20
20
|
*
|
|
21
21
|
* Also see {@link pointInside}.
|
|
22
22
|
*
|
package/classify-point.js
CHANGED
|
@@ -17,9 +17,9 @@ import { __dispatch } from "./internal/dispatch.js";
|
|
|
17
17
|
* - {@link Sphere}
|
|
18
18
|
* - {@link Triangle}
|
|
19
19
|
*
|
|
20
|
-
* The
|
|
21
|
-
* feature set (incl. support for more shapes) to perform
|
|
22
|
-
* function.
|
|
20
|
+
* The [thi.ng/geom-sdf](https://thi.ng/thi.ng/geom-sdf) package provides a much
|
|
21
|
+
* more comprehensive feature set (incl. support for more shapes) to perform
|
|
22
|
+
* similar checks as this function.
|
|
23
23
|
*
|
|
24
24
|
* Also see {@link pointInside}.
|
|
25
25
|
*
|
package/clip-convex.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
|
7
7
|
* boundary). Returns `undefined` if there're no remaining result vertices.
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
|
-
* Internally uses
|
|
11
|
-
*
|
|
10
|
+
* Internally uses
|
|
11
|
+
* [`sutherlandHodgeman()`](https://docs.thi.ng/umbrella/geom-clip-poly/functions/sutherlandHodgeman.html).
|
|
12
|
+
* For groups, calls itself for each child shape individually and returns a new
|
|
12
13
|
* group of results (if any).
|
|
13
14
|
*
|
|
14
15
|
* @param shape
|
package/clip-convex.js
CHANGED
|
@@ -14,8 +14,9 @@ import { ensureVertices, vertices } from "./vertices.js";
|
|
|
14
14
|
* boundary). Returns `undefined` if there're no remaining result vertices.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* Internally uses
|
|
18
|
-
*
|
|
17
|
+
* Internally uses
|
|
18
|
+
* [`sutherlandHodgeman()`](https://docs.thi.ng/umbrella/geom-clip-poly/functions/sutherlandHodgeman.html).
|
|
19
|
+
* For groups, calls itself for each child shape individually and returns a new
|
|
19
20
|
* group of results (if any).
|
|
20
21
|
*
|
|
21
22
|
* @param shape
|
package/convex-hull.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { IShape } from "@thi.ng/geom-api";
|
|
|
4
4
|
* Computes the convex hull for given shape and returns it as {@link Polygon}.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* Internally uses
|
|
7
|
+
* Internally uses
|
|
8
|
+
* [`grahamScan2()`](https://docs.thi.ng/umbrella/geom-hull/functions/grahamScan2.html).
|
|
8
9
|
*
|
|
9
10
|
* Currently implemented for:
|
|
10
11
|
*
|
package/convex-hull.js
CHANGED
|
@@ -8,7 +8,8 @@ import { vertices } from "./vertices.js";
|
|
|
8
8
|
* Computes the convex hull for given shape and returns it as {@link Polygon}.
|
|
9
9
|
*
|
|
10
10
|
* @remarks
|
|
11
|
-
* Internally uses
|
|
11
|
+
* Internally uses
|
|
12
|
+
* [`grahamScan2()`](https://docs.thi.ng/umbrella/geom-hull/functions/grahamScan2.html).
|
|
12
13
|
*
|
|
13
14
|
* Currently implemented for:
|
|
14
15
|
*
|
package/edges.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { VecPair } from "@thi.ng/vectors";
|
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the edges of given shape's boundary and returns them as an iterable
|
|
6
6
|
* of vector pairs. Some shapes also support
|
|
7
|
-
*
|
|
7
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html).
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
10
|
* Currently implemented for:
|
package/edges.js
CHANGED
|
@@ -7,7 +7,7 @@ import { vertices } from "./vertices.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Extracts the edges of given shape's boundary and returns them as an iterable
|
|
9
9
|
* of vector pairs. Some shapes also support
|
|
10
|
-
*
|
|
10
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html).
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
13
|
* Currently implemented for:
|
package/internal/bounds.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import type { ReadonlyVec, VecPair } from "@thi.ng/vectors";
|
|
|
13
13
|
export declare const __collBounds: (shapes: IShape[], bounds: Fn<IShape, AABBLike | undefined>) => import("@thi.ng/vectors").Vec[] | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Takes the position and size vectors of 2
|
|
16
|
-
*
|
|
17
|
-
* `[pos,size]` of their union bounds.
|
|
16
|
+
* [`AABBLike`](https://docs.thi.ng/umbrella/geom-api/interfaces/AABBLike.html)s
|
|
17
|
+
* and returns 2-tuple of `[pos,size]` of their union bounds.
|
|
18
18
|
*
|
|
19
19
|
* @param apos - bbox 1 min pos
|
|
20
20
|
* @param asize - bbox1 size
|
package/internal/bounds.js
CHANGED
|
@@ -29,8 +29,8 @@ export const __collBounds = (shapes, bounds) => {
|
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Takes the position and size vectors of 2
|
|
32
|
-
*
|
|
33
|
-
* `[pos,size]` of their union bounds.
|
|
32
|
+
* [`AABBLike`](https://docs.thi.ng/umbrella/geom-api/interfaces/AABBLike.html)s
|
|
33
|
+
* and returns 2-tuple of `[pos,size]` of their union bounds.
|
|
34
34
|
*
|
|
35
35
|
* @param apos - bbox 1 min pos
|
|
36
36
|
* @param asize - bbox1 size
|
package/intersects.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { MultiFn2 } from "@thi.ng/defmulti";
|
|
|
2
2
|
import type { IntersectionResult, IShape } from "@thi.ng/geom-api";
|
|
3
3
|
/**
|
|
4
4
|
* Performs intersection tests on given 2 shapes and returns
|
|
5
|
-
*
|
|
5
|
+
* [`IntersectionResult`](https://docs.thi.ng/umbrella/geom-api/interfaces/IntersectionResult.html).
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Currently supported pairs:
|
package/intersects.js
CHANGED
|
@@ -12,7 +12,7 @@ import { testAabbAabb, testRectRect } from "@thi.ng/geom-isec/rect-rect";
|
|
|
12
12
|
import { __dispatch2 } from "./internal/dispatch.js";
|
|
13
13
|
/**
|
|
14
14
|
* Performs intersection tests on given 2 shapes and returns
|
|
15
|
-
*
|
|
15
|
+
* [`IntersectionResult`](https://docs.thi.ng/umbrella/geom-api/interfaces/IntersectionResult.html).
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
18
|
* Currently supported pairs:
|
package/offset.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import type { IShape } from "@thi.ng/geom-api";
|
|
|
5
5
|
* distance `dist`.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Also see
|
|
8
|
+
* Also see [thi.ng/geom-sdf](https://thi.ng/thi.ng/geom-sdf) package for more
|
|
9
|
+
* flexible & advanced usage.
|
|
9
10
|
*
|
|
10
11
|
* Currently only implemented for:
|
|
11
12
|
*
|
package/offset.js
CHANGED
|
@@ -15,7 +15,8 @@ import { rectWithCentroidAndMargin } from "./rect.js";
|
|
|
15
15
|
* distance `dist`.
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Also see
|
|
18
|
+
* Also see [thi.ng/geom-sdf](https://thi.ng/thi.ng/geom-sdf) package for more
|
|
19
|
+
* flexible & advanced usage.
|
|
19
20
|
*
|
|
20
21
|
* Currently only implemented for:
|
|
21
22
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/geom",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Functional, polymorphic API for 2D geometry types & SVG generation",
|
|
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
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -35,41 +35,41 @@
|
|
|
35
35
|
"tool:bpatch": "tools:node-esm tools/bpatch.ts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.
|
|
39
|
-
"@thi.ng/arrays": "^2.4.
|
|
40
|
-
"@thi.ng/associative": "^6.2.
|
|
41
|
-
"@thi.ng/checks": "^3.3.
|
|
42
|
-
"@thi.ng/defmulti": "^2.1.
|
|
43
|
-
"@thi.ng/equiv": "^2.1.
|
|
44
|
-
"@thi.ng/errors": "^2.2.
|
|
45
|
-
"@thi.ng/geom-api": "^3.3.
|
|
46
|
-
"@thi.ng/geom-arc": "^2.1.
|
|
47
|
-
"@thi.ng/geom-clip-line": "^2.2.
|
|
48
|
-
"@thi.ng/geom-clip-poly": "^2.1.
|
|
49
|
-
"@thi.ng/geom-closest-point": "^2.1.
|
|
50
|
-
"@thi.ng/geom-hull": "^2.1.
|
|
51
|
-
"@thi.ng/geom-isec": "^2.1.
|
|
52
|
-
"@thi.ng/geom-poly-utils": "^2.3.
|
|
53
|
-
"@thi.ng/geom-resample": "^2.1.
|
|
54
|
-
"@thi.ng/geom-splines": "^2.2.
|
|
55
|
-
"@thi.ng/geom-subdiv-curve": "^2.1.
|
|
56
|
-
"@thi.ng/geom-tessellate": "^2.1.
|
|
57
|
-
"@thi.ng/hiccup": "^4.2.
|
|
58
|
-
"@thi.ng/hiccup-svg": "^4.3.
|
|
59
|
-
"@thi.ng/math": "^5.3.
|
|
60
|
-
"@thi.ng/matrices": "^2.1.
|
|
61
|
-
"@thi.ng/random": "^3.3.
|
|
62
|
-
"@thi.ng/strings": "^3.3.
|
|
63
|
-
"@thi.ng/transducers": "^8.3.
|
|
64
|
-
"@thi.ng/vectors": "^7.5.
|
|
38
|
+
"@thi.ng/api": "^8.6.1",
|
|
39
|
+
"@thi.ng/arrays": "^2.4.6",
|
|
40
|
+
"@thi.ng/associative": "^6.2.20",
|
|
41
|
+
"@thi.ng/checks": "^3.3.5",
|
|
42
|
+
"@thi.ng/defmulti": "^2.1.25",
|
|
43
|
+
"@thi.ng/equiv": "^2.1.15",
|
|
44
|
+
"@thi.ng/errors": "^2.2.6",
|
|
45
|
+
"@thi.ng/geom-api": "^3.3.22",
|
|
46
|
+
"@thi.ng/geom-arc": "^2.1.40",
|
|
47
|
+
"@thi.ng/geom-clip-line": "^2.2.2",
|
|
48
|
+
"@thi.ng/geom-clip-poly": "^2.1.39",
|
|
49
|
+
"@thi.ng/geom-closest-point": "^2.1.36",
|
|
50
|
+
"@thi.ng/geom-hull": "^2.1.36",
|
|
51
|
+
"@thi.ng/geom-isec": "^2.1.39",
|
|
52
|
+
"@thi.ng/geom-poly-utils": "^2.3.23",
|
|
53
|
+
"@thi.ng/geom-resample": "^2.1.40",
|
|
54
|
+
"@thi.ng/geom-splines": "^2.2.14",
|
|
55
|
+
"@thi.ng/geom-subdiv-curve": "^2.1.39",
|
|
56
|
+
"@thi.ng/geom-tessellate": "^2.1.39",
|
|
57
|
+
"@thi.ng/hiccup": "^4.2.27",
|
|
58
|
+
"@thi.ng/hiccup-svg": "^4.3.25",
|
|
59
|
+
"@thi.ng/math": "^5.3.17",
|
|
60
|
+
"@thi.ng/matrices": "^2.1.37",
|
|
61
|
+
"@thi.ng/random": "^3.3.19",
|
|
62
|
+
"@thi.ng/strings": "^3.3.21",
|
|
63
|
+
"@thi.ng/transducers": "^8.3.27",
|
|
64
|
+
"@thi.ng/vectors": "^7.5.28"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@microsoft/api-extractor": "^7.33.
|
|
68
|
-
"@thi.ng/testament": "^0.3.
|
|
67
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
68
|
+
"@thi.ng/testament": "^0.3.7",
|
|
69
69
|
"rimraf": "^3.0.2",
|
|
70
70
|
"tools": "^0.0.1",
|
|
71
|
-
"typedoc": "^0.23.
|
|
72
|
-
"typescript": "^4.
|
|
71
|
+
"typedoc": "^0.23.22",
|
|
72
|
+
"typescript": "^4.9.4"
|
|
73
73
|
},
|
|
74
74
|
"keywords": [
|
|
75
75
|
"2d",
|
|
@@ -383,5 +383,5 @@
|
|
|
383
383
|
"thi.ng": {
|
|
384
384
|
"year": 2013
|
|
385
385
|
},
|
|
386
|
-
"gitHead": "
|
|
386
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
387
387
|
}
|
package/scatter.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { IShape } from "@thi.ng/geom-api";
|
|
2
2
|
import type { Vec } from "@thi.ng/vectors";
|
|
3
3
|
/**
|
|
4
|
-
* Produces `num` random points for which {@link pointInside}
|
|
4
|
+
* Produces `num` random points for which {@link pointInside} succeeds for the
|
|
5
5
|
* given `shape`. Writes results into `out` array (or creates a new one).
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Samples are only created with the shapes bounding box and are chosen using
|
|
9
|
-
*
|
|
9
|
+
* optionally provided `rnd`
|
|
10
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
11
|
+
* instance.
|
|
10
12
|
*
|
|
11
13
|
* @param shape
|
|
12
14
|
* @param num
|
package/scatter.js
CHANGED
|
@@ -3,12 +3,14 @@ import { randMinMax } from "@thi.ng/vectors/random";
|
|
|
3
3
|
import { bounds } from "./bounds.js";
|
|
4
4
|
import { pointInside } from "./point-inside.js";
|
|
5
5
|
/**
|
|
6
|
-
* Produces `num` random points for which {@link pointInside}
|
|
6
|
+
* Produces `num` random points for which {@link pointInside} succeeds for the
|
|
7
7
|
* given `shape`. Writes results into `out` array (or creates a new one).
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
10
|
* Samples are only created with the shapes bounding box and are chosen using
|
|
11
|
-
*
|
|
11
|
+
* optionally provided `rnd`
|
|
12
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html)
|
|
13
|
+
* instance.
|
|
12
14
|
*
|
|
13
15
|
* @param shape
|
|
14
16
|
* @param num
|
package/simplify.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import type { MultiFn2 } from "@thi.ng/defmulti";
|
|
|
2
2
|
import type { IShape } from "@thi.ng/geom-api";
|
|
3
3
|
/**
|
|
4
4
|
* Simplifies given 2D shape boundary using Douglas-Peucker algorithm
|
|
5
|
-
* (implemented by
|
|
6
|
-
*
|
|
5
|
+
* (implemented by
|
|
6
|
+
* [`simplify()`](https://docs.thi.ng/umbrella/geom-resample/functions/simplify.html))
|
|
7
|
+
* and given `threshold` distance (default: 0, which removes only co-linear
|
|
8
|
+
* vertices).
|
|
7
9
|
*
|
|
8
10
|
* @remarks
|
|
9
11
|
* Currently only implemented for:
|
package/simplify.js
CHANGED
|
@@ -9,8 +9,10 @@ import { __dispatch } from "./internal/dispatch.js";
|
|
|
9
9
|
import { vertices } from "./vertices.js";
|
|
10
10
|
/**
|
|
11
11
|
* Simplifies given 2D shape boundary using Douglas-Peucker algorithm
|
|
12
|
-
* (implemented by
|
|
13
|
-
*
|
|
12
|
+
* (implemented by
|
|
13
|
+
* [`simplify()`](https://docs.thi.ng/umbrella/geom-resample/functions/simplify.html))
|
|
14
|
+
* and given `threshold` distance (default: 0, which removes only co-linear
|
|
15
|
+
* vertices).
|
|
14
16
|
*
|
|
15
17
|
* @remarks
|
|
16
18
|
* Currently only implemented for:
|
package/subdiv-curve.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { MultiFn2O } from "@thi.ng/defmulti";
|
|
2
2
|
import type { IShape, SubdivKernel } from "@thi.ng/geom-api";
|
|
3
3
|
/**
|
|
4
|
-
* Recursively applies
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Recursively applies
|
|
5
|
+
* [`SubdivKernel`](https://docs.thi.ng/umbrella/geom-api/interfaces/SubdivKernel.html)
|
|
6
|
+
* to given shape/boundary. See
|
|
7
|
+
* [thi.ng/geom-subdiv-curve](https://thi.ng/thi.ng/geom-subdiv-curve) package
|
|
8
|
+
* for further details.
|
|
7
9
|
*
|
|
8
10
|
* @remarks
|
|
9
11
|
* By default only applies a single iteration.
|
package/subdiv-curve.js
CHANGED
|
@@ -5,9 +5,11 @@ import { Polyline } from "./api/polyline.js";
|
|
|
5
5
|
import { __copyAttribs } from "./internal/copy.js";
|
|
6
6
|
import { __dispatch } from "./internal/dispatch.js";
|
|
7
7
|
/**
|
|
8
|
-
* Recursively applies
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Recursively applies
|
|
9
|
+
* [`SubdivKernel`](https://docs.thi.ng/umbrella/geom-api/interfaces/SubdivKernel.html)
|
|
10
|
+
* to given shape/boundary. See
|
|
11
|
+
* [thi.ng/geom-subdiv-curve](https://thi.ng/thi.ng/geom-subdiv-curve) package
|
|
12
|
+
* for further details.
|
|
11
13
|
*
|
|
12
14
|
* @remarks
|
|
13
15
|
* By default only applies a single iteration.
|
package/tessellate.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import type { IShape, Tessellator } from "@thi.ng/geom-api";
|
|
|
2
2
|
import type { Vec } from "@thi.ng/vectors";
|
|
3
3
|
/**
|
|
4
4
|
* Recursively tessellates shape using provided
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* [`Tessellator`](https://docs.thi.ng/umbrella/geom-api/types/Tessellator.html)
|
|
6
|
+
* functions. See
|
|
7
|
+
* [thi.ng/geom-tessellate](https://thi.ng/thi.ng/geom-tessellate) package for
|
|
8
|
+
* more details.
|
|
7
9
|
*
|
|
8
10
|
* @remarks
|
|
9
11
|
* Implemented for all shapes supported by {@link vertices}.
|
package/tessellate.js
CHANGED
|
@@ -4,8 +4,10 @@ import { __dispatch } from "./internal/dispatch.js";
|
|
|
4
4
|
import { vertices } from "./vertices.js";
|
|
5
5
|
/**
|
|
6
6
|
* Recursively tessellates shape using provided
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* [`Tessellator`](https://docs.thi.ng/umbrella/geom-api/types/Tessellator.html)
|
|
8
|
+
* functions. See
|
|
9
|
+
* [thi.ng/geom-tessellate](https://thi.ng/thi.ng/geom-tessellate) package for
|
|
10
|
+
* more details.
|
|
9
11
|
*
|
|
10
12
|
* @remarks
|
|
11
13
|
* Implemented for all shapes supported by {@link vertices}.
|
package/vertices.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { SamplingOpts } from "@thi.ng/geom-api/sample";
|
|
|
4
4
|
import type { Vec } from "@thi.ng/vectors";
|
|
5
5
|
/**
|
|
6
6
|
* Extracts/samples vertices from given shape's boundary and returns them as
|
|
7
|
-
* array. Some shapes also support
|
|
7
|
+
* array. Some shapes also support
|
|
8
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html).
|
|
8
9
|
*
|
|
9
10
|
* @remarks
|
|
10
11
|
* The given sampling options (if any) can also be overridden per shape using
|
package/vertices.js
CHANGED
|
@@ -16,7 +16,8 @@ import { Polygon } from "./api/polygon.js";
|
|
|
16
16
|
import { __dispatch } from "./internal/dispatch.js";
|
|
17
17
|
/**
|
|
18
18
|
* Extracts/samples vertices from given shape's boundary and returns them as
|
|
19
|
-
* array. Some shapes also support
|
|
19
|
+
* array. Some shapes also support
|
|
20
|
+
* [`SamplingOpts`](https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html).
|
|
20
21
|
*
|
|
21
22
|
* @remarks
|
|
22
23
|
* The given sampling options (if any) can also be overridden per shape using
|
package/with-attribs.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Attribs, IShape } from "@thi.ng/geom-api";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a shallow copy of given shape with new `attribs` assigned (using
|
|
4
|
-
*
|
|
5
|
-
* new attribs will be merged with the existing ones
|
|
4
|
+
* [`IAttributed`](https://docs.thi.ng/umbrella/geom-api/interfaces/IAttributed.html).withAttribs}).
|
|
5
|
+
* If `replace` is false, the new attribs will be merged with the existing ones
|
|
6
|
+
* (if any).
|
|
6
7
|
*
|
|
7
8
|
* @param shape
|
|
8
9
|
* @param attribs
|
package/with-attribs.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns a shallow copy of given shape with new `attribs` assigned (using
|
|
3
|
-
*
|
|
4
|
-
* new attribs will be merged with the existing ones
|
|
3
|
+
* [`IAttributed`](https://docs.thi.ng/umbrella/geom-api/interfaces/IAttributed.html).withAttribs}).
|
|
4
|
+
* If `replace` is false, the new attribs will be merged with the existing ones
|
|
5
|
+
* (if any).
|
|
5
6
|
*
|
|
6
7
|
* @param shape
|
|
7
8
|
* @param attribs
|