@pmndrs/vdb 0.0.0-stage → 0.1.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 (390) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/LICENSE +21 -0
  3. package/README.md +448 -2
  4. package/THIRD_PARTY_NOTICES.md +147 -0
  5. package/dist/core/compute/atlas.d.ts +94 -0
  6. package/dist/core/compute/atlas.js +98 -0
  7. package/dist/core/compute/atlas.js.map +1 -0
  8. package/dist/core/compute/index.d.ts +13 -0
  9. package/dist/core/compute/index.js +9 -0
  10. package/dist/core/compute/index.js.map +1 -0
  11. package/dist/core/compute/pyramid.d.ts +105 -0
  12. package/dist/core/compute/pyramid.js +455 -0
  13. package/dist/core/compute/pyramid.js.map +1 -0
  14. package/dist/core/compute/shared.d.ts +115 -0
  15. package/dist/core/compute/shared.js +211 -0
  16. package/dist/core/compute/shared.js.map +1 -0
  17. package/dist/core/compute/stats.d.ts +71 -0
  18. package/dist/core/compute/stats.js +188 -0
  19. package/dist/core/compute/stats.js.map +1 -0
  20. package/dist/core/compute/value-transform.d.ts +23 -0
  21. package/dist/core/compute/value-transform.js +58 -0
  22. package/dist/core/compute/value-transform.js.map +1 -0
  23. package/dist/core/errors.d.ts +11 -0
  24. package/dist/core/errors.js +9 -0
  25. package/dist/core/errors.js.map +1 -0
  26. package/dist/core/index.d.ts +30 -0
  27. package/dist/core/index.js +27 -0
  28. package/dist/core/index.js.map +1 -0
  29. package/dist/core/internal.d.ts +15 -0
  30. package/dist/core/internal.js +15 -0
  31. package/dist/core/internal.js.map +1 -0
  32. package/dist/core/pool/affine.d.ts +34 -0
  33. package/dist/core/pool/affine.js +100 -0
  34. package/dist/core/pool/affine.js.map +1 -0
  35. package/dist/core/pool/allocator.d.ts +32 -0
  36. package/dist/core/pool/allocator.js +81 -0
  37. package/dist/core/pool/allocator.js.map +1 -0
  38. package/dist/core/pool/image-header.d.ts +82 -0
  39. package/dist/core/pool/image-header.js +175 -0
  40. package/dist/core/pool/image-header.js.map +1 -0
  41. package/dist/core/pool/layout.d.ts +164 -0
  42. package/dist/core/pool/layout.js +267 -0
  43. package/dist/core/pool/layout.js.map +1 -0
  44. package/dist/core/pool/limits.d.ts +40 -0
  45. package/dist/core/pool/limits.js +79 -0
  46. package/dist/core/pool/limits.js.map +1 -0
  47. package/dist/core/pool/pool.d.ts +279 -0
  48. package/dist/core/pool/pool.js +953 -0
  49. package/dist/core/pool/pool.js.map +1 -0
  50. package/dist/core/source/dense.d.ts +19 -0
  51. package/dist/core/source/dense.js +287 -0
  52. package/dist/core/source/dense.js.map +1 -0
  53. package/dist/core/source/types.d.ts +63 -0
  54. package/dist/core/source/types.js +9 -0
  55. package/dist/core/source/types.js.map +1 -0
  56. package/dist/core/types.d.ts +28 -0
  57. package/dist/core/types.js +28 -0
  58. package/dist/core/types.js.map +1 -0
  59. package/dist/core/wgsl/api.d.ts +41 -0
  60. package/dist/core/wgsl/api.js +463 -0
  61. package/dist/core/wgsl/api.js.map +1 -0
  62. package/dist/core/wgsl/generate.d.ts +82 -0
  63. package/dist/core/wgsl/generate.js +505 -0
  64. package/dist/core/wgsl/generate.js.map +1 -0
  65. package/dist/core/wgsl/level-set.d.ts +54 -0
  66. package/dist/core/wgsl/level-set.js +194 -0
  67. package/dist/core/wgsl/level-set.js.map +1 -0
  68. package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
  69. package/dist/core/wgsl/pnanovdb.chunks.generated.js +330 -0
  70. package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
  71. package/dist/core/wgsl/reserved.d.ts +9 -0
  72. package/dist/core/wgsl/reserved.js +26 -0
  73. package/dist/core/wgsl/reserved.js.map +1 -0
  74. package/dist/core/wgsl/types.d.ts +104 -0
  75. package/dist/core/wgsl/types.js +2 -0
  76. package/dist/core/wgsl/types.js.map +1 -0
  77. package/dist/three/coarse-first.d.ts +162 -0
  78. package/dist/three/coarse-first.js +187 -0
  79. package/dist/three/coarse-first.js.map +1 -0
  80. package/dist/three/compute.d.ts +63 -0
  81. package/dist/three/compute.js +56 -0
  82. package/dist/three/compute.js.map +1 -0
  83. package/dist/three/device.d.ts +59 -0
  84. package/dist/three/device.js +59 -0
  85. package/dist/three/device.js.map +1 -0
  86. package/dist/three/frame/blackbody.d.ts +42 -0
  87. package/dist/three/frame/blackbody.js +74 -0
  88. package/dist/three/frame/blackbody.js.map +1 -0
  89. package/dist/three/frame/chunks.d.ts +157 -0
  90. package/dist/three/frame/chunks.js +559 -0
  91. package/dist/three/frame/chunks.js.map +1 -0
  92. package/dist/three/frame/density-material.d.ts +53 -0
  93. package/dist/three/frame/density-material.js +353 -0
  94. package/dist/three/frame/density-material.js.map +1 -0
  95. package/dist/three/frame/emission-light.d.ts +167 -0
  96. package/dist/three/frame/emission-light.js +655 -0
  97. package/dist/three/frame/emission-light.js.map +1 -0
  98. package/dist/three/frame/environment-grid-material.d.ts +21 -0
  99. package/dist/three/frame/environment-grid-material.js +184 -0
  100. package/dist/three/frame/environment-grid-material.js.map +1 -0
  101. package/dist/three/frame/environment-material.d.ts +22 -0
  102. package/dist/three/frame/environment-material.js +87 -0
  103. package/dist/three/frame/environment-material.js.map +1 -0
  104. package/dist/three/frame/grid-mip-material.d.ts +12 -0
  105. package/dist/three/frame/grid-mip-material.js +61 -0
  106. package/dist/three/frame/grid-mip-material.js.map +1 -0
  107. package/dist/three/frame/index.d.ts +39 -0
  108. package/dist/three/frame/index.js +35 -0
  109. package/dist/three/frame/index.js.map +1 -0
  110. package/dist/three/frame/inject-material.d.ts +56 -0
  111. package/dist/three/frame/inject-material.js +424 -0
  112. package/dist/three/frame/inject-material.js.map +1 -0
  113. package/dist/three/frame/integrate-material.d.ts +26 -0
  114. package/dist/three/frame/integrate-material.js +198 -0
  115. package/dist/three/frame/integrate-material.js.map +1 -0
  116. package/dist/three/frame/layout.d.ts +34 -0
  117. package/dist/three/frame/layout.js +48 -0
  118. package/dist/three/frame/layout.js.map +1 -0
  119. package/dist/three/frame/lighting-material.d.ts +41 -0
  120. package/dist/three/frame/lighting-material.js +257 -0
  121. package/dist/three/frame/lighting-material.js.map +1 -0
  122. package/dist/three/frame/lights.d.ts +11 -0
  123. package/dist/three/frame/lights.js +16 -0
  124. package/dist/three/frame/lights.js.map +1 -0
  125. package/dist/three/frame/medium.d.ts +21 -0
  126. package/dist/three/frame/medium.js +29 -0
  127. package/dist/three/frame/medium.js.map +1 -0
  128. package/dist/three/frame/neural.d.ts +14 -0
  129. package/dist/three/frame/neural.js +105 -0
  130. package/dist/three/frame/neural.js.map +1 -0
  131. package/dist/three/frame/phase.d.ts +44 -0
  132. package/dist/three/frame/phase.js +80 -0
  133. package/dist/three/frame/phase.js.map +1 -0
  134. package/dist/three/frame/renderer.d.ts +493 -0
  135. package/dist/three/frame/renderer.js +1498 -0
  136. package/dist/three/frame/renderer.js.map +1 -0
  137. package/dist/three/frame/shadow-density-material.d.ts +30 -0
  138. package/dist/three/frame/shadow-density-material.js +123 -0
  139. package/dist/three/frame/shadow-density-material.js.map +1 -0
  140. package/dist/three/frame/spectrum.d.ts +18 -0
  141. package/dist/three/frame/spectrum.js +36 -0
  142. package/dist/three/frame/spectrum.js.map +1 -0
  143. package/dist/three/frame/temporal-material.d.ts +29 -0
  144. package/dist/three/frame/temporal-material.js +152 -0
  145. package/dist/three/frame/temporal-material.js.map +1 -0
  146. package/dist/three/frame/three-internals.d.ts +65 -0
  147. package/dist/three/frame/three-internals.js +150 -0
  148. package/dist/three/frame/three-internals.js.map +1 -0
  149. package/dist/three/frame/transmittance-material.d.ts +31 -0
  150. package/dist/three/frame/transmittance-material.js +315 -0
  151. package/dist/three/frame/transmittance-material.js.map +1 -0
  152. package/dist/three/frame/view.d.ts +103 -0
  153. package/dist/three/frame/view.js +296 -0
  154. package/dist/three/frame/view.js.map +1 -0
  155. package/dist/three/frame/volume-shadow-material.d.ts +36 -0
  156. package/dist/three/frame/volume-shadow-material.js +128 -0
  157. package/dist/three/frame/volume-shadow-material.js.map +1 -0
  158. package/dist/three/frame/volume-shadows.d.ts +153 -0
  159. package/dist/three/frame/volume-shadows.js +756 -0
  160. package/dist/three/frame/volume-shadows.js.map +1 -0
  161. package/dist/three/frame/volume.d.ts +172 -0
  162. package/dist/three/frame/volume.js +256 -0
  163. package/dist/three/frame/volume.js.map +1 -0
  164. package/dist/three/grid-node.d.ts +196 -0
  165. package/dist/three/grid-node.js +510 -0
  166. package/dist/three/grid-node.js.map +1 -0
  167. package/dist/three/index.d.ts +43 -0
  168. package/dist/three/index.js +49 -0
  169. package/dist/three/index.js.map +1 -0
  170. package/dist/three/internal.d.ts +14 -0
  171. package/dist/three/internal.js +14 -0
  172. package/dist/three/internal.js.map +1 -0
  173. package/dist/three/level-set-material.d.ts +112 -0
  174. package/dist/three/level-set-material.js +204 -0
  175. package/dist/three/level-set-material.js.map +1 -0
  176. package/dist/three/material.d.ts +194 -0
  177. package/dist/three/material.js +359 -0
  178. package/dist/three/material.js.map +1 -0
  179. package/dist/three/points.d.ts +84 -0
  180. package/dist/three/points.js +130 -0
  181. package/dist/three/points.js.map +1 -0
  182. package/dist/three/sequence.d.ts +317 -0
  183. package/dist/three/sequence.js +526 -0
  184. package/dist/three/sequence.js.map +1 -0
  185. package/dist/three/sparse-source.d.ts +233 -0
  186. package/dist/three/sparse-source.js +876 -0
  187. package/dist/three/sparse-source.js.map +1 -0
  188. package/dist/three/volume-source.d.ts +167 -0
  189. package/dist/three/volume-source.js +353 -0
  190. package/dist/three/volume-source.js.map +1 -0
  191. package/dist/tools/cpu/compute.d.ts +97 -0
  192. package/dist/tools/cpu/compute.js +218 -0
  193. package/dist/tools/cpu/compute.js.map +1 -0
  194. package/dist/tools/cpu/level-set.d.ts +72 -0
  195. package/dist/tools/cpu/level-set.js +261 -0
  196. package/dist/tools/cpu/level-set.js.map +1 -0
  197. package/dist/tools/cpu/march.d.ts +206 -0
  198. package/dist/tools/cpu/march.js +575 -0
  199. package/dist/tools/cpu/march.js.map +1 -0
  200. package/dist/tools/cpu/probe-coords.d.ts +70 -0
  201. package/dist/tools/cpu/probe-coords.js +116 -0
  202. package/dist/tools/cpu/probe-coords.js.map +1 -0
  203. package/dist/tools/cpu/read-value.d.ts +31 -0
  204. package/dist/tools/cpu/read-value.js +336 -0
  205. package/dist/tools/cpu/read-value.js.map +1 -0
  206. package/dist/tools/cpu/sample-trilinear.d.ts +30 -0
  207. package/dist/tools/cpu/sample-trilinear.js +156 -0
  208. package/dist/tools/cpu/sample-trilinear.js.map +1 -0
  209. package/dist/tools/cpu/stride-tables.d.ts +56 -0
  210. package/dist/tools/cpu/stride-tables.generated.d.ts +1058 -0
  211. package/dist/tools/cpu/stride-tables.generated.js +1266 -0
  212. package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
  213. package/dist/tools/cpu/stride-tables.js +78 -0
  214. package/dist/tools/cpu/stride-tables.js.map +1 -0
  215. package/dist/tools/errors.d.ts +57 -0
  216. package/dist/tools/errors.js +58 -0
  217. package/dist/tools/errors.js.map +1 -0
  218. package/dist/tools/frame/blackbody.d.ts +42 -0
  219. package/dist/tools/frame/blackbody.js +116 -0
  220. package/dist/tools/frame/blackbody.js.map +1 -0
  221. package/dist/tools/frame/emission.d.ts +128 -0
  222. package/dist/tools/frame/emission.js +282 -0
  223. package/dist/tools/frame/emission.js.map +1 -0
  224. package/dist/tools/frame/environment.d.ts +105 -0
  225. package/dist/tools/frame/environment.js +268 -0
  226. package/dist/tools/frame/environment.js.map +1 -0
  227. package/dist/tools/frame/grid.d.ts +302 -0
  228. package/dist/tools/frame/grid.js +703 -0
  229. package/dist/tools/frame/grid.js.map +1 -0
  230. package/dist/tools/frame/index.d.ts +136 -0
  231. package/dist/tools/frame/index.js +348 -0
  232. package/dist/tools/frame/index.js.map +1 -0
  233. package/dist/tools/frame/medium.d.ts +61 -0
  234. package/dist/tools/frame/medium.js +99 -0
  235. package/dist/tools/frame/medium.js.map +1 -0
  236. package/dist/tools/frame/mie-table.d.ts +6 -0
  237. package/dist/tools/frame/mie-table.js +16 -0
  238. package/dist/tools/frame/mie-table.js.map +1 -0
  239. package/dist/tools/frame/mie.d.ts +54 -0
  240. package/dist/tools/frame/mie.js +176 -0
  241. package/dist/tools/frame/mie.js.map +1 -0
  242. package/dist/tools/frame/neural-weights.d.ts +9 -0
  243. package/dist/tools/frame/neural-weights.js +245 -0
  244. package/dist/tools/frame/neural-weights.js.map +1 -0
  245. package/dist/tools/frame/neural.d.ts +80 -0
  246. package/dist/tools/frame/neural.js +150 -0
  247. package/dist/tools/frame/neural.js.map +1 -0
  248. package/dist/tools/frame/pyramid-layout.d.ts +38 -0
  249. package/dist/tools/frame/pyramid-layout.js +53 -0
  250. package/dist/tools/frame/pyramid-layout.js.map +1 -0
  251. package/dist/tools/frame/shadows.d.ts +80 -0
  252. package/dist/tools/frame/shadows.js +182 -0
  253. package/dist/tools/frame/shadows.js.map +1 -0
  254. package/dist/tools/frame/sparse.d.ts +65 -0
  255. package/dist/tools/frame/sparse.js +191 -0
  256. package/dist/tools/frame/sparse.js.map +1 -0
  257. package/dist/tools/frame/spectral.d.ts +203 -0
  258. package/dist/tools/frame/spectral.js +550 -0
  259. package/dist/tools/frame/spectral.js.map +1 -0
  260. package/dist/tools/index.d.ts +106 -0
  261. package/dist/tools/index.js +88 -0
  262. package/dist/tools/index.js.map +1 -0
  263. package/dist/tools/internal.d.ts +46 -0
  264. package/dist/tools/internal.js +31 -0
  265. package/dist/tools/internal.js.map +1 -0
  266. package/dist/tools/nanovdb/build-from-vdb.d.ts +50 -0
  267. package/dist/tools/nanovdb/build-from-vdb.js +92 -0
  268. package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
  269. package/dist/tools/nanovdb/bytes.d.ts +220 -0
  270. package/dist/tools/nanovdb/bytes.js +345 -0
  271. package/dist/tools/nanovdb/bytes.js.map +1 -0
  272. package/dist/tools/nanovdb/coarse-first.d.ts +62 -0
  273. package/dist/tools/nanovdb/coarse-first.js +86 -0
  274. package/dist/tools/nanovdb/coarse-first.js.map +1 -0
  275. package/dist/tools/nanovdb/index.d.ts +32 -0
  276. package/dist/tools/nanovdb/index.js +24 -0
  277. package/dist/tools/nanovdb/index.js.map +1 -0
  278. package/dist/tools/nanovdb/inspect.d.ts +24 -0
  279. package/dist/tools/nanovdb/inspect.js +63 -0
  280. package/dist/tools/nanovdb/inspect.js.map +1 -0
  281. package/dist/tools/nanovdb/leaf-codec.d.ts +85 -0
  282. package/dist/tools/nanovdb/leaf-codec.js +320 -0
  283. package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
  284. package/dist/tools/nanovdb/quantize.d.ts +43 -0
  285. package/dist/tools/nanovdb/quantize.js +277 -0
  286. package/dist/tools/nanovdb/quantize.js.map +1 -0
  287. package/dist/tools/nanovdb/resample.d.ts +160 -0
  288. package/dist/tools/nanovdb/resample.js +679 -0
  289. package/dist/tools/nanovdb/resample.js.map +1 -0
  290. package/dist/tools/nanovdb/serialize.d.ts +145 -0
  291. package/dist/tools/nanovdb/serialize.js +395 -0
  292. package/dist/tools/nanovdb/serialize.js.map +1 -0
  293. package/dist/tools/nanovdb/stats.d.ts +58 -0
  294. package/dist/tools/nanovdb/stats.js +149 -0
  295. package/dist/tools/nanovdb/stats.js.map +1 -0
  296. package/dist/tools/nanovdb/transform.d.ts +26 -0
  297. package/dist/tools/nanovdb/transform.js +91 -0
  298. package/dist/tools/nanovdb/transform.js.map +1 -0
  299. package/dist/tools/nanovdb/tree.d.ts +175 -0
  300. package/dist/tools/nanovdb/tree.js +518 -0
  301. package/dist/tools/nanovdb/tree.js.map +1 -0
  302. package/dist/tools/nanovdb/write-nvdb.d.ts +39 -0
  303. package/dist/tools/nanovdb/write-nvdb.js +210 -0
  304. package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
  305. package/dist/tools/nvdb-file.d.ts +195 -0
  306. package/dist/tools/nvdb-file.js +606 -0
  307. package/dist/tools/nvdb-file.js.map +1 -0
  308. package/dist/tools/nvdb-stream.d.ts +138 -0
  309. package/dist/tools/nvdb-stream.js +365 -0
  310. package/dist/tools/nvdb-stream.js.map +1 -0
  311. package/dist/tools/vdb/bit-utils.d.ts +20 -0
  312. package/dist/tools/vdb/bit-utils.js +42 -0
  313. package/dist/tools/vdb/bit-utils.js.map +1 -0
  314. package/dist/tools/vdb/blosc.d.ts +56 -0
  315. package/dist/tools/vdb/blosc.js +231 -0
  316. package/dist/tools/vdb/blosc.js.map +1 -0
  317. package/dist/tools/vdb/byte-reader.d.ts +40 -0
  318. package/dist/tools/vdb/byte-reader.js +139 -0
  319. package/dist/tools/vdb/byte-reader.js.map +1 -0
  320. package/dist/tools/vdb/compression.d.ts +73 -0
  321. package/dist/tools/vdb/compression.js +249 -0
  322. package/dist/tools/vdb/compression.js.map +1 -0
  323. package/dist/tools/vdb/errors.d.ts +10 -0
  324. package/dist/tools/vdb/errors.js +11 -0
  325. package/dist/tools/vdb/errors.js.map +1 -0
  326. package/dist/tools/vdb/grid.d.ts +37 -0
  327. package/dist/tools/vdb/grid.js +147 -0
  328. package/dist/tools/vdb/grid.js.map +1 -0
  329. package/dist/tools/vdb/half-float.d.ts +9 -0
  330. package/dist/tools/vdb/half-float.js +24 -0
  331. package/dist/tools/vdb/half-float.js.map +1 -0
  332. package/dist/tools/vdb/index.d.ts +3 -0
  333. package/dist/tools/vdb/index.js +3 -0
  334. package/dist/tools/vdb/index.js.map +1 -0
  335. package/dist/tools/vdb/inflate.d.ts +24 -0
  336. package/dist/tools/vdb/inflate.js +334 -0
  337. package/dist/tools/vdb/inflate.js.map +1 -0
  338. package/dist/tools/vdb/metadata.d.ts +17 -0
  339. package/dist/tools/vdb/metadata.js +72 -0
  340. package/dist/tools/vdb/metadata.js.map +1 -0
  341. package/dist/tools/vdb/parse.d.ts +25 -0
  342. package/dist/tools/vdb/parse.js +171 -0
  343. package/dist/tools/vdb/parse.js.map +1 -0
  344. package/dist/tools/vdb/point-render-data.d.ts +31 -0
  345. package/dist/tools/vdb/point-render-data.js +57 -0
  346. package/dist/tools/vdb/point-render-data.js.map +1 -0
  347. package/dist/tools/vdb/points.d.ts +160 -0
  348. package/dist/tools/vdb/points.js +794 -0
  349. package/dist/tools/vdb/points.js.map +1 -0
  350. package/dist/tools/vdb/transform.d.ts +23 -0
  351. package/dist/tools/vdb/transform.js +54 -0
  352. package/dist/tools/vdb/transform.js.map +1 -0
  353. package/dist/tools/vdb/tree.d.ts +111 -0
  354. package/dist/tools/vdb/tree.js +228 -0
  355. package/dist/tools/vdb/tree.js.map +1 -0
  356. package/dist/tools/vdb/types.d.ts +138 -0
  357. package/dist/tools/vdb/types.js +3 -0
  358. package/dist/tools/vdb/types.js.map +1 -0
  359. package/dist/tools/wvdb/bake.d.ts +116 -0
  360. package/dist/tools/wvdb/bake.js +311 -0
  361. package/dist/tools/wvdb/bake.js.map +1 -0
  362. package/dist/tools/wvdb/dense.d.ts +112 -0
  363. package/dist/tools/wvdb/dense.js +309 -0
  364. package/dist/tools/wvdb/dense.js.map +1 -0
  365. package/dist/tools/wvdb/format.d.ts +161 -0
  366. package/dist/tools/wvdb/format.js +303 -0
  367. package/dist/tools/wvdb/format.js.map +1 -0
  368. package/dist/tools/wvdb/index.d.ts +13 -0
  369. package/dist/tools/wvdb/index.js +14 -0
  370. package/dist/tools/wvdb/index.js.map +1 -0
  371. package/dist/tools/wvdb/level-set.d.ts +48 -0
  372. package/dist/tools/wvdb/level-set.js +153 -0
  373. package/dist/tools/wvdb/level-set.js.map +1 -0
  374. package/dist/tools/wvdb/nanovdb.d.ts +54 -0
  375. package/dist/tools/wvdb/nanovdb.js +60 -0
  376. package/dist/tools/wvdb/nanovdb.js.map +1 -0
  377. package/dist/tools/wvdb/read.d.ts +260 -0
  378. package/dist/tools/wvdb/read.js +743 -0
  379. package/dist/tools/wvdb/read.js.map +1 -0
  380. package/dist/tools/wvdb/sha256.d.ts +7 -0
  381. package/dist/tools/wvdb/sha256.js +76 -0
  382. package/dist/tools/wvdb/sha256.js.map +1 -0
  383. package/dist/tools/wvdb/write.d.ts +127 -0
  384. package/dist/tools/wvdb/write.js +396 -0
  385. package/dist/tools/wvdb/write.js.map +1 -0
  386. package/package.json +82 -4
  387. package/vendor/LICENSE +201 -0
  388. package/vendor/NOTICE +19 -0
  389. package/vendor/VENDOR.md +85 -0
  390. package/vendor/pnanovdb.wgsl +1539 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/tools/vdb/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAsB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAI,YAAY,CAAC,CAAC,IAAI;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM;AAC9D,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO;AAC1D,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,QAAQ;AAE3D,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,IAAI;AACtC,MAAM,WAAW,GAAG,YAAY,GAA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ACN,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;IAC/E,CAAC;IAED,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,MAAM;QAAE,gBAAgB,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzE,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,IAAI,CAAC,MAAM;YAAE,gBAAgB,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAE7E,OAAO;QACL,UAAU;QACV,MAAM;QACN,KAAK;QACL,gBAAgB;QAChB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChG,CAAC;AACJ,CAAC","sourcesContent":["/**\n * tree.ts — the 5-4-3 tree: root -> upper (32^3 slots, log2dim 5) -> lower\n * (16^3 slots, log2dim 4) -> leaf (8^3 voxels, log2dim 3).\n *\n * Two-phase read, per both format references (and matching real OpenVDB's\n * `Tree::readTopology`/`Tree::readBuffers` split):\n * 1. **Topology** (single recursive pass): root tiles/children; each\n * upper/lower node's `(childMask, valueMask, tileValues)` inline (file\n * version >= 214, \"internal-node compression\" — always true for our\n * 218-224 window); each leaf's `valueMask` ONLY (its value buffer is\n * deferred).\n * 2. **Buffers** (second pass, same recursion order, leaves only): each\n * leaf re-serializes its `valueMask` (a genuine on-disk quirk — OpenVDB's\n * `LeafNode::writeBuffers` re-saves the mask right before the buffer;\n * confirmed against `vdb-rs`'s `read_tree_data`, which does the same\n * double read) followed by its compressed voxel values.\n *\n * The `mjurczyk/openvdb` JS reader (this repo's other reference) never\n * actually implements leaf value decoding — `ChildNode.readValues()` returns\n * early for leaves with a mask-derived 0/1 placeholder array and\n * `GridDescriptor.readBuffers()` is a bare `// TODO`. That's fine for its\n * boolean-active demos but useless for real voxel data, which is the whole\n * point of this parser (handing Phase 5b's serializer real floats) — the\n * two-phase buffer reading here is lifted from `vdb-rs` instead.\n *\n * ## Active tiles (K4.1)\n *\n * Root, upper and lower nodes may hold *active tiles*: a slot whose child bit\n * is clear and whose value-mask bit is set stands for a uniform, active block\n * of `childDim^3` voxels (lower slot: one 8^3 leaf; upper slot: one 128^3 lower\n * node; root tile: one 4096^3 upper node). They are read from the formats'\n * own topology fields (OpenVDB `RootNode::readTopology` /\n * `InternalNode::readTopology`) and returned as {@link TileData}, so\n * `buildFromVdb` can emit them as NanoVDB tiles rather than expanding them.\n * Inactive tiles are kept too (K4.9): `active: false`, with their stored value\n * (a level set's interior reads `-background`). Internal-node inactive tiles\n * equal to the background are skipped, as they read identically to no tile.\n *\n * ## Value types and point data (K4.2)\n *\n * Values follow the grid's {@link ValueFormat} (float, vec3s/vec3d/vec3i, or\n * `PointDataIndex32` for point data grids): the root background and root\n * tile values are full-width `ValueType`s, internal-node and leaf arrays go\n * through `readCompressedValues`, `components` scalars per value. Point data\n * grids write their leaf buffers in passes; `points.ts` reads those.\n *\n * Scope limits (throw `VDBUnsupportedError`, not silently wrong data):\n * multi-buffer trees.\n */\n\nimport { countBits, countZeroBits, iterOnes, testBit } from \"./bit-utils.js\";\nimport type { ByteReader } from \"./byte-reader.js\";\nimport type { CompressionFlags, ValueFormat } from \"./compression.js\";\nimport { FLOAT_FORMAT, readCompressedValues, readFullValue } from \"./compression.js\";\nimport { VdbFormatError, VDBUnsupportedError } from \"./errors.js\";\nimport { MAX_POINT_EXPANSION, type PointLeafData, readPointDataBuffers } from \"./points.js\";\n\nexport const LEAF_LOG2DIM = 3;\nexport const LOWER_LOG2DIM = 4;\nexport const UPPER_LOG2DIM = 5;\n\nexport const LEAF_DIM = 1 << LEAF_LOG2DIM; // 8\nexport const LEAF_NUM_VALUES = 1 << (3 * LEAF_LOG2DIM); // 512\nconst LOWER_NUM_VALUES = 1 << (3 * LOWER_LOG2DIM); // 4096\nconst UPPER_NUM_VALUES = 1 << (3 * UPPER_LOG2DIM); // 32768\n\nconst LOWER_TOTAL = LEAF_LOG2DIM; // 3\nconst UPPER_TOTAL = LEAF_LOG2DIM + LOWER_LOG2DIM; // 7\n\n/** Edge length, in voxels, of an active tile at each level. */\nexport const LOWER_TILE_DIM = 8; // 1 << LOWER_TOTAL: a lower-node tile covers one leaf\nexport const UPPER_TILE_DIM = 128; // 1 << UPPER_TOTAL: an upper-node tile covers one lower node\nexport const ROOT_TILE_DIM = 4096; // 1 << (3 + 4 + 5): a root tile covers one upper node\n\nexport interface LeafData {\n origin: [number, number, number];\n values: Float32Array; // 512 * components\n valueMask: Uint32Array; // 16 x u32 = 512 bits\n}\n\n/**\n * One tile above leaf level: `dim^3` voxels, all `value`. Active tiles have their\n * value-mask bit set. Inactive tiles (K4.9) keep a stored value, e.g. a level\n * set's interior `-background`; internal-node inactive tiles whose value equals\n * the background are not kept (they read the same as no tile).\n */\nexport interface TileData {\n /** Index-space min corner, a multiple of `dim`. */\n origin: [number, number, number];\n /** Edge length in voxels: 8 (lower-node tile), 128 (upper-node tile) or 4096 (root tile). */\n dim: 8 | 128 | 4096;\n /** The tile value, `components` scalars. */\n value: number[];\n /** True for an active tile, false for an inactive tile with a stored value. */\n active: boolean;\n}\n\nexport interface TreeReadResult {\n /** The background value, `components` scalars. */\n background: number[];\n leaves: LeafData[];\n /** Point data grids only: per-leaf attribute data, in `leaves` order. */\n pointLeaves?: PointLeafData[];\n /** Point data grids only: the most `points()` may allocate (a multiple of the file size). */\n pointOutputBudget?: number;\n /** Tiles at root, upper and lower level: active ones and inactive ones with a non-background value (root: all). */\n tiles: TileData[];\n /** Active voxels in leaves plus `dim^3` per active tile. */\n activeVoxelCount: number;\n}\n\ninterface TreeCtx {\n reader: ByteReader;\n fileVersion: number;\n compression: CompressionFlags;\n useHalf: boolean;\n format: ValueFormat;\n background: number[];\n /** Active tiles collected during the topology pass. */\n tiles: TileData[];\n}\n\nfunction offsetToLocalCoord(offset: number, log2dim: number): [number, number, number] {\n const x = offset >> (2 * log2dim);\n const rem = offset & ((1 << (2 * log2dim)) - 1);\n const y = rem >> log2dim;\n const z = rem & ((1 << log2dim) - 1);\n return [x, y, z];\n}\n\nfunction offsetToGlobalCoord(\n offset: number,\n log2dim: number,\n total: number,\n origin: readonly [number, number, number],\n): [number, number, number] {\n const [lx, ly, lz] = offsetToLocalCoord(offset, log2dim);\n return [origin[0] + (lx << total), origin[1] + (ly << total), origin[2] + (lz << total)];\n}\n\n/**\n * Reads `(childMask, valueMask, tileValues)` for an upper/lower node and\n * appends every active tile (child bit clear, value bit set) to `ctx.tiles`.\n *\n * Tile-value layout follows OpenVDB `InternalNode::readTopology`: from file\n * version 222 (node-mask compression) the stream holds a value for every slot,\n * indexed by slot; before 222 it holds one value per child-*off* slot, packed\n * in slot order.\n */\nfunction readInternalNodeTopology(\n ctx: TreeCtx,\n origin: readonly [number, number, number],\n log2dim: number,\n childTotal: number,\n fullNumValues: number,\n): { childMask: Uint32Array; valueMask: Uint32Array } {\n const childMask = ctx.reader.maskWords(fullNumValues);\n const valueMask = ctx.reader.maskWords(fullNumValues);\n const packed = ctx.fileVersion < 222;\n const numValuesForStream = packed ? countZeroBits(childMask, fullNumValues) : fullNumValues;\n const values = readCompressedValues(ctx.reader, {\n fileVersion: ctx.fileVersion,\n compression: ctx.compression,\n useHalf: ctx.useHalf,\n background: ctx.background,\n numValues: numValuesForStream,\n valueMask,\n format: ctx.format,\n });\n const comps = ctx.format.components;\n const dim = (1 << childTotal) as TileData[\"dim\"];\n let packedIdx = 0;\n for (let i = 0; i < fullNumValues; i++) {\n if (testBit(childMask, i)) continue;\n const at = (packed ? packedIdx++ : i) * comps;\n const active = testBit(valueMask, i);\n const value = Array.from(values.subarray(at, at + comps));\n // An inactive tile holding the background reads exactly like no tile.\n if (!active && value.every((v, c) => v === ctx.background[c])) continue;\n ctx.tiles.push({ origin: offsetToGlobalCoord(i, log2dim, childTotal, origin), dim, value, active });\n }\n return { childMask, valueMask };\n}\n\nexport interface LeafPlaceholder {\n origin: [number, number, number];\n}\n\ninterface LowerNode {\n origin: [number, number, number];\n childMask: Uint32Array;\n leaves: Map<number, LeafPlaceholder>;\n}\n\ninterface UpperNode {\n origin: [number, number, number];\n childMask: Uint32Array;\n lowers: Map<number, LowerNode>;\n}\n\nfunction readLowerTopology(ctx: TreeCtx, origin: [number, number, number]): LowerNode {\n const { childMask } = readInternalNodeTopology(ctx, origin, LOWER_LOG2DIM, LOWER_TOTAL, LOWER_NUM_VALUES);\n const leaves = new Map<number, LeafPlaceholder>();\n for (const idx of iterOnes(childMask, LOWER_NUM_VALUES)) {\n const leafOrigin = offsetToGlobalCoord(idx, LOWER_LOG2DIM, LOWER_TOTAL, origin);\n // Leaf topology: value mask only, no child mask, no data (deferred).\n ctx.reader.maskWords(LEAF_NUM_VALUES);\n leaves.set(idx, { origin: leafOrigin });\n }\n return { origin, childMask, leaves };\n}\n\nfunction readUpperTopology(ctx: TreeCtx, origin: [number, number, number]): UpperNode {\n const { childMask } = readInternalNodeTopology(ctx, origin, UPPER_LOG2DIM, UPPER_TOTAL, UPPER_NUM_VALUES);\n const lowers = new Map<number, LowerNode>();\n for (const idx of iterOnes(childMask, UPPER_NUM_VALUES)) {\n const lowerOrigin = offsetToGlobalCoord(idx, UPPER_LOG2DIM, UPPER_TOTAL, origin);\n lowers.set(idx, readLowerTopology(ctx, lowerOrigin));\n }\n return { origin, childMask, lowers };\n}\n\nfunction readLeafBuffer(ctx: TreeCtx, placeholder: LeafPlaceholder): LeafData {\n // The value mask is re-serialized immediately before the buffer data — a\n // real on-disk quirk of LeafNode::writeBuffers, not a bug in this reader.\n const valueMask = ctx.reader.maskWords(LEAF_NUM_VALUES);\n // Before v222 the origin and a buffer count follow the mask\n // (OpenVDB `LeafNode::readBuffers`).\n if (ctx.fileVersion < 222) {\n ctx.reader.vec3i(); // origin (redundant with topology-derived origin)\n const numBuffers = ctx.reader.u8();\n if (numBuffers !== 1) {\n throw new VdbFormatError(`leaf node numBuffers ${numBuffers} !== 1 (multi-buffer leaves unsupported)`);\n }\n }\n const values = readCompressedValues(ctx.reader, {\n fileVersion: ctx.fileVersion,\n compression: ctx.compression,\n useHalf: ctx.useHalf,\n background: ctx.background,\n numValues: LEAF_NUM_VALUES,\n valueMask,\n format: ctx.format,\n });\n return { origin: placeholder.origin, values, valueMask };\n}\n\nexport interface TreeReadOptions {\n fileVersion: number;\n compression: CompressionFlags;\n useHalf: boolean;\n /** The grid's value layout. Default: float. */\n format?: ValueFormat;\n /**\n * A `PointDataGrid`: leaf buffers are written in passes (OpenVDB\n * `Grid::readBuffers` with `io::MultiPass`) and hold attribute arrays.\n */\n pointData?: boolean;\n}\n\nexport function readTree(reader: ByteReader, options: TreeReadOptions): TreeReadResult {\n const bufferCount = reader.u32();\n if (bufferCount !== 1) {\n throw new VDBUnsupportedError(`multi-buffer trees are not supported (bufferCount=${bufferCount})`);\n }\n\n // RootNode::readTopology: the background is a full-width ValueType.\n const format = options.format ?? FLOAT_FORMAT;\n const background = readFullValue(reader, format);\n const tiles: TileData[] = [];\n const ctx: TreeCtx = {\n reader,\n fileVersion: options.fileVersion,\n compression: options.compression,\n useHalf: options.useHalf,\n format,\n background,\n tiles,\n };\n\n const numTiles = reader.u32();\n const numRootChildren = reader.u32();\n\n // Root tiles: origin, value (always full-width ValueType, never half — see\n // OpenVDB `RootNode::readTopology`), active flag. Inactive tiles are kept (K4.9).\n for (let i = 0; i < numTiles; i++) {\n const origin = reader.vec3i();\n const value = readFullValue(reader, format);\n const active = reader.bool();\n if (origin.some((c) => c % ROOT_TILE_DIM !== 0)) {\n throw new VdbFormatError(`root tile origin [${origin.join(\", \")}] is not ${ROOT_TILE_DIM}-aligned`);\n }\n tiles.push({ origin, dim: ROOT_TILE_DIM, value, active });\n }\n\n const uppers: UpperNode[] = [];\n for (let i = 0; i < numRootChildren; i++) {\n const origin = reader.vec3i();\n uppers.push(readUpperTopology(ctx, origin));\n }\n\n const placeholders: LeafPlaceholder[] = [];\n for (const upper of uppers) {\n for (const lower of upper.lowers.values()) {\n for (const placeholder of lower.leaves.values()) placeholders.push(placeholder);\n }\n }\n\n let leaves: LeafData[];\n let pointLeaves: PointLeafData[] | undefined;\n if (options.pointData) {\n // Compression is recorded per array (paged, Blosc flag), not taken from the grid.\n pointLeaves = readPointDataBuffers(reader, { fileVersion: options.fileVersion, leaves: placeholders });\n leaves = pointLeaves.map((p) => ({ origin: p.origin, values: Float32Array.from(p.offsets), valueMask: p.valueMask }));\n } else {\n leaves = placeholders.map((placeholder) => readLeafBuffer(ctx, placeholder));\n }\n\n let activeVoxelCount = 0;\n for (const leaf of leaves) activeVoxelCount += countBits(leaf.valueMask);\n for (const tile of tiles) if (tile.active) activeVoxelCount += tile.dim ** 3;\n\n return {\n background,\n leaves,\n tiles,\n activeVoxelCount,\n ...(pointLeaves ? { pointLeaves, pointOutputBudget: MAX_POINT_EXPANSION * reader.length } : {}),\n };\n}\n"]}
@@ -0,0 +1,138 @@
1
+ /** Public `.vdb` parser types (docs/archive/v1/SPEC.md §4, docs/archive/v1/PLAN.md Phase 5). */
2
+ export interface VdbFile {
3
+ fileVersion: number;
4
+ grids: VdbGrid[];
5
+ }
6
+ export interface VdbTransformInfo {
7
+ type: string;
8
+ /** 4x4 row-major index->world affine matrix. */
9
+ matrix: number[];
10
+ voxelSize: [number, number, number];
11
+ }
12
+ export interface VdbBBox {
13
+ min: [number, number, number];
14
+ max: [number, number, number];
15
+ }
16
+ /** A 3-vector of numbers (also exported by the core as `VDBVec3`). */
17
+ export type VDBVec3 = [number, number, number];
18
+ /**
19
+ * The OpenVDB value types this parser reads (the `<valueType>` of a
20
+ * `Tree_<valueType>_5_4_3` grid type): `float`; the vectors `vec3s`, `vec3d`
21
+ * (narrowed to f32) and `vec3i` (exact below 2^24); and `ptdataidx32`, the
22
+ * point data grid (`points::PointDataGrid`).
23
+ */
24
+ export type VdbValueType = "float" | "vec3s" | "vec3d" | "vec3i" | "ptdataidx32";
25
+ export interface VdbLeaf {
26
+ origin: [number, number, number];
27
+ /**
28
+ * All 512 voxel values in leaf-offset order, `components` scalars each
29
+ * (xyz interleaved for vector grids, so 1536 entries). For a point data
30
+ * grid these are the voxels' point end offsets, see {@link VdbPointDataGrid}.
31
+ */
32
+ values: Float32Array;
33
+ /** 512-bit active mask as 16 little-endian u32 words. */
34
+ valueMask: Uint32Array;
35
+ }
36
+ /**
37
+ * An active tile above leaf level: a `dim^3` block of voxels that are all
38
+ * active and all equal to `value`. `dim` is 8 for a lower-node (16^3) tile,
39
+ * 128 for an upper-node (32^3) tile and 4096 for a root tile.
40
+ */
41
+ export interface VdbTile<V = number> {
42
+ /** Index-space min corner, a multiple of `dim`. */
43
+ origin: [number, number, number];
44
+ dim: 8 | 128 | 4096;
45
+ value: V;
46
+ }
47
+ interface VdbGridBase<V> {
48
+ name: string;
49
+ /** The grid type without the `_HalfFloat` suffix, e.g. `Tree_vec3s_5_4_3`. */
50
+ gridType: string;
51
+ transform: VdbTransformInfo;
52
+ metadata: Record<string, unknown>;
53
+ indexBBox: VdbBBox | null;
54
+ /** Active voxels in leaves plus `dim^3` for every active tile. */
55
+ activeVoxelCount: bigint;
56
+ background: V;
57
+ /**
58
+ * Value and active state at an index coordinate: a leaf voxel, else the value
59
+ * of an enclosing active tile, else the background (inactive).
60
+ */
61
+ readValue(ijk: [number, number, number]): {
62
+ value: V;
63
+ active: boolean;
64
+ };
65
+ iterLeaves(): Iterable<VdbLeaf>;
66
+ /** Active tiles at root, upper and lower level. Empty for fully leaf-resolved grids. */
67
+ iterTiles(): Iterable<VdbTile<V>>;
68
+ /**
69
+ * Inactive tiles with a stored value (K4.9), e.g. a level set's interior
70
+ * `-background`. Internal-node inactive tiles equal to the background are omitted.
71
+ */
72
+ iterInactiveTiles(): Iterable<VdbTile<V>>;
73
+ }
74
+ /** A scalar `FloatGrid`. */
75
+ export interface VdbFloatGrid extends VdbGridBase<number> {
76
+ valueType: "float";
77
+ components: 1;
78
+ }
79
+ /** A `Vec3SGrid` / `Vec3DGrid` / `Vec3IGrid`. Values are `[x, y, z]`. */
80
+ export interface VdbVec3Grid extends VdbGridBase<VDBVec3> {
81
+ valueType: "vec3s" | "vec3d" | "vec3i";
82
+ components: 3;
83
+ }
84
+ /** Element type of a decoded point attribute. */
85
+ export type VdbPointAttributeArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Uint8Array | Uint16Array | Uint32Array | BigUint64Array;
86
+ /** One attribute in a point data grid's descriptor. */
87
+ export interface VdbPointAttributeInfo {
88
+ name: string;
89
+ /** OpenVDB value type name, e.g. `vec3s`, `float`, `int32`, `uint8`. */
90
+ type: string;
91
+ /** OpenVDB codec name, e.g. `null`, `trnc`, `fxpt16`, `uvec`, `grp`, `str`. */
92
+ codec: string;
93
+ /** Position in the attribute set. */
94
+ index: number;
95
+ }
96
+ /** Points decoded from a point data grid, in OpenVDB leaf and voxel order. */
97
+ export interface VdbPointList {
98
+ count: number;
99
+ /** World-space positions, xyz per point: `vdbTransform(voxel ijk + P)`. */
100
+ positions: Float32Array;
101
+ /**
102
+ * Every other decodable attribute, `count * stride * components` values
103
+ * (vectors interleaved). Real types decode to `Float32Array` (`double` to
104
+ * `Float64Array`), whatever their codec; integer types keep their width.
105
+ * Group attributes (codec `grp`) are not listed here; see `groups`.
106
+ */
107
+ attributes: Record<string, VdbPointAttributeArray>;
108
+ /** Shape of each entry in `attributes`. */
109
+ attributeShapes: Record<string, {
110
+ components: number;
111
+ stride: number;
112
+ }>;
113
+ /** Group membership per point (0 or 1), by group name. */
114
+ groups: Record<string, Uint8Array>;
115
+ /** Attributes whose type/codec pair this decoder does not handle. */
116
+ skipped: VdbPointAttributeInfo[];
117
+ }
118
+ /**
119
+ * A `points::PointDataGrid` (`ptdataidx32`). The tree is parsed like any
120
+ * other: each leaf voxel holds the *end* offset of its points within the
121
+ * leaf's attribute arrays (so a voxel's points are `[prev end, end)`).
122
+ * `readValue` returns that offset. {@link VdbPointDataGrid.points} decodes the
123
+ * attribute arrays.
124
+ */
125
+ export interface VdbPointDataGrid extends VdbGridBase<number> {
126
+ valueType: "ptdataidx32";
127
+ components: 1;
128
+ /** Total points (the sum of every leaf's last end offset). */
129
+ pointCount: number;
130
+ /** The attribute descriptor of the first leaf (OpenVDB shares one per grid when it can). */
131
+ attributes: VdbPointAttributeInfo[];
132
+ /** Group names, from the descriptor. */
133
+ groupNames: string[];
134
+ /** Decodes every leaf's attribute arrays (cached after the first call). */
135
+ points(): VdbPointList;
136
+ }
137
+ export type VdbGrid = VdbFloatGrid | VdbVec3Grid | VdbPointDataGrid;
138
+ export {};
@@ -0,0 +1,3 @@
1
+ /** Public `.vdb` parser types (docs/archive/v1/SPEC.md §4, docs/archive/v1/PLAN.md Phase 5). */
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/vdb/types.ts"],"names":[],"mappings":"AAAA,gGAAgG","sourcesContent":["/** Public `.vdb` parser types (docs/archive/v1/SPEC.md §4, docs/archive/v1/PLAN.md Phase 5). */\n\nexport interface VdbFile {\n fileVersion: number;\n grids: VdbGrid[];\n}\n\nexport interface VdbTransformInfo {\n type: string;\n /** 4x4 row-major index->world affine matrix. */\n matrix: number[];\n voxelSize: [number, number, number];\n}\n\nexport interface VdbBBox {\n min: [number, number, number];\n max: [number, number, number];\n}\n\n/** A 3-vector of numbers (also exported by the core as `VDBVec3`). */\nexport type VDBVec3 = [number, number, number];\n\n/**\n * The OpenVDB value types this parser reads (the `<valueType>` of a\n * `Tree_<valueType>_5_4_3` grid type): `float`; the vectors `vec3s`, `vec3d`\n * (narrowed to f32) and `vec3i` (exact below 2^24); and `ptdataidx32`, the\n * point data grid (`points::PointDataGrid`).\n */\nexport type VdbValueType = \"float\" | \"vec3s\" | \"vec3d\" | \"vec3i\" | \"ptdataidx32\";\n\nexport interface VdbLeaf {\n origin: [number, number, number];\n /**\n * All 512 voxel values in leaf-offset order, `components` scalars each\n * (xyz interleaved for vector grids, so 1536 entries). For a point data\n * grid these are the voxels' point end offsets, see {@link VdbPointDataGrid}.\n */\n values: Float32Array;\n /** 512-bit active mask as 16 little-endian u32 words. */\n valueMask: Uint32Array;\n}\n\n/**\n * An active tile above leaf level: a `dim^3` block of voxels that are all\n * active and all equal to `value`. `dim` is 8 for a lower-node (16^3) tile,\n * 128 for an upper-node (32^3) tile and 4096 for a root tile.\n */\nexport interface VdbTile<V = number> {\n /** Index-space min corner, a multiple of `dim`. */\n origin: [number, number, number];\n dim: 8 | 128 | 4096;\n value: V;\n}\n\ninterface VdbGridBase<V> {\n name: string;\n /** The grid type without the `_HalfFloat` suffix, e.g. `Tree_vec3s_5_4_3`. */\n gridType: string;\n transform: VdbTransformInfo;\n metadata: Record<string, unknown>;\n indexBBox: VdbBBox | null;\n /** Active voxels in leaves plus `dim^3` for every active tile. */\n activeVoxelCount: bigint;\n background: V;\n /**\n * Value and active state at an index coordinate: a leaf voxel, else the value\n * of an enclosing active tile, else the background (inactive).\n */\n readValue(ijk: [number, number, number]): { value: V; active: boolean };\n iterLeaves(): Iterable<VdbLeaf>;\n /** Active tiles at root, upper and lower level. Empty for fully leaf-resolved grids. */\n iterTiles(): Iterable<VdbTile<V>>;\n /**\n * Inactive tiles with a stored value (K4.9), e.g. a level set's interior\n * `-background`. Internal-node inactive tiles equal to the background are omitted.\n */\n iterInactiveTiles(): Iterable<VdbTile<V>>;\n}\n\n/** A scalar `FloatGrid`. */\nexport interface VdbFloatGrid extends VdbGridBase<number> {\n valueType: \"float\";\n components: 1;\n}\n\n/** A `Vec3SGrid` / `Vec3DGrid` / `Vec3IGrid`. Values are `[x, y, z]`. */\nexport interface VdbVec3Grid extends VdbGridBase<VDBVec3> {\n valueType: \"vec3s\" | \"vec3d\" | \"vec3i\";\n components: 3;\n}\n\n/** Element type of a decoded point attribute. */\nexport type VdbPointAttributeArray =\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Uint8Array\n | Uint16Array\n | Uint32Array\n | BigUint64Array;\n\n/** One attribute in a point data grid's descriptor. */\nexport interface VdbPointAttributeInfo {\n name: string;\n /** OpenVDB value type name, e.g. `vec3s`, `float`, `int32`, `uint8`. */\n type: string;\n /** OpenVDB codec name, e.g. `null`, `trnc`, `fxpt16`, `uvec`, `grp`, `str`. */\n codec: string;\n /** Position in the attribute set. */\n index: number;\n}\n\n/** Points decoded from a point data grid, in OpenVDB leaf and voxel order. */\nexport interface VdbPointList {\n count: number;\n /** World-space positions, xyz per point: `vdbTransform(voxel ijk + P)`. */\n positions: Float32Array;\n /**\n * Every other decodable attribute, `count * stride * components` values\n * (vectors interleaved). Real types decode to `Float32Array` (`double` to\n * `Float64Array`), whatever their codec; integer types keep their width.\n * Group attributes (codec `grp`) are not listed here; see `groups`.\n */\n attributes: Record<string, VdbPointAttributeArray>;\n /** Shape of each entry in `attributes`. */\n attributeShapes: Record<string, { components: number; stride: number }>;\n /** Group membership per point (0 or 1), by group name. */\n groups: Record<string, Uint8Array>;\n /** Attributes whose type/codec pair this decoder does not handle. */\n skipped: VdbPointAttributeInfo[];\n}\n\n/**\n * A `points::PointDataGrid` (`ptdataidx32`). The tree is parsed like any\n * other: each leaf voxel holds the *end* offset of its points within the\n * leaf's attribute arrays (so a voxel's points are `[prev end, end)`).\n * `readValue` returns that offset. {@link VdbPointDataGrid.points} decodes the\n * attribute arrays.\n */\nexport interface VdbPointDataGrid extends VdbGridBase<number> {\n valueType: \"ptdataidx32\";\n components: 1;\n /** Total points (the sum of every leaf's last end offset). */\n pointCount: number;\n /** The attribute descriptor of the first leaf (OpenVDB shares one per grid when it can). */\n attributes: VdbPointAttributeInfo[];\n /** Group names, from the descriptor. */\n groupNames: string[];\n /** Decodes every leaf's attribute arrays (cached after the first call). */\n points(): VdbPointList;\n}\n\nexport type VdbGrid = VdbFloatGrid | VdbVec3Grid | VdbPointDataGrid;\n"]}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * bake.ts — resample sparse grids (a parsed `.vdb`, or a NanoVDB grid image
3
+ * through the CPU oracle) to dense levels and write a `.wvdb`.
4
+ *
5
+ * Portions derived from mjurczyk/openvdb (MIT), commit 75e7345:
6
+ * `src/wvdb/bake.js` (getWVDBBox, getFinestDimensions, forEachTexel,
7
+ * sampleScalarGrid, the level-set band limit) and `src/wvdb/cli.js` (the
8
+ * `source` member). His sampling is reproduced, including its arithmetic order:
9
+ * - one shared world box for all grids: the union of the grids' active-voxel
10
+ * index boxes (voxel centres, so `max` is the last voxel, not one past it)
11
+ * mapped to world space, unless `bbox` is given;
12
+ * - the finest LOD has `resolution` voxels on the longest box side, the other
13
+ * sides `max(1, round(side * resolution / longest))` (§3.2.1);
14
+ * - **point sampling, no prefilter** (§3.2.2): world position of voxel centre
15
+ * `min + ((i + 0.5) / X) * size`, mapped to index space with the inverse
16
+ * map, rounded with `Math.round` (halves toward +infinity) and read with
17
+ * the grid's own value lookup (inactive values included). A source much
18
+ * finer than the target resolution aliases; that is his behaviour and the
19
+ * default here (`sampling: 'nearest'`).
20
+ *
21
+ * Options beyond his CLI (K4.13):
22
+ * - `sampling: 'box'` prefilters: each texel is the area-weighted mean of the
23
+ * source voxels its cell covers, on the same lattice (`vdbResampleDense`, the
24
+ * K4.4 `vdbResampleGrid` box filter). Mass is conserved and thin features fade
25
+ * instead of flickering in and out;
26
+ * - `levelSetSampler: 'surface-mean'` samples level sets with his CLI's
27
+ * `sampleLevelSet` (`level-set.ts`), which reproduces his level-set files.
28
+ *
29
+ * Differences from his CLI (also in docs/archive/handoffs/K4-3.md):
30
+ * - by default (`levelSetSampler: 'spec'`) level sets are point-sampled and
31
+ * then encoded by the §8 rule (active: clamp to `±(b - 2b/maxCode)`;
32
+ * inactive: `±b` by sign). His CLI uses `sampleLevelSet` (a surface-aware
33
+ * mean) instead, so level-set bytes differ (DIVERGES V17);
34
+ * - `dimensions` can override the finest LOD size (his pre-0.11 bakes used
35
+ * `resolution`³ for every box, e.g. the committed `smoke.wvdb` and
36
+ * `bunny_cloud.wvdb`; this reproduces them).
37
+ */
38
+ import type { VdbFile, VdbGrid } from "../vdb/types.js";
39
+ import type { WvdbBits, WvdbBox, WvdbVec3 } from "./format.js";
40
+ import { type WvdbIndexAccess } from "./level-set.js";
41
+ import { type WriteWvdbOptions, type WriteWvdbResult } from "./write.js";
42
+ /** A grid the baker can point-sample in world space. */
43
+ export interface WvdbSampleSource {
44
+ name: string;
45
+ /** `.wvdb` class string: "fog volume", "level set", "staggered" or "unknown". */
46
+ class: string;
47
+ background: number;
48
+ /** World box of the active voxels (voxel centres), or null when the grid has none. */
49
+ bbox: WvdbBox | null;
50
+ /** The grid value (and active state) at the voxel nearest to a world position. */
51
+ sample(world: WvdbVec3): {
52
+ value: number;
53
+ active: boolean;
54
+ };
55
+ /** Index-space access, for `levelSetSampler: 'surface-mean'`. The built-in sources have it. */
56
+ index?: WvdbIndexAccess;
57
+ /** The sparse grid behind the source, for `sampling: 'box'`. The built-in sources have it. */
58
+ grid?: Uint32Array | VdbGrid;
59
+ }
60
+ export interface BakeWvdbOptions extends Omit<WriteWvdbOptions, "resolution" | "bakeBBox"> {
61
+ /** Voxels on the longest box side of the finest LOD. Default 128. */
62
+ resolution?: number;
63
+ /** One world box for all grids (a sequence box, §10; recorded as `bake.bbox`). Default: union of the grids' boxes. */
64
+ bbox?: WvdbBox | null;
65
+ /** Override the finest LOD dimensions (default from `resolution` and the box). */
66
+ dimensions?: WvdbVec3;
67
+ /**
68
+ * Grids to keep, by name; also recorded as `bake.grids`. Default null (all).
69
+ */
70
+ gridNames?: string[] | null;
71
+ /**
72
+ * Resampling filter. `"nearest"` (default): his point sampling. `"box"`: the
73
+ * area-weighted mean over each texel's cell (K4.4's box filter; conserves
74
+ * mass, no aliasing when the source is finer than the texels). Needs a source
75
+ * with `grid` (the built-in sources).
76
+ */
77
+ sampling?: WvdbSampling;
78
+ /**
79
+ * How level sets are sampled. `"spec"` (default): `sampling`, then the spec
80
+ * §8 rule by active state. `"surface-mean"`: his CLI's `sampleLevelSet`
81
+ * (trilinear near the surface, a 4x4x4 mean in texels that cross it), which
82
+ * reproduces his level-set `.wvdb` files; it ignores `sampling`.
83
+ */
84
+ levelSetSampler?: WvdbLevelSetSampler;
85
+ }
86
+ export type WvdbSampling = "nearest" | "box";
87
+ export type WvdbLevelSetSampler = "spec" | "surface-mean";
88
+ /** §3.2.1, his `getFinestDimensions`. */
89
+ export declare function wvdbFinestDimensions(bbox: WvdbBox | null, resolution: number): WvdbVec3;
90
+ /** Point-samples one source over the box (his `forEachTexel` + `sampleScalarGrid`). */
91
+ export declare function sampleWvdbDense(source: WvdbSampleSource, bbox: WvdbBox | null, dimensions: WvdbVec3, bits?: WvdbBits): Float32Array;
92
+ /**
93
+ * Box-filters one source over the box (`sampling: 'box'`): `vdbResampleDense` on
94
+ * his lattice, then the level-set rule of {@link sampleWvdbDense} by the
95
+ * filtered active state.
96
+ */
97
+ export declare function sampleWvdbDenseBox(source: WvdbSampleSource, bbox: WvdbBox | null, dimensions: WvdbVec3, bits?: WvdbBits): Float32Array;
98
+ /** Bakes sources to a `.wvdb` with his CLI defaults (128, 3 LODs, 8 bits, sparse, 1024 bricks per page). */
99
+ export declare function bakeWvdb(sources: readonly WvdbSampleSource[], options?: BakeWvdbOptions): WriteWvdbResult;
100
+ /** A parsed `.vdb` grid (axis-aligned map) as a sample source. */
101
+ export declare function wvdbSourceFromVdbGrid(grid: VdbGrid): WvdbSampleSource;
102
+ /** A NanoVDB FLOAT/Fp8/FpN grid image as a sample source, read through the CPU oracle (`readValue`). */
103
+ export declare function wvdbSourceFromNvdb(gridWords: Uint32Array): WvdbSampleSource;
104
+ export interface VdbToWvdbOptions extends BakeWvdbOptions {
105
+ /** `source.file` (the name without directories). Default "". */
106
+ fileName?: string;
107
+ }
108
+ /**
109
+ * `.vdb` → `.wvdb`, like his `wvdb` CLI with the same options. Given the file
110
+ * bytes, `source.sha256` is their digest. Only float grids are baked: vector
111
+ * and point data grids are skipped (his CLI bakes vectors as 3 channels and
112
+ * point data grids as points grids; not ported yet).
113
+ */
114
+ export declare function vdbToWvdb(input: ArrayBuffer | Uint8Array | VdbFile, options?: VdbToWvdbOptions): WriteWvdbResult;
115
+ /** NanoVDB grid image(s) → `.wvdb`, sampled through the CPU oracle. */
116
+ export declare function nvdbToWvdb(images: Uint32Array | readonly Uint32Array[], options?: BakeWvdbOptions): WriteWvdbResult;
@@ -0,0 +1,311 @@
1
+ /**
2
+ * bake.ts — resample sparse grids (a parsed `.vdb`, or a NanoVDB grid image
3
+ * through the CPU oracle) to dense levels and write a `.wvdb`.
4
+ *
5
+ * Portions derived from mjurczyk/openvdb (MIT), commit 75e7345:
6
+ * `src/wvdb/bake.js` (getWVDBBox, getFinestDimensions, forEachTexel,
7
+ * sampleScalarGrid, the level-set band limit) and `src/wvdb/cli.js` (the
8
+ * `source` member). His sampling is reproduced, including its arithmetic order:
9
+ * - one shared world box for all grids: the union of the grids' active-voxel
10
+ * index boxes (voxel centres, so `max` is the last voxel, not one past it)
11
+ * mapped to world space, unless `bbox` is given;
12
+ * - the finest LOD has `resolution` voxels on the longest box side, the other
13
+ * sides `max(1, round(side * resolution / longest))` (§3.2.1);
14
+ * - **point sampling, no prefilter** (§3.2.2): world position of voxel centre
15
+ * `min + ((i + 0.5) / X) * size`, mapped to index space with the inverse
16
+ * map, rounded with `Math.round` (halves toward +infinity) and read with
17
+ * the grid's own value lookup (inactive values included). A source much
18
+ * finer than the target resolution aliases; that is his behaviour and the
19
+ * default here (`sampling: 'nearest'`).
20
+ *
21
+ * Options beyond his CLI (K4.13):
22
+ * - `sampling: 'box'` prefilters: each texel is the area-weighted mean of the
23
+ * source voxels its cell covers, on the same lattice (`vdbResampleDense`, the
24
+ * K4.4 `vdbResampleGrid` box filter). Mass is conserved and thin features fade
25
+ * instead of flickering in and out;
26
+ * - `levelSetSampler: 'surface-mean'` samples level sets with his CLI's
27
+ * `sampleLevelSet` (`level-set.ts`), which reproduces his level-set files.
28
+ *
29
+ * Differences from his CLI (also in docs/archive/handoffs/K4-3.md):
30
+ * - by default (`levelSetSampler: 'spec'`) level sets are point-sampled and
31
+ * then encoded by the §8 rule (active: clamp to `±(b - 2b/maxCode)`;
32
+ * inactive: `±b` by sign). His CLI uses `sampleLevelSet` (a surface-aware
33
+ * mean) instead, so level-set bytes differ (DIVERGES V17);
34
+ * - `dimensions` can override the finest LOD size (his pre-0.11 bakes used
35
+ * `resolution`³ for every box, e.g. the committed `smoke.wvdb` and
36
+ * `bunny_cloud.wvdb`; this reproduces them).
37
+ */
38
+ import { VDBToolsError, VDBUnsupportedError } from "../errors.js";
39
+ import { vdbReadValueCpu } from "../cpu/read-value.js";
40
+ import { vdbResampleDense } from "../nanovdb/resample.js";
41
+ import { gridTypeConstantsForId } from "../cpu/stride-tables.js";
42
+ import { GRID_NAME_MAX, GRID_OFF_GRID_CLASS, GRID_OFF_GRID_NAME, GRID_OFF_GRID_TYPE, GRID_OFF_MAP, GRID_SIZE, MAP_OFF_INVMATD, MAP_OFF_MATD, MAP_OFF_VECD, ROOT_OFF_BBOX_MAX, ROOT_OFF_BBOX_MIN, TREE_OFF_NODE_OFFSET_ROOT, } from "../nanovdb/bytes.js";
43
+ import { parseVdb } from "../vdb/parse.js";
44
+ import { sampleWvdbLevelSetSurfaceMean } from "./level-set.js";
45
+ import { sha256Hex } from "./sha256.js";
46
+ import { writeWvdb } from "./write.js";
47
+ function unionBox(boxes) {
48
+ if (!boxes.length)
49
+ return null;
50
+ const min = [...boxes[0][0]];
51
+ const max = [...boxes[0][1]];
52
+ for (const [lo, hi] of boxes.slice(1)) {
53
+ for (let a = 0; a < 3; a++) {
54
+ min[a] = Math.min(min[a], lo[a]);
55
+ max[a] = Math.max(max[a], hi[a]);
56
+ }
57
+ }
58
+ return [min, max];
59
+ }
60
+ /** §3.2.1, his `getFinestDimensions`. */
61
+ export function wvdbFinestDimensions(bbox, resolution) {
62
+ const size = bbox ? [0, 1, 2].map((a) => bbox[1][a] - bbox[0][a]) : [0, 0, 0];
63
+ const longest = Math.max(...size);
64
+ if (!(longest > 0))
65
+ return [resolution, resolution, resolution];
66
+ return size.map((side) => Math.max(1, Math.round((side * resolution) / longest)));
67
+ }
68
+ /** Point-samples one source over the box (his `forEachTexel` + `sampleScalarGrid`). */
69
+ export function sampleWvdbDense(source, bbox, dimensions, bits = 8) {
70
+ const [w, h, d] = dimensions;
71
+ const values = new Float32Array(w * h * d);
72
+ const background = source.background;
73
+ if (!source.bbox || !bbox)
74
+ return values.fill(background);
75
+ const min = bbox[0];
76
+ const size = [0, 1, 2].map((a) => bbox[1][a] - min[a]);
77
+ const isLevelSet = source.class === "level set";
78
+ const band = background - (2 * background) / ((1 << bits) - 1);
79
+ const world = [0, 0, 0];
80
+ let o = 0;
81
+ for (let z = 0; z < d; z++) {
82
+ world[2] = ((z + 0.5) / d) * size[2] + min[2];
83
+ for (let y = 0; y < h; y++) {
84
+ world[1] = ((y + 0.5) / h) * size[1] + min[1];
85
+ for (let x = 0; x < w; x++) {
86
+ world[0] = ((x + 0.5) / w) * size[0] + min[0];
87
+ const { value, active } = source.sample(world);
88
+ let v = Number.isFinite(value) ? value : background;
89
+ if (isLevelSet)
90
+ v = active ? Math.min(Math.max(v, -band), band) : v < 0 ? -background : background;
91
+ values[o++] = v;
92
+ }
93
+ }
94
+ }
95
+ return values;
96
+ }
97
+ /**
98
+ * Box-filters one source over the box (`sampling: 'box'`): `vdbResampleDense` on
99
+ * his lattice, then the level-set rule of {@link sampleWvdbDense} by the
100
+ * filtered active state.
101
+ */
102
+ export function sampleWvdbDenseBox(source, bbox, dimensions, bits = 8) {
103
+ const background = source.background;
104
+ if (!source.bbox || !bbox)
105
+ return new Float32Array(dimensions[0] * dimensions[1] * dimensions[2]).fill(background);
106
+ if (!source.grid) {
107
+ throw new VDBToolsError("VDB_BAD_OPTION", `bakeWvdb: sampling "box" needs the source grid; "${source.name}" has none (use wvdbSourceFromVdbGrid or wvdbSourceFromNvdb)`);
108
+ }
109
+ const { values, active } = vdbResampleDense(source.grid, { bbox, dimensions, filter: "box" });
110
+ if (source.class === "level set") {
111
+ const band = background - (2 * background) / ((1 << bits) - 1);
112
+ for (let i = 0; i < values.length; i++) {
113
+ const v = Number.isFinite(values[i]) ? values[i] : background;
114
+ values[i] = active[i] ? Math.min(Math.max(v, -band), band) : v < 0 ? -background : background;
115
+ }
116
+ }
117
+ else {
118
+ for (let i = 0; i < values.length; i++)
119
+ if (!Number.isFinite(values[i]))
120
+ values[i] = background;
121
+ }
122
+ return values;
123
+ }
124
+ /** Bakes sources to a `.wvdb` with his CLI defaults (128, 3 LODs, 8 bits, sparse, 1024 bricks per page). */
125
+ export function bakeWvdb(sources, options = {}) {
126
+ const { resolution = 128, bbox: bakeBBox = null, dimensions, gridNames = null, sampling = "nearest", levelSetSampler = "spec", ...write } = options;
127
+ if (sampling !== "nearest" && sampling !== "box")
128
+ throw new VDBToolsError("VDB_BAD_OPTION", `bakeWvdb: unknown sampling "${String(sampling)}"`);
129
+ if (levelSetSampler !== "spec" && levelSetSampler !== "surface-mean") {
130
+ throw new VDBToolsError("VDB_BAD_OPTION", `bakeWvdb: unknown levelSetSampler "${String(levelSetSampler)}"`);
131
+ }
132
+ if (!Number.isInteger(resolution) || resolution < 1)
133
+ throw new VDBToolsError("VDB_BAD_OPTION", `bakeWvdb: invalid resolution ${resolution}`);
134
+ const selected = gridNames ? sources.filter((s) => gridNames.includes(s.name)) : [...sources];
135
+ const box = bakeBBox ?? unionBox(selected.flatMap((s) => (s.bbox ? [s.bbox] : [])));
136
+ const dims = dimensions ?? wvdbFinestDimensions(box, resolution);
137
+ const bits = write.bits ?? 8;
138
+ const grids = selected.map((s) => ({
139
+ name: s.name,
140
+ class: s.class,
141
+ background: s.background,
142
+ bbox: box,
143
+ finest: {
144
+ dimensions: dims,
145
+ values: s.class === "level set" && levelSetSampler === "surface-mean"
146
+ ? sampleWvdbLevelSetSurfaceMean(s, box, dims, bits)
147
+ : sampling === "box"
148
+ ? sampleWvdbDenseBox(s, box, dims, bits)
149
+ : sampleWvdbDense(s, box, dims, bits),
150
+ },
151
+ }));
152
+ return writeWvdb(grids, { ...write, resolution, gridNames, bakeBBox });
153
+ }
154
+ // ---------------------------------------------------------------------------
155
+ // Sources
156
+ // ---------------------------------------------------------------------------
157
+ /** A parsed `.vdb` grid (axis-aligned map) as a sample source. */
158
+ export function wvdbSourceFromVdbGrid(grid) {
159
+ if (grid.valueType !== "float") {
160
+ throw new VDBToolsError("VDB_UNSUPPORTED_GRID_TYPE", `wvdbSourceFromVdbGrid: grid "${grid.name}" is a ${grid.valueType} grid; only float grids can be baked ` +
161
+ `(vdbToWvdb skips the others)`);
162
+ }
163
+ const m = grid.transform.matrix;
164
+ if (m[1] !== 0 || m[2] !== 0 || m[4] !== 0 || m[6] !== 0 || m[8] !== 0 || m[9] !== 0) {
165
+ throw new VDBUnsupportedError(`wvdbSourceFromVdbGrid: grid "${grid.name}" has a rotated map; only axis-aligned maps are supported`);
166
+ }
167
+ const scale = [m[0], m[5], m[10]];
168
+ const translation = [m[3], m[7], m[11]];
169
+ const inverse = scale.map((s) => 1 / s);
170
+ const lo = [Infinity, Infinity, Infinity];
171
+ const hi = [-Infinity, -Infinity, -Infinity];
172
+ for (const leaf of grid.iterLeaves()) {
173
+ for (let offset = 0; offset < 512; offset++) {
174
+ if (((leaf.valueMask[offset >>> 5] >>> (offset & 31)) & 1) === 0)
175
+ continue;
176
+ const ijk = [leaf.origin[0] + (offset >> 6), leaf.origin[1] + ((offset >> 3) & 7), leaf.origin[2] + (offset & 7)];
177
+ for (let a = 0; a < 3; a++) {
178
+ lo[a] = Math.min(lo[a], ijk[a]);
179
+ hi[a] = Math.max(hi[a], ijk[a]);
180
+ }
181
+ }
182
+ }
183
+ let bbox = null;
184
+ if (lo[0] <= hi[0]) {
185
+ const a = [0, 1, 2].map((i) => lo[i] * scale[i] + translation[i]);
186
+ const b = [0, 1, 2].map((i) => hi[i] * scale[i] + translation[i]);
187
+ bbox = [a.map((v, i) => Math.min(v, b[i])), a.map((v, i) => Math.max(v, b[i]))];
188
+ }
189
+ const cls = grid.metadata["class"];
190
+ const ijk = [0, 0, 0];
191
+ return {
192
+ name: grid.name,
193
+ class: typeof cls === "string" ? cls : "unknown",
194
+ background: grid.background,
195
+ bbox,
196
+ sample(world) {
197
+ for (let a = 0; a < 3; a++)
198
+ ijk[a] = Math.round((world[a] - translation[a]) * inverse[a]);
199
+ return grid.readValue(ijk);
200
+ },
201
+ index: {
202
+ // His GridTransform scale-translate maps: (v - translation) * scaleInverse.
203
+ toIndex(world, out) {
204
+ for (let a = 0; a < 3; a++)
205
+ out[a] = (world[a] - translation[a]) * inverse[a];
206
+ return out;
207
+ },
208
+ toIndexVector(v, out) {
209
+ for (let a = 0; a < 3; a++)
210
+ out[a] = v[a] * inverse[a];
211
+ return out;
212
+ },
213
+ voxel: (p) => grid.readValue(p),
214
+ },
215
+ grid,
216
+ };
217
+ }
218
+ const NANO_CLASS = { 1: "level set", 2: "fog volume", 3: "staggered" };
219
+ /** A NanoVDB FLOAT/Fp8/FpN grid image as a sample source, read through the CPU oracle (`readValue`). */
220
+ export function wvdbSourceFromNvdb(gridWords) {
221
+ const view = new DataView(gridWords.buffer, gridWords.byteOffset, gridWords.byteLength);
222
+ const nameBytes = new Uint8Array(gridWords.buffer, gridWords.byteOffset + GRID_OFF_GRID_NAME, GRID_NAME_MAX);
223
+ const nul = nameBytes.indexOf(0);
224
+ const name = new TextDecoder().decode(nameBytes.subarray(0, nul < 0 ? GRID_NAME_MAX : nul));
225
+ const gridType = view.getUint32(GRID_OFF_GRID_TYPE, true);
226
+ const cls = NANO_CLASS[view.getUint32(GRID_OFF_GRID_CLASS, true)] ?? "unknown";
227
+ const mat = Array.from({ length: 9 }, (_, i) => view.getFloat64(GRID_OFF_MAP + MAP_OFF_MATD + i * 8, true));
228
+ const inv = Array.from({ length: 9 }, (_, i) => view.getFloat64(GRID_OFF_MAP + MAP_OFF_INVMATD + i * 8, true));
229
+ const vec = Array.from({ length: 3 }, (_, i) => view.getFloat64(GRID_OFF_MAP + MAP_OFF_VECD + i * 8, true));
230
+ const root = GRID_SIZE + Number(view.getBigUint64(GRID_SIZE + TREE_OFF_NODE_OFFSET_ROOT, true));
231
+ const lo = [0, 1, 2].map((i) => view.getInt32(root + ROOT_OFF_BBOX_MIN + i * 4, true));
232
+ const hi = [0, 1, 2].map((i) => view.getInt32(root + ROOT_OFF_BBOX_MAX + i * 4, true));
233
+ const background = view.getFloat32(root + gridTypeConstantsForId(gridType).root_off_background, true);
234
+ const toWorld = (p) => [0, 1, 2].map((r) => mat[r * 3] * p[0] + mat[r * 3 + 1] * p[1] + mat[r * 3 + 2] * p[2] + vec[r]);
235
+ let bbox = null;
236
+ if (lo[0] <= hi[0] && lo[1] <= hi[1] && lo[2] <= hi[2]) {
237
+ const min = [Infinity, Infinity, Infinity];
238
+ const max = [-Infinity, -Infinity, -Infinity];
239
+ for (let c = 0; c < 8; c++) {
240
+ const w = toWorld([c & 1 ? hi[0] : lo[0], c & 2 ? hi[1] : lo[1], c & 4 ? hi[2] : lo[2]]);
241
+ for (let a = 0; a < 3; a++) {
242
+ min[a] = Math.min(min[a], w[a]);
243
+ max[a] = Math.max(max[a], w[a]);
244
+ }
245
+ }
246
+ bbox = [min, max];
247
+ }
248
+ const ijk = [0, 0, 0];
249
+ return {
250
+ name,
251
+ class: cls,
252
+ background,
253
+ bbox,
254
+ sample(world) {
255
+ const p = [world[0] - vec[0], world[1] - vec[1], world[2] - vec[2]];
256
+ for (let r = 0; r < 3; r++)
257
+ ijk[r] = Math.round(inv[r * 3] * p[0] + inv[r * 3 + 1] * p[1] + inv[r * 3 + 2] * p[2]);
258
+ return vdbReadValueCpu(gridWords, ijk);
259
+ },
260
+ index: {
261
+ toIndex(world, out) {
262
+ const p0 = world[0] - vec[0];
263
+ const p1 = world[1] - vec[1];
264
+ const p2 = world[2] - vec[2];
265
+ for (let r = 0; r < 3; r++)
266
+ out[r] = inv[r * 3] * p0 + inv[r * 3 + 1] * p1 + inv[r * 3 + 2] * p2;
267
+ return out;
268
+ },
269
+ toIndexVector(v, out) {
270
+ const [v0, v1, v2] = v;
271
+ for (let r = 0; r < 3; r++)
272
+ out[r] = inv[r * 3] * v0 + inv[r * 3 + 1] * v1 + inv[r * 3 + 2] * v2;
273
+ return out;
274
+ },
275
+ voxel: (p) => vdbReadValueCpu(gridWords, p),
276
+ },
277
+ grid: gridWords,
278
+ };
279
+ }
280
+ /**
281
+ * `.vdb` → `.wvdb`, like his `wvdb` CLI with the same options. Given the file
282
+ * bytes, `source.sha256` is their digest. Only float grids are baked: vector
283
+ * and point data grids are skipped (his CLI bakes vectors as 3 channels and
284
+ * point data grids as points grids; not ported yet).
285
+ */
286
+ export function vdbToWvdb(input, options = {}) {
287
+ const { fileName = "", ...bake } = options;
288
+ let file;
289
+ let source = bake.source;
290
+ if (input instanceof ArrayBuffer || input instanceof Uint8Array) {
291
+ const bytes = input instanceof Uint8Array ? input : new Uint8Array(input);
292
+ const buffer = bytes.byteOffset === 0 && bytes.byteLength === bytes.buffer.byteLength && bytes.buffer instanceof ArrayBuffer
293
+ ? bytes.buffer
294
+ : bytes.slice().buffer;
295
+ file = parseVdb(buffer);
296
+ source ??= { file: fileName, sha256: sha256Hex(bytes) };
297
+ }
298
+ else {
299
+ file = input;
300
+ }
301
+ const floatGrids = file.grids.filter((g) => g.valueType === "float");
302
+ if (floatGrids.length === 0)
303
+ throw new VDBToolsError("VDB_UNSUPPORTED_GRID_TYPE", "vdbToWvdb: the file has no float grids to bake");
304
+ return bakeWvdb(floatGrids.map(wvdbSourceFromVdbGrid), { ...bake, ...(source ? { source } : {}) });
305
+ }
306
+ /** NanoVDB grid image(s) → `.wvdb`, sampled through the CPU oracle. */
307
+ export function nvdbToWvdb(images, options = {}) {
308
+ const list = images instanceof Uint32Array ? [images] : images;
309
+ return bakeWvdb(list.map(wvdbSourceFromNvdb), options);
310
+ }
311
+ //# sourceMappingURL=bake.js.map