@ac-kit/math-geometry 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/README.md +323 -52
  3. package/dist/_brand.d.ts +14 -0
  4. package/dist/_brand.d.ts.map +1 -0
  5. package/dist/_brand.js +2 -0
  6. package/dist/_brand.js.map +1 -0
  7. package/dist/_ear-clipping.d.ts +20 -0
  8. package/dist/_ear-clipping.d.ts.map +1 -0
  9. package/dist/_ear-clipping.js +360 -0
  10. package/dist/_ear-clipping.js.map +1 -0
  11. package/dist/_ray3-intersect.d.ts +19 -0
  12. package/dist/_ray3-intersect.d.ts.map +1 -0
  13. package/dist/_ray3-intersect.js +122 -0
  14. package/dist/_ray3-intersect.js.map +1 -0
  15. package/dist/box2-array-boundary.d.ts +50 -0
  16. package/dist/box2-array-boundary.d.ts.map +1 -0
  17. package/dist/box2-array-boundary.js +97 -0
  18. package/dist/box2-array-boundary.js.map +1 -0
  19. package/dist/box2-array.d.ts +42 -0
  20. package/dist/box2-array.d.ts.map +1 -0
  21. package/dist/box2-array.js +134 -0
  22. package/dist/box2-array.js.map +1 -0
  23. package/dist/box2-componentwise.d.ts +110 -0
  24. package/dist/box2-componentwise.d.ts.map +1 -0
  25. package/dist/box2-componentwise.js +325 -0
  26. package/dist/box2-componentwise.js.map +1 -0
  27. package/dist/box2-grid-index.d.ts +67 -0
  28. package/dist/box2-grid-index.d.ts.map +1 -0
  29. package/dist/box2-grid-index.js +198 -0
  30. package/dist/box2-grid-index.js.map +1 -0
  31. package/dist/box2-record.d.ts +83 -0
  32. package/dist/box2-record.d.ts.map +1 -0
  33. package/dist/box2-record.js +124 -0
  34. package/dist/box2-record.js.map +1 -0
  35. package/dist/box2.d.ts +38 -0
  36. package/dist/box2.d.ts.map +1 -0
  37. package/dist/box2.js +97 -0
  38. package/dist/box2.js.map +1 -0
  39. package/dist/box3-array-boundary.d.ts +50 -0
  40. package/dist/box3-array-boundary.d.ts.map +1 -0
  41. package/dist/box3-array-boundary.js +107 -0
  42. package/dist/box3-array-boundary.js.map +1 -0
  43. package/dist/box3-componentwise.d.ts +110 -0
  44. package/dist/box3-componentwise.d.ts.map +1 -0
  45. package/dist/box3-componentwise.js +392 -0
  46. package/dist/box3-componentwise.js.map +1 -0
  47. package/dist/box3-record.d.ts +92 -0
  48. package/dist/box3-record.d.ts.map +1 -0
  49. package/dist/box3-record.js +147 -0
  50. package/dist/box3-record.js.map +1 -0
  51. package/dist/box3.d.ts +19 -16
  52. package/dist/box3.d.ts.map +1 -1
  53. package/dist/box3.js +73 -76
  54. package/dist/box3.js.map +1 -1
  55. package/dist/box4-array-boundary.d.ts +50 -0
  56. package/dist/box4-array-boundary.d.ts.map +1 -0
  57. package/dist/box4-array-boundary.js +117 -0
  58. package/dist/box4-array-boundary.js.map +1 -0
  59. package/dist/box4-componentwise.d.ts +110 -0
  60. package/dist/box4-componentwise.d.ts.map +1 -0
  61. package/dist/box4-componentwise.js +459 -0
  62. package/dist/box4-componentwise.js.map +1 -0
  63. package/dist/box4-record.d.ts +96 -0
  64. package/dist/box4-record.d.ts.map +1 -0
  65. package/dist/box4-record.js +167 -0
  66. package/dist/box4-record.js.map +1 -0
  67. package/dist/box4.d.ts +13 -8
  68. package/dist/box4.d.ts.map +1 -1
  69. package/dist/box4.js +27 -5
  70. package/dist/box4.js.map +1 -1
  71. package/dist/circle2-array-boundary.d.ts +51 -0
  72. package/dist/circle2-array-boundary.d.ts.map +1 -0
  73. package/dist/circle2-array-boundary.js +93 -0
  74. package/dist/circle2-array-boundary.js.map +1 -0
  75. package/dist/circle2-array.d.ts +17 -0
  76. package/dist/circle2-array.d.ts.map +1 -0
  77. package/dist/circle2-array.js +44 -0
  78. package/dist/circle2-array.js.map +1 -0
  79. package/dist/circle2-record.d.ts +81 -0
  80. package/dist/circle2-record.d.ts.map +1 -0
  81. package/dist/circle2-record.js +114 -0
  82. package/dist/circle2-record.js.map +1 -0
  83. package/dist/circle2.d.ts +27 -82
  84. package/dist/circle2.d.ts.map +1 -1
  85. package/dist/circle2.js +59 -104
  86. package/dist/circle2.js.map +1 -1
  87. package/dist/coordinates/cylindrical-record.d.ts +86 -0
  88. package/dist/coordinates/cylindrical-record.d.ts.map +1 -0
  89. package/dist/coordinates/cylindrical-record.js +114 -0
  90. package/dist/coordinates/cylindrical-record.js.map +1 -0
  91. package/dist/coordinates/horizontal-record.d.ts +86 -0
  92. package/dist/coordinates/horizontal-record.d.ts.map +1 -0
  93. package/dist/coordinates/horizontal-record.js +114 -0
  94. package/dist/coordinates/horizontal-record.js.map +1 -0
  95. package/dist/coordinates/horizontal.d.ts +48 -0
  96. package/dist/coordinates/horizontal.d.ts.map +1 -0
  97. package/dist/coordinates/horizontal.js +100 -0
  98. package/dist/coordinates/horizontal.js.map +1 -0
  99. package/dist/coordinates/index.d.ts +10 -0
  100. package/dist/coordinates/index.d.ts.map +1 -0
  101. package/dist/coordinates/index.js +10 -0
  102. package/dist/coordinates/index.js.map +1 -0
  103. package/dist/coordinates/longitude-latitude-record.d.ts +81 -0
  104. package/dist/coordinates/longitude-latitude-record.d.ts.map +1 -0
  105. package/dist/coordinates/longitude-latitude-record.js +104 -0
  106. package/dist/coordinates/longitude-latitude-record.js.map +1 -0
  107. package/dist/coordinates/longitude-latitude.d.ts +33 -0
  108. package/dist/coordinates/longitude-latitude.d.ts.map +1 -0
  109. package/dist/coordinates/longitude-latitude.js +78 -0
  110. package/dist/coordinates/longitude-latitude.js.map +1 -0
  111. package/dist/coordinates/polar-record.d.ts +77 -0
  112. package/dist/coordinates/polar-record.d.ts.map +1 -0
  113. package/dist/coordinates/polar-record.js +104 -0
  114. package/dist/coordinates/polar-record.js.map +1 -0
  115. package/dist/coordinates/polar.d.ts +28 -0
  116. package/dist/coordinates/polar.d.ts.map +1 -0
  117. package/dist/coordinates/polar.js +68 -0
  118. package/dist/coordinates/polar.js.map +1 -0
  119. package/dist/coordinates/spherical-cylindrical.d.ts +49 -0
  120. package/dist/coordinates/spherical-cylindrical.d.ts.map +1 -0
  121. package/dist/coordinates/spherical-cylindrical.js +110 -0
  122. package/dist/coordinates/spherical-cylindrical.js.map +1 -0
  123. package/dist/coordinates/spherical-record.d.ts +86 -0
  124. package/dist/coordinates/spherical-record.d.ts.map +1 -0
  125. package/dist/coordinates/spherical-record.js +114 -0
  126. package/dist/coordinates/spherical-record.js.map +1 -0
  127. package/dist/frustum3-record.d.ts +132 -0
  128. package/dist/frustum3-record.d.ts.map +1 -0
  129. package/dist/frustum3-record.js +333 -0
  130. package/dist/frustum3-record.js.map +1 -0
  131. package/dist/frustum3.d.ts +60 -0
  132. package/dist/frustum3.d.ts.map +1 -0
  133. package/dist/frustum3.js +186 -0
  134. package/dist/frustum3.js.map +1 -0
  135. package/dist/index.d.ts +36 -16
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +36 -16
  138. package/dist/index.js.map +1 -1
  139. package/dist/line2-record.d.ts +87 -0
  140. package/dist/line2-record.d.ts.map +1 -0
  141. package/dist/line2-record.js +123 -0
  142. package/dist/line2-record.js.map +1 -0
  143. package/dist/line2.d.ts +20 -33
  144. package/dist/line2.d.ts.map +1 -1
  145. package/dist/line2.js +56 -51
  146. package/dist/line2.js.map +1 -1
  147. package/dist/line3-record.d.ts +91 -0
  148. package/dist/line3-record.d.ts.map +1 -0
  149. package/dist/line3-record.js +146 -0
  150. package/dist/line3-record.js.map +1 -0
  151. package/dist/line3.d.ts +11 -24
  152. package/dist/line3.d.ts.map +1 -1
  153. package/dist/line3.js +32 -36
  154. package/dist/line3.js.map +1 -1
  155. package/dist/mesh/_generator-kit.d.ts +14 -0
  156. package/dist/mesh/_generator-kit.d.ts.map +1 -0
  157. package/dist/mesh/_generator-kit.js +39 -0
  158. package/dist/mesh/_generator-kit.js.map +1 -0
  159. package/dist/mesh/_index-kernels-u16.d.ts +43 -0
  160. package/dist/mesh/_index-kernels-u16.d.ts.map +1 -0
  161. package/dist/mesh/_index-kernels-u16.js +264 -0
  162. package/dist/mesh/_index-kernels-u16.js.map +1 -0
  163. package/dist/mesh/_index-kernels-u32.d.ts +43 -0
  164. package/dist/mesh/_index-kernels-u32.d.ts.map +1 -0
  165. package/dist/mesh/_index-kernels-u32.js +264 -0
  166. package/dist/mesh/_index-kernels-u32.js.map +1 -0
  167. package/dist/mesh/generate-box.d.ts +16 -0
  168. package/dist/mesh/generate-box.d.ts.map +1 -0
  169. package/dist/mesh/generate-box.js +79 -0
  170. package/dist/mesh/generate-box.js.map +1 -0
  171. package/dist/mesh/generate-cylinder.d.ts +25 -0
  172. package/dist/mesh/generate-cylinder.d.ts.map +1 -0
  173. package/dist/mesh/generate-cylinder.js +117 -0
  174. package/dist/mesh/generate-cylinder.js.map +1 -0
  175. package/dist/mesh/generate-heightfield.d.ts +24 -0
  176. package/dist/mesh/generate-heightfield.d.ts.map +1 -0
  177. package/dist/mesh/generate-heightfield.js +48 -0
  178. package/dist/mesh/generate-heightfield.js.map +1 -0
  179. package/dist/mesh/generate-plane.d.ts +18 -0
  180. package/dist/mesh/generate-plane.d.ts.map +1 -0
  181. package/dist/mesh/generate-plane.js +39 -0
  182. package/dist/mesh/generate-plane.js.map +1 -0
  183. package/dist/mesh/generate-sphere.d.ts +50 -0
  184. package/dist/mesh/generate-sphere.d.ts.map +1 -0
  185. package/dist/mesh/generate-sphere.js +244 -0
  186. package/dist/mesh/generate-sphere.js.map +1 -0
  187. package/dist/mesh/index.d.ts +8 -0
  188. package/dist/mesh/index.d.ts.map +1 -0
  189. package/dist/mesh/index.js +8 -0
  190. package/dist/mesh/index.js.map +1 -0
  191. package/dist/mesh/mesh3-kernels.d.ts +82 -0
  192. package/dist/mesh/mesh3-kernels.d.ts.map +1 -0
  193. package/dist/mesh/mesh3-kernels.js +180 -0
  194. package/dist/mesh/mesh3-kernels.js.map +1 -0
  195. package/dist/mesh/mesh3.d.ts +66 -0
  196. package/dist/mesh/mesh3.d.ts.map +1 -0
  197. package/dist/mesh/mesh3.js +128 -0
  198. package/dist/mesh/mesh3.js.map +1 -0
  199. package/dist/plane3-record.d.ts +88 -0
  200. package/dist/plane3-record.d.ts.map +1 -0
  201. package/dist/plane3-record.js +123 -0
  202. package/dist/plane3-record.js.map +1 -0
  203. package/dist/plane3.d.ts +42 -28
  204. package/dist/plane3.d.ts.map +1 -1
  205. package/dist/plane3.js +166 -48
  206. package/dist/plane3.js.map +1 -1
  207. package/dist/polygon2.d.ts +82 -29
  208. package/dist/polygon2.d.ts.map +1 -1
  209. package/dist/polygon2.js +236 -93
  210. package/dist/polygon2.js.map +1 -1
  211. package/dist/polygon3.d.ts +40 -21
  212. package/dist/polygon3.d.ts.map +1 -1
  213. package/dist/polygon3.js +215 -91
  214. package/dist/polygon3.js.map +1 -1
  215. package/dist/polyline2.d.ts +37 -0
  216. package/dist/polyline2.d.ts.map +1 -0
  217. package/dist/polyline2.js +146 -0
  218. package/dist/polyline2.js.map +1 -0
  219. package/dist/polyline3.d.ts +35 -0
  220. package/dist/polyline3.d.ts.map +1 -0
  221. package/dist/polyline3.js +159 -0
  222. package/dist/polyline3.js.map +1 -0
  223. package/dist/quadtree.d.ts +238 -0
  224. package/dist/quadtree.d.ts.map +1 -0
  225. package/dist/quadtree.js +1019 -0
  226. package/dist/quadtree.js.map +1 -0
  227. package/dist/ray2-record.d.ts +86 -0
  228. package/dist/ray2-record.d.ts.map +1 -0
  229. package/dist/ray2-record.js +123 -0
  230. package/dist/ray2-record.js.map +1 -0
  231. package/dist/ray2.d.ts +38 -13
  232. package/dist/ray2.d.ts.map +1 -1
  233. package/dist/ray2.js +85 -22
  234. package/dist/ray2.js.map +1 -1
  235. package/dist/ray3-array.d.ts +27 -0
  236. package/dist/ray3-array.d.ts.map +1 -0
  237. package/dist/ray3-array.js +89 -0
  238. package/dist/ray3-array.js.map +1 -0
  239. package/dist/ray3-record.d.ts +90 -0
  240. package/dist/ray3-record.d.ts.map +1 -0
  241. package/dist/ray3-record.js +146 -0
  242. package/dist/ray3-record.js.map +1 -0
  243. package/dist/ray3.d.ts +72 -25
  244. package/dist/ray3.d.ts.map +1 -1
  245. package/dist/ray3.js +233 -64
  246. package/dist/ray3.js.map +1 -1
  247. package/dist/segment2-record.d.ts +80 -0
  248. package/dist/segment2-record.d.ts.map +1 -0
  249. package/dist/segment2-record.js +122 -0
  250. package/dist/segment2-record.js.map +1 -0
  251. package/dist/segment2.d.ts +34 -19
  252. package/dist/segment2.d.ts.map +1 -1
  253. package/dist/segment2.js +88 -42
  254. package/dist/segment2.js.map +1 -1
  255. package/dist/segment3-record.d.ts +90 -0
  256. package/dist/segment3-record.d.ts.map +1 -0
  257. package/dist/segment3-record.js +146 -0
  258. package/dist/segment3-record.js.map +1 -0
  259. package/dist/segment3.d.ts +24 -12
  260. package/dist/segment3.d.ts.map +1 -1
  261. package/dist/segment3.js +67 -30
  262. package/dist/segment3.js.map +1 -1
  263. package/dist/size.d.ts +40 -0
  264. package/dist/size.d.ts.map +1 -0
  265. package/dist/size.js +72 -0
  266. package/dist/size.js.map +1 -0
  267. package/dist/sphere3-array-boundary.d.ts +51 -0
  268. package/dist/sphere3-array-boundary.d.ts.map +1 -0
  269. package/dist/sphere3-array-boundary.js +98 -0
  270. package/dist/sphere3-array-boundary.js.map +1 -0
  271. package/dist/sphere3-record.d.ts +88 -0
  272. package/dist/sphere3-record.d.ts.map +1 -0
  273. package/dist/sphere3-record.js +123 -0
  274. package/dist/sphere3-record.js.map +1 -0
  275. package/dist/sphere3.d.ts +55 -12
  276. package/dist/sphere3.d.ts.map +1 -1
  277. package/dist/sphere3.js +233 -24
  278. package/dist/sphere3.js.map +1 -1
  279. package/dist/spherical/cap.d.ts +56 -0
  280. package/dist/spherical/cap.d.ts.map +1 -0
  281. package/dist/spherical/cap.js +363 -0
  282. package/dist/spherical/cap.js.map +1 -0
  283. package/dist/spherical/great-circle.d.ts +39 -0
  284. package/dist/spherical/great-circle.d.ts.map +1 -0
  285. package/dist/spherical/great-circle.js +158 -0
  286. package/dist/spherical/great-circle.js.map +1 -0
  287. package/dist/spherical/index.d.ts +3 -0
  288. package/dist/spherical/index.d.ts.map +1 -0
  289. package/dist/spherical/index.js +3 -0
  290. package/dist/spherical/index.js.map +1 -0
  291. package/dist/triangle2-record.d.ts +91 -0
  292. package/dist/triangle2-record.d.ts.map +1 -0
  293. package/dist/triangle2-record.js +146 -0
  294. package/dist/triangle2-record.js.map +1 -0
  295. package/dist/triangle2.d.ts +29 -14
  296. package/dist/triangle2.d.ts.map +1 -1
  297. package/dist/triangle2.js +86 -22
  298. package/dist/triangle2.js.map +1 -1
  299. package/dist/triangle3-record.d.ts +97 -0
  300. package/dist/triangle3-record.d.ts.map +1 -0
  301. package/dist/triangle3-record.js +178 -0
  302. package/dist/triangle3-record.js.map +1 -0
  303. package/dist/triangle3.d.ts +41 -17
  304. package/dist/triangle3.d.ts.map +1 -1
  305. package/dist/triangle3.js +267 -38
  306. package/dist/triangle3.js.map +1 -1
  307. package/package.json +15 -8
  308. package/dist/angles.d.ts +0 -31
  309. package/dist/angles.d.ts.map +0 -1
  310. package/dist/angles.js +0 -53
  311. package/dist/angles.js.map +0 -1
  312. package/dist/coordinate-spaces.d.ts +0 -39
  313. package/dist/coordinate-spaces.d.ts.map +0 -1
  314. package/dist/coordinate-spaces.js +0 -52
  315. package/dist/coordinate-spaces.js.map +0 -1
  316. package/dist/coordinates-vec2.d.ts +0 -7
  317. package/dist/coordinates-vec2.d.ts.map +0 -1
  318. package/dist/coordinates-vec2.js +0 -35
  319. package/dist/coordinates-vec2.js.map +0 -1
  320. package/dist/coordinates-vec3.d.ts +0 -11
  321. package/dist/coordinates-vec3.d.ts.map +0 -1
  322. package/dist/coordinates-vec3.js +0 -61
  323. package/dist/coordinates-vec3.js.map +0 -1
  324. package/dist/coordinates.d.ts +0 -54
  325. package/dist/coordinates.d.ts.map +0 -1
  326. package/dist/coordinates.js +0 -2
  327. package/dist/coordinates.js.map +0 -1
  328. package/dist/euler-angles-quaternion.d.ts +0 -7
  329. package/dist/euler-angles-quaternion.d.ts.map +0 -1
  330. package/dist/euler-angles-quaternion.js +0 -100
  331. package/dist/euler-angles-quaternion.js.map +0 -1
  332. package/dist/euler-angles.d.ts +0 -33
  333. package/dist/euler-angles.d.ts.map +0 -1
  334. package/dist/euler-angles.js +0 -35
  335. package/dist/euler-angles.js.map +0 -1
  336. package/dist/geometry-vectors.d.ts +0 -11
  337. package/dist/geometry-vectors.d.ts.map +0 -1
  338. package/dist/geometry-vectors.js +0 -19
  339. package/dist/geometry-vectors.js.map +0 -1
  340. package/dist/mesh3.d.ts +0 -32
  341. package/dist/mesh3.d.ts.map +0 -1
  342. package/dist/mesh3.js +0 -142
  343. package/dist/mesh3.js.map +0 -1
  344. package/dist/point2.d.ts +0 -41
  345. package/dist/point2.d.ts.map +0 -1
  346. package/dist/point2.js +0 -92
  347. package/dist/point2.js.map +0 -1
  348. package/dist/point3.d.ts +0 -43
  349. package/dist/point3.d.ts.map +0 -1
  350. package/dist/point3.js +0 -103
  351. package/dist/point3.js.map +0 -1
  352. package/dist/point4.d.ts +0 -12
  353. package/dist/point4.d.ts.map +0 -1
  354. package/dist/point4.js +0 -28
  355. package/dist/point4.js.map +0 -1
  356. package/dist/rect2.d.ts +0 -54
  357. package/dist/rect2.d.ts.map +0 -1
  358. package/dist/rect2.js +0 -149
  359. package/dist/rect2.js.map +0 -1
  360. package/dist/size2.d.ts +0 -33
  361. package/dist/size2.d.ts.map +0 -1
  362. package/dist/size2.js +0 -81
  363. package/dist/size2.js.map +0 -1
  364. package/dist/size3.d.ts +0 -21
  365. package/dist/size3.d.ts.map +0 -1
  366. package/dist/size3.js +0 -59
  367. package/dist/size3.js.map +0 -1
  368. package/dist/size4.d.ts +0 -10
  369. package/dist/size4.d.ts.map +0 -1
  370. package/dist/size4.js +0 -16
  371. package/dist/size4.js.map +0 -1
package/dist/ray3.js CHANGED
@@ -1,81 +1,250 @@
1
- import { vec3Dot, vec3Normalize } from "@ac-kit/math-linear";
2
- import { diffOfProducts } from "@ac-kit/math-scalar";
1
+ import { intersectBox_, intersectSphere_ } from "./_ray3-intersect.js";
3
2
  import { geometryConfig } from "./globals.js";
4
- import { point3Distance } from "./point3.js";
5
- /** Returns the point along the ray at parameter `t` (origin + direction * t). */
6
- export function ray3At(ray, t) {
7
- return {
8
- x: ray.origin.x + ray.direction[0] * t,
9
- y: ray.origin.y + ray.direction[1] * t,
10
- z: ray.origin.z + ray.direction[2] * t,
11
- };
3
+ /** Writes the point `origin + t · direction` into `out`. */
4
+ export function ray3At(out, ray, t) {
5
+ out[0] = ray[0] + ray[3] * t;
6
+ out[1] = ray[1] + ray[4] * t;
7
+ out[2] = ray[2] + ray[5] * t;
8
+ return out;
12
9
  }
13
- /** Returns the closest point on the ray (t >= 0) to `p`. */
14
- export function ray3ClosestPoint(ray, p) {
15
- const d = vec3Normalize(ray.direction);
16
- const v = [p.x - ray.origin.x, p.y - ray.origin.y, p.z - ray.origin.z];
17
- const t = Math.max(0, vec3Dot(v, d));
18
- return {
19
- x: ray.origin.x + d[0] * t,
20
- y: ray.origin.y + d[1] * t,
21
- z: ray.origin.z + d[2] * t,
22
- };
10
+ /**
11
+ * The parameter `t ≥ 0`, in units of the direction's length, of the point of
12
+ * the ray nearest to `point`; a zero direction gives `0`.
13
+ */
14
+ export function ray3ClosestParameter(ray, point) {
15
+ const lengthSquared = ray[3] * ray[3] + ray[4] * ray[4] + ray[5] * ray[5];
16
+ if (lengthSquared === 0) {
17
+ return 0;
18
+ }
19
+ const t = ((point[0] - ray[0]) * ray[3] +
20
+ (point[1] - ray[1]) * ray[4] +
21
+ (point[2] - ray[2]) * ray[5]) /
22
+ lengthSquared;
23
+ return t < 0 ? 0 : t;
23
24
  }
24
- export function ray3DistanceToPoint(ray, p) {
25
- return point3Distance(ray3ClosestPoint(ray, p), p);
25
+ /** Writes the point of the ray nearest to `point` into `out`. */
26
+ export function ray3ClosestPoint(out, ray, point) {
27
+ const t = ray3ClosestParameter(ray, point);
28
+ out[0] = ray[0] + ray[3] * t;
29
+ out[1] = ray[1] + ray[4] * t;
30
+ out[2] = ray[2] + ray[5] * t;
31
+ return out;
26
32
  }
27
- /** Exact equality of origin and direction. */
28
- export function ray3Equals(a, b) {
29
- return (a.origin.x === b.origin.x &&
30
- a.origin.y === b.origin.y &&
31
- a.origin.z === b.origin.z &&
32
- a.direction[0] === b.direction[0] &&
33
- a.direction[1] === b.direction[1] &&
34
- a.direction[2] === b.direction[2]);
33
+ /** The distance from `point` to the ray. */
34
+ export function ray3DistanceToPoint(ray, point) {
35
+ const t = ray3ClosestParameter(ray, point);
36
+ const dx = point[0] - (ray[0] + ray[3] * t);
37
+ const dy = point[1] - (ray[1] + ray[4] * t);
38
+ const dz = point[2] - (ray[2] + ray[5] * t);
39
+ return Math.sqrt(dx * dx + dy * dy + dz * dz);
35
40
  }
36
41
  /**
37
- * Returns the intersection point of the ray with the plane, or `null` if
38
- * parallel or behind the ray.
42
+ * Writes the ray that starts at `ray`'s point at parameter `t` and keeps its
43
+ * direction into `out`. `out` may be `ray`.
44
+ */
45
+ export function ray3Recast(out, ray, t) {
46
+ const directionX = ray[3];
47
+ const directionY = ray[4];
48
+ const directionZ = ray[5];
49
+ out[0] = ray[0] + directionX * t;
50
+ out[1] = ray[1] + directionY * t;
51
+ out[2] = ray[2] + directionZ * t;
52
+ out[3] = directionX;
53
+ out[4] = directionY;
54
+ out[5] = directionZ;
55
+ return out;
56
+ }
57
+ /**
58
+ * The parameter `t ≥ 0` at which the ray crosses the plane, `Infinity` for a
59
+ * miss: parallel (`|n · d| ≤ tolerance · |n| · |d|`, a ray lying in the plane
60
+ * included) or pointing away from it. The point is {@link ray3At}.
39
61
  *
40
- * @param tolerance - Dimensionless bound on the dot product of the ray
41
- * direction and the plane normal, below which the two count as parallel. Both
42
- * are unit-length, so the raw dot product is already scale-free.
62
+ * @param tolerance Dimensionless bound on the sine of the angle between the ray
63
+ * and the plane; defaults to `geometryConfig.defaultAngularTolerance`.
64
+ */
65
+ export function ray3IntersectPlane3(ray, plane, tolerance = geometryConfig.defaultAngularTolerance) {
66
+ const rate = plane[0] * ray[3] + plane[1] * ray[4] + plane[2] * ray[5];
67
+ const scale = Math.sqrt(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]) *
68
+ Math.sqrt(ray[3] * ray[3] + ray[4] * ray[4] + ray[5] * ray[5]);
69
+ if (Math.abs(rate) <= tolerance * scale) {
70
+ return Number.POSITIVE_INFINITY;
71
+ }
72
+ const t = -(plane[0] * ray[0] + plane[1] * ray[1] + plane[2] * ray[2] + plane[3]) /
73
+ rate;
74
+ return t < 0 ? Number.POSITIVE_INFINITY : t;
75
+ }
76
+ /**
77
+ * The parameter `t ≥ 0` of the nearest hit of the ray with the ball, `Infinity`
78
+ * for a miss or a negative radius; an origin inside gives the far side. A zero
79
+ * direction gives `NaN`.
80
+ */
81
+ export function ray3IntersectSphere3(ray, sphere) {
82
+ return intersectSphere_(ray[0], ray[1], ray[2], ray[3], ray[4], ray[5], sphere[0], sphere[1], sphere[2], sphere[3]);
83
+ }
84
+ /**
85
+ * The parameter `t ≥ 0` of the nearest hit of the ray with the box (slab test):
86
+ * `0` for an origin inside, `Infinity` for a miss or an empty box.
43
87
  */
44
- export function ray3IntersectPlane(ray, plane, tolerance = geometryConfig.defaultAngularTolerance) {
45
- const d = vec3Dot(ray.direction, plane.normal);
46
- if (Math.abs(d) <= tolerance) {
47
- return null; // ray is parallel to plane
88
+ export function ray3IntersectBox3(ray, box) {
89
+ return intersectBox_(ray[0], ray[1], ray[2], ray[3], ray[4], ray[5], box[0], box[1], box[2], box[3], box[4], box[5]);
90
+ }
91
+ /**
92
+ * Möller–Trumbore: the parameter `t ≥ 0` at which the ray crosses the triangle,
93
+ * `Infinity` for a miss. On a hit `out` holds the barycentric coordinates `[u,
94
+ * v]` of the point (`a·(1 − u − v) + b·u + c·v`); on a miss `NaN`. A triangle
95
+ * seen from behind (its counter-clockwise normal pointing away from the ray) is
96
+ * a miss when `cullBackFaces` is set. A ray parallel to the triangle is a
97
+ * miss.
98
+ */
99
+ export function ray3IntersectTriangle3(out, ray, triangle, cullBackFaces) {
100
+ const edge1X = triangle[3] - triangle[0];
101
+ const edge1Y = triangle[4] - triangle[1];
102
+ const edge1Z = triangle[5] - triangle[2];
103
+ const edge2X = triangle[6] - triangle[0];
104
+ const edge2Y = triangle[7] - triangle[1];
105
+ const edge2Z = triangle[8] - triangle[2];
106
+ const directionX = ray[3];
107
+ const directionY = ray[4];
108
+ const directionZ = ray[5];
109
+ const pX = directionY * edge2Z - directionZ * edge2Y;
110
+ const pY = directionZ * edge2X - directionX * edge2Z;
111
+ const pZ = directionX * edge2Y - directionY * edge2X;
112
+ const determinant = edge1X * pX + edge1Y * pY + edge1Z * pZ;
113
+ if (cullBackFaces ? !(determinant > 0) : determinant === 0) {
114
+ return miss_(out);
115
+ }
116
+ const inverse = 1 / determinant;
117
+ const fromX = ray[0] - triangle[0];
118
+ const fromY = ray[1] - triangle[1];
119
+ const fromZ = ray[2] - triangle[2];
120
+ const u = (fromX * pX + fromY * pY + fromZ * pZ) * inverse;
121
+ if (!(u >= 0 && u <= 1)) {
122
+ return miss_(out);
48
123
  }
49
- const t = (plane.distance -
50
- vec3Dot(plane.normal, [ray.origin.x, ray.origin.y, ray.origin.z])) /
51
- d;
52
- if (t < 0) {
53
- return null; // intersection is behind the ray
124
+ const qX = fromY * edge1Z - fromZ * edge1Y;
125
+ const qY = fromZ * edge1X - fromX * edge1Z;
126
+ const qZ = fromX * edge1Y - fromY * edge1X;
127
+ const v = (directionX * qX + directionY * qY + directionZ * qZ) * inverse;
128
+ if (!(v >= 0 && u + v <= 1)) {
129
+ return miss_(out);
54
130
  }
55
- return ray3At(ray, t);
131
+ const t = (edge2X * qX + edge2Y * qY + edge2Z * qZ) * inverse;
132
+ if (!(t >= 0)) {
133
+ return miss_(out);
134
+ }
135
+ out[0] = u;
136
+ out[1] = v;
137
+ return t;
138
+ }
139
+ function miss_(out) {
140
+ out[0] = Number.NaN;
141
+ out[1] = Number.NaN;
142
+ return Number.POSITIVE_INFINITY;
56
143
  }
57
144
  /**
58
- * Returns the first intersection point of the ray with the sphere (nearest to
59
- * origin), or `null` if no intersection.
145
+ * Writes the ray moved by `transform` into `out`: the origin as a point, the
146
+ * direction as a vector (the translation does not apply, and the length scales
147
+ * with the transform, so a `t` along the result is a `t` along the input).
148
+ * `out` may be `ray`.
60
149
  */
61
- export function ray3IntersectSphere(ray, sphere) {
62
- const d = ray.direction;
63
- const oc = [
64
- ray.origin.x - sphere.center[0],
65
- ray.origin.y - sphere.center[1],
66
- ray.origin.z - sphere.center[2],
67
- ];
68
- const a = vec3Dot(d, d);
69
- const b = 2 * vec3Dot(oc, d);
70
- const c = vec3Dot(oc, oc) - sphere.radius * sphere.radius;
71
- const discriminant = diffOfProducts(b, b, 4 * a, c);
72
- if (discriminant < 0) {
73
- return null;
150
+ export function ray3TransformAffine3(out, ray, transform) {
151
+ const x = ray[0];
152
+ const y = ray[1];
153
+ const z = ray[2];
154
+ const dx = ray[3];
155
+ const dy = ray[4];
156
+ const dz = ray[5];
157
+ out[0] =
158
+ transform[0] * x + transform[3] * y + transform[6] * z + transform[9];
159
+ out[1] =
160
+ transform[1] * x + transform[4] * y + transform[7] * z + transform[10];
161
+ out[2] =
162
+ transform[2] * x + transform[5] * y + transform[8] * z + transform[11];
163
+ out[3] = transform[0] * dx + transform[3] * dy + transform[6] * dz;
164
+ out[4] = transform[1] * dx + transform[4] * dy + transform[7] * dz;
165
+ out[5] = transform[2] * dx + transform[5] * dy + transform[8] * dz;
166
+ return out;
167
+ }
168
+ /**
169
+ * Writes the picking ray through the pixel `(x, y)` into `out`: the origin is
170
+ * the point unprojected at the near plane's depth of `depthRange` (`0` for
171
+ * `"zero-to-one"`, `−1` for `"negative-one-to-one"`, `1` for `"one-to-zero"`),
172
+ * the direction points toward the far plane's depth and is a unit vector. Both
173
+ * unproject in homogeneous coordinates, so an infinite far plane (`w = 0`
174
+ * there) still gives a finite direction in all three ranges.
175
+ *
176
+ * `depthRange` must be the projection's own: with a reversed infinite
177
+ * projection, `"zero-to-one"` would unproject the origin at infinity. A
178
+ * non-finite origin or direction (a singular matrix, an eye-plane origin, a
179
+ * zero-size viewport) writes `NaN` into every component of `out`: nothing
180
+ * throws.
181
+ *
182
+ * @param inverseViewProjection `mat4x4Invert` of the view-projection.
183
+ * @param viewport The render target in pixels, origin top-left, y down.
184
+ */
185
+ export function ray3FromViewport(out, x, y, inverseViewProjection, viewport, depthRange) {
186
+ const ndcX = ((x - viewport[0]) / viewport[2]) * 2 - 1;
187
+ const ndcY = 1 - ((y - viewport[1]) / viewport[3]) * 2;
188
+ let nearDepth = 0;
189
+ let farDepth = 1;
190
+ if (depthRange === "negative-one-to-one") {
191
+ nearDepth = -1;
192
+ }
193
+ else if (depthRange === "one-to-zero") {
194
+ nearDepth = 1;
195
+ farDepth = 0;
196
+ }
197
+ const m = inverseViewProjection;
198
+ const baseX = m[0] * ndcX + m[4] * ndcY + m[12];
199
+ const baseY = m[1] * ndcX + m[5] * ndcY + m[13];
200
+ const baseZ = m[2] * ndcX + m[6] * ndcY + m[14];
201
+ const baseW = m[3] * ndcX + m[7] * ndcY + m[15];
202
+ const nearX = baseX + m[8] * nearDepth;
203
+ const nearY = baseY + m[9] * nearDepth;
204
+ const nearZ = baseZ + m[10] * nearDepth;
205
+ const nearW = baseW + m[11] * nearDepth;
206
+ const farX = baseX + m[8] * farDepth;
207
+ const farY = baseY + m[9] * farDepth;
208
+ const farZ = baseZ + m[10] * farDepth;
209
+ const farW = baseW + m[11] * farDepth;
210
+ // The direction from the near to the far point, scaled by the product of
211
+ // their weights (positive for points in front of the eye), which stays
212
+ // finite when the far weight is zero.
213
+ const directionX = farX * nearW - nearX * farW;
214
+ const directionY = farY * nearW - nearY * farW;
215
+ const directionZ = farZ * nearW - nearZ * farW;
216
+ const scale = Math.max(Math.abs(directionX), Math.abs(directionY), Math.abs(directionZ));
217
+ const scaledX = directionX / scale;
218
+ const scaledY = directionY / scale;
219
+ const scaledZ = directionZ / scale;
220
+ const length = Math.sqrt(scaledX * scaledX + scaledY * scaledY + scaledZ * scaledZ);
221
+ const originX = nearX / nearW;
222
+ const originY = nearY / nearW;
223
+ const originZ = nearZ / nearW;
224
+ const unitX = scaledX / length;
225
+ const unitY = scaledY / length;
226
+ const unitZ = scaledZ / length;
227
+ if (Number.isFinite(originX) &&
228
+ Number.isFinite(originY) &&
229
+ Number.isFinite(originZ) &&
230
+ Number.isFinite(unitX) &&
231
+ Number.isFinite(unitY) &&
232
+ Number.isFinite(unitZ)) {
233
+ out[0] = originX;
234
+ out[1] = originY;
235
+ out[2] = originZ;
236
+ out[3] = unitX;
237
+ out[4] = unitY;
238
+ out[5] = unitZ;
74
239
  }
75
- const t = (-b - Math.sqrt(discriminant)) / (2 * a);
76
- if (t < 0) {
77
- return null;
240
+ else {
241
+ out[0] = Number.NaN;
242
+ out[1] = Number.NaN;
243
+ out[2] = Number.NaN;
244
+ out[3] = Number.NaN;
245
+ out[4] = Number.NaN;
246
+ out[5] = Number.NaN;
78
247
  }
79
- return ray3At(ray, t);
248
+ return out;
80
249
  }
81
250
  //# sourceMappingURL=ray3.js.map
package/dist/ray3.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ray3.js","sourceRoot":"","sources":["../src/ray3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAU,cAAc,EAAE,MAAM,aAAa,CAAC;AAQrD,iFAAiF;AACjF,MAAM,UAAU,MAAM,CAAC,GAAS,EAAE,CAAS;IAC1C,OAAO;QACN,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,C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AAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,80 @@
1
+ import type { Brand_ } from "./_brand.js";
2
+ /**
3
+ * A segment in the plane: its start point then its end point.
4
+ *
5
+ * A plain array of 4 binary64 numbers carrying a type-level brand, holding
6
+ * exactly the numbers one element of the matching bulk buffer holds, in the
7
+ * same order.
8
+ *
9
+ * Only {@link segment2Create}, {@link segment2Of}, {@link segment2Clone},
10
+ * {@link segment2FromArray} and the functions that write an `out` make one; see
11
+ * `Vec3` in `@ac-kit/math-linear` for the rules that bind callers who bypass
12
+ * the types.
13
+ */
14
+ export type Segment2 = [aX: number, aY: number, bX: number, bY: number] & Brand_<"Segment2">;
15
+ /** A {@link Segment2} that is only read. */
16
+ export type ReadonlySegment2 = readonly [
17
+ aX: number,
18
+ aY: number,
19
+ bX: number,
20
+ bY: number
21
+ ] & Brand_<"Segment2">;
22
+ /**
23
+ * Creates the zero-length segment at the origin.
24
+ *
25
+ * Allocates; keep it out of hot loops.
26
+ */
27
+ export declare function segment2Create(): Segment2;
28
+ /**
29
+ * Creates the segment with the components `aX, aY, bX, bY`, in storage order.
30
+ *
31
+ * Allocates; keep it out of hot loops.
32
+ */
33
+ export declare function segment2Of(aX: number, aY: number, bX: number, bY: number): Segment2;
34
+ /**
35
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
36
+ *
37
+ * Allocates; keep it out of hot loops.
38
+ */
39
+ export declare function segment2Clone(a: ReadonlySegment2): Segment2;
40
+ /** Writes the components, in storage order, into `out`. */
41
+ export declare function segment2Set(out: Segment2, aX: number, aY: number, bX: number, bY: number): Segment2;
42
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
43
+ export declare function segment2Copy(out: Segment2, a: ReadonlySegment2): Segment2;
44
+ /**
45
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
46
+ * included, and an infinity equals itself. See {@link segment2IsClose} for a
47
+ * tolerant test.
48
+ */
49
+ export declare function segment2Equals(a: ReadonlySegment2, b: ReadonlySegment2): boolean;
50
+ /**
51
+ * Component-wise approximate equality: every pair differs by at most
52
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
53
+ * close only to itself. Not transitive, so never a basis for ordering or a
54
+ * container key: use {@link segment2Equals} there.
55
+ *
56
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
57
+ */
58
+ export declare function segment2IsClose(a: ReadonlySegment2, b: ReadonlySegment2, tolerance?: number): boolean;
59
+ /**
60
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
61
+ * origin): `source[offset … offset + 4)` copied into `out`, each element that
62
+ * is not a number written as `NaN`, an index past the end of `source` too, so
63
+ * `out` never holds a non-number. A cold path: buffers use {@link segment2Load}.
64
+ * O(1).
65
+ *
66
+ * `source` may be `out` itself: the 4 elements are read before the first write.
67
+ *
68
+ * @param out The segment to fill.
69
+ * @param source The array to read, of any length and any content.
70
+ * @param offset The index of the first component in `source`.
71
+ * @returns `out`.
72
+ */
73
+ export declare function segment2FromArray(out: Segment2, source: ArrayLike<number>, offset?: number): Segment2;
74
+ /**
75
+ * Whether every component is a finite number: the check to run after parsing
76
+ * untrusted data or before an upload, as operations never check. A component
77
+ * that is not a number at all counts as not finite.
78
+ */
79
+ export declare function segment2IsFinite(value: ReadonlySegment2): boolean;
80
+ //# sourceMappingURL=segment2-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment2-record.d.ts","sourceRoot":"","sources":["../src/segment2-record.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GACtE,MAAM,CAAC,UAAU,CAAC,CAAC;AAEpB,4CAA4C;AAC5C,MAAM,MAAM,gBAAgB,GAAG,SAAS;IACvC,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;CACV,GACA,MAAM,CAAC,UAAU,CAAC,CAAC;AAQpB;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAOzC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACzB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACR,QAAQ,CAOV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,gBAAgB,GAAG,QAAQ,CAO3D;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAC1B,GAAG,EAAE,QAAQ,EACb,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACR,QAAQ,CAMV;AAED,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,gBAAgB,GAAG,QAAQ,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,CAAC,EAAE,gBAAgB,EACnB,CAAC,EAAE,gBAAgB,GACjB,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,CAAC,EAAE,gBAAgB,EACnB,CAAC,EAAE,gBAAgB,EACnB,SAAS,GAAE,MAA8C,GACvD,OAAO,CAOT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EACzB,MAAM,SAAI,GACR,QAAQ,CAUV;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAOjE"}
@@ -0,0 +1,122 @@
1
+ // Generated from scripts/templates/record.liquid by scripts/generate-records.ts. Do not edit.
2
+ import { isCloseAbsolute, numberAtOrNaN } from "@ac-kit/core";
3
+ import { geometryConfig } from "./globals.js";
4
+ /**
5
+ * Every creator copies this array, which holds non-integer doubles and is never
6
+ * exposed: nothing a caller does can change the element kind it copies.
7
+ */
8
+ const TEMPLATE_ = [0.5, 0.5, 0.5, 0.5];
9
+ /**
10
+ * Creates the zero-length segment at the origin.
11
+ *
12
+ * Allocates; keep it out of hot loops.
13
+ */
14
+ export function segment2Create() {
15
+ const out = TEMPLATE_.slice();
16
+ out[0] = 0;
17
+ out[1] = 0;
18
+ out[2] = 0;
19
+ out[3] = 0;
20
+ return out;
21
+ }
22
+ /**
23
+ * Creates the segment with the components `aX, aY, bX, bY`, in storage order.
24
+ *
25
+ * Allocates; keep it out of hot loops.
26
+ */
27
+ export function segment2Of(aX, aY, bX, bY) {
28
+ const out = TEMPLATE_.slice();
29
+ out[0] = aX;
30
+ out[1] = aY;
31
+ out[2] = bX;
32
+ out[3] = bY;
33
+ return out;
34
+ }
35
+ /**
36
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
37
+ *
38
+ * Allocates; keep it out of hot loops.
39
+ */
40
+ export function segment2Clone(a) {
41
+ const out = TEMPLATE_.slice();
42
+ out[0] = a[0];
43
+ out[1] = a[1];
44
+ out[2] = a[2];
45
+ out[3] = a[3];
46
+ return out;
47
+ }
48
+ /** Writes the components, in storage order, into `out`. */
49
+ export function segment2Set(out, aX, aY, bX, bY) {
50
+ out[0] = aX;
51
+ out[1] = aY;
52
+ out[2] = bX;
53
+ out[3] = bY;
54
+ return out;
55
+ }
56
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
57
+ export function segment2Copy(out, a) {
58
+ out[0] = a[0];
59
+ out[1] = a[1];
60
+ out[2] = a[2];
61
+ out[3] = a[3];
62
+ return out;
63
+ }
64
+ /**
65
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
66
+ * included, and an infinity equals itself. See {@link segment2IsClose} for a
67
+ * tolerant test.
68
+ */
69
+ export function segment2Equals(a, b) {
70
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];
71
+ }
72
+ /**
73
+ * Component-wise approximate equality: every pair differs by at most
74
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
75
+ * close only to itself. Not transitive, so never a basis for ordering or a
76
+ * container key: use {@link segment2Equals} there.
77
+ *
78
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
79
+ */
80
+ export function segment2IsClose(a, b, tolerance = geometryConfig.defaultLinearTolerance) {
81
+ return (isCloseAbsolute(a[0], b[0], tolerance) &&
82
+ isCloseAbsolute(a[1], b[1], tolerance) &&
83
+ isCloseAbsolute(a[2], b[2], tolerance) &&
84
+ isCloseAbsolute(a[3], b[3], tolerance));
85
+ }
86
+ /**
87
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
88
+ * origin): `source[offset … offset + 4)` copied into `out`, each element that
89
+ * is not a number written as `NaN`, an index past the end of `source` too, so
90
+ * `out` never holds a non-number. A cold path: buffers use {@link segment2Load}.
91
+ * O(1).
92
+ *
93
+ * `source` may be `out` itself: the 4 elements are read before the first write.
94
+ *
95
+ * @param out The segment to fill.
96
+ * @param source The array to read, of any length and any content.
97
+ * @param offset The index of the first component in `source`.
98
+ * @returns `out`.
99
+ */
100
+ export function segment2FromArray(out, source, offset = 0) {
101
+ const value0 = numberAtOrNaN(source, offset);
102
+ const value1 = numberAtOrNaN(source, offset + 1);
103
+ const value2 = numberAtOrNaN(source, offset + 2);
104
+ const value3 = numberAtOrNaN(source, offset + 3);
105
+ out[0] = value0;
106
+ out[1] = value1;
107
+ out[2] = value2;
108
+ out[3] = value3;
109
+ return out;
110
+ }
111
+ /**
112
+ * Whether every component is a finite number: the check to run after parsing
113
+ * untrusted data or before an upload, as operations never check. A component
114
+ * that is not a number at all counts as not finite.
115
+ */
116
+ export function segment2IsFinite(value) {
117
+ return (Number.isFinite(value[0]) &&
118
+ Number.isFinite(value[1]) &&
119
+ Number.isFinite(value[2]) &&
120
+ Number.isFinite(value[3]));
121
+ }
122
+ //# sourceMappingURL=segment2-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment2-record.js","sourceRoot":"","sources":["../src/segment2-record.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA0B9C;;;GAGG;AACH,MAAM,SAAS,GAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC7B,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAc,CAAC;IAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACzB,EAAU,EACV,EAAU,EACV,EAAU,EACV,EAAU;IAEV,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAc,CAAC;IAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACZ,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACZ,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACZ,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACZ,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,CAAmB;IAChD,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAc,CAAC;IAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACd,GAA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AAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC;AACH,CAAC"}
@@ -1,24 +1,39 @@
1
- import { Point2 } from "./point2.js";
2
- export type Segment2 = {
3
- a: Point2;
4
- b: Point2;
5
- };
6
- /** Returns the closest point on the segment to `p`. */
7
- export declare function segment2ClosestPoint(seg: Segment2, p: Point2): Point2;
8
- export declare function segment2DistanceToPoint(seg: Segment2, p: Point2): number;
9
- export declare function segment2Equals(a: Segment2, b: Segment2): boolean;
1
+ import type { ReadonlyVec2, Vec2 } from "@ac-kit/math-linear";
2
+ import type { ReadonlySegment2 } from "./segment2-record.js";
3
+ /** The length of the segment. */
4
+ export declare function segment2Length(segment: ReadonlySegment2): number;
5
+ /** The squared length of the segment: no square root. */
6
+ export declare function segment2LengthSquared(segment: ReadonlySegment2): number;
7
+ /** Writes the midpoint of the segment into `out`. */
8
+ export declare function segment2Midpoint(out: Vec2, segment: ReadonlySegment2): Vec2;
10
9
  /**
11
- * Returns the intersection point of two line segments, or `null` if they do not
12
- * intersect.
10
+ * Writes the point at parameter `t` into `out`: the start at `0`, the end at
11
+ * `1`; outside `[0, 1]` the supporting line is extrapolated.
12
+ */
13
+ export declare function segment2PointAt(out: Vec2, segment: ReadonlySegment2, t: number): Vec2;
14
+ /**
15
+ * The parameter, in `[0, 1]`, of the point of the segment nearest to `point`; a
16
+ * zero-length segment gives `0`.
17
+ */
18
+ export declare function segment2ClosestParameter(segment: ReadonlySegment2, point: ReadonlyVec2): number;
19
+ /** Writes the point of the segment nearest to `point` into `out`. */
20
+ export declare function segment2ClosestPoint(out: Vec2, segment: ReadonlySegment2, point: ReadonlyVec2): Vec2;
21
+ /** The squared distance from `point` to the segment. */
22
+ export declare function segment2DistanceSquaredToPoint(segment: ReadonlySegment2, point: ReadonlyVec2): number;
23
+ /** The distance from `point` to the segment. */
24
+ export declare function segment2DistanceToPoint(segment: ReadonlySegment2, point: ReadonlyVec2): number;
25
+ /**
26
+ * Whether the two segments cross, and where: on `true`, `out` holds the
27
+ * parameters `[s, t]` of the crossing along `a` and along `b`, each in `[0,
28
+ * 1]`. On `false` (parallel, collinear, or the lines cross outside either
29
+ * segment) `out` holds `NaN`, never a stale value.
13
30
  *
14
- * The parallel test scales the cross product by both segment lengths, so it is
15
- * an angular threshold rather than a raw one — rescaling either segment leaves
16
- * the answer unchanged, which a bare bound on `denom` would not.
31
+ * The parallel test is scale-free: the segments count as parallel when `|d₁ ×
32
+ * d₂| ≤ tolerance · |d₁| · |d₂|`, so a zero-length segment is parallel to
33
+ * everything.
17
34
  *
18
- * @param tolerance - Dimensionless bound on `sin` of the angle between the two
19
- * segments, below which they count as parallel.
35
+ * @param tolerance Dimensionless bound on the sine of the angle between the
36
+ * segments; defaults to `geometryConfig.defaultAngularTolerance`.
20
37
  */
21
- export declare function segment2Intersect(a: Segment2, b: Segment2, tolerance?: number): Point2 | null;
22
- export declare function segment2Length(seg: Segment2): number;
23
- export declare function segment2Midpoint(seg: Segment2): Point2;
38
+ export declare function segment2IntersectSegment2(out: Vec2, a: ReadonlySegment2, b: ReadonlySegment2, tolerance?: number): boolean;
24
39
  //# sourceMappingURL=segment2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment2.d.ts","sourceRoot":"","sources":["../src/segment2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAgC,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAarE;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