@thi.ng/geom 2.1.28 → 3.0.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 +131 -152
- package/README.md +17 -6
- package/{ctors/aabb.d.ts → aabb.d.ts} +3 -3
- package/{ctors/aabb.js → aabb.js} +10 -5
- package/api/aabb.d.ts +1 -1
- package/api/aabb.js +5 -4
- package/api/arc.d.ts +1 -1
- package/api/arc.js +4 -4
- package/api/circle.d.ts +1 -1
- package/api/circle.js +3 -3
- package/api/cubic.d.ts +1 -1
- package/api/cubic.js +3 -3
- package/api/ellipse.d.ts +1 -1
- package/api/ellipse.js +4 -4
- package/api/group.js +2 -2
- package/api/line.d.ts +1 -1
- package/api/line.js +3 -3
- package/api/path.js +4 -4
- package/api/plane.d.ts +1 -1
- package/api/plane.js +3 -3
- package/api/points.d.ts +1 -1
- package/api/points.js +4 -4
- package/api/polygon.d.ts +1 -1
- package/api/polygon.js +3 -3
- package/api/polyline.d.ts +1 -1
- package/api/polyline.js +4 -4
- package/api/quad.d.ts +1 -1
- package/api/quad.js +3 -3
- package/api/quad3.d.ts +1 -1
- package/api/quad3.js +3 -3
- package/api/quadratic.d.ts +1 -1
- package/api/quadratic.js +3 -3
- package/api/ray.d.ts +1 -1
- package/api/ray.js +4 -3
- package/api/rect.d.ts +1 -1
- package/api/rect.js +5 -4
- package/api/sphere.d.ts +1 -1
- package/api/sphere.js +3 -3
- package/api/text.d.ts +1 -1
- package/api/text.js +3 -3
- package/api/triangle.d.ts +1 -1
- package/api/triangle.js +3 -3
- package/{ops/arc-length.d.ts → arc-length.d.ts} +2 -1
- package/{ops/arc-length.js → arc-length.js} +9 -9
- package/{ctors/arc.d.ts → arc.d.ts} +1 -1
- package/{ctors/arc.js → arc.js} +3 -3
- package/{ops/area.d.ts → area.d.ts} +1 -1
- package/{ops/area.js → area.js} +7 -9
- package/{ops/as-cubic.d.ts → as-cubic.d.ts} +2 -2
- package/as-cubic.js +40 -0
- package/{ops/as-path.d.ts → as-path.d.ts} +1 -1
- package/as-path.js +4 -0
- package/{ops/as-polygon.d.ts → as-polygon.d.ts} +2 -2
- package/as-polygon.js +18 -0
- package/{ops/as-polyline.d.ts → as-polyline.d.ts} +2 -2
- package/as-polyline.js +30 -0
- package/{ops/as-svg.d.ts → as-svg.d.ts} +0 -0
- package/as-svg.js +24 -0
- package/bounds.d.ts +4 -0
- package/bounds.js +50 -0
- package/center.d.ts +5 -0
- package/center.js +22 -0
- package/centroid.d.ts +5 -0
- package/centroid.js +35 -0
- package/{ctors/circle.d.ts → circle.d.ts} +2 -2
- package/{ctors/circle.js → circle.js} +6 -5
- package/classify-point.d.ts +5 -0
- package/classify-point.js +11 -0
- package/clip-convex.d.ts +5 -0
- package/clip-convex.js +44 -0
- package/closest-point.d.ts +5 -0
- package/{ops/closest-point.js → closest-point.js} +16 -11
- package/convex-hull.d.ts +4 -0
- package/convex-hull.js +18 -0
- package/{ctors/cubic.d.ts → cubic.d.ts} +2 -2
- package/cubic.js +12 -0
- package/{ops/edges.d.ts → edges.d.ts} +1 -1
- package/edges.js +30 -0
- package/{ctors/ellipse.d.ts → ellipse.d.ts} +1 -1
- package/ellipse.js +5 -0
- package/{ops/fit-into-bounds.d.ts → fit-into-bounds.d.ts} +2 -2
- package/{ops/fit-into-bounds.js → fit-into-bounds.js} +15 -12
- package/flip.d.ts +4 -0
- package/flip.js +38 -0
- package/{ctors/group.d.ts → group.d.ts} +1 -1
- package/{ctors/group.js → group.js} +1 -1
- package/index.d.ts +80 -90
- package/index.js +80 -90
- package/internal/args.d.ts +3 -3
- package/internal/args.js +8 -7
- package/internal/bounds.d.ts +25 -0
- package/internal/bounds.js +45 -0
- package/internal/collate.d.ts +2 -2
- package/internal/collate.js +9 -4
- package/internal/copy.d.ts +4 -0
- package/internal/copy.js +3 -0
- package/internal/dispatch.d.ts +2 -2
- package/internal/dispatch.js +2 -2
- package/internal/edges.d.ts +1 -1
- package/internal/edges.js +3 -2
- package/internal/pclike.d.ts +1 -1
- package/internal/pclike.js +3 -3
- package/internal/points-as-shape.d.ts +2 -2
- package/internal/points-as-shape.js +4 -4
- package/internal/split.d.ts +2 -2
- package/internal/split.js +3 -2
- package/internal/transform.d.ts +16 -0
- package/internal/transform.js +14 -0
- package/internal/translate.d.ts +5 -0
- package/internal/translate.js +4 -0
- package/intersects.d.ts +4 -0
- package/{ops/intersects.js → intersects.js} +18 -10
- package/{ctors/line.d.ts → line.d.ts} +2 -2
- package/{ctors/line.js → line.js} +6 -6
- package/map-point.d.ts +5 -0
- package/map-point.js +7 -0
- package/offset.d.ts +4 -0
- package/offset.js +27 -0
- package/package.json +298 -51
- package/{ctors/path-builder.d.ts → path-builder.d.ts} +2 -2
- package/{ctors/path-builder.js → path-builder.js} +13 -8
- package/path-from-svg.d.ts +2 -0
- package/{ctors/path-from-svg.js → path-from-svg.js} +5 -5
- package/{ctors/path.d.ts → path.d.ts} +3 -3
- package/{ctors/path.js → path.js} +8 -7
- package/{ctors/plane.d.ts → plane.d.ts} +2 -2
- package/{ctors/plane.js → plane.js} +4 -2
- package/point-at.d.ts +5 -0
- package/point-at.js +29 -0
- package/point-inside.d.ts +5 -0
- package/{ops/point-inside.js → point-inside.js} +9 -9
- package/{ctors/points.d.ts → points.d.ts} +1 -1
- package/{ctors/points.js → points.js} +1 -1
- package/{ctors/polygon.d.ts → polygon.d.ts} +2 -2
- package/polygon.js +11 -0
- package/{ctors/polyline.d.ts → polyline.d.ts} +1 -1
- package/{ctors/polyline.js → polyline.js} +1 -1
- package/{ctors/quad.d.ts → quad.d.ts} +4 -4
- package/quad.js +28 -0
- package/{ctors/quadratic.d.ts → quadratic.d.ts} +1 -1
- package/{ctors/quadratic.js → quadratic.js} +4 -4
- package/{ctors/ray.d.ts → ray.d.ts} +2 -2
- package/{ctors/ray.js → ray.js} +2 -2
- package/{ctors/rect.d.ts → rect.d.ts} +4 -4
- package/{ctors/rect.js → rect.js} +13 -6
- package/resample.d.ts +4 -0
- package/resample.js +18 -0
- package/scatter.d.ts +4 -0
- package/{ops/scatter.js → scatter.js} +4 -4
- package/simplify.d.ts +4 -0
- package/{ops/simplify.js → simplify.js} +14 -15
- package/{ctors/sphere.d.ts → sphere.d.ts} +2 -2
- package/sphere.js +8 -0
- package/split-at.d.ts +4 -0
- package/split-at.js +28 -0
- package/{ops/split-near.d.ts → split-near.d.ts} +2 -1
- package/split-near.js +38 -0
- package/{ops/subdiv-curve.d.ts → subdiv-curve.d.ts} +1 -1
- package/subdiv-curve.js +10 -0
- package/tangent-at.d.ts +5 -0
- package/tangent-at.js +21 -0
- package/{ops/tessellate.d.ts → tessellate.d.ts} +0 -0
- package/tessellate.js +7 -0
- package/{ctors/text.d.ts → text.d.ts} +1 -1
- package/{ctors/text.js → text.js} +1 -1
- package/{ops/transform-vertices.d.ts → transform-vertices.d.ts} +3 -1
- package/{ops/transform-vertices.js → transform-vertices.js} +22 -22
- package/{ops/transform.d.ts → transform.d.ts} +3 -1
- package/transform.js +58 -0
- package/translate.d.ts +5 -0
- package/translate.js +55 -0
- package/{ctors/triangle.d.ts → triangle.d.ts} +1 -1
- package/triangle.js +7 -0
- package/union.d.ts +4 -0
- package/union.js +13 -0
- package/{ops/unmap-point.d.ts → unmap-point.d.ts} +2 -2
- package/{ops/unmap-point.js → unmap-point.js} +8 -7
- package/{ops/vertices.d.ts → vertices.d.ts} +4 -3
- package/{ops/vertices.js → vertices.js} +26 -17
- package/{ops/volume.d.ts → volume.d.ts} +2 -1
- package/{ops/volume.js → volume.js} +5 -6
- package/{ops/warp-points.d.ts → warp-points.d.ts} +0 -0
- package/{ops/warp-points.js → warp-points.js} +2 -2
- package/{ops/with-attribs.d.ts → with-attribs.d.ts} +0 -0
- package/with-attribs.js +4 -0
- package/ctors/cubic.js +0 -10
- package/ctors/ellipse.js +0 -5
- package/ctors/path-from-svg.d.ts +0 -2
- package/ctors/polygon.js +0 -6
- package/ctors/quad.js +0 -26
- package/ctors/sphere.js +0 -7
- package/ctors/triangle.js +0 -7
- package/internal/coll-bounds.d.ts +0 -13
- package/internal/coll-bounds.js +0 -27
- package/internal/copy-attribs.d.ts +0 -3
- package/internal/copy-attribs.js +0 -1
- package/internal/copy-shape.d.ts +0 -3
- package/internal/copy-shape.js +0 -3
- package/internal/transform-points.d.ts +0 -16
- package/internal/transform-points.js +0 -14
- package/internal/translate-points.d.ts +0 -5
- package/internal/translate-points.js +0 -4
- package/internal/union-bounds.d.ts +0 -13
- package/internal/union-bounds.js +0 -17
- package/lib/index.js +0 -1938
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
- package/ops/as-cubic.js +0 -39
- package/ops/as-path.js +0 -4
- package/ops/as-polygon.js +0 -18
- package/ops/as-polyline.js +0 -30
- package/ops/as-svg.js +0 -17
- package/ops/bounds.d.ts +0 -3
- package/ops/bounds.js +0 -39
- package/ops/center.d.ts +0 -5
- package/ops/center.js +0 -21
- package/ops/centroid.d.ts +0 -5
- package/ops/centroid.js +0 -29
- package/ops/classify-point.d.ts +0 -5
- package/ops/classify-point.js +0 -12
- package/ops/clip-convex.d.ts +0 -4
- package/ops/clip-convex.js +0 -44
- package/ops/closest-point.d.ts +0 -5
- package/ops/convex-hull.d.ts +0 -3
- package/ops/convex-hull.js +0 -18
- package/ops/edges.js +0 -30
- package/ops/flip.d.ts +0 -3
- package/ops/flip.js +0 -38
- package/ops/intersects.d.ts +0 -4
- package/ops/map-point.d.ts +0 -5
- package/ops/map-point.js +0 -8
- package/ops/offset.d.ts +0 -3
- package/ops/offset.js +0 -22
- package/ops/point-at.d.ts +0 -4
- package/ops/point-at.js +0 -22
- package/ops/point-inside.d.ts +0 -4
- package/ops/resample.d.ts +0 -3
- package/ops/resample.js +0 -18
- package/ops/scatter.d.ts +0 -4
- package/ops/simplify.d.ts +0 -3
- package/ops/split-at.d.ts +0 -3
- package/ops/split-at.js +0 -28
- package/ops/split-near.js +0 -38
- package/ops/subdiv-curve.js +0 -11
- package/ops/tangent-at.d.ts +0 -4
- package/ops/tangent-at.js +0 -19
- package/ops/tessellate.js +0 -6
- package/ops/transform.js +0 -58
- package/ops/translate.d.ts +0 -4
- package/ops/translate.js +0 -55
- package/ops/union.d.ts +0 -3
- package/ops/union.js +0 -14
- package/ops/with-attribs.js +0 -4
package/index.d.ts
CHANGED
|
@@ -1,91 +1,81 @@
|
|
|
1
|
-
export * from "./api/aabb";
|
|
2
|
-
export * from "./api/apc";
|
|
3
|
-
export * from "./api/arc";
|
|
4
|
-
export * from "./api/circle";
|
|
5
|
-
export * from "./api/cubic";
|
|
6
|
-
export * from "./api/ellipse";
|
|
7
|
-
export * from "./api/group";
|
|
8
|
-
export * from "./api/line";
|
|
9
|
-
export * from "./api/path";
|
|
10
|
-
export * from "./api/plane";
|
|
11
|
-
export * from "./api/points";
|
|
12
|
-
export * from "./api/polygon";
|
|
13
|
-
export * from "./api/polyline";
|
|
14
|
-
export * from "./api/quad";
|
|
15
|
-
export * from "./api/quad3";
|
|
16
|
-
export * from "./api/quadratic";
|
|
17
|
-
export * from "./api/ray";
|
|
18
|
-
export * from "./api/rect";
|
|
19
|
-
export * from "./api/sphere";
|
|
20
|
-
export * from "./api/text";
|
|
21
|
-
export * from "./api/triangle";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./
|
|
26
|
-
export * from "./
|
|
27
|
-
export * from "./
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
31
|
-
export * from "./
|
|
32
|
-
export * from "./
|
|
33
|
-
export * from "./
|
|
34
|
-
export * from "./
|
|
35
|
-
export * from "./
|
|
36
|
-
export * from "./
|
|
37
|
-
export * from "./
|
|
38
|
-
export * from "./
|
|
39
|
-
export * from "./
|
|
40
|
-
export * from "./
|
|
41
|
-
export * from "./
|
|
42
|
-
export * from "./
|
|
43
|
-
export * from "./
|
|
44
|
-
export * from "./
|
|
45
|
-
export * from "./
|
|
46
|
-
export * from "./
|
|
47
|
-
export * from "./
|
|
48
|
-
export * from "./
|
|
49
|
-
export * from "./
|
|
50
|
-
export * from "./
|
|
51
|
-
export * from "./
|
|
52
|
-
export * from "./
|
|
53
|
-
export * from "./
|
|
54
|
-
export * from "./
|
|
55
|
-
export * from "./
|
|
56
|
-
export * from "./
|
|
57
|
-
export * from "./
|
|
58
|
-
export * from "./
|
|
59
|
-
export * from "./
|
|
60
|
-
export * from "./
|
|
61
|
-
export * from "./
|
|
62
|
-
export * from "./
|
|
63
|
-
export * from "./
|
|
64
|
-
export * from "./
|
|
65
|
-
export * from "./
|
|
66
|
-
export * from "./
|
|
67
|
-
export * from "./
|
|
68
|
-
export * from "./
|
|
69
|
-
export * from "./
|
|
70
|
-
export * from "./
|
|
71
|
-
export * from "./
|
|
72
|
-
export * from "./
|
|
73
|
-
export * from "./
|
|
74
|
-
export * from "./
|
|
75
|
-
export * from "./
|
|
76
|
-
export * from "./
|
|
77
|
-
export * from "./
|
|
78
|
-
export * from "./
|
|
79
|
-
export * from "./
|
|
80
|
-
export * from "./
|
|
81
|
-
export * from "./internal/coll-bounds";
|
|
82
|
-
export * from "./internal/copy-attribs";
|
|
83
|
-
export * from "./internal/copy-shape";
|
|
84
|
-
export * from "./internal/edges";
|
|
85
|
-
export * from "./internal/pclike";
|
|
86
|
-
export * from "./internal/points-as-shape";
|
|
87
|
-
export * from "./internal/split";
|
|
88
|
-
export * from "./internal/transform-points";
|
|
89
|
-
export * from "./internal/translate-points";
|
|
90
|
-
export * from "./internal/union-bounds";
|
|
1
|
+
export * from "./api/aabb.js";
|
|
2
|
+
export * from "./api/apc.js";
|
|
3
|
+
export * from "./api/arc.js";
|
|
4
|
+
export * from "./api/circle.js";
|
|
5
|
+
export * from "./api/cubic.js";
|
|
6
|
+
export * from "./api/ellipse.js";
|
|
7
|
+
export * from "./api/group.js";
|
|
8
|
+
export * from "./api/line.js";
|
|
9
|
+
export * from "./api/path.js";
|
|
10
|
+
export * from "./api/plane.js";
|
|
11
|
+
export * from "./api/points.js";
|
|
12
|
+
export * from "./api/polygon.js";
|
|
13
|
+
export * from "./api/polyline.js";
|
|
14
|
+
export * from "./api/quad.js";
|
|
15
|
+
export * from "./api/quad3.js";
|
|
16
|
+
export * from "./api/quadratic.js";
|
|
17
|
+
export * from "./api/ray.js";
|
|
18
|
+
export * from "./api/rect.js";
|
|
19
|
+
export * from "./api/sphere.js";
|
|
20
|
+
export * from "./api/text.js";
|
|
21
|
+
export * from "./api/triangle.js";
|
|
22
|
+
export * from "./aabb.js";
|
|
23
|
+
export * from "./arc.js";
|
|
24
|
+
export * from "./circle.js";
|
|
25
|
+
export * from "./cubic.js";
|
|
26
|
+
export * from "./ellipse.js";
|
|
27
|
+
export * from "./group.js";
|
|
28
|
+
export * from "./line.js";
|
|
29
|
+
export * from "./path.js";
|
|
30
|
+
export * from "./path-builder.js";
|
|
31
|
+
export * from "./path-from-svg.js";
|
|
32
|
+
export * from "./plane.js";
|
|
33
|
+
export * from "./points.js";
|
|
34
|
+
export * from "./polygon.js";
|
|
35
|
+
export * from "./polyline.js";
|
|
36
|
+
export * from "./quad.js";
|
|
37
|
+
export * from "./quadratic.js";
|
|
38
|
+
export * from "./ray.js";
|
|
39
|
+
export * from "./rect.js";
|
|
40
|
+
export * from "./text.js";
|
|
41
|
+
export * from "./triangle.js";
|
|
42
|
+
export * from "./arc-length.js";
|
|
43
|
+
export * from "./area.js";
|
|
44
|
+
export * from "./as-cubic.js";
|
|
45
|
+
export * from "./as-path.js";
|
|
46
|
+
export * from "./as-polygon.js";
|
|
47
|
+
export * from "./as-polyline.js";
|
|
48
|
+
export * from "./as-svg.js";
|
|
49
|
+
export * from "./bounds.js";
|
|
50
|
+
export * from "./center.js";
|
|
51
|
+
export * from "./centroid.js";
|
|
52
|
+
export * from "./classify-point.js";
|
|
53
|
+
export * from "./clip-convex.js";
|
|
54
|
+
export * from "./closest-point.js";
|
|
55
|
+
export * from "./convex-hull.js";
|
|
56
|
+
export * from "./edges.js";
|
|
57
|
+
export * from "./fit-into-bounds.js";
|
|
58
|
+
export * from "./flip.js";
|
|
59
|
+
export * from "./intersects.js";
|
|
60
|
+
export * from "./map-point.js";
|
|
61
|
+
export * from "./offset.js";
|
|
62
|
+
export * from "./point-at.js";
|
|
63
|
+
export * from "./point-inside.js";
|
|
64
|
+
export * from "./resample.js";
|
|
65
|
+
export * from "./scatter.js";
|
|
66
|
+
export * from "./simplify.js";
|
|
67
|
+
export * from "./split-at.js";
|
|
68
|
+
export * from "./split-near.js";
|
|
69
|
+
export * from "./subdiv-curve.js";
|
|
70
|
+
export * from "./tangent-at.js";
|
|
71
|
+
export * from "./tessellate.js";
|
|
72
|
+
export * from "./transform.js";
|
|
73
|
+
export * from "./transform-vertices.js";
|
|
74
|
+
export * from "./translate.js";
|
|
75
|
+
export * from "./union.js";
|
|
76
|
+
export * from "./unmap-point.js";
|
|
77
|
+
export * from "./vertices.js";
|
|
78
|
+
export * from "./volume.js";
|
|
79
|
+
export * from "./warp-points.js";
|
|
80
|
+
export * from "./with-attribs.js";
|
|
91
81
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,90 +1,80 @@
|
|
|
1
|
-
export * from "./api/aabb";
|
|
2
|
-
export * from "./api/apc";
|
|
3
|
-
export * from "./api/arc";
|
|
4
|
-
export * from "./api/circle";
|
|
5
|
-
export * from "./api/cubic";
|
|
6
|
-
export * from "./api/ellipse";
|
|
7
|
-
export * from "./api/group";
|
|
8
|
-
export * from "./api/line";
|
|
9
|
-
export * from "./api/path";
|
|
10
|
-
export * from "./api/plane";
|
|
11
|
-
export * from "./api/points";
|
|
12
|
-
export * from "./api/polygon";
|
|
13
|
-
export * from "./api/polyline";
|
|
14
|
-
export * from "./api/quad";
|
|
15
|
-
export * from "./api/quad3";
|
|
16
|
-
export * from "./api/quadratic";
|
|
17
|
-
export * from "./api/ray";
|
|
18
|
-
export * from "./api/rect";
|
|
19
|
-
export * from "./api/sphere";
|
|
20
|
-
export * from "./api/text";
|
|
21
|
-
export * from "./api/triangle";
|
|
22
|
-
export * from "./
|
|
23
|
-
export * from "./
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./
|
|
26
|
-
export * from "./
|
|
27
|
-
export * from "./
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
31
|
-
export * from "./
|
|
32
|
-
export * from "./
|
|
33
|
-
export * from "./
|
|
34
|
-
export * from "./
|
|
35
|
-
export * from "./
|
|
36
|
-
export * from "./
|
|
37
|
-
export * from "./
|
|
38
|
-
export * from "./
|
|
39
|
-
export * from "./
|
|
40
|
-
export * from "./
|
|
41
|
-
export * from "./
|
|
42
|
-
export * from "./
|
|
43
|
-
export * from "./
|
|
44
|
-
export * from "./
|
|
45
|
-
export * from "./
|
|
46
|
-
export * from "./
|
|
47
|
-
export * from "./
|
|
48
|
-
export * from "./
|
|
49
|
-
export * from "./
|
|
50
|
-
export * from "./
|
|
51
|
-
export * from "./
|
|
52
|
-
export * from "./
|
|
53
|
-
export * from "./
|
|
54
|
-
export * from "./
|
|
55
|
-
export * from "./
|
|
56
|
-
export * from "./
|
|
57
|
-
export * from "./
|
|
58
|
-
export * from "./
|
|
59
|
-
export * from "./
|
|
60
|
-
export * from "./
|
|
61
|
-
export * from "./
|
|
62
|
-
export * from "./
|
|
63
|
-
export * from "./
|
|
64
|
-
export * from "./
|
|
65
|
-
export * from "./
|
|
66
|
-
export * from "./
|
|
67
|
-
export * from "./
|
|
68
|
-
export * from "./
|
|
69
|
-
export * from "./
|
|
70
|
-
export * from "./
|
|
71
|
-
export * from "./
|
|
72
|
-
export * from "./
|
|
73
|
-
export * from "./
|
|
74
|
-
export * from "./
|
|
75
|
-
export * from "./
|
|
76
|
-
export * from "./
|
|
77
|
-
export * from "./
|
|
78
|
-
export * from "./
|
|
79
|
-
export * from "./
|
|
80
|
-
export * from "./
|
|
81
|
-
export * from "./internal/coll-bounds";
|
|
82
|
-
export * from "./internal/copy-attribs";
|
|
83
|
-
export * from "./internal/copy-shape";
|
|
84
|
-
export * from "./internal/edges";
|
|
85
|
-
export * from "./internal/pclike";
|
|
86
|
-
export * from "./internal/points-as-shape";
|
|
87
|
-
export * from "./internal/split";
|
|
88
|
-
export * from "./internal/transform-points";
|
|
89
|
-
export * from "./internal/translate-points";
|
|
90
|
-
export * from "./internal/union-bounds";
|
|
1
|
+
export * from "./api/aabb.js";
|
|
2
|
+
export * from "./api/apc.js";
|
|
3
|
+
export * from "./api/arc.js";
|
|
4
|
+
export * from "./api/circle.js";
|
|
5
|
+
export * from "./api/cubic.js";
|
|
6
|
+
export * from "./api/ellipse.js";
|
|
7
|
+
export * from "./api/group.js";
|
|
8
|
+
export * from "./api/line.js";
|
|
9
|
+
export * from "./api/path.js";
|
|
10
|
+
export * from "./api/plane.js";
|
|
11
|
+
export * from "./api/points.js";
|
|
12
|
+
export * from "./api/polygon.js";
|
|
13
|
+
export * from "./api/polyline.js";
|
|
14
|
+
export * from "./api/quad.js";
|
|
15
|
+
export * from "./api/quad3.js";
|
|
16
|
+
export * from "./api/quadratic.js";
|
|
17
|
+
export * from "./api/ray.js";
|
|
18
|
+
export * from "./api/rect.js";
|
|
19
|
+
export * from "./api/sphere.js";
|
|
20
|
+
export * from "./api/text.js";
|
|
21
|
+
export * from "./api/triangle.js";
|
|
22
|
+
export * from "./aabb.js";
|
|
23
|
+
export * from "./arc.js";
|
|
24
|
+
export * from "./circle.js";
|
|
25
|
+
export * from "./cubic.js";
|
|
26
|
+
export * from "./ellipse.js";
|
|
27
|
+
export * from "./group.js";
|
|
28
|
+
export * from "./line.js";
|
|
29
|
+
export * from "./path.js";
|
|
30
|
+
export * from "./path-builder.js";
|
|
31
|
+
export * from "./path-from-svg.js";
|
|
32
|
+
export * from "./plane.js";
|
|
33
|
+
export * from "./points.js";
|
|
34
|
+
export * from "./polygon.js";
|
|
35
|
+
export * from "./polyline.js";
|
|
36
|
+
export * from "./quad.js";
|
|
37
|
+
export * from "./quadratic.js";
|
|
38
|
+
export * from "./ray.js";
|
|
39
|
+
export * from "./rect.js";
|
|
40
|
+
export * from "./text.js";
|
|
41
|
+
export * from "./triangle.js";
|
|
42
|
+
export * from "./arc-length.js";
|
|
43
|
+
export * from "./area.js";
|
|
44
|
+
export * from "./as-cubic.js";
|
|
45
|
+
export * from "./as-path.js";
|
|
46
|
+
export * from "./as-polygon.js";
|
|
47
|
+
export * from "./as-polyline.js";
|
|
48
|
+
export * from "./as-svg.js";
|
|
49
|
+
export * from "./bounds.js";
|
|
50
|
+
export * from "./center.js";
|
|
51
|
+
export * from "./centroid.js";
|
|
52
|
+
export * from "./classify-point.js";
|
|
53
|
+
export * from "./clip-convex.js";
|
|
54
|
+
export * from "./closest-point.js";
|
|
55
|
+
export * from "./convex-hull.js";
|
|
56
|
+
export * from "./edges.js";
|
|
57
|
+
export * from "./fit-into-bounds.js";
|
|
58
|
+
export * from "./flip.js";
|
|
59
|
+
export * from "./intersects.js";
|
|
60
|
+
export * from "./map-point.js";
|
|
61
|
+
export * from "./offset.js";
|
|
62
|
+
export * from "./point-at.js";
|
|
63
|
+
export * from "./point-inside.js";
|
|
64
|
+
export * from "./resample.js";
|
|
65
|
+
export * from "./scatter.js";
|
|
66
|
+
export * from "./simplify.js";
|
|
67
|
+
export * from "./split-at.js";
|
|
68
|
+
export * from "./split-near.js";
|
|
69
|
+
export * from "./subdiv-curve.js";
|
|
70
|
+
export * from "./tangent-at.js";
|
|
71
|
+
export * from "./tessellate.js";
|
|
72
|
+
export * from "./transform.js";
|
|
73
|
+
export * from "./transform-vertices.js";
|
|
74
|
+
export * from "./translate.js";
|
|
75
|
+
export * from "./union.js";
|
|
76
|
+
export * from "./unmap-point.js";
|
|
77
|
+
export * from "./vertices.js";
|
|
78
|
+
export * from "./volume.js";
|
|
79
|
+
export * from "./warp-points.js";
|
|
80
|
+
export * from "./with-attribs.js";
|
package/internal/args.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const __argAttribs: (args: any[]) => any;
|
|
11
11
|
/**
|
|
12
12
|
* Args parser for functions expecting up to 2 vector args and optional
|
|
13
13
|
* attribs object. Returns 3-tuple of re-structured args.
|
|
@@ -16,7 +16,7 @@ export declare const argAttribs: (args: any[]) => any;
|
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const __argsVV: (args: any[]) => any[];
|
|
20
20
|
/**
|
|
21
21
|
* Args parser for functions expecting a vector, numeric and/or optional
|
|
22
22
|
* attribs object. Returns 3-tuple of re-structured args.
|
|
@@ -25,5 +25,5 @@ export declare const argsVV: (args: any[]) => any[];
|
|
|
25
25
|
*
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const __argsVN: (args: any[]) => any[];
|
|
29
29
|
//# sourceMappingURL=args.d.ts.map
|
package/internal/args.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { peek } from "@thi.ng/arrays";
|
|
2
|
-
import { isNumber
|
|
1
|
+
import { peek } from "@thi.ng/arrays/peek";
|
|
2
|
+
import { isNumber } from "@thi.ng/checks/is-number";
|
|
3
|
+
import { isPlainObject } from "@thi.ng/checks/is-plain-object";
|
|
3
4
|
/**
|
|
4
5
|
* Takes an array of arguments, checks if last element is a plain object
|
|
5
6
|
* and if so, removes it from array and returns it. Else returns
|
|
@@ -9,7 +10,7 @@ import { isNumber, isPlainObject } from "@thi.ng/checks";
|
|
|
9
10
|
*
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
|
-
export const
|
|
13
|
+
export const __argAttribs = (args) => isPlainObject(peek(args)) ? args.pop() : undefined;
|
|
13
14
|
/**
|
|
14
15
|
* Args parser for functions expecting up to 2 vector args and optional
|
|
15
16
|
* attribs object. Returns 3-tuple of re-structured args.
|
|
@@ -18,8 +19,8 @@ export const argAttribs = (args) => isPlainObject(peek(args)) ? args.pop() : und
|
|
|
18
19
|
*
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
21
|
-
export const
|
|
22
|
-
const attr =
|
|
22
|
+
export const __argsVV = (args) => {
|
|
23
|
+
const attr = __argAttribs(args);
|
|
23
24
|
return args.length
|
|
24
25
|
? args.length === 2
|
|
25
26
|
? [args[0], args[1], attr]
|
|
@@ -34,8 +35,8 @@ export const argsVV = (args) => {
|
|
|
34
35
|
*
|
|
35
36
|
* @internal
|
|
36
37
|
*/
|
|
37
|
-
export const
|
|
38
|
-
const attr =
|
|
38
|
+
export const __argsVN = (args) => {
|
|
39
|
+
const attr = __argAttribs(args);
|
|
39
40
|
return args.length
|
|
40
41
|
? args.length === 2
|
|
41
42
|
? [args[0], args[1], attr]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Fn } from "@thi.ng/api";
|
|
2
|
+
import type { AABBLike, IShape } from "@thi.ng/geom-api";
|
|
3
|
+
import type { ReadonlyVec, VecPair } from "@thi.ng/vectors";
|
|
4
|
+
/**
|
|
5
|
+
* Computes the total bounds for the given shape collection, which
|
|
6
|
+
* should either contain only 2D or 3D types. No mixed dimensions are
|
|
7
|
+
* allowed! Currently the {@link bounds} function MUST be passed in as
|
|
8
|
+
* arg to avoid circular module dependencies.
|
|
9
|
+
*
|
|
10
|
+
* @param shapes - input shapes
|
|
11
|
+
* @param bounds - bbox function
|
|
12
|
+
*/
|
|
13
|
+
export declare const __collBounds: (shapes: IShape[], bounds: Fn<IShape, AABBLike | undefined>) => import("@thi.ng/vectors").Vec[] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Takes the position and size vectors of 2
|
|
16
|
+
* {@link @thi.ng/geom-api#AABBLike}s and returns 2-tuple of
|
|
17
|
+
* `[pos,size]` of their union bounds.
|
|
18
|
+
*
|
|
19
|
+
* @param apos - bbox 1 min pos
|
|
20
|
+
* @param asize - bbox1 size
|
|
21
|
+
* @param bpos - bbox 2 min pos
|
|
22
|
+
* @param bsize - bbox 2 size
|
|
23
|
+
*/
|
|
24
|
+
export declare const __unionBounds: (apos: ReadonlyVec, asize: ReadonlyVec, bpos: ReadonlyVec, bsize: ReadonlyVec) => VecPair;
|
|
25
|
+
//# sourceMappingURL=bounds.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { add } from "@thi.ng/vectors/add";
|
|
2
|
+
import { max } from "@thi.ng/vectors/max";
|
|
3
|
+
import { min } from "@thi.ng/vectors/min";
|
|
4
|
+
import { sub } from "@thi.ng/vectors/sub";
|
|
5
|
+
/**
|
|
6
|
+
* Computes the total bounds for the given shape collection, which
|
|
7
|
+
* should either contain only 2D or 3D types. No mixed dimensions are
|
|
8
|
+
* allowed! Currently the {@link bounds} function MUST be passed in as
|
|
9
|
+
* arg to avoid circular module dependencies.
|
|
10
|
+
*
|
|
11
|
+
* @param shapes - input shapes
|
|
12
|
+
* @param bounds - bbox function
|
|
13
|
+
*/
|
|
14
|
+
export const __collBounds = (shapes, bounds) => {
|
|
15
|
+
let n = shapes.length - 1;
|
|
16
|
+
if (n < 0)
|
|
17
|
+
return;
|
|
18
|
+
let b = bounds(shapes[n]);
|
|
19
|
+
if (!b)
|
|
20
|
+
return;
|
|
21
|
+
let { pos, size } = b;
|
|
22
|
+
for (; --n >= 0;) {
|
|
23
|
+
b = bounds(shapes[n]);
|
|
24
|
+
if (!b)
|
|
25
|
+
continue;
|
|
26
|
+
[pos, size] = __unionBounds(pos, size, b.pos, b.size);
|
|
27
|
+
}
|
|
28
|
+
return [pos, size];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Takes the position and size vectors of 2
|
|
32
|
+
* {@link @thi.ng/geom-api#AABBLike}s and returns 2-tuple of
|
|
33
|
+
* `[pos,size]` of their union bounds.
|
|
34
|
+
*
|
|
35
|
+
* @param apos - bbox 1 min pos
|
|
36
|
+
* @param asize - bbox1 size
|
|
37
|
+
* @param bpos - bbox 2 min pos
|
|
38
|
+
* @param bsize - bbox 2 size
|
|
39
|
+
*/
|
|
40
|
+
export const __unionBounds = (apos, asize, bpos, bsize) => {
|
|
41
|
+
const p = add([], apos, asize);
|
|
42
|
+
const q = add([], bpos, bsize);
|
|
43
|
+
const pos = min([], apos, bpos);
|
|
44
|
+
return [pos, sub(null, max(null, p, q), pos)];
|
|
45
|
+
};
|
package/internal/collate.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export interface CollateOpts {
|
|
|
6
6
|
cstride: number;
|
|
7
7
|
estride: number;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const __remapBuffer: (buf: NumericArray, pts: StridedVec[], start: number, cstride: number, estride: number) => NumericArray;
|
|
10
|
+
export declare const __collateWith: (fn: (buf: NumericArray, src: Iterable<Readonly<StridedVec>>, start: number, cstride: number, estride: number) => NumericArray, pts: StridedVec[], opts: Partial<CollateOpts>, stride: number) => NumericArray;
|
|
11
11
|
//# sourceMappingURL=collate.d.ts.map
|
package/internal/collate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const __remapBuffer = (buf, pts, start, cstride, estride) => {
|
|
2
2
|
for (let i = pts.length; --i >= 0;) {
|
|
3
3
|
const p = pts[i];
|
|
4
4
|
p.buf = buf;
|
|
@@ -7,8 +7,13 @@ export const remap = (buf, pts, start, cstride, estride) => {
|
|
|
7
7
|
}
|
|
8
8
|
return buf;
|
|
9
9
|
};
|
|
10
|
-
export const
|
|
11
|
-
opts =
|
|
10
|
+
export const __collateWith = (fn, pts, opts, stride) => {
|
|
11
|
+
opts = {
|
|
12
|
+
start: 0,
|
|
13
|
+
cstride: 1,
|
|
14
|
+
estride: stride,
|
|
15
|
+
...opts,
|
|
16
|
+
};
|
|
12
17
|
const { start, cstride, estride } = opts;
|
|
13
|
-
return
|
|
18
|
+
return __remapBuffer(fn(opts.buf || new Array(start + pts.length * estride).fill(0), pts, start, cstride, estride), pts, start, cstride, estride);
|
|
14
19
|
};
|
package/internal/copy.js
ADDED
package/internal/dispatch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { IShape } from "@thi.ng/geom-api";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const __dispatch: (x: IShape) => string | number;
|
|
3
|
+
export declare const __dispatch2: (a: IShape, b: IShape) => string;
|
|
4
4
|
//# sourceMappingURL=dispatch.d.ts.map
|
package/internal/dispatch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
1
|
+
export const __dispatch = (x) => x.type;
|
|
2
|
+
export const __dispatch2 = (a, b) => a.type + "-" + b.type;
|
package/internal/edges.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReadonlyVec, VecPair } from "@thi.ng/vectors";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const __edges: (vertices: Iterable<ReadonlyVec>, closed?: boolean) => IterableIterator<VecPair>;
|
|
3
3
|
//# sourceMappingURL=edges.d.ts.map
|
package/internal/edges.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { partition
|
|
2
|
-
|
|
1
|
+
import { partition } from "@thi.ng/transducers/partition";
|
|
2
|
+
import { wrapSides } from "@thi.ng/transducers/wrap-sides";
|
|
3
|
+
export const __edges = (vertices, closed = false) => (partition(2, 1, closed ? wrapSides(vertices, 0, 1) : vertices));
|
package/internal/pclike.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PCLikeConstructor } from "@thi.ng/geom-api";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const __pclike: (ctor: PCLikeConstructor, args: any[]) => import("@thi.ng/geom-api").PCLike;
|
|
3
3
|
//# sourceMappingURL=pclike.d.ts.map
|
package/internal/pclike.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const
|
|
3
|
-
const attr =
|
|
1
|
+
import { __argAttribs } from "./args.js";
|
|
2
|
+
export const __pclike = (ctor, args) => {
|
|
3
|
+
const attr = __argAttribs(args);
|
|
4
4
|
return new ctor(args.length === 1 ? args[0] : args, attr);
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vec } from "@thi.ng/vectors";
|
|
2
1
|
import type { Attribs, PCLikeConstructor } from "@thi.ng/geom-api";
|
|
3
|
-
|
|
2
|
+
import type { Vec } from "@thi.ng/vectors";
|
|
3
|
+
export declare const __pointArraysAsShapes: (ctor: PCLikeConstructor, src?: Iterable<Vec[]> | undefined, attribs?: Attribs | undefined) => import("@thi.ng/geom-api").PCLike[] | undefined;
|
|
4
4
|
//# sourceMappingURL=points-as-shape.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { map } from "@thi.ng/transducers";
|
|
2
|
-
import { copyVectors } from "@thi.ng/vectors";
|
|
3
|
-
export const
|
|
4
|
-
? [...map((pts) => new ctor(copyVectors(pts),
|
|
1
|
+
import { map } from "@thi.ng/transducers/map";
|
|
2
|
+
import { copyVectors } from "@thi.ng/vectors/copy";
|
|
3
|
+
export const __pointArraysAsShapes = (ctor, src, attribs) => src
|
|
4
|
+
? [...map((pts) => new ctor(copyVectors(pts), { ...attribs }), src)]
|
|
5
5
|
: undefined;
|
package/internal/split.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Vec, VecPair } from "@thi.ng/vectors";
|
|
2
|
-
export declare const
|
|
1
|
+
import type { Vec, VecPair } from "@thi.ng/vectors";
|
|
2
|
+
export declare const __splitLine: (a: Vec, b: Vec, t: number) => [VecPair, VecPair];
|
|
3
3
|
//# sourceMappingURL=split.d.ts.map
|
package/internal/split.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { mixN
|
|
2
|
-
|
|
1
|
+
import { mixN } from "@thi.ng/vectors/mixn";
|
|
2
|
+
import { set } from "@thi.ng/vectors/set";
|
|
3
|
+
export const __splitLine = (a, b, t) => {
|
|
3
4
|
const p = mixN([], a, b, t);
|
|
4
5
|
return [
|
|
5
6
|
[a, p],
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Fn } from "@thi.ng/api";
|
|
2
|
+
import type { PCLike, PCLikeConstructor } from "@thi.ng/geom-api";
|
|
3
|
+
import type { MatOpMV, ReadonlyMat } from "@thi.ng/matrices";
|
|
4
|
+
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
5
|
+
export declare const __transformPoints: (pts: ReadonlyVec[], mat: ReadonlyMat, op?: MatOpMV) => ReadonlyVec[];
|
|
6
|
+
export declare const __transformedPoints: (pts: ReadonlyVec[], mat: ReadonlyMat, op?: MatOpMV) => import("@thi.ng/vectors").Vec[];
|
|
7
|
+
export declare const __transformPointsWith: (pts: ReadonlyVec[], fn: Fn<ReadonlyVec, ReadonlyMat>, op?: MatOpMV) => ReadonlyVec[];
|
|
8
|
+
export declare const __transformedPointsWith: (pts: ReadonlyVec[], fn: Fn<ReadonlyVec, ReadonlyMat>, op?: MatOpMV) => import("@thi.ng/vectors").Vec[];
|
|
9
|
+
export declare const __transformedShape: (ctor: PCLikeConstructor) => ($: PCLike, mat: ReadonlyMat) => PCLike;
|
|
10
|
+
export declare const __transformedShapePoints: (ctor: PCLikeConstructor) => ($: PCLike, fn: Fn<ReadonlyVec, ReadonlyMat>) => PCLike;
|
|
11
|
+
export declare const __transformPoints3: (pts: ReadonlyVec[], mat: ReadonlyMat) => ReadonlyVec[];
|
|
12
|
+
export declare const __transformedPoints3: (pts: ReadonlyVec[], mat: ReadonlyMat) => import("@thi.ng/vectors").Vec[];
|
|
13
|
+
export declare const __transformedPointsWith3: (pts: ReadonlyVec[], fn: Fn<ReadonlyVec, ReadonlyMat>) => import("@thi.ng/vectors").Vec[];
|
|
14
|
+
export declare const __transformedShape3: (ctor: PCLikeConstructor) => ($: PCLike, mat: ReadonlyMat) => PCLike;
|
|
15
|
+
export declare const __transformedShapePoints3: (ctor: PCLikeConstructor) => ($: PCLike, fn: Fn<ReadonlyVec, ReadonlyMat>) => PCLike;
|
|
16
|
+
//# sourceMappingURL=transform.d.ts.map
|