@math.gl/geometry 5.0.0-alpha.2 → 5.0.0-alpha.20

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 (381) hide show
  1. package/LICENSE +97 -49
  2. package/README.md +16 -1
  3. package/THIRD-PARTY-NOTICES.md +18 -0
  4. package/dist/culling/constants.d.ts +3 -0
  5. package/dist/culling/constants.d.ts.map +1 -0
  6. package/dist/culling/constants.js +5 -0
  7. package/dist/culling/constants.js.map +1 -0
  8. package/dist/culling/index.cjs +2014 -0
  9. package/dist/culling/index.cjs.map +6 -0
  10. package/dist/culling/index.d.ts +29 -0
  11. package/dist/culling/index.d.ts.map +1 -0
  12. package/dist/culling/index.js +23 -0
  13. package/dist/culling/index.js.map +1 -0
  14. package/dist/culling/lib/algorithms/bounding-box-from-points.d.ts +15 -0
  15. package/dist/culling/lib/algorithms/bounding-box-from-points.d.ts.map +1 -0
  16. package/dist/culling/lib/algorithms/bounding-box-from-points.js +137 -0
  17. package/dist/culling/lib/algorithms/bounding-box-from-points.js.map +1 -0
  18. package/dist/culling/lib/algorithms/bounding-sphere-from-points.d.ts +14 -0
  19. package/dist/culling/lib/algorithms/bounding-sphere-from-points.d.ts.map +1 -0
  20. package/dist/culling/lib/algorithms/bounding-sphere-from-points.js +146 -0
  21. package/dist/culling/lib/algorithms/bounding-sphere-from-points.js.map +1 -0
  22. package/dist/culling/lib/algorithms/compute-eigen-decomposition.d.ts +37 -0
  23. package/dist/culling/lib/algorithms/compute-eigen-decomposition.d.ts.map +1 -0
  24. package/dist/culling/lib/algorithms/compute-eigen-decomposition.js +137 -0
  25. package/dist/culling/lib/algorithms/compute-eigen-decomposition.js.map +1 -0
  26. package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.d.ts +7 -0
  27. package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.d.ts.map +1 -0
  28. package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.js +26 -0
  29. package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.js.map +1 -0
  30. package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +56 -0
  31. package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.d.ts.map +1 -0
  32. package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.js +116 -0
  33. package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.js.map +1 -0
  34. package/dist/culling/lib/bounding-volumes/bounding-sphere.d.ts +40 -0
  35. package/dist/culling/lib/bounding-volumes/bounding-sphere.d.ts.map +1 -0
  36. package/dist/culling/lib/bounding-volumes/bounding-sphere.js +123 -0
  37. package/dist/culling/lib/bounding-volumes/bounding-sphere.js.map +1 -0
  38. package/dist/culling/lib/bounding-volumes/bounding-volume.d.ts +30 -0
  39. package/dist/culling/lib/bounding-volumes/bounding-volume.d.ts.map +1 -0
  40. package/dist/culling/lib/bounding-volumes/bounding-volume.js +7 -0
  41. package/dist/culling/lib/bounding-volumes/bounding-volume.js.map +1 -0
  42. package/dist/culling/lib/bounding-volumes/oriented-bounding-box.d.ts +62 -0
  43. package/dist/culling/lib/bounding-volumes/oriented-bounding-box.d.ts.map +1 -0
  44. package/dist/culling/lib/bounding-volumes/oriented-bounding-box.js +230 -0
  45. package/dist/culling/lib/bounding-volumes/oriented-bounding-box.js.map +1 -0
  46. package/dist/culling/lib/culling-volume.d.ts +46 -0
  47. package/dist/culling/lib/culling-volume.d.ts.map +1 -0
  48. package/dist/culling/lib/culling-volume.js +126 -0
  49. package/dist/culling/lib/culling-volume.js.map +1 -0
  50. package/dist/culling/lib/perspective-frustum.d.ts +153 -0
  51. package/dist/culling/lib/perspective-frustum.d.ts.map +1 -0
  52. package/dist/culling/lib/perspective-frustum.js +191 -0
  53. package/dist/culling/lib/perspective-frustum.js.map +1 -0
  54. package/dist/culling/lib/perspective-off-center-frustum.d.ts +158 -0
  55. package/dist/culling/lib/perspective-off-center-frustum.d.ts.map +1 -0
  56. package/dist/culling/lib/perspective-off-center-frustum.js +276 -0
  57. package/dist/culling/lib/perspective-off-center-frustum.js.map +1 -0
  58. package/dist/culling/lib/plane.d.ts +35 -0
  59. package/dist/culling/lib/plane.d.ts.map +1 -0
  60. package/dist/culling/lib/plane.js +90 -0
  61. package/dist/culling/lib/plane.js.map +1 -0
  62. package/dist/culling/lib/ray.d.ts +13 -0
  63. package/dist/culling/lib/ray.d.ts.map +1 -0
  64. package/dist/culling/lib/ray.js +30 -0
  65. package/dist/culling/lib/ray.js.map +1 -0
  66. package/dist/culling/lib/shapes/box-shape.d.ts +19 -0
  67. package/dist/culling/lib/shapes/box-shape.d.ts.map +1 -0
  68. package/dist/culling/lib/shapes/box-shape.js +69 -0
  69. package/dist/culling/lib/shapes/box-shape.js.map +1 -0
  70. package/dist/culling/lib/shapes/capsule-shape.d.ts +23 -0
  71. package/dist/culling/lib/shapes/capsule-shape.d.ts.map +1 -0
  72. package/dist/culling/lib/shapes/capsule-shape.js +151 -0
  73. package/dist/culling/lib/shapes/capsule-shape.js.map +1 -0
  74. package/dist/culling/lib/shapes/cylinder-shape.d.ts +22 -0
  75. package/dist/culling/lib/shapes/cylinder-shape.d.ts.map +1 -0
  76. package/dist/culling/lib/shapes/cylinder-shape.js +99 -0
  77. package/dist/culling/lib/shapes/cylinder-shape.js.map +1 -0
  78. package/dist/culling/lib/shapes/implicit-shape.d.ts +56 -0
  79. package/dist/culling/lib/shapes/implicit-shape.d.ts.map +1 -0
  80. package/dist/culling/lib/shapes/implicit-shape.js +142 -0
  81. package/dist/culling/lib/shapes/implicit-shape.js.map +1 -0
  82. package/dist/culling/lib/shapes/plane-shape.d.ts +27 -0
  83. package/dist/culling/lib/shapes/plane-shape.d.ts.map +1 -0
  84. package/dist/culling/lib/shapes/plane-shape.js +71 -0
  85. package/dist/culling/lib/shapes/plane-shape.js.map +1 -0
  86. package/dist/culling/lib/shapes/sphere-shape.d.ts +18 -0
  87. package/dist/culling/lib/shapes/sphere-shape.d.ts.map +1 -0
  88. package/dist/culling/lib/shapes/sphere-shape.js +43 -0
  89. package/dist/culling/lib/shapes/sphere-shape.js.map +1 -0
  90. package/dist/culling/oriented-box-2d.cjs +73 -0
  91. package/dist/culling/oriented-box-2d.cjs.map +6 -0
  92. package/dist/culling/oriented-box-2d.d.ts +22 -0
  93. package/dist/culling/oriented-box-2d.d.ts.map +1 -0
  94. package/dist/culling/oriented-box-2d.js +86 -0
  95. package/dist/culling/oriented-box-2d.js.map +1 -0
  96. package/dist/culling/queries.cjs +161 -0
  97. package/dist/culling/queries.cjs.map +6 -0
  98. package/dist/culling/queries.d.ts +20 -0
  99. package/dist/culling/queries.d.ts.map +1 -0
  100. package/dist/culling/queries.js +139 -0
  101. package/dist/culling/queries.js.map +1 -0
  102. package/dist/curves/bezier-curves.d.ts +18 -0
  103. package/dist/curves/bezier-curves.d.ts.map +1 -0
  104. package/dist/curves/bezier-curves.js +54 -0
  105. package/dist/curves/bezier-curves.js.map +1 -0
  106. package/dist/curves/catmull-rom-curve.d.ts +15 -0
  107. package/dist/curves/catmull-rom-curve.d.ts.map +1 -0
  108. package/dist/curves/catmull-rom-curve.js +77 -0
  109. package/dist/curves/catmull-rom-curve.js.map +1 -0
  110. package/dist/curves/curve-arc-length.d.ts +17 -0
  111. package/dist/curves/curve-arc-length.d.ts.map +1 -0
  112. package/dist/curves/curve-arc-length.js +58 -0
  113. package/dist/curves/curve-arc-length.js.map +1 -0
  114. package/dist/curves/curve.d.ts +23 -0
  115. package/dist/curves/curve.d.ts.map +1 -0
  116. package/dist/curves/curve.js +77 -0
  117. package/dist/curves/curve.js.map +1 -0
  118. package/dist/curves/hermite-curve.d.ts +9 -0
  119. package/dist/curves/hermite-curve.d.ts.map +1 -0
  120. package/dist/curves/hermite-curve.js +24 -0
  121. package/dist/curves/hermite-curve.js.map +1 -0
  122. package/dist/curves/index.cjs +293 -0
  123. package/dist/curves/index.cjs.map +6 -0
  124. package/dist/curves/index.d.ts +8 -0
  125. package/dist/curves/index.d.ts.map +1 -0
  126. package/dist/curves/index.js +9 -0
  127. package/dist/curves/index.js.map +1 -0
  128. package/dist/geometries/box-geometry.js +1 -1
  129. package/dist/geometries/box-geometry.js.map +1 -1
  130. package/dist/geometries/capsule-geometry.js +1 -1
  131. package/dist/geometries/capsule-geometry.js.map +1 -1
  132. package/dist/geometries/cylinder-geometry.js +1 -1
  133. package/dist/geometries/cylinder-geometry.js.map +1 -1
  134. package/dist/geometries/geometry-helpers.js +1 -1
  135. package/dist/geometries/geometry-helpers.js.map +1 -1
  136. package/dist/geometries/ico-sphere-geometry.js +1 -1
  137. package/dist/geometries/ico-sphere-geometry.js.map +1 -1
  138. package/dist/geometries/plane-geometry.js +1 -1
  139. package/dist/geometries/plane-geometry.js.map +1 -1
  140. package/dist/geometries/primitive-mesh-builder.d.ts +24 -0
  141. package/dist/geometries/primitive-mesh-builder.d.ts.map +1 -0
  142. package/dist/geometries/primitive-mesh-builder.js +74 -0
  143. package/dist/geometries/primitive-mesh-builder.js.map +1 -0
  144. package/dist/geometries/prism-geometry.d.ts +13 -0
  145. package/dist/geometries/prism-geometry.d.ts.map +1 -0
  146. package/dist/geometries/prism-geometry.js +34 -0
  147. package/dist/geometries/prism-geometry.js.map +1 -0
  148. package/dist/geometries/ring-geometry.d.ts +15 -0
  149. package/dist/geometries/ring-geometry.d.ts.map +1 -0
  150. package/dist/geometries/ring-geometry.js +64 -0
  151. package/dist/geometries/ring-geometry.js.map +1 -0
  152. package/dist/geometries/sphere-geometry.js +1 -1
  153. package/dist/geometries/sphere-geometry.js.map +1 -1
  154. package/dist/geometries/surface-of-revolution.js +1 -1
  155. package/dist/geometries/surface-of-revolution.js.map +1 -1
  156. package/dist/geometries/truncated-cone-geometry.js +1 -1
  157. package/dist/geometries/truncated-cone-geometry.js.map +1 -1
  158. package/dist/index.cjs +290 -9
  159. package/dist/index.cjs.map +3 -3
  160. package/dist/index.d.ts +6 -0
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +4 -1
  163. package/dist/index.js.map +1 -1
  164. package/dist/lib/geometry-utils.js +1 -1
  165. package/dist/lib/geometry-utils.js.map +1 -1
  166. package/dist/lib/geometry.d.ts +1 -1
  167. package/dist/lib/geometry.d.ts.map +1 -1
  168. package/dist/lib/geometry.js +1 -1
  169. package/dist/lib/geometry.js.map +1 -1
  170. package/dist/lib/hinge-tree.d.ts +33 -0
  171. package/dist/lib/hinge-tree.d.ts.map +1 -0
  172. package/dist/lib/hinge-tree.js +144 -0
  173. package/dist/lib/hinge-tree.js.map +1 -0
  174. package/dist/parametric/lathe-geometry.d.ts +14 -0
  175. package/dist/parametric/lathe-geometry.d.ts.map +1 -0
  176. package/dist/parametric/lathe-geometry.js +48 -0
  177. package/dist/parametric/lathe-geometry.js.map +1 -0
  178. package/dist/parametric/parametric-geometry.d.ts +20 -0
  179. package/dist/parametric/parametric-geometry.d.ts.map +1 -0
  180. package/dist/parametric/parametric-geometry.js +88 -0
  181. package/dist/parametric/parametric-geometry.js.map +1 -0
  182. package/dist/parametric/torus-geometry.d.ts +19 -0
  183. package/dist/parametric/torus-geometry.d.ts.map +1 -0
  184. package/dist/parametric/torus-geometry.js +89 -0
  185. package/dist/parametric/torus-geometry.js.map +1 -0
  186. package/dist/parametric.cjs +328 -0
  187. package/dist/parametric.cjs.map +6 -0
  188. package/dist/parametric.d.ts +7 -0
  189. package/dist/parametric.d.ts.map +1 -0
  190. package/dist/parametric.js +7 -0
  191. package/dist/parametric.js.map +1 -0
  192. package/dist/polygon/cut-by-grid.d.ts +24 -0
  193. package/dist/polygon/cut-by-grid.d.ts.map +1 -0
  194. package/dist/polygon/cut-by-grid.js +221 -0
  195. package/dist/polygon/cut-by-grid.js.map +1 -0
  196. package/dist/polygon/cut-by-mercator-bounds.d.ts +17 -0
  197. package/dist/polygon/cut-by-mercator-bounds.d.ts.map +1 -0
  198. package/dist/polygon/cut-by-mercator-bounds.js +149 -0
  199. package/dist/polygon/cut-by-mercator-bounds.js.map +1 -0
  200. package/dist/polygon/earcut.d.ts +13 -0
  201. package/dist/polygon/earcut.d.ts.map +1 -0
  202. package/dist/polygon/earcut.js +627 -0
  203. package/dist/polygon/earcut.js.map +1 -0
  204. package/dist/polygon/index.cjs +1437 -0
  205. package/dist/polygon/index.cjs.map +6 -0
  206. package/dist/polygon/index.d.ts +12 -0
  207. package/dist/polygon/index.d.ts.map +1 -0
  208. package/dist/polygon/index.js +12 -0
  209. package/dist/polygon/index.js.map +1 -0
  210. package/dist/polygon/lineclip.d.ts +31 -0
  211. package/dist/polygon/lineclip.d.ts.map +1 -0
  212. package/dist/polygon/lineclip.js +184 -0
  213. package/dist/polygon/lineclip.js.map +1 -0
  214. package/dist/polygon/polygon-utils.d.ts +103 -0
  215. package/dist/polygon/polygon-utils.d.ts.map +1 -0
  216. package/dist/polygon/polygon-utils.js +155 -0
  217. package/dist/polygon/polygon-utils.js.map +1 -0
  218. package/dist/polygon/polygon.d.ts +41 -0
  219. package/dist/polygon/polygon.d.ts.map +1 -0
  220. package/dist/polygon/polygon.js +76 -0
  221. package/dist/polygon/polygon.js.map +1 -0
  222. package/dist/polygon/subdivide-polyline.d.ts +56 -0
  223. package/dist/polygon/subdivide-polyline.d.ts.map +1 -0
  224. package/dist/polygon/subdivide-polyline.js +141 -0
  225. package/dist/polygon/subdivide-polyline.js.map +1 -0
  226. package/dist/polygon/subdivide-triangle-mesh.d.ts +68 -0
  227. package/dist/polygon/subdivide-triangle-mesh.d.ts.map +1 -0
  228. package/dist/polygon/subdivide-triangle-mesh.js +228 -0
  229. package/dist/polygon/subdivide-triangle-mesh.js.map +1 -0
  230. package/dist/polygon/utils.d.ts +5 -0
  231. package/dist/polygon/utils.d.ts.map +1 -0
  232. package/dist/polygon/utils.js +38 -0
  233. package/dist/polygon/utils.js.map +1 -0
  234. package/dist/spatial-index/box-index.cjs +328 -0
  235. package/dist/spatial-index/box-index.cjs.map +6 -0
  236. package/dist/spatial-index/box-index.d.ts +65 -0
  237. package/dist/spatial-index/box-index.d.ts.map +1 -0
  238. package/dist/spatial-index/box-index.js +263 -0
  239. package/dist/spatial-index/box-index.js.map +1 -0
  240. package/dist/spatial-index/index.cjs +494 -0
  241. package/dist/spatial-index/index.cjs.map +6 -0
  242. package/dist/spatial-index/index.d.ts +5 -0
  243. package/dist/spatial-index/index.d.ts.map +1 -0
  244. package/dist/spatial-index/index.js +6 -0
  245. package/dist/spatial-index/index.js.map +1 -0
  246. package/dist/spatial-index/triangle-bvh.d.ts +53 -0
  247. package/dist/spatial-index/triangle-bvh.d.ts.map +1 -0
  248. package/dist/spatial-index/triangle-bvh.js +102 -0
  249. package/dist/spatial-index/triangle-bvh.js.map +1 -0
  250. package/dist/utils/attribute-compression.d.ts +50 -0
  251. package/dist/utils/attribute-compression.d.ts.map +1 -0
  252. package/dist/utils/attribute-compression.js +186 -0
  253. package/dist/utils/attribute-compression.js.map +1 -0
  254. package/dist/utils/attribute-iterator.d.ts +8 -0
  255. package/dist/utils/attribute-iterator.d.ts.map +1 -0
  256. package/dist/utils/attribute-iterator.js +25 -0
  257. package/dist/utils/attribute-iterator.js.map +1 -0
  258. package/dist/utils/compute-vertex-normals.d.ts +4 -0
  259. package/dist/utils/compute-vertex-normals.d.ts.map +1 -0
  260. package/dist/utils/compute-vertex-normals.js +54 -0
  261. package/dist/utils/compute-vertex-normals.js.map +1 -0
  262. package/dist/utils/constants.d.ts +52 -0
  263. package/dist/utils/constants.d.ts.map +1 -0
  264. package/dist/utils/constants.js +39 -0
  265. package/dist/utils/constants.js.map +1 -0
  266. package/dist/utils/coordinates.d.ts +3 -0
  267. package/dist/utils/coordinates.d.ts.map +1 -0
  268. package/dist/utils/coordinates.js +8 -0
  269. package/dist/utils/coordinates.js.map +1 -0
  270. package/dist/utils/geometry.d.ts +20 -0
  271. package/dist/utils/geometry.d.ts.map +1 -0
  272. package/dist/utils/geometry.js +31 -0
  273. package/dist/utils/geometry.js.map +1 -0
  274. package/dist/utils/gl-type.d.ts +17 -0
  275. package/dist/utils/gl-type.d.ts.map +1 -0
  276. package/dist/utils/gl-type.js +69 -0
  277. package/dist/utils/gl-type.js.map +1 -0
  278. package/dist/utils/index.cjs +965 -0
  279. package/dist/utils/index.cjs.map +6 -0
  280. package/dist/utils/index.d.ts +18 -0
  281. package/dist/utils/index.d.ts.map +1 -0
  282. package/dist/utils/index.js +16 -0
  283. package/dist/utils/index.js.map +1 -0
  284. package/dist/utils/interpolate-packed-attributes.cjs +176 -0
  285. package/dist/utils/interpolate-packed-attributes.cjs.map +6 -0
  286. package/dist/utils/interpolate-packed-attributes.d.ts +43 -0
  287. package/dist/utils/interpolate-packed-attributes.d.ts.map +1 -0
  288. package/dist/utils/interpolate-packed-attributes.js +192 -0
  289. package/dist/utils/interpolate-packed-attributes.js.map +1 -0
  290. package/dist/utils/mesh-processing.d.ts +18 -0
  291. package/dist/utils/mesh-processing.d.ts.map +1 -0
  292. package/dist/utils/mesh-processing.js +300 -0
  293. package/dist/utils/mesh-processing.js.map +1 -0
  294. package/dist/utils/primitive-iterator.d.ts +21 -0
  295. package/dist/utils/primitive-iterator.d.ts.map +1 -0
  296. package/dist/utils/primitive-iterator.js +117 -0
  297. package/dist/utils/primitive-iterator.js.map +1 -0
  298. package/dist/utils/rgb565.d.ts +5 -0
  299. package/dist/utils/rgb565.d.ts.map +1 -0
  300. package/dist/utils/rgb565.js +24 -0
  301. package/dist/utils/rgb565.js.map +1 -0
  302. package/dist/utils/typed-array-utils.d.ts +3 -0
  303. package/dist/utils/typed-array-utils.d.ts.map +1 -0
  304. package/dist/utils/typed-array-utils.js +16 -0
  305. package/dist/utils/typed-array-utils.js.map +1 -0
  306. package/package.json +57 -4
  307. package/src/culling/constants.ts +6 -0
  308. package/src/culling/index.ts +45 -0
  309. package/src/culling/lib/algorithms/bounding-box-from-points.ts +174 -0
  310. package/src/culling/lib/algorithms/bounding-sphere-from-points.ts +175 -0
  311. package/src/culling/lib/algorithms/compute-eigen-decomposition.ts +171 -0
  312. package/src/culling/lib/algorithms/oriented-bounding-box-quaternion.ts +32 -0
  313. package/src/culling/lib/bounding-volumes/axis-aligned-bounding-box.ts +153 -0
  314. package/src/culling/lib/bounding-volumes/bounding-sphere.ts +154 -0
  315. package/src/culling/lib/bounding-volumes/bounding-volume.ts +38 -0
  316. package/src/culling/lib/bounding-volumes/oriented-bounding-box.ts +320 -0
  317. package/src/culling/lib/culling-volume.ts +163 -0
  318. package/src/culling/lib/perspective-frustum.ts +288 -0
  319. package/src/culling/lib/perspective-off-center-frustum.ts +381 -0
  320. package/src/culling/lib/plane.ts +118 -0
  321. package/src/culling/lib/ray.ts +33 -0
  322. package/src/culling/lib/shapes/box-shape.ts +78 -0
  323. package/src/culling/lib/shapes/capsule-shape.ts +232 -0
  324. package/src/culling/lib/shapes/cylinder-shape.ts +133 -0
  325. package/src/culling/lib/shapes/implicit-shape.ts +209 -0
  326. package/src/culling/lib/shapes/plane-shape.ts +78 -0
  327. package/src/culling/lib/shapes/sphere-shape.ts +60 -0
  328. package/src/culling/oriented-box-2d.ts +165 -0
  329. package/src/culling/queries.ts +155 -0
  330. package/src/curves/bezier-curves.ts +62 -0
  331. package/src/curves/catmull-rom-curve.ts +89 -0
  332. package/src/curves/curve-arc-length.ts +70 -0
  333. package/src/curves/curve.ts +96 -0
  334. package/src/curves/hermite-curve.ts +34 -0
  335. package/src/curves/index.ts +15 -0
  336. package/src/geometries/box-geometry.ts +1 -1
  337. package/src/geometries/capsule-geometry.ts +1 -1
  338. package/src/geometries/cylinder-geometry.ts +1 -1
  339. package/src/geometries/geometry-helpers.ts +1 -1
  340. package/src/geometries/ico-sphere-geometry.ts +1 -1
  341. package/src/geometries/plane-geometry.ts +1 -1
  342. package/src/geometries/primitive-mesh-builder.ts +84 -0
  343. package/src/geometries/prism-geometry.ts +57 -0
  344. package/src/geometries/ring-geometry.ts +102 -0
  345. package/src/geometries/sphere-geometry.ts +1 -1
  346. package/src/geometries/surface-of-revolution.ts +1 -1
  347. package/src/geometries/truncated-cone-geometry.ts +1 -1
  348. package/src/index.ts +10 -1
  349. package/src/lib/geometry-utils.ts +2 -2
  350. package/src/lib/geometry.ts +2 -2
  351. package/src/lib/hinge-tree.ts +170 -0
  352. package/src/parametric/lathe-geometry.ts +70 -0
  353. package/src/parametric/parametric-geometry.ts +118 -0
  354. package/src/parametric/torus-geometry.ts +118 -0
  355. package/src/parametric.ts +9 -0
  356. package/src/polygon/cut-by-grid.ts +313 -0
  357. package/src/polygon/cut-by-mercator-bounds.ts +204 -0
  358. package/src/polygon/earcut.ts +798 -0
  359. package/src/polygon/index.ts +35 -0
  360. package/src/polygon/lineclip.ts +218 -0
  361. package/src/polygon/polygon-utils.ts +273 -0
  362. package/src/polygon/polygon.ts +105 -0
  363. package/src/polygon/subdivide-polyline.ts +223 -0
  364. package/src/polygon/subdivide-triangle-mesh.ts +322 -0
  365. package/src/polygon/utils.ts +50 -0
  366. package/src/spatial-index/box-index.ts +343 -0
  367. package/src/spatial-index/index.ts +18 -0
  368. package/src/spatial-index/triangle-bvh.ts +162 -0
  369. package/src/utils/attribute-compression.ts +234 -0
  370. package/src/utils/attribute-iterator.ts +28 -0
  371. package/src/utils/compute-vertex-normals.ts +63 -0
  372. package/src/utils/constants.ts +42 -0
  373. package/src/utils/coordinates.ts +8 -0
  374. package/src/utils/geometry.ts +49 -0
  375. package/src/utils/gl-type.ts +87 -0
  376. package/src/utils/index.ts +55 -0
  377. package/src/utils/interpolate-packed-attributes.ts +284 -0
  378. package/src/utils/mesh-processing.ts +377 -0
  379. package/src/utils/primitive-iterator.ts +145 -0
  380. package/src/utils/rgb565.ts +26 -0
  381. package/src/utils/typed-array-utils.ts +16 -0
@@ -0,0 +1,965 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // dist/utils/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ GL: () => GL,
23
+ GLType: () => GLType,
24
+ GL_PRIMITIVE: () => GL_PRIMITIVE,
25
+ GL_PRIMITIVE_MODE: () => GL_PRIMITIVE_MODE,
26
+ GL_TYPE: () => GL_TYPE,
27
+ compressTextureCoordinates: () => compressTextureCoordinates,
28
+ computeVertexNormals: () => computeVertexNormals,
29
+ concatTypedArrays: () => concatTypedArrays,
30
+ decodeRGB565: () => decodeRGB565,
31
+ decompressTextureCoordinates: () => decompressTextureCoordinates,
32
+ emod: () => emod,
33
+ encodeRGB565: () => encodeRGB565,
34
+ getDegenerateTriangles: () => getDegenerateTriangles,
35
+ interpolatePackedAttributes: () => interpolatePackedAttributes,
36
+ isGeometry: () => isGeometry,
37
+ makeAttributeIterator: () => makeAttributeIterator,
38
+ makePrimitiveIterator: () => makePrimitiveIterator,
39
+ mergeGeometries: () => mergeGeometries,
40
+ octDecode: () => octDecode,
41
+ octDecodeFloat: () => octDecodeFloat,
42
+ octDecodeFromVector4: () => octDecodeFromVector4,
43
+ octDecodeInRange: () => octDecodeInRange,
44
+ octEncode: () => octEncode,
45
+ octEncodeFloat: () => octEncodeFloat,
46
+ octEncodeInRange: () => octEncodeInRange,
47
+ octEncodeToVector4: () => octEncodeToVector4,
48
+ octPack: () => octPack,
49
+ octPackFloat: () => octPackFloat,
50
+ octUnpack: () => octUnpack,
51
+ transformGeometry: () => transformGeometry,
52
+ weldGeometry: () => weldGeometry,
53
+ zigZagDeltaDecode: () => zigZagDeltaDecode
54
+ });
55
+ module.exports = __toCommonJS(index_exports);
56
+
57
+ // dist/utils/constants.js
58
+ var GL_PRIMITIVE = {
59
+ POINTS: 0,
60
+ LINES: 1,
61
+ TRIANGLES: 4
62
+ };
63
+ var GL_PRIMITIVE_MODE = {
64
+ POINTS: 0,
65
+ LINES: 1,
66
+ LINE_LOOP: 2,
67
+ LINE_STRIP: 3,
68
+ TRIANGLES: 4,
69
+ TRIANGLE_STRIP: 5,
70
+ TRIANGLE_FAN: 6
71
+ };
72
+ var GL_TYPE = {
73
+ BYTE: 5120,
74
+ UNSIGNED_BYTE: 5121,
75
+ SHORT: 5122,
76
+ UNSIGNED_SHORT: 5123,
77
+ INT: 5124,
78
+ UNSIGNED_INT: 5125,
79
+ FLOAT: 5126,
80
+ DOUBLE: 5130,
81
+ UNSIGNED_SHORT_4_4_4_4: 32819,
82
+ UNSIGNED_SHORT_5_5_5_1: 32820,
83
+ UNSIGNED_SHORT_5_6_5: 33635
84
+ };
85
+ var GL = {
86
+ ...GL_PRIMITIVE_MODE,
87
+ ...GL_TYPE
88
+ };
89
+
90
+ // dist/utils/gl-type.js
91
+ var GL_TYPE_TO_ARRAY_TYPE = {
92
+ [GL_TYPE.DOUBLE]: Float64Array,
93
+ [GL_TYPE.FLOAT]: Float32Array,
94
+ [GL_TYPE.UNSIGNED_SHORT]: Uint16Array,
95
+ [GL_TYPE.UNSIGNED_INT]: Uint32Array,
96
+ [GL_TYPE.UNSIGNED_BYTE]: Uint8Array,
97
+ [GL_TYPE.BYTE]: Int8Array,
98
+ [GL_TYPE.SHORT]: Int16Array,
99
+ [GL_TYPE.INT]: Int32Array,
100
+ [GL_TYPE.UNSIGNED_SHORT_4_4_4_4]: Uint16Array,
101
+ [GL_TYPE.UNSIGNED_SHORT_5_5_5_1]: Uint16Array,
102
+ [GL_TYPE.UNSIGNED_SHORT_5_6_5]: Uint16Array
103
+ };
104
+ var NAME_TO_GL_TYPE = Object.fromEntries(Object.entries(GL_TYPE).map(([name, glType]) => [name, glType]));
105
+ var TYPE_CONVERSION_ERROR = "Failed to convert GL type";
106
+ var GLType = class _GLType {
107
+ /** Returns the WebGL component constant for a typed array or typed-array constructor. */
108
+ static fromTypedArray(arrayOrType) {
109
+ const arrayType = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;
110
+ if (arrayType === Uint8ClampedArray) {
111
+ return GL_TYPE.UNSIGNED_BYTE;
112
+ }
113
+ for (const [glType, candidateArrayType] of Object.entries(GL_TYPE_TO_ARRAY_TYPE)) {
114
+ if (candidateArrayType === arrayType) {
115
+ return Number(glType);
116
+ }
117
+ }
118
+ throw new Error(TYPE_CONVERSION_ERROR);
119
+ }
120
+ /** Returns a WebGL component constant from its uppercase name. */
121
+ static fromName(name) {
122
+ const glType = NAME_TO_GL_TYPE[name];
123
+ if (glType === void 0) {
124
+ throw new Error(TYPE_CONVERSION_ERROR);
125
+ }
126
+ return glType;
127
+ }
128
+ /** Returns the typed-array constructor for a WebGL component constant. */
129
+ static getArrayType(glType) {
130
+ const ArrayType = GL_TYPE_TO_ARRAY_TYPE[glType];
131
+ if (!ArrayType) {
132
+ throw new Error(TYPE_CONVERSION_ERROR);
133
+ }
134
+ return ArrayType;
135
+ }
136
+ /** Returns the size in bytes of one element of a WebGL component type. */
137
+ static getByteSize(glType) {
138
+ return _GLType.getArrayType(glType).BYTES_PER_ELEMENT;
139
+ }
140
+ /** Returns whether a value is a supported WebGL component type. */
141
+ static validate(glType) {
142
+ return Boolean(GL_TYPE_TO_ARRAY_TYPE[glType]);
143
+ }
144
+ /** Creates a typed view over an ArrayBuffer or an existing ArrayBuffer view. */
145
+ static createTypedArray(glType, buffer, byteOffset = 0, length) {
146
+ const ArrayType = _GLType.getArrayType(glType);
147
+ const arrayBuffer = ArrayBuffer.isView(buffer) ? buffer.buffer : buffer;
148
+ const viewByteOffset = ArrayBuffer.isView(buffer) ? buffer.byteOffset : 0;
149
+ const resolvedByteOffset = viewByteOffset + byteOffset;
150
+ const resolvedLength = length ?? Math.floor((buffer.byteLength - byteOffset) / ArrayType.BYTES_PER_ELEMENT);
151
+ return new ArrayType(arrayBuffer, resolvedByteOffset, resolvedLength);
152
+ }
153
+ };
154
+
155
+ // dist/utils/geometry.js
156
+ function isGeometry(value) {
157
+ if (!value || typeof value !== "object") {
158
+ return false;
159
+ }
160
+ const geometry = value;
161
+ return typeof geometry.mode === "number" && Boolean(geometry.attributes);
162
+ }
163
+ function getAttributeValues(attribute) {
164
+ if (ArrayBuffer.isView(attribute)) {
165
+ return attribute;
166
+ }
167
+ const values = attribute.value || attribute.values;
168
+ if (!values) {
169
+ throw new Error("Geometry attribute does not contain typed-array values");
170
+ }
171
+ return values;
172
+ }
173
+ function getPositionAttribute(geometry) {
174
+ const position = geometry.attributes["POSITION"] || geometry.attributes["positions"];
175
+ if (!position) {
176
+ throw new Error("Geometry does not contain a position attribute");
177
+ }
178
+ return position;
179
+ }
180
+
181
+ // dist/utils/attribute-iterator.js
182
+ function* makeAttributeIterator(values, size) {
183
+ if (!Number.isInteger(size) || size <= 0) {
184
+ throw new Error("Attribute size must be a positive integer");
185
+ }
186
+ if (values.length % size !== 0) {
187
+ throw new Error("Attribute length must be divisible by its size");
188
+ }
189
+ const ArrayType = values.constructor;
190
+ const element = new ArrayType(size);
191
+ for (let index = 0; index < values.length; index += size) {
192
+ for (let componentIndex = 0; componentIndex < size; componentIndex++) {
193
+ element[componentIndex] = values[index + componentIndex];
194
+ }
195
+ yield element;
196
+ }
197
+ }
198
+
199
+ // dist/utils/primitive-iterator.js
200
+ function* makePrimitiveIterator(geometryOrIndices, attributes = {}, mode, start = 0, end) {
201
+ let indices;
202
+ if (isGeometry(geometryOrIndices)) {
203
+ const geometry = geometryOrIndices;
204
+ indices = geometry.indices ? getAttributeValues(geometry.indices) : void 0;
205
+ attributes = geometry.attributes;
206
+ mode = geometry.mode;
207
+ if (end === void 0) {
208
+ const position = getPositionAttribute(geometry);
209
+ end = (indices == null ? void 0 : indices.length) ?? getAttributeValues(position).length / (position.size || 3);
210
+ }
211
+ } else if (geometryOrIndices) {
212
+ indices = getAttributeValues(geometryOrIndices);
213
+ }
214
+ if (mode === void 0) {
215
+ throw new Error("Primitive mode is required");
216
+ }
217
+ end ?? (end = (indices == null ? void 0 : indices.length) ?? start);
218
+ const dereference = (index) => Number(indices ? indices[index] : index);
219
+ let primitiveIndex = 0;
220
+ switch (mode) {
221
+ case GL.POINTS:
222
+ for (let index = start; index < end; index++) {
223
+ yield {
224
+ attributes,
225
+ type: GL.POINTS,
226
+ i1: dereference(index),
227
+ primitiveIndex: primitiveIndex++
228
+ };
229
+ }
230
+ return;
231
+ case GL.LINES:
232
+ for (let index = start; index + 1 < end; index += 2) {
233
+ yield {
234
+ attributes,
235
+ type: GL.LINES,
236
+ i1: dereference(index),
237
+ i2: dereference(index + 1),
238
+ primitiveIndex: primitiveIndex++
239
+ };
240
+ }
241
+ return;
242
+ case GL.LINE_STRIP:
243
+ for (let index = start; index + 1 < end; index++) {
244
+ yield {
245
+ attributes,
246
+ type: GL.LINES,
247
+ i1: dereference(index),
248
+ i2: dereference(index + 1),
249
+ primitiveIndex: primitiveIndex++
250
+ };
251
+ }
252
+ return;
253
+ case GL.LINE_LOOP:
254
+ for (let index = start; index < end; index++) {
255
+ yield {
256
+ attributes,
257
+ type: GL.LINES,
258
+ i1: dereference(index),
259
+ i2: dereference(index + 1 < end ? index + 1 : start),
260
+ primitiveIndex: primitiveIndex++
261
+ };
262
+ }
263
+ return;
264
+ case GL.TRIANGLES:
265
+ for (let index = start; index + 2 < end; index += 3) {
266
+ yield {
267
+ attributes,
268
+ type: GL.TRIANGLES,
269
+ i1: dereference(index),
270
+ i2: dereference(index + 1),
271
+ i3: dereference(index + 2),
272
+ primitiveIndex: primitiveIndex++
273
+ };
274
+ }
275
+ return;
276
+ case GL.TRIANGLE_STRIP:
277
+ for (let index = start; index + 2 < end; index++) {
278
+ const odd = (index - start) % 2 === 1;
279
+ yield {
280
+ attributes,
281
+ type: GL.TRIANGLES,
282
+ i1: dereference(odd ? index + 1 : index),
283
+ i2: dereference(odd ? index : index + 1),
284
+ i3: dereference(index + 2),
285
+ primitiveIndex: primitiveIndex++
286
+ };
287
+ }
288
+ return;
289
+ case GL.TRIANGLE_FAN:
290
+ for (let index = start + 1; index + 1 < end; index++) {
291
+ yield {
292
+ attributes,
293
+ type: GL.TRIANGLES,
294
+ i1: dereference(start),
295
+ i2: dereference(index),
296
+ i3: dereference(index + 1),
297
+ primitiveIndex: primitiveIndex++
298
+ };
299
+ }
300
+ return;
301
+ default:
302
+ throw new Error(`Unknown primitive mode ${mode}`);
303
+ }
304
+ }
305
+
306
+ // dist/utils/compute-vertex-normals.js
307
+ var import_core = require("@math.gl/core");
308
+ function computeVertexNormals(geometry) {
309
+ if (geometry.mode !== GL.TRIANGLES && geometry.mode !== GL.TRIANGLE_STRIP && geometry.mode !== GL.TRIANGLE_FAN) {
310
+ throw new Error("Triangle geometry is required");
311
+ }
312
+ const position = getPositionAttribute(geometry);
313
+ const positions = getAttributeValues(position);
314
+ const positionSize = position.size || 3;
315
+ if (positionSize < 3) {
316
+ throw new Error("Position attributes must have at least three components");
317
+ }
318
+ const vertexCount = positions.length / positionSize;
319
+ const normals = new Float32Array(vertexCount * 3);
320
+ const vectorA = new import_core.Vector3();
321
+ const vectorB = new import_core.Vector3();
322
+ const vectorC = new import_core.Vector3();
323
+ const edgeCB = new import_core.Vector3();
324
+ const edgeAB = new import_core.Vector3();
325
+ for (const primitive of makePrimitiveIterator(geometry)) {
326
+ const { i1, i2, i3 } = primitive;
327
+ if (i2 === void 0 || i3 === void 0) {
328
+ continue;
329
+ }
330
+ vectorA.fromArray(positions, i1 * positionSize);
331
+ vectorB.fromArray(positions, i2 * positionSize);
332
+ vectorC.fromArray(positions, i3 * positionSize);
333
+ const faceNormal = edgeCB.subVectors(vectorC, vectorB).cross(edgeAB.subVectors(vectorA, vectorB));
334
+ for (const vertexIndex of [i1, i2, i3]) {
335
+ normals[vertexIndex * 3] += faceNormal.x;
336
+ normals[vertexIndex * 3 + 1] += faceNormal.y;
337
+ normals[vertexIndex * 3 + 2] += faceNormal.z;
338
+ }
339
+ }
340
+ const normal = new import_core.Vector3();
341
+ for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
342
+ normal.fromArray(normals, vertexIndex * 3);
343
+ if (normal.magnitudeSquared() > 0) {
344
+ normal.normalize().toArray(normals, vertexIndex * 3);
345
+ }
346
+ }
347
+ return normals;
348
+ }
349
+
350
+ // dist/utils/rgb565.js
351
+ function decodeRGB565(rgb565, target = [0, 0, 0]) {
352
+ const red = rgb565 >> 11 & 31;
353
+ const green = rgb565 >> 5 & 63;
354
+ const blue = rgb565 & 31;
355
+ target[0] = red << 3 | red >> 2;
356
+ target[1] = green << 2 | green >> 4;
357
+ target[2] = blue << 3 | blue >> 2;
358
+ return target;
359
+ }
360
+ function encodeRGB565(rgb) {
361
+ const red = Math.round(clampByte(rgb[0] ?? 0) * (31 / 255));
362
+ const green = Math.round(clampByte(rgb[1] ?? 0) * (63 / 255));
363
+ const blue = Math.round(clampByte(rgb[2] ?? 0) * (31 / 255));
364
+ return red << 11 | green << 5 | blue;
365
+ }
366
+ function clampByte(value) {
367
+ return Math.max(0, Math.min(255, value));
368
+ }
369
+
370
+ // dist/utils/typed-array-utils.js
371
+ function concatTypedArrays(arrays = []) {
372
+ const byteLength = arrays.reduce((length, array) => length + array.byteLength, 0);
373
+ const result = new Uint8Array(byteLength);
374
+ let byteOffset = 0;
375
+ for (const array of arrays) {
376
+ const bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
377
+ result.set(bytes, byteOffset);
378
+ byteOffset += bytes.byteLength;
379
+ }
380
+ return result;
381
+ }
382
+
383
+ // dist/utils/attribute-compression.js
384
+ var import_core2 = require("@math.gl/core");
385
+ var RIGHT_SHIFT = 1 / 256;
386
+ var LEFT_SHIFT = 256;
387
+ var scratchVector2 = new import_core2.Vector2();
388
+ var scratchVector3 = new import_core2.Vector3();
389
+ var scratchEncodeVector2 = new import_core2.Vector2();
390
+ var octEncodeScratch = new import_core2.Vector2();
391
+ var uint8ForceArray = new Uint8Array(1);
392
+ function forceUint8(value) {
393
+ uint8ForceArray[0] = value;
394
+ return uint8ForceArray[0];
395
+ }
396
+ function fromSNorm(value, rangeMaximum = 255) {
397
+ return (0, import_core2.clamp)(value, 0, rangeMaximum) / rangeMaximum * 2 - 1;
398
+ }
399
+ function toSNorm(value, rangeMaximum = 255) {
400
+ return Math.round(((0, import_core2.clamp)(value, -1, 1) * 0.5 + 0.5) * rangeMaximum);
401
+ }
402
+ function signNotZero(value) {
403
+ return value < 0 ? -1 : 1;
404
+ }
405
+ function octEncodeInRange(vector, rangeMaximum, result) {
406
+ (0, import_core2.assert)(vector);
407
+ (0, import_core2.assert)(result);
408
+ scratchVector3.from(vector);
409
+ (0, import_core2.assert)(Math.abs(scratchVector3.magnitudeSquared() - 1) <= import_core2._MathUtils.EPSILON6);
410
+ const denominator = Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z);
411
+ result.x = vector.x / denominator;
412
+ result.y = vector.y / denominator;
413
+ if (vector.z < 0) {
414
+ const x = result.x;
415
+ const y = result.y;
416
+ result.x = (1 - Math.abs(y)) * signNotZero(x);
417
+ result.y = (1 - Math.abs(x)) * signNotZero(y);
418
+ }
419
+ result.x = toSNorm(result.x, rangeMaximum);
420
+ result.y = toSNorm(result.y, rangeMaximum);
421
+ return result;
422
+ }
423
+ function octEncode(vector, result) {
424
+ return octEncodeInRange(vector, 255, result);
425
+ }
426
+ function octEncodeToVector4(vector, result) {
427
+ octEncodeInRange(vector, 65535, octEncodeScratch);
428
+ result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
429
+ result.y = forceUint8(octEncodeScratch.x);
430
+ result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
431
+ result.w = forceUint8(octEncodeScratch.y);
432
+ return result;
433
+ }
434
+ function octDecodeInRange(x, y, rangeMaximum, result) {
435
+ (0, import_core2.assert)(result);
436
+ if (x < 0 || x > rangeMaximum || y < 0 || y > rangeMaximum) {
437
+ throw new Error(`x and y must be unsigned normalized integers between 0 and ${rangeMaximum}`);
438
+ }
439
+ result.x = fromSNorm(x, rangeMaximum);
440
+ result.y = fromSNorm(y, rangeMaximum);
441
+ result.z = 1 - (Math.abs(result.x) + Math.abs(result.y));
442
+ if (result.z < 0) {
443
+ const oldX = result.x;
444
+ result.x = (1 - Math.abs(result.y)) * signNotZero(oldX);
445
+ result.y = (1 - Math.abs(oldX)) * signNotZero(result.y);
446
+ }
447
+ return result.normalize();
448
+ }
449
+ function octDecode(x, y, result) {
450
+ return octDecodeInRange(x, y, 255, result);
451
+ }
452
+ function octDecodeFromVector4(encoded, result) {
453
+ (0, import_core2.assert)(encoded);
454
+ (0, import_core2.assert)(result);
455
+ const { x, y, z, w } = encoded;
456
+ if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
457
+ throw new Error("x, y, z, and w must be unsigned normalized integers between 0 and 255");
458
+ }
459
+ return octDecodeInRange(x * LEFT_SHIFT + y, z * LEFT_SHIFT + w, 65535, result);
460
+ }
461
+ function octPackFloat(encoded) {
462
+ scratchVector2.from(encoded);
463
+ return 256 * scratchVector2.x + scratchVector2.y;
464
+ }
465
+ function octEncodeFloat(vector) {
466
+ octEncode(vector, scratchEncodeVector2);
467
+ return octPackFloat(scratchEncodeVector2);
468
+ }
469
+ function octDecodeFloat(value, result) {
470
+ (0, import_core2.assert)(Number.isFinite(value));
471
+ const temporary = value / 256;
472
+ const x = Math.floor(temporary);
473
+ const y = (temporary - x) * 256;
474
+ return octDecode(x, y, result);
475
+ }
476
+ function octPack(vector1, vector2, vector3, result) {
477
+ (0, import_core2.assert)(vector1);
478
+ (0, import_core2.assert)(vector2);
479
+ (0, import_core2.assert)(vector3);
480
+ (0, import_core2.assert)(result);
481
+ const encoded1 = octEncodeFloat(vector1);
482
+ const encoded2 = octEncodeFloat(vector2);
483
+ const encoded3 = octEncode(vector3, scratchEncodeVector2);
484
+ result.x = 65536 * encoded3.x + encoded1;
485
+ result.y = 65536 * encoded3.y + encoded2;
486
+ return result;
487
+ }
488
+ function octUnpack(packed, vector1, vector2, vector3) {
489
+ let temporary = packed.x / 65536;
490
+ const x = Math.floor(temporary);
491
+ const encodedFloat1 = (temporary - x) * 65536;
492
+ temporary = packed.y / 65536;
493
+ const y = Math.floor(temporary);
494
+ const encodedFloat2 = (temporary - y) * 65536;
495
+ octDecodeFloat(encodedFloat1, vector1);
496
+ octDecodeFloat(encodedFloat2, vector2);
497
+ octDecode(x, y, vector3);
498
+ }
499
+ function compressTextureCoordinates(textureCoordinates) {
500
+ const x = textureCoordinates.x * 4095 | 0;
501
+ const y = textureCoordinates.y * 4095 | 0;
502
+ return 4096 * x + y;
503
+ }
504
+ function decompressTextureCoordinates(compressed, result) {
505
+ const temporary = compressed / 4096;
506
+ const x = Math.floor(temporary);
507
+ result.x = x / 4095;
508
+ result.y = (compressed - x * 4096) / 4095;
509
+ return result;
510
+ }
511
+ function zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer) {
512
+ (0, import_core2.assert)(uBuffer);
513
+ (0, import_core2.assert)(vBuffer);
514
+ (0, import_core2.assert)(uBuffer.length === vBuffer.length);
515
+ if (heightBuffer) {
516
+ (0, import_core2.assert)(uBuffer.length === heightBuffer.length);
517
+ }
518
+ let u = 0;
519
+ let v = 0;
520
+ let height = 0;
521
+ for (let index = 0; index < uBuffer.length; index++) {
522
+ u += zigZagDecode(uBuffer[index]);
523
+ v += zigZagDecode(vBuffer[index]);
524
+ uBuffer[index] = u;
525
+ vBuffer[index] = v;
526
+ if (heightBuffer) {
527
+ height += zigZagDecode(heightBuffer[index]);
528
+ heightBuffer[index] = height;
529
+ }
530
+ }
531
+ }
532
+ function zigZagDecode(value) {
533
+ return value >> 1 ^ -(value & 1);
534
+ }
535
+
536
+ // dist/utils/coordinates.js
537
+ function emod(value) {
538
+ return (value % 1 + 1) % 1;
539
+ }
540
+
541
+ // dist/utils/mesh-processing.js
542
+ var import_core3 = require("@math.gl/core");
543
+ function transformGeometry(geometry, matrix) {
544
+ const mesh = readMesh(geometry);
545
+ if (matrix.length !== 16 || Array.from(matrix).some((v) => !Number.isFinite(v)) || matrix[3] !== 0 || matrix[7] !== 0 || matrix[11] !== 0 || matrix[15] !== 1) {
546
+ throw new RangeError("Transform must be a finite affine column-major matrix");
547
+ }
548
+ const transform = new import_core3.Matrix4(Array.from(matrix));
549
+ const columns = [0, 4, 8].map((offset) => Array.from(matrix).slice(offset, offset + 3));
550
+ const scales = columns.map((column) => Math.max(...column.map(Math.abs)));
551
+ const basis = columns.map((column, i) => column.map((v) => scales[i] ? v / scales[i] : 0));
552
+ const cofactors = [
553
+ cross(basis[1], basis[2]),
554
+ cross(basis[2], basis[0]),
555
+ cross(basis[0], basis[1])
556
+ ];
557
+ const determinant = basis[0].reduce((sum, v, i) => sum + v * cofactors[0][i], 0);
558
+ const attributes = copyAttributes(mesh.attributes);
559
+ const normalName = attributes["NORMAL"] ? "NORMAL" : attributes["normals"] ? "normals" : null;
560
+ const tangentName = attributes["TANGENT"] ? "TANGENT" : null;
561
+ if ((normalName || tangentName) && (!Number.isFinite(determinant) || determinant === 0))
562
+ throw new RangeError("Normals and tangents require an invertible transform");
563
+ const positions = new Float64Array(mesh.count * 3);
564
+ const source = mesh.attributes[mesh.position].value;
565
+ for (let i = 0; i < mesh.count; i++) {
566
+ const point = transform.transformAsPoint([source[i * 3], source[i * 3 + 1], source[i * 3 + 2]]);
567
+ positions.set(point, i * 3);
568
+ }
569
+ attributes[mesh.position] = { size: 3, value: positions };
570
+ if (normalName) {
571
+ const input = mesh.attributes[normalName];
572
+ if (input.size !== 3)
573
+ throw new RangeError("Normals must have size 3");
574
+ const output = new Float64Array(mesh.count * 3);
575
+ for (let i = 0; i < mesh.count; i++) {
576
+ const value = normalizedLinearCombination(cofactors, Array.from(input.value.slice(i * 3, i * 3 + 3)), scales.map((v) => -Math.log(v)));
577
+ output.set(value.map((v) => determinant < 0 ? -v : v), i * 3);
578
+ }
579
+ attributes[normalName] = { size: 3, value: output };
580
+ }
581
+ if (tangentName) {
582
+ const input = mesh.attributes[tangentName];
583
+ if (input.size !== 4)
584
+ throw new RangeError("Tangents must have size 4");
585
+ const output = new Float64Array(mesh.count * 4);
586
+ for (let i = 0; i < mesh.count; i++) {
587
+ const value = normalizedLinearCombination(basis, Array.from(input.value.slice(i * 4, i * 4 + 3)), scales.map(Math.log));
588
+ if (normalName) {
589
+ const n = attributes[normalName].value.slice(i * 3, i * 3 + 3);
590
+ const projection = value[0] * n[0] + value[1] * n[1] + value[2] * n[2];
591
+ for (let axis = 0; axis < 3; axis++)
592
+ value[axis] -= projection * n[axis];
593
+ }
594
+ const length = Math.hypot(...value);
595
+ output.set(value.map((v) => length ? v / length : 0), i * 4);
596
+ output[i * 4 + 3] = input.value[i * 4 + 3] * (determinant < 0 ? -1 : 1);
597
+ }
598
+ attributes[tangentName] = { size: 4, value: output };
599
+ }
600
+ const indices = mesh.indices.slice();
601
+ if (determinant < 0)
602
+ for (let i = 0; i < indices.length; i += 3)
603
+ [indices[i + 1], indices[i + 2]] = [indices[i + 2], indices[i + 1]];
604
+ return { mode: GL.TRIANGLES, attributes, indices };
605
+ }
606
+ function mergeGeometries(geometries) {
607
+ if (!geometries.length)
608
+ throw new RangeError("At least one geometry is required");
609
+ const meshes = geometries.map(readMesh), first = meshes[0], names = Object.keys(first.attributes).sort();
610
+ let count = 0, indexCount = 0;
611
+ for (const mesh of meshes) {
612
+ if (mesh.position !== first.position || Object.keys(mesh.attributes).length !== names.length || names.some((name) => !Object.prototype.hasOwnProperty.call(mesh.attributes, name)))
613
+ throw new RangeError("Attribute names must match");
614
+ for (const name of names) {
615
+ if (mesh.attributes[name].size !== first.attributes[name].size || mesh.attributes[name].value.constructor !== first.attributes[name].value.constructor) {
616
+ throw new RangeError("Attribute sizes and storage types must match");
617
+ }
618
+ }
619
+ count += mesh.count;
620
+ indexCount += mesh.indices.length;
621
+ }
622
+ if (count > 4294967295)
623
+ throw new RangeError("Geometry exceeds 32-bit indexing");
624
+ const attributes = {};
625
+ for (const name of names) {
626
+ const attribute = first.attributes[name], Constructor = attribute.value.constructor;
627
+ const value = new Constructor(count * attribute.size);
628
+ let offset = 0;
629
+ for (const mesh of meshes) {
630
+ value.set(mesh.attributes[name].value, offset);
631
+ offset += mesh.attributes[name].value.length;
632
+ }
633
+ attributes[name] = { size: attribute.size, value };
634
+ }
635
+ const indices = new Uint32Array(indexCount);
636
+ let vertexOffset = 0, indexOffset = 0;
637
+ for (const mesh of meshes) {
638
+ for (const index of mesh.indices)
639
+ indices[indexOffset++] = index + vertexOffset;
640
+ vertexOffset += mesh.count;
641
+ }
642
+ return { mode: GL.TRIANGLES, attributes, indices };
643
+ }
644
+ function weldGeometry(geometry, options = {}) {
645
+ const mesh = readMesh(geometry), grid = options.positionGridSize ?? 0;
646
+ if (!Number.isFinite(grid) || grid < 0)
647
+ throw new RangeError("positionGridSize must be finite and nonnegative");
648
+ const names = Object.keys(mesh.attributes).sort(), keys = /* @__PURE__ */ new Map(), rows = [], vertexMap = new Uint32Array(mesh.count);
649
+ for (let i = 0; i < mesh.count; i++) {
650
+ const tuple = [];
651
+ for (const name of names) {
652
+ const attribute = mesh.attributes[name];
653
+ for (let component = 0; component < attribute.size; component++) {
654
+ const value = attribute.value[i * attribute.size + component];
655
+ const quantized = name === mesh.position && grid ? Math.round(value / grid) : value;
656
+ if (!Number.isFinite(quantized))
657
+ throw new RangeError("Position quantization overflow");
658
+ tuple.push(quantized);
659
+ }
660
+ }
661
+ const key = tuple.join(",");
662
+ let row = keys.get(key);
663
+ if (row === void 0) {
664
+ row = rows.length;
665
+ keys.set(key, row);
666
+ rows.push(i);
667
+ }
668
+ vertexMap[i] = row;
669
+ }
670
+ const attributes = {};
671
+ for (const name of names) {
672
+ const attribute = mesh.attributes[name], Constructor = attribute.value.constructor;
673
+ const value = new Constructor(rows.length * attribute.size);
674
+ rows.forEach((row, i) => value.set(attribute.value.subarray(row * attribute.size, (row + 1) * attribute.size), i * attribute.size));
675
+ attributes[name] = { size: attribute.size, value };
676
+ }
677
+ return {
678
+ geometry: {
679
+ mode: GL.TRIANGLES,
680
+ attributes,
681
+ indices: Uint32Array.from(mesh.indices, (index) => vertexMap[index])
682
+ },
683
+ vertexMap,
684
+ removedVertices: mesh.count - rows.length
685
+ };
686
+ }
687
+ function getDegenerateTriangles(geometry, areaEpsilon = 0) {
688
+ if (!Number.isFinite(areaEpsilon) || areaEpsilon < 0)
689
+ throw new RangeError("Area epsilon must be finite and nonnegative");
690
+ const mesh = readMesh(geometry), positions = mesh.attributes[mesh.position].value, result = [];
691
+ for (let i = 0; i < mesh.indices.length; i += 3) {
692
+ const [a, b, c] = Array.from(mesh.indices.subarray(i, i + 3), (index) => index * 3);
693
+ const ab = [
694
+ positions[b] - positions[a],
695
+ positions[b + 1] - positions[a + 1],
696
+ positions[b + 2] - positions[a + 2]
697
+ ];
698
+ const ac = [
699
+ positions[c] - positions[a],
700
+ positions[c + 1] - positions[a + 1],
701
+ positions[c + 2] - positions[a + 2]
702
+ ];
703
+ const scaleAB = Math.max(...ab.map(Math.abs));
704
+ const scaleAC = Math.max(...ac.map(Math.abs));
705
+ const normalizedAB = ab.map((v) => scaleAB ? v / scaleAB : 0);
706
+ const normalizedAC = ac.map((v) => scaleAC ? v / scaleAC : 0);
707
+ const crossLength = Math.hypot(...cross(normalizedAB, normalizedAC));
708
+ const lostComponent = [ab, ac].some((edge, i2) => edge.some((v, axis) => v !== 0 && (i2 ? normalizedAC : normalizedAB)[axis] === 0));
709
+ if (!Number.isFinite(crossLength) || crossLength === 0 || lostComponent) {
710
+ if (exactAreaAtMost(positions, a, b, c, areaEpsilon))
711
+ result.push(i / 3);
712
+ } else {
713
+ const logArea = Math.log(crossLength) + Math.log(scaleAB) + Math.log(scaleAC) - Math.log(2);
714
+ if (areaEpsilon > 0 && logArea <= Math.log(areaEpsilon))
715
+ result.push(i / 3);
716
+ }
717
+ }
718
+ return Uint32Array.from(result);
719
+ }
720
+ function readMesh(geometry) {
721
+ if (geometry.mode !== GL.TRIANGLES)
722
+ throw new RangeError("Packed triangle-list geometry is required");
723
+ const position = geometry.attributes["POSITION"] ? "POSITION" : geometry.attributes["positions"] ? "positions" : null;
724
+ if (!position)
725
+ throw new RangeError("POSITION or positions is required");
726
+ const attributes = {};
727
+ let count;
728
+ for (const [name, attribute] of Object.entries(geometry.attributes)) {
729
+ const value = getAttributeValues(attribute), size = attribute.size ?? (name === position ? 3 : void 0);
730
+ if (!Number.isSafeInteger(size) || size < 1 || value.length % size)
731
+ throw new RangeError("Attributes need explicit packed sizes");
732
+ const length = value.length / size;
733
+ if (name === position) {
734
+ if (size !== 3)
735
+ throw new RangeError("Positions must have size 3");
736
+ count = length;
737
+ }
738
+ for (const component of value)
739
+ if (!Number.isFinite(component))
740
+ throw new RangeError("Attributes must be finite");
741
+ attributes[name] = { value, size };
742
+ }
743
+ for (const attribute of Object.values(attributes))
744
+ if (attribute.value.length / attribute.size !== count)
745
+ throw new RangeError("Attribute vertex counts must match");
746
+ if (count > 4294967295)
747
+ throw new RangeError("Geometry exceeds 32-bit indexing");
748
+ const input = geometry.indices ? getAttributeValues(geometry.indices) : Uint32Array.from({ length: count }, (_, i) => i);
749
+ if (input.length % 3)
750
+ throw new RangeError("Indices must form triangles");
751
+ for (const index of input)
752
+ if (!Number.isSafeInteger(index) || index < 0 || index >= count)
753
+ throw new RangeError("Vertex index is out of bounds");
754
+ return { attributes, position, count, indices: Uint32Array.from(input) };
755
+ }
756
+ function copyAttributes(attributes) {
757
+ return Object.fromEntries(Object.entries(attributes).map(([name, attribute]) => [
758
+ name,
759
+ { size: attribute.size, value: attribute.value.slice() }
760
+ ]));
761
+ }
762
+ function cross(a, b) {
763
+ return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
764
+ }
765
+ function normalizedLinearCombination(columns, vector, logScales) {
766
+ const logs = vector.map((v, i) => v ? Math.log(Math.abs(v)) + logScales[i] : -Infinity);
767
+ const largest = Math.max(...logs);
768
+ if (largest === -Infinity)
769
+ return [0, 0, 0];
770
+ const weights = logs.map((v, i) => Math.sign(vector[i]) * Math.exp(v - largest));
771
+ const result = [0, 1, 2].map((axis) => columns.reduce((sum, column, i) => sum + column[axis] * weights[i], 0));
772
+ const length = Math.hypot(...result);
773
+ return result.map((v) => length ? v / length : 0);
774
+ }
775
+ function exactAreaAtMost(positions, a, b, c, epsilon) {
776
+ const edge = (end) => [0, 1, 2].map((axis) => subtractDyadic(toDyadic(positions[end + axis]), toDyadic(positions[a + axis])));
777
+ const ab = edge(b), ac = edge(c);
778
+ const components = [0, 1, 2].map((axis) => {
779
+ const j = (axis + 1) % 3, k = (axis + 2) % 3;
780
+ return subtractDyadic(multiplyDyadic(ab[j], ac[k]), multiplyDyadic(ab[k], ac[j]));
781
+ });
782
+ if (epsilon === 0)
783
+ return components.every((v) => v.n === 0n);
784
+ const squared = components.map((v) => multiplyDyadic(v, v));
785
+ const sum = squared.reduce((total, v) => subtractDyadic(total, { ...v, n: -v.n }), {
786
+ n: 0n,
787
+ exponent: 0
788
+ });
789
+ const threshold = multiplyDyadic(toDyadic(epsilon), toDyadic(epsilon));
790
+ threshold.exponent += 2;
791
+ return subtractDyadic(sum, threshold).n <= 0n;
792
+ }
793
+ function toDyadic(value) {
794
+ const bits = new DataView(new ArrayBuffer(8));
795
+ bits.setFloat64(0, value);
796
+ const high = bits.getUint32(0), low = bits.getUint32(4);
797
+ const exponentBits = high >>> 20 & 2047;
798
+ const fraction = BigInt(high & 1048575) << 32n | BigInt(low);
799
+ const n = exponentBits ? 1n << 52n | fraction : fraction;
800
+ return { n: high >>> 31 ? -n : n, exponent: exponentBits ? exponentBits - 1075 : -1074 };
801
+ }
802
+ function subtractDyadic(a, b) {
803
+ const exponent = Math.min(a.exponent, b.exponent);
804
+ return {
805
+ n: (a.n << BigInt(a.exponent - exponent)) - (b.n << BigInt(b.exponent - exponent)),
806
+ exponent
807
+ };
808
+ }
809
+ function multiplyDyadic(a, b) {
810
+ return { n: a.n * b.n, exponent: a.exponent + b.exponent };
811
+ }
812
+
813
+ // dist/utils/interpolate-packed-attributes.js
814
+ var BYTE_SIZES = {
815
+ int8: 1,
816
+ uint8: 1,
817
+ int16: 2,
818
+ uint16: 2,
819
+ int32: 4,
820
+ uint32: 4,
821
+ float32: 4,
822
+ float64: 8
823
+ };
824
+ function interpolatePackedAttributes(source, provenance, options) {
825
+ const { byteStride, attributes, littleEndian = true, maxOutputBytes = 64 * 1024 * 1024 } = options;
826
+ const { sourceVertexIndices, sourceVertexWeights } = provenance;
827
+ if (!Number.isSafeInteger(byteStride) || byteStride <= 0 || source.byteLength % byteStride || !Array.isArray(options.attributes) || typeof littleEndian !== "boolean" || !Number.isSafeInteger(maxOutputBytes) || maxOutputBytes < 0 || !Number.isSafeInteger(sourceVertexIndices.length) || sourceVertexIndices.length < 0 || sourceVertexIndices.length % 3 || sourceVertexIndices.length !== sourceVertexWeights.length) {
828
+ throw new RangeError("Invalid packed attribute layout or provenance lengths");
829
+ }
830
+ const outputCount = sourceVertexIndices.length / 3;
831
+ const outputBytes = outputCount * byteStride;
832
+ if (!Number.isSafeInteger(outputBytes) || outputBytes > maxOutputBytes) {
833
+ throw new RangeError("Packed attribute interpolation exceeded maxOutputBytes");
834
+ }
835
+ const ranges = [];
836
+ for (const attribute of attributes) {
837
+ if (!attribute || typeof attribute !== "object" || !Object.prototype.hasOwnProperty.call(BYTE_SIZES, attribute.type) || !Number.isSafeInteger(attribute.size) || attribute.size <= 0 || !Number.isSafeInteger(attribute.byteOffset) || attribute.byteOffset < 0) {
838
+ throw new RangeError("Invalid packed attribute descriptor");
839
+ }
840
+ const end = attribute.byteOffset + attribute.size * BYTE_SIZES[attribute.type];
841
+ if (!Number.isSafeInteger(end) || end > byteStride || ranges.some(([start, previousEnd]) => attribute.byteOffset < previousEnd && end > start)) {
842
+ throw new RangeError("Packed attribute ranges must fit the stride and not overlap");
843
+ }
844
+ ranges.push([attribute.byteOffset, end]);
845
+ if (typeof attribute.interpolation === "string") {
846
+ validateInterpolation(attribute.interpolation);
847
+ } else {
848
+ if (!Array.isArray(attribute.interpolation) || attribute.interpolation.length !== attribute.size) {
849
+ throw new RangeError("Expected one interpolation policy per component");
850
+ }
851
+ for (let component = 0; component < attribute.size; component++) {
852
+ validateInterpolation(attribute.interpolation[component]);
853
+ }
854
+ }
855
+ }
856
+ const sourceCount = source.byteLength / byteStride;
857
+ const input = new DataView(source.buffer, source.byteOffset, source.byteLength);
858
+ const output = new Uint8Array(outputBytes);
859
+ const result = new DataView(output.buffer);
860
+ for (let vertex = 0; vertex < outputCount; vertex++) {
861
+ let sum = 0;
862
+ let firstSource = -1;
863
+ let contributors = 0;
864
+ for (let slot = 0; slot < 3; slot++) {
865
+ const weight = sourceVertexWeights[vertex * 3 + slot];
866
+ const index = sourceVertexIndices[vertex * 3 + slot];
867
+ if (!Number.isFinite(weight) || weight < 0 || weight > 1 || weight > 0 && (!Number.isSafeInteger(index) || index < 0 || index >= sourceCount)) {
868
+ throw new RangeError("Invalid contributing source index or interpolation weight");
869
+ }
870
+ if (weight > 0) {
871
+ contributors++;
872
+ if (firstSource < 0)
873
+ firstSource = index;
874
+ }
875
+ sum += weight;
876
+ }
877
+ if (firstSource < 0 || Math.abs(sum - 1) > 1e-10) {
878
+ throw new RangeError("Interpolation weights must sum to one");
879
+ }
880
+ output.set(source.subarray(firstSource * byteStride, (firstSource + 1) * byteStride), vertex * byteStride);
881
+ for (const attribute of attributes) {
882
+ for (let component = 0; component < attribute.size; component++) {
883
+ const offset = attribute.byteOffset + component * BYTE_SIZES[attribute.type];
884
+ const policy = typeof attribute.interpolation === "string" ? attribute.interpolation : attribute.interpolation[component];
885
+ const firstValue = readComponent(input, firstSource * byteStride + offset, attribute.type, littleEndian);
886
+ let value = 0;
887
+ for (let slot = 0; slot < 3; slot++) {
888
+ const weight = sourceVertexWeights[vertex * 3 + slot];
889
+ if (weight === 0)
890
+ continue;
891
+ const sourceValue = readComponent(input, sourceVertexIndices[vertex * 3 + slot] * byteStride + offset, attribute.type, littleEndian);
892
+ if (!Number.isFinite(sourceValue))
893
+ throw new RangeError("Packed attributes must be finite");
894
+ if (policy === "flat" && sourceValue !== firstValue) {
895
+ throw new RangeError("Flat attribute contributors must agree");
896
+ }
897
+ value += sourceValue * weight;
898
+ }
899
+ if (policy === "linear") {
900
+ if (!Number.isFinite(value))
901
+ throw new RangeError("Interpolated attributes must be finite");
902
+ if (contributors !== 1 || sum !== 1) {
903
+ writeComponent(result, vertex * byteStride + offset, attribute.type, value, littleEndian);
904
+ }
905
+ }
906
+ }
907
+ }
908
+ }
909
+ return output;
910
+ }
911
+ function validateInterpolation(interpolation) {
912
+ if (interpolation !== "linear" && interpolation !== "flat") {
913
+ throw new RangeError("Expected linear or flat interpolation");
914
+ }
915
+ }
916
+ function readComponent(view, offset, type, littleEndian) {
917
+ switch (type) {
918
+ case "int8":
919
+ return view.getInt8(offset);
920
+ case "uint8":
921
+ return view.getUint8(offset);
922
+ case "int16":
923
+ return view.getInt16(offset, littleEndian);
924
+ case "uint16":
925
+ return view.getUint16(offset, littleEndian);
926
+ case "int32":
927
+ return view.getInt32(offset, littleEndian);
928
+ case "uint32":
929
+ return view.getUint32(offset, littleEndian);
930
+ case "float32":
931
+ return view.getFloat32(offset, littleEndian);
932
+ case "float64":
933
+ return view.getFloat64(offset, littleEndian);
934
+ }
935
+ }
936
+ function writeComponent(view, offset, type, value, littleEndian) {
937
+ const integer = Math.round(value);
938
+ switch (type) {
939
+ case "int8":
940
+ view.setInt8(offset, integer);
941
+ break;
942
+ case "uint8":
943
+ view.setUint8(offset, integer);
944
+ break;
945
+ case "int16":
946
+ view.setInt16(offset, integer, littleEndian);
947
+ break;
948
+ case "uint16":
949
+ view.setUint16(offset, integer, littleEndian);
950
+ break;
951
+ case "int32":
952
+ view.setInt32(offset, integer, littleEndian);
953
+ break;
954
+ case "uint32":
955
+ view.setUint32(offset, integer, littleEndian);
956
+ break;
957
+ case "float32":
958
+ view.setFloat32(offset, value, littleEndian);
959
+ break;
960
+ case "float64":
961
+ view.setFloat64(offset, value, littleEndian);
962
+ break;
963
+ }
964
+ }
965
+ //# sourceMappingURL=index.cjs.map