@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.
Files changed (254) hide show
  1. package/CHANGELOG.md +131 -152
  2. package/README.md +17 -6
  3. package/{ctors/aabb.d.ts → aabb.d.ts} +3 -3
  4. package/{ctors/aabb.js → aabb.js} +10 -5
  5. package/api/aabb.d.ts +1 -1
  6. package/api/aabb.js +5 -4
  7. package/api/arc.d.ts +1 -1
  8. package/api/arc.js +4 -4
  9. package/api/circle.d.ts +1 -1
  10. package/api/circle.js +3 -3
  11. package/api/cubic.d.ts +1 -1
  12. package/api/cubic.js +3 -3
  13. package/api/ellipse.d.ts +1 -1
  14. package/api/ellipse.js +4 -4
  15. package/api/group.js +2 -2
  16. package/api/line.d.ts +1 -1
  17. package/api/line.js +3 -3
  18. package/api/path.js +4 -4
  19. package/api/plane.d.ts +1 -1
  20. package/api/plane.js +3 -3
  21. package/api/points.d.ts +1 -1
  22. package/api/points.js +4 -4
  23. package/api/polygon.d.ts +1 -1
  24. package/api/polygon.js +3 -3
  25. package/api/polyline.d.ts +1 -1
  26. package/api/polyline.js +4 -4
  27. package/api/quad.d.ts +1 -1
  28. package/api/quad.js +3 -3
  29. package/api/quad3.d.ts +1 -1
  30. package/api/quad3.js +3 -3
  31. package/api/quadratic.d.ts +1 -1
  32. package/api/quadratic.js +3 -3
  33. package/api/ray.d.ts +1 -1
  34. package/api/ray.js +4 -3
  35. package/api/rect.d.ts +1 -1
  36. package/api/rect.js +5 -4
  37. package/api/sphere.d.ts +1 -1
  38. package/api/sphere.js +3 -3
  39. package/api/text.d.ts +1 -1
  40. package/api/text.js +3 -3
  41. package/api/triangle.d.ts +1 -1
  42. package/api/triangle.js +3 -3
  43. package/{ops/arc-length.d.ts → arc-length.d.ts} +2 -1
  44. package/{ops/arc-length.js → arc-length.js} +9 -9
  45. package/{ctors/arc.d.ts → arc.d.ts} +1 -1
  46. package/{ctors/arc.js → arc.js} +3 -3
  47. package/{ops/area.d.ts → area.d.ts} +1 -1
  48. package/{ops/area.js → area.js} +7 -9
  49. package/{ops/as-cubic.d.ts → as-cubic.d.ts} +2 -2
  50. package/as-cubic.js +40 -0
  51. package/{ops/as-path.d.ts → as-path.d.ts} +1 -1
  52. package/as-path.js +4 -0
  53. package/{ops/as-polygon.d.ts → as-polygon.d.ts} +2 -2
  54. package/as-polygon.js +18 -0
  55. package/{ops/as-polyline.d.ts → as-polyline.d.ts} +2 -2
  56. package/as-polyline.js +30 -0
  57. package/{ops/as-svg.d.ts → as-svg.d.ts} +0 -0
  58. package/as-svg.js +24 -0
  59. package/bounds.d.ts +4 -0
  60. package/bounds.js +50 -0
  61. package/center.d.ts +5 -0
  62. package/center.js +22 -0
  63. package/centroid.d.ts +5 -0
  64. package/centroid.js +35 -0
  65. package/{ctors/circle.d.ts → circle.d.ts} +2 -2
  66. package/{ctors/circle.js → circle.js} +6 -5
  67. package/classify-point.d.ts +5 -0
  68. package/classify-point.js +11 -0
  69. package/clip-convex.d.ts +5 -0
  70. package/clip-convex.js +44 -0
  71. package/closest-point.d.ts +5 -0
  72. package/{ops/closest-point.js → closest-point.js} +16 -11
  73. package/convex-hull.d.ts +4 -0
  74. package/convex-hull.js +18 -0
  75. package/{ctors/cubic.d.ts → cubic.d.ts} +2 -2
  76. package/cubic.js +12 -0
  77. package/{ops/edges.d.ts → edges.d.ts} +1 -1
  78. package/edges.js +30 -0
  79. package/{ctors/ellipse.d.ts → ellipse.d.ts} +1 -1
  80. package/ellipse.js +5 -0
  81. package/{ops/fit-into-bounds.d.ts → fit-into-bounds.d.ts} +2 -2
  82. package/{ops/fit-into-bounds.js → fit-into-bounds.js} +15 -12
  83. package/flip.d.ts +4 -0
  84. package/flip.js +38 -0
  85. package/{ctors/group.d.ts → group.d.ts} +1 -1
  86. package/{ctors/group.js → group.js} +1 -1
  87. package/index.d.ts +80 -90
  88. package/index.js +80 -90
  89. package/internal/args.d.ts +3 -3
  90. package/internal/args.js +8 -7
  91. package/internal/bounds.d.ts +25 -0
  92. package/internal/bounds.js +45 -0
  93. package/internal/collate.d.ts +2 -2
  94. package/internal/collate.js +9 -4
  95. package/internal/copy.d.ts +4 -0
  96. package/internal/copy.js +3 -0
  97. package/internal/dispatch.d.ts +2 -2
  98. package/internal/dispatch.js +2 -2
  99. package/internal/edges.d.ts +1 -1
  100. package/internal/edges.js +3 -2
  101. package/internal/pclike.d.ts +1 -1
  102. package/internal/pclike.js +3 -3
  103. package/internal/points-as-shape.d.ts +2 -2
  104. package/internal/points-as-shape.js +4 -4
  105. package/internal/split.d.ts +2 -2
  106. package/internal/split.js +3 -2
  107. package/internal/transform.d.ts +16 -0
  108. package/internal/transform.js +14 -0
  109. package/internal/translate.d.ts +5 -0
  110. package/internal/translate.js +4 -0
  111. package/intersects.d.ts +4 -0
  112. package/{ops/intersects.js → intersects.js} +18 -10
  113. package/{ctors/line.d.ts → line.d.ts} +2 -2
  114. package/{ctors/line.js → line.js} +6 -6
  115. package/map-point.d.ts +5 -0
  116. package/map-point.js +7 -0
  117. package/offset.d.ts +4 -0
  118. package/offset.js +27 -0
  119. package/package.json +298 -51
  120. package/{ctors/path-builder.d.ts → path-builder.d.ts} +2 -2
  121. package/{ctors/path-builder.js → path-builder.js} +13 -8
  122. package/path-from-svg.d.ts +2 -0
  123. package/{ctors/path-from-svg.js → path-from-svg.js} +5 -5
  124. package/{ctors/path.d.ts → path.d.ts} +3 -3
  125. package/{ctors/path.js → path.js} +8 -7
  126. package/{ctors/plane.d.ts → plane.d.ts} +2 -2
  127. package/{ctors/plane.js → plane.js} +4 -2
  128. package/point-at.d.ts +5 -0
  129. package/point-at.js +29 -0
  130. package/point-inside.d.ts +5 -0
  131. package/{ops/point-inside.js → point-inside.js} +9 -9
  132. package/{ctors/points.d.ts → points.d.ts} +1 -1
  133. package/{ctors/points.js → points.js} +1 -1
  134. package/{ctors/polygon.d.ts → polygon.d.ts} +2 -2
  135. package/polygon.js +11 -0
  136. package/{ctors/polyline.d.ts → polyline.d.ts} +1 -1
  137. package/{ctors/polyline.js → polyline.js} +1 -1
  138. package/{ctors/quad.d.ts → quad.d.ts} +4 -4
  139. package/quad.js +28 -0
  140. package/{ctors/quadratic.d.ts → quadratic.d.ts} +1 -1
  141. package/{ctors/quadratic.js → quadratic.js} +4 -4
  142. package/{ctors/ray.d.ts → ray.d.ts} +2 -2
  143. package/{ctors/ray.js → ray.js} +2 -2
  144. package/{ctors/rect.d.ts → rect.d.ts} +4 -4
  145. package/{ctors/rect.js → rect.js} +13 -6
  146. package/resample.d.ts +4 -0
  147. package/resample.js +18 -0
  148. package/scatter.d.ts +4 -0
  149. package/{ops/scatter.js → scatter.js} +4 -4
  150. package/simplify.d.ts +4 -0
  151. package/{ops/simplify.js → simplify.js} +14 -15
  152. package/{ctors/sphere.d.ts → sphere.d.ts} +2 -2
  153. package/sphere.js +8 -0
  154. package/split-at.d.ts +4 -0
  155. package/split-at.js +28 -0
  156. package/{ops/split-near.d.ts → split-near.d.ts} +2 -1
  157. package/split-near.js +38 -0
  158. package/{ops/subdiv-curve.d.ts → subdiv-curve.d.ts} +1 -1
  159. package/subdiv-curve.js +10 -0
  160. package/tangent-at.d.ts +5 -0
  161. package/tangent-at.js +21 -0
  162. package/{ops/tessellate.d.ts → tessellate.d.ts} +0 -0
  163. package/tessellate.js +7 -0
  164. package/{ctors/text.d.ts → text.d.ts} +1 -1
  165. package/{ctors/text.js → text.js} +1 -1
  166. package/{ops/transform-vertices.d.ts → transform-vertices.d.ts} +3 -1
  167. package/{ops/transform-vertices.js → transform-vertices.js} +22 -22
  168. package/{ops/transform.d.ts → transform.d.ts} +3 -1
  169. package/transform.js +58 -0
  170. package/translate.d.ts +5 -0
  171. package/translate.js +55 -0
  172. package/{ctors/triangle.d.ts → triangle.d.ts} +1 -1
  173. package/triangle.js +7 -0
  174. package/union.d.ts +4 -0
  175. package/union.js +13 -0
  176. package/{ops/unmap-point.d.ts → unmap-point.d.ts} +2 -2
  177. package/{ops/unmap-point.js → unmap-point.js} +8 -7
  178. package/{ops/vertices.d.ts → vertices.d.ts} +4 -3
  179. package/{ops/vertices.js → vertices.js} +26 -17
  180. package/{ops/volume.d.ts → volume.d.ts} +2 -1
  181. package/{ops/volume.js → volume.js} +5 -6
  182. package/{ops/warp-points.d.ts → warp-points.d.ts} +0 -0
  183. package/{ops/warp-points.js → warp-points.js} +2 -2
  184. package/{ops/with-attribs.d.ts → with-attribs.d.ts} +0 -0
  185. package/with-attribs.js +4 -0
  186. package/ctors/cubic.js +0 -10
  187. package/ctors/ellipse.js +0 -5
  188. package/ctors/path-from-svg.d.ts +0 -2
  189. package/ctors/polygon.js +0 -6
  190. package/ctors/quad.js +0 -26
  191. package/ctors/sphere.js +0 -7
  192. package/ctors/triangle.js +0 -7
  193. package/internal/coll-bounds.d.ts +0 -13
  194. package/internal/coll-bounds.js +0 -27
  195. package/internal/copy-attribs.d.ts +0 -3
  196. package/internal/copy-attribs.js +0 -1
  197. package/internal/copy-shape.d.ts +0 -3
  198. package/internal/copy-shape.js +0 -3
  199. package/internal/transform-points.d.ts +0 -16
  200. package/internal/transform-points.js +0 -14
  201. package/internal/translate-points.d.ts +0 -5
  202. package/internal/translate-points.js +0 -4
  203. package/internal/union-bounds.d.ts +0 -13
  204. package/internal/union-bounds.js +0 -17
  205. package/lib/index.js +0 -1938
  206. package/lib/index.js.map +0 -1
  207. package/lib/index.umd.js +0 -1
  208. package/lib/index.umd.js.map +0 -1
  209. package/ops/as-cubic.js +0 -39
  210. package/ops/as-path.js +0 -4
  211. package/ops/as-polygon.js +0 -18
  212. package/ops/as-polyline.js +0 -30
  213. package/ops/as-svg.js +0 -17
  214. package/ops/bounds.d.ts +0 -3
  215. package/ops/bounds.js +0 -39
  216. package/ops/center.d.ts +0 -5
  217. package/ops/center.js +0 -21
  218. package/ops/centroid.d.ts +0 -5
  219. package/ops/centroid.js +0 -29
  220. package/ops/classify-point.d.ts +0 -5
  221. package/ops/classify-point.js +0 -12
  222. package/ops/clip-convex.d.ts +0 -4
  223. package/ops/clip-convex.js +0 -44
  224. package/ops/closest-point.d.ts +0 -5
  225. package/ops/convex-hull.d.ts +0 -3
  226. package/ops/convex-hull.js +0 -18
  227. package/ops/edges.js +0 -30
  228. package/ops/flip.d.ts +0 -3
  229. package/ops/flip.js +0 -38
  230. package/ops/intersects.d.ts +0 -4
  231. package/ops/map-point.d.ts +0 -5
  232. package/ops/map-point.js +0 -8
  233. package/ops/offset.d.ts +0 -3
  234. package/ops/offset.js +0 -22
  235. package/ops/point-at.d.ts +0 -4
  236. package/ops/point-at.js +0 -22
  237. package/ops/point-inside.d.ts +0 -4
  238. package/ops/resample.d.ts +0 -3
  239. package/ops/resample.js +0 -18
  240. package/ops/scatter.d.ts +0 -4
  241. package/ops/simplify.d.ts +0 -3
  242. package/ops/split-at.d.ts +0 -3
  243. package/ops/split-at.js +0 -28
  244. package/ops/split-near.js +0 -38
  245. package/ops/subdiv-curve.js +0 -11
  246. package/ops/tangent-at.d.ts +0 -4
  247. package/ops/tangent-at.js +0 -19
  248. package/ops/tessellate.js +0 -6
  249. package/ops/transform.js +0 -58
  250. package/ops/translate.d.ts +0 -4
  251. package/ops/translate.js +0 -55
  252. package/ops/union.d.ts +0 -3
  253. package/ops/union.js +0 -14
  254. 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 "./ctors/aabb";
23
- export * from "./ctors/arc";
24
- export * from "./ctors/circle";
25
- export * from "./ctors/cubic";
26
- export * from "./ctors/ellipse";
27
- export * from "./ctors/group";
28
- export * from "./ctors/line";
29
- export * from "./ctors/path";
30
- export * from "./ctors/path-builder";
31
- export * from "./ctors/path-from-svg";
32
- export * from "./ctors/plane";
33
- export * from "./ctors/points";
34
- export * from "./ctors/polygon";
35
- export * from "./ctors/polyline";
36
- export * from "./ctors/quad";
37
- export * from "./ctors/quadratic";
38
- export * from "./ctors/ray";
39
- export * from "./ctors/rect";
40
- export * from "./ctors/text";
41
- export * from "./ctors/triangle";
42
- export * from "./ops/arc-length";
43
- export * from "./ops/area";
44
- export * from "./ops/as-cubic";
45
- export * from "./ops/as-path";
46
- export * from "./ops/as-polygon";
47
- export * from "./ops/as-polyline";
48
- export * from "./ops/as-svg";
49
- export * from "./ops/bounds";
50
- export * from "./ops/center";
51
- export * from "./ops/centroid";
52
- export * from "./ops/classify-point";
53
- export * from "./ops/clip-convex";
54
- export * from "./ops/closest-point";
55
- export * from "./ops/convex-hull";
56
- export * from "./ops/edges";
57
- export * from "./ops/fit-into-bounds";
58
- export * from "./ops/flip";
59
- export * from "./ops/intersects";
60
- export * from "./ops/map-point";
61
- export * from "./ops/offset";
62
- export * from "./ops/point-at";
63
- export * from "./ops/point-inside";
64
- export * from "./ops/resample";
65
- export * from "./ops/scatter";
66
- export * from "./ops/simplify";
67
- export * from "./ops/split-at";
68
- export * from "./ops/split-near";
69
- export * from "./ops/subdiv-curve";
70
- export * from "./ops/tangent-at";
71
- export * from "./ops/tessellate";
72
- export * from "./ops/transform";
73
- export * from "./ops/transform-vertices";
74
- export * from "./ops/translate";
75
- export * from "./ops/union";
76
- export * from "./ops/unmap-point";
77
- export * from "./ops/vertices";
78
- export * from "./ops/volume";
79
- export * from "./ops/warp-points";
80
- export * from "./ops/with-attribs";
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 "./ctors/aabb";
23
- export * from "./ctors/arc";
24
- export * from "./ctors/circle";
25
- export * from "./ctors/cubic";
26
- export * from "./ctors/ellipse";
27
- export * from "./ctors/group";
28
- export * from "./ctors/line";
29
- export * from "./ctors/path";
30
- export * from "./ctors/path-builder";
31
- export * from "./ctors/path-from-svg";
32
- export * from "./ctors/plane";
33
- export * from "./ctors/points";
34
- export * from "./ctors/polygon";
35
- export * from "./ctors/polyline";
36
- export * from "./ctors/quad";
37
- export * from "./ctors/quadratic";
38
- export * from "./ctors/ray";
39
- export * from "./ctors/rect";
40
- export * from "./ctors/text";
41
- export * from "./ctors/triangle";
42
- export * from "./ops/arc-length";
43
- export * from "./ops/area";
44
- export * from "./ops/as-cubic";
45
- export * from "./ops/as-path";
46
- export * from "./ops/as-polygon";
47
- export * from "./ops/as-polyline";
48
- export * from "./ops/as-svg";
49
- export * from "./ops/bounds";
50
- export * from "./ops/center";
51
- export * from "./ops/centroid";
52
- export * from "./ops/classify-point";
53
- export * from "./ops/clip-convex";
54
- export * from "./ops/closest-point";
55
- export * from "./ops/convex-hull";
56
- export * from "./ops/edges";
57
- export * from "./ops/fit-into-bounds";
58
- export * from "./ops/flip";
59
- export * from "./ops/intersects";
60
- export * from "./ops/map-point";
61
- export * from "./ops/offset";
62
- export * from "./ops/point-at";
63
- export * from "./ops/point-inside";
64
- export * from "./ops/resample";
65
- export * from "./ops/scatter";
66
- export * from "./ops/simplify";
67
- export * from "./ops/split-at";
68
- export * from "./ops/split-near";
69
- export * from "./ops/subdiv-curve";
70
- export * from "./ops/tangent-at";
71
- export * from "./ops/tessellate";
72
- export * from "./ops/transform";
73
- export * from "./ops/transform-vertices";
74
- export * from "./ops/translate";
75
- export * from "./ops/union";
76
- export * from "./ops/unmap-point";
77
- export * from "./ops/vertices";
78
- export * from "./ops/volume";
79
- export * from "./ops/warp-points";
80
- export * from "./ops/with-attribs";
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";
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @internal
9
9
  */
10
- export declare const argAttribs: (args: any[]) => any;
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 argsVV: (args: any[]) => any[];
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 argsVN: (args: any[]) => any[];
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, isPlainObject } from "@thi.ng/checks";
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 argAttribs = (args) => isPlainObject(peek(args)) ? args.pop() : undefined;
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 argsVV = (args) => {
22
- const attr = argAttribs(args);
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 argsVN = (args) => {
38
- const attr = argAttribs(args);
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
+ };
@@ -6,6 +6,6 @@ export interface CollateOpts {
6
6
  cstride: number;
7
7
  estride: number;
8
8
  }
9
- export declare const remap: (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;
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
@@ -1,4 +1,4 @@
1
- export const remap = (buf, pts, start, cstride, estride) => {
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 collateWith = (fn, pts, opts, stride) => {
11
- opts = Object.assign({ start: 0, cstride: 1, estride: stride }, 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 remap(fn(opts.buf || new Array(start + pts.length * estride).fill(0), pts, start, cstride, estride), pts, start, cstride, estride);
18
+ return __remapBuffer(fn(opts.buf || new Array(start + pts.length * estride).fill(0), pts, start, cstride, estride), pts, start, cstride, estride);
14
19
  };
@@ -0,0 +1,4 @@
1
+ import type { Attribs, IShape, PCLike, PCLikeConstructor } from "@thi.ng/geom-api";
2
+ export declare const __copyAttribs: ($: IShape) => Attribs;
3
+ export declare const __copyShape: (ctor: PCLikeConstructor, inst: PCLike) => PCLike;
4
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { copyVectors } from "@thi.ng/vectors/copy";
2
+ export const __copyAttribs = ($) => ({ ...$.attribs });
3
+ export const __copyShape = (ctor, inst) => new ctor(copyVectors(inst.points), __copyAttribs(inst));
@@ -1,4 +1,4 @@
1
1
  import type { IShape } from "@thi.ng/geom-api";
2
- export declare const dispatch: (x: IShape) => string | number;
3
- export declare const dispatch2: (a: IShape, b: IShape) => string;
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
@@ -1,2 +1,2 @@
1
- export const dispatch = (x) => x.type;
2
- export const dispatch2 = (a, b) => a.type + "-" + b.type;
1
+ export const __dispatch = (x) => x.type;
2
+ export const __dispatch2 = (a, b) => a.type + "-" + b.type;
@@ -1,3 +1,3 @@
1
1
  import type { ReadonlyVec, VecPair } from "@thi.ng/vectors";
2
- export declare const edgeIterator: (vertices: Iterable<ReadonlyVec>, closed?: boolean) => IterableIterator<VecPair>;
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, wrapSides } from "@thi.ng/transducers";
2
- export const edgeIterator = (vertices, closed = false) => (partition(2, 1, closed ? wrapSides(vertices, 0, 1) : vertices));
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));
@@ -1,3 +1,3 @@
1
1
  import type { PCLikeConstructor } from "@thi.ng/geom-api";
2
- export declare const pclike: (ctor: PCLikeConstructor, args: any[]) => import("@thi.ng/geom-api").PCLike;
2
+ export declare const __pclike: (ctor: PCLikeConstructor, args: any[]) => import("@thi.ng/geom-api").PCLike;
3
3
  //# sourceMappingURL=pclike.d.ts.map
@@ -1,5 +1,5 @@
1
- import { argAttribs } from "./args";
2
- export const pclike = (ctor, args) => {
3
- const attr = argAttribs(args);
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
- export declare const pointArraysAsShapes: (ctor: PCLikeConstructor, src?: Iterable<Vec[]> | undefined, attribs?: Attribs | undefined) => import("@thi.ng/geom-api").PCLike[] | undefined;
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 pointArraysAsShapes = (ctor, src, attribs) => src
4
- ? [...map((pts) => new ctor(copyVectors(pts), Object.assign({}, attribs)), src)]
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;
@@ -1,3 +1,3 @@
1
- import { Vec, VecPair } from "@thi.ng/vectors";
2
- export declare const splitLine: (a: Vec, b: Vec, t: number) => [VecPair, VecPair];
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, set } from "@thi.ng/vectors";
2
- export const splitLine = (a, b, t) => {
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