@bldrs-ai/conway 1.389.1221 → 1.394.1504

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 (382) hide show
  1. package/README.md +36 -22
  2. package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
  3. package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
  4. package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
  5. package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
  6. package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  7. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
  8. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
  9. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
  10. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
  11. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  12. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
  13. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
  14. package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
  15. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
  16. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
  17. package/compiled/examples/browser-bundled.cjs +1569 -51
  18. package/compiled/examples/cli-bundled.cjs +2790 -436
  19. package/compiled/examples/cli-step-bundled.cjs +1904 -229
  20. package/compiled/examples/validator-bundled.cjs +1569 -51
  21. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
  22. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
  23. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
  24. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
  25. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
  26. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
  27. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
  28. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
  29. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
  30. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
  31. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
  32. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
  33. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
  34. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
  35. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
  36. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
  37. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
  38. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
  39. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
  40. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
  41. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
  42. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
  43. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
  44. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
  45. package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
  46. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
  47. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
  48. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
  49. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
  50. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
  51. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
  52. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
  53. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
  54. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
  55. package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
  56. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
  57. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
  58. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
  59. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
  60. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
  61. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
  62. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
  63. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
  64. package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
  65. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
  66. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
  67. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
  68. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
  69. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
  70. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
  71. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
  72. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
  73. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
  74. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
  75. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
  76. package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
  77. package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
  78. package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
  79. package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
  80. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
  81. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
  82. package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
  83. package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
  84. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  85. package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
  86. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
  87. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
  88. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
  89. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
  90. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
  91. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
  92. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  93. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
  94. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
  95. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
  96. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
  97. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
  98. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
  99. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
  100. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
  101. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
  102. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
  103. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
  104. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  105. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
  106. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
  107. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
  108. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
  109. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
  110. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
  111. package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
  112. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
  113. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
  114. package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
  115. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
  116. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
  117. package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
  118. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
  119. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
  120. package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
  121. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
  122. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
  123. package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
  124. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
  125. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
  126. package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
  127. package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
  128. package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
  129. package/compiled/src/core/composed_model_skeleton.js +66 -0
  130. package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
  131. package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
  132. package/compiled/src/core/composed_model_skeleton.test.js +69 -0
  133. package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
  134. package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
  135. package/compiled/src/core/demand_geometry_queue.js +223 -0
  136. package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
  137. package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
  138. package/compiled/src/core/demand_geometry_queue.test.js +133 -0
  139. package/compiled/src/core/demand_residency_pump.d.ts +93 -0
  140. package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
  141. package/compiled/src/core/demand_residency_pump.js +120 -0
  142. package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
  143. package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
  144. package/compiled/src/core/demand_residency_pump.test.js +148 -0
  145. package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
  146. package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
  147. package/compiled/src/core/geometry_tile_bindings.js +76 -0
  148. package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
  149. package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
  150. package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
  151. package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
  152. package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
  153. package/compiled/src/core/geometry_tile_pool.js +104 -0
  154. package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
  155. package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
  156. package/compiled/src/core/geometry_tile_pool.test.js +180 -0
  157. package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
  158. package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
  159. package/compiled/src/core/mem/chunked_pool.js +149 -0
  160. package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
  161. package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
  162. package/compiled/src/core/mem/chunked_pool.test.js +63 -0
  163. package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
  164. package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
  165. package/compiled/src/core/mem/shared_asset_pool.js +113 -0
  166. package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
  167. package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
  168. package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
  169. package/compiled/src/core/model_registry.d.ts +87 -0
  170. package/compiled/src/core/model_registry.d.ts.map +1 -0
  171. package/compiled/src/core/model_registry.js +101 -0
  172. package/compiled/src/core/model_registry.test.d.ts +2 -0
  173. package/compiled/src/core/model_registry.test.d.ts.map +1 -0
  174. package/compiled/src/core/model_registry.test.js +60 -0
  175. package/compiled/src/core/model_uri.d.ts +57 -0
  176. package/compiled/src/core/model_uri.d.ts.map +1 -0
  177. package/compiled/src/core/model_uri.js +101 -0
  178. package/compiled/src/core/model_uri.test.d.ts +2 -0
  179. package/compiled/src/core/model_uri.test.d.ts.map +1 -0
  180. package/compiled/src/core/model_uri.test.js +49 -0
  181. package/compiled/src/core/progress.d.ts +16 -2
  182. package/compiled/src/core/progress.d.ts.map +1 -1
  183. package/compiled/src/core/progress.js +31 -5
  184. package/compiled/src/core/progress.test.js +11 -2
  185. package/compiled/src/core/progress_log.d.ts +1 -0
  186. package/compiled/src/core/progress_log.d.ts.map +1 -1
  187. package/compiled/src/core/progress_log.js +7 -2
  188. package/compiled/src/core/progress_log.test.js +21 -0
  189. package/compiled/src/core/shared_byte_budget.d.ts +60 -0
  190. package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
  191. package/compiled/src/core/shared_byte_budget.js +85 -0
  192. package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
  193. package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
  194. package/compiled/src/core/shared_byte_budget.test.js +55 -0
  195. package/compiled/src/core/wasm_heap.d.ts +208 -0
  196. package/compiled/src/core/wasm_heap.d.ts.map +1 -0
  197. package/compiled/src/core/wasm_heap.js +417 -0
  198. package/compiled/src/core/wasm_heap.test.d.ts +2 -0
  199. package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
  200. package/compiled/src/core/wasm_heap.test.js +546 -0
  201. package/compiled/src/demand/index.d.ts +23 -0
  202. package/compiled/src/demand/index.d.ts.map +1 -0
  203. package/compiled/src/demand/index.js +22 -0
  204. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
  205. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
  206. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
  207. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
  208. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
  209. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
  210. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
  211. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
  212. package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
  213. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
  214. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
  215. package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
  216. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
  217. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  218. package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
  219. package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
  220. package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
  221. package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
  222. package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
  223. package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
  224. package/compiled/src/ifc/ifc_model_geometry.js +15 -0
  225. package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
  226. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
  227. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
  228. package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
  229. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
  230. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
  231. package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
  232. package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
  233. package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
  234. package/compiled/src/ifc/ifc_step_model.js +6 -4
  235. package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
  236. package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
  237. package/compiled/src/ifc/ifc_step_parser.js +64 -0
  238. package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
  239. package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
  240. package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
  241. package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
  242. package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
  243. package/compiled/src/ifc/ifc_stream_open.js +116 -0
  244. package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
  245. package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
  246. package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
  247. package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
  248. package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
  249. package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
  250. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
  251. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
  252. package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
  253. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
  254. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
  255. package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
  256. package/compiled/src/index.d.ts +21 -1
  257. package/compiled/src/index.d.ts.map +1 -1
  258. package/compiled/src/index.js +28 -1
  259. package/compiled/src/logging/logger.d.ts +16 -2
  260. package/compiled/src/logging/logger.d.ts.map +1 -1
  261. package/compiled/src/logging/logger.js +34 -7
  262. package/compiled/src/logging/logger.test.js +30 -0
  263. package/compiled/src/mem/index.d.ts +17 -0
  264. package/compiled/src/mem/index.d.ts.map +1 -0
  265. package/compiled/src/mem/index.js +16 -0
  266. package/compiled/src/namespace_surface.test.d.ts +2 -0
  267. package/compiled/src/namespace_surface.test.d.ts.map +1 -0
  268. package/compiled/src/namespace_surface.test.js +43 -0
  269. package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
  270. package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
  271. package/compiled/src/parsing/parsing_buffer.js +31 -0
  272. package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
  273. package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
  274. package/compiled/src/scripts/model_report_displacement.test.js +104 -0
  275. package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
  276. package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
  277. package/compiled/src/scripts/render_glb_paths.test.js +115 -0
  278. package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
  279. package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
  280. package/compiled/src/step/indexing/step_type_indexer.js +67 -0
  281. package/compiled/src/step/parsing/byte_source.d.ts +153 -0
  282. package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
  283. package/compiled/src/step/parsing/byte_source.js +106 -0
  284. package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
  285. package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
  286. package/compiled/src/step/parsing/byte_source.test.js +47 -0
  287. package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
  288. package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
  289. package/compiled/src/step/parsing/byte_source_node.js +54 -0
  290. package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
  291. package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
  292. package/compiled/src/step/parsing/columnar_index.js +224 -0
  293. package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
  294. package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
  295. package/compiled/src/step/parsing/columnar_index.test.js +155 -0
  296. package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
  297. package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
  298. package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
  299. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
  300. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
  301. package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
  302. package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
  303. package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
  304. package/compiled/src/step/parsing/decode_utf8.js +28 -0
  305. package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
  306. package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
  307. package/compiled/src/step/parsing/express_ref_scan.js +91 -0
  308. package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
  309. package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
  310. package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
  311. package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
  312. package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
  313. package/compiled/src/step/parsing/index_sidecar.js +283 -0
  314. package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
  315. package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
  316. package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
  317. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
  318. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
  319. package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
  320. package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
  321. package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
  322. package/compiled/src/step/parsing/prefix_type_index.js +207 -0
  323. package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
  324. package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
  325. package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
  326. package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
  327. package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
  328. package/compiled/src/step/parsing/range_byte_source.js +78 -0
  329. package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
  330. package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
  331. package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
  332. package/compiled/src/step/parsing/record_event.d.ts +23 -0
  333. package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
  334. package/compiled/src/step/parsing/record_event.js +1 -0
  335. package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
  336. package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
  337. package/compiled/src/step/parsing/record_field_cursor.js +189 -0
  338. package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
  339. package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
  340. package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
  341. package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
  342. package/compiled/src/step/parsing/step_parser.d.ts +66 -1
  343. package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
  344. package/compiled/src/step/parsing/step_parser.js +164 -10
  345. package/compiled/src/step/parsing/step_string_parser.js +8 -8
  346. package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
  347. package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
  348. package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
  349. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
  350. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
  351. package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
  352. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
  353. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
  354. package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
  355. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
  356. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
  357. package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
  358. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
  359. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
  360. package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
  361. package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
  362. package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
  363. package/compiled/src/step/parsing/uint32_sink.js +180 -0
  364. package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
  365. package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
  366. package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
  367. package/compiled/src/step/step_buffer_provider.d.ts +48 -3
  368. package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
  369. package/compiled/src/step/step_buffer_provider.js +60 -11
  370. package/compiled/src/step/step_buffer_provider.test.js +14 -0
  371. package/compiled/src/step/step_entity_base.d.ts +65 -3
  372. package/compiled/src/step/step_entity_base.d.ts.map +1 -1
  373. package/compiled/src/step/step_entity_base.js +135 -3
  374. package/compiled/src/step/step_model_base.d.ts +221 -8
  375. package/compiled/src/step/step_model_base.d.ts.map +1 -1
  376. package/compiled/src/step/step_model_base.js +542 -7
  377. package/compiled/src/stream/index.d.ts +34 -0
  378. package/compiled/src/stream/index.d.ts.map +1 -0
  379. package/compiled/src/stream/index.js +32 -0
  380. package/compiled/src/version/version.js +1 -1
  381. package/compiled/tsconfig.tsbuildinfo +1 -1
  382. package/package.json +16 -1
@@ -34,9 +34,10 @@
34
34
  * a {@link StepExternalByteStore} with an LRU residency cap.
35
35
  * Records contained in one chunk are served as a view over it;
36
36
  * records straddling chunks get a per-record merged copy. Eviction
37
- * is advisory — descriptors that captured a chunk keep it alive
38
- * via their own reference, so correctness never depends on the
39
- * residency set; only memory does.
37
+ * is advisory while a descriptor still holds a chunk view.
38
+ * {@link StepModelBase.releaseSourceViews} drops those views so
39
+ * the LRU can evict; the next sync read must `ensureResident`
40
+ * first (same as any other miss).
40
41
  *
41
42
  * The external store itself is environment-provided (OPFS in the
42
43
  * browser, a file or memory in node) — this module only defines the
@@ -150,6 +151,21 @@ export interface StepBufferProvider {
150
151
  * @return {Promise< void >} Resolves when resident.
151
152
  */
152
153
  ensureResident(address: number, length: number): Promise<void>;
154
+ /**
155
+ * Hold a range against LRU eviction until a matching
156
+ * {@link unpinRange}. No-op on a fully-resident source. Refcounted.
157
+ *
158
+ * @param address Absolute start of the range.
159
+ * @param length Length of the range.
160
+ */
161
+ pinRange?(address: number, length: number): void;
162
+ /**
163
+ * Drop one {@link pinRange} hold on a range.
164
+ *
165
+ * @param address Absolute start of the range.
166
+ * @param length Length of the range.
167
+ */
168
+ unpinRange?(address: number, length: number): void;
153
169
  }
154
170
  /**
155
171
  * Provider over a fully-resident source buffer — the default, and
@@ -274,5 +290,34 @@ export declare class WindowedStepBufferProvider implements StepBufferProvider {
274
290
  * @return {Promise< void >} Resolves when resident.
275
291
  */
276
292
  ensureResident(address: number, length: number): Promise<void>;
293
+ /**
294
+ * Hold a range against LRU eviction until {@link unpinRange}.
295
+ *
296
+ * @param address Absolute start of the range.
297
+ * @param length Length of the range.
298
+ */
299
+ pinRange(address: number, length: number): void;
300
+ /**
301
+ * Drop one {@link pinRange} hold.
302
+ *
303
+ * @param address Absolute start of the range.
304
+ * @param length Length of the range.
305
+ */
306
+ unpinRange(address: number, length: number): void;
307
+ /**
308
+ * Chunk indices covering `[address, address + length)`.
309
+ *
310
+ * @param address Absolute start.
311
+ * @param length Length in bytes.
312
+ * @return {number[]} Inclusive chunk indices.
313
+ */
314
+ private chunkSpan_;
315
+ /**
316
+ * Adjust a chunk's pin count, deleting the entry at zero.
317
+ *
318
+ * @param chunkIndex The chunk.
319
+ * @param delta +1 pin or -1 unpin.
320
+ */
321
+ private addPin_;
277
322
  }
278
323
  //# sourceMappingURL=step_buffer_provider.d.ts.map
@@ -1 +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IAEtE;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;IAE1D;;;;;;OAMG;gBAEkB,MAAM,EAAE,qBAAqB,EAC9C,UAAU,GAAE,MAA4B,EACxC,iBAAiB,GAAE,MAAoC;IAU3D;;;;OAIG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;OAIG;IACH,IAAW,aAAa,IAAI,MAAM,CASjC;IAED;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAKd;;;;;;;;;;;OAWG;IACI,OAAO,CAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,qBAAqB;IAgDxE;;;;;;;;OAQG;IACU,cAAc,CAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,OAAO,CAAE,IAAI,CAAE;IAoF/E;;;;;OAKG;IACI,QAAQ,CAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,IAAI;IAOxD;;;;;OAKG;IACI,UAAU,CAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,IAAI;IAO1D;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAclB;;;;;OAKG;IACH,OAAO,CAAC,OAAO;CAUhB"}
@@ -34,9 +34,10 @@
34
34
  * a {@link StepExternalByteStore} with an LRU residency cap.
35
35
  * Records contained in one chunk are served as a view over it;
36
36
  * records straddling chunks get a per-record merged copy. Eviction
37
- * is advisory — descriptors that captured a chunk keep it alive
38
- * via their own reference, so correctness never depends on the
39
- * residency set; only memory does.
37
+ * is advisory while a descriptor still holds a chunk view.
38
+ * {@link StepModelBase.releaseSourceViews} drops those views so
39
+ * the LRU can evict; the next sync read must `ensureResident`
40
+ * first (same as any other miss).
40
41
  *
41
42
  * The external store itself is environment-provided (OPFS in the
42
43
  * browser, a file or memory in node) — this module only defines the
@@ -323,7 +324,7 @@ export class WindowedStepBufferProvider {
323
324
  // until we return — the caller's synchronous acquire runs in its
324
325
  // continuation, which can interleave with other ensures' evictions.
325
326
  for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
326
- this.ensurePins_.set(chunkIndex, (this.ensurePins_.get(chunkIndex) ?? 0) + 1);
327
+ this.addPin_(chunkIndex, 1);
327
328
  }
328
329
  try {
329
330
  const loads = [];
@@ -369,14 +370,62 @@ export class WindowedStepBufferProvider {
369
370
  }
370
371
  finally {
371
372
  for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
372
- const pins = this.ensurePins_.get(chunkIndex) ?? 0;
373
- if (pins <= 1) {
374
- this.ensurePins_.delete(chunkIndex);
375
- }
376
- else {
377
- this.ensurePins_.set(chunkIndex, pins - 1);
378
- }
373
+ this.addPin_(chunkIndex, -1);
379
374
  }
380
375
  }
381
376
  }
377
+ /**
378
+ * Hold a range against LRU eviction until {@link unpinRange}.
379
+ *
380
+ * @param address Absolute start of the range.
381
+ * @param length Length of the range.
382
+ */
383
+ pinRange(address, length) {
384
+ for (const chunkIndex of this.chunkSpan_(address, length)) {
385
+ this.addPin_(chunkIndex, 1);
386
+ }
387
+ }
388
+ /**
389
+ * Drop one {@link pinRange} hold.
390
+ *
391
+ * @param address Absolute start of the range.
392
+ * @param length Length of the range.
393
+ */
394
+ unpinRange(address, length) {
395
+ for (const chunkIndex of this.chunkSpan_(address, length)) {
396
+ this.addPin_(chunkIndex, -1);
397
+ }
398
+ }
399
+ /**
400
+ * Chunk indices covering `[address, address + length)`.
401
+ *
402
+ * @param address Absolute start.
403
+ * @param length Length in bytes.
404
+ * @return {number[]} Inclusive chunk indices.
405
+ */
406
+ chunkSpan_(address, length) {
407
+ const chunkBytes = this.chunkBytes_;
408
+ const firstChunk = Math.floor(address / chunkBytes);
409
+ const lastChunk = Math.floor((address + Math.max(length, 1) - 1) / chunkBytes);
410
+ const span = [];
411
+ for (let chunkIndex = firstChunk; chunkIndex <= lastChunk; ++chunkIndex) {
412
+ span.push(chunkIndex);
413
+ }
414
+ return span;
415
+ }
416
+ /**
417
+ * Adjust a chunk's pin count, deleting the entry at zero.
418
+ *
419
+ * @param chunkIndex The chunk.
420
+ * @param delta +1 pin or -1 unpin.
421
+ */
422
+ addPin_(chunkIndex, delta) {
423
+ const pins = (this.ensurePins_.get(chunkIndex) ?? 0) + delta;
424
+ if (pins <= 0) {
425
+ this.ensurePins_.delete(chunkIndex);
426
+ }
427
+ else {
428
+ this.ensurePins_.set(chunkIndex, pins);
429
+ }
430
+ }
382
431
  }
@@ -79,6 +79,20 @@ describe("WindowedStepBufferProvider", () => {
79
79
  expect(() => provider.acquire(16, 8)).not.toThrow();
80
80
  expect(() => provider.acquire(32, 8)).toThrow(StepBufferNotResidentError);
81
81
  });
82
+ test("pinRange holds a chunk across later ensures that would evict it", async () => {
83
+ const bytes = makeBytes(160);
84
+ const provider = new WindowedStepBufferProvider(new InMemoryStepByteStore(bytes), 16, 2);
85
+ await provider.ensureResident(0, 8);
86
+ provider.pinRange(0, 8);
87
+ await provider.ensureResident(16, 8);
88
+ await provider.ensureResident(32, 8);
89
+ await provider.ensureResident(48, 8);
90
+ expect(() => provider.acquire(0, 8)).not.toThrow();
91
+ provider.unpinRange(0, 8);
92
+ await provider.ensureResident(64, 8);
93
+ await provider.ensureResident(80, 8);
94
+ expect(() => provider.acquire(0, 8)).toThrow(StepBufferNotResidentError);
95
+ });
82
96
  test("de-duplicates concurrent in-flight chunk loads", async () => {
83
97
  const bytes = makeBytes(64);
84
98
  let reads = 0;
@@ -3,6 +3,7 @@ import { Entity } from "../core/entity.js";
3
3
  import { EntityDescription, EntityFieldsDescription } from "../core/entity_description.js";
4
4
  import { EntityFieldDescription } from "../core/entity_field_description.js";
5
5
  import { WasmModule } from "../core/native_types.js";
6
+ import { Uint32Sink } from "./parsing/uint32_sink.js";
6
7
  import { StepEntityConstructorAbstract } from "./step_entity_constructor.js";
7
8
  import StepEntityInternalReference from "./step_entity_internal_reference.js";
8
9
  import StepModelBase from "./step_model_base.js";
@@ -125,14 +126,21 @@ export default abstract class StepEntityBase<EntityTypeIDs extends number> imple
125
126
  * Used by other extraction methods with wrappers to perform
126
127
  * semantically correct extraction.
127
128
  *
129
+ * Unlike the other extractors this has a single signature rather than an
130
+ * optional/non-optional overload pair, because LOGICAL is three-valued:
131
+ * `.U.` is a legitimate value that reads as null, so a non-optional LOGICAL
132
+ * is null-valued too and `optional` only decides whether a *missing* value
133
+ * throws. The old `optional: false` overload promised a bare `boolean` and
134
+ * was a lie for exactly the `.U.` case this extractor exists to handle.
135
+ *
128
136
  * @param offset The offset in the vtable to extract from
129
137
  * @param baseOffset The base offset in the vtable to extract from
130
138
  * @param depth The depth of the vtable to extract from
131
139
  * @param optional Is this an optional field?
132
- * @return {boolean | null} The extracted logical or null for optionals.
140
+ * @return {boolean | null} The extracted logical, or null for `.U.` and for
141
+ * an absent optional.
133
142
  */
134
- extractLogical(offset: number, baseOffset: number, depth: number, optional: true): boolean | null;
135
- extractLogical(offset: number, baseOffset: number, depth: number, optional: false): boolean;
143
+ extractLogical(offset: number, baseOffset: number, depth: number, optional: boolean): boolean | null;
136
144
  /**
137
145
  * Extract a reference from an offset, without type check.
138
146
  *
@@ -144,6 +152,21 @@ export default abstract class StepEntityBase<EntityTypeIDs extends number> imple
144
152
  */
145
153
  extractReference(offset: number, baseOffset: number, depth: number, optional: true): StepEntityBase<EntityTypeIDs> | null;
146
154
  extractReference(offset: number, baseOffset: number, depth: number, optional: false): StepEntityBase<EntityTypeIDs>;
155
+ /**
156
+ * Resolve a single reference field to its local ID without
157
+ * constructing the target entity. Prep maps that only store
158
+ * `Item.localID` (IfcStyledItem → faceset) must not hydrate the
159
+ * target: on a windowed source that would pin the faceset record
160
+ * (often megabytes) for every styled item at once.
161
+ *
162
+ * @param offset The offset in the vtable to extract from.
163
+ * @param baseOffset The base offset of the class in the vtable.
164
+ * @param depth The depth in the inheritance hierarchy.
165
+ * @param optional Is this an optional field?
166
+ * @return {number | null} The referenced local ID, or null if the
167
+ * field is unset/optional-null.
168
+ */
169
+ extractReferenceLocalID(offset: number, baseOffset: number, depth: number, optional: boolean): number | null;
147
170
  /**
148
171
  *
149
172
  * @param buffer
@@ -307,6 +330,45 @@ export default abstract class StepEntityBase<EntityTypeIDs extends number> imple
307
330
  * @return {boolean} True if this extracts, false (usually because this is optional)
308
331
  */
309
332
  extractParseBuffer(offset: number, baseOffset: number, depth: number, result: ParseBuffer, module: WasmModule, optional: boolean): boolean;
333
+ /**
334
+ * Append an unsigned-integer list field straight from the STEP buffer
335
+ * into `sink`, without materialising an intermediate `Array< number >`.
336
+ *
337
+ * Semantically identical to the generated array getters (same
338
+ * optional handling, same element extraction, same "incorrectly
339
+ * typed" error), but it neither allocates nor caches a per-record
340
+ * array — the caller owns one reusable sink for the whole batch. On
341
+ * tessellated models this removes millions of short-lived arrays and
342
+ * the retained heap that goes with them; see Uint32Sink.
343
+ *
344
+ * @param offset The offset in the vtable to extract from.
345
+ * @param baseOffset The base offset of the class in the vtable.
346
+ * @param depth The depth in the inheritance hierarchy.
347
+ * @param sink Receives the appended values.
348
+ * @return {number} How many values were appended (0 when the field is
349
+ * unset/optional-null).
350
+ */
351
+ /**
352
+ * Walk a reference-list field, handing each element's express ID to
353
+ * `onReference` without resolving it to an entity.
354
+ *
355
+ * Lets hot loops decide per element how to read the referenced record
356
+ * (see StepModelBase.extractIntegerArrayByExpressIDInto) instead of
357
+ * paying for an entity per element the way the generated list getters
358
+ * do. Inline (non-reference) elements yield `undefined`, and
359
+ * `onReference` returning false aborts the walk — together those let
360
+ * a caller bail out to the generated getter for anything it is not
361
+ * prepared to handle.
362
+ *
363
+ * @param offset The offset in the vtable to extract from.
364
+ * @param baseOffset The base offset of the class in the vtable.
365
+ * @param depth The depth in the inheritance hierarchy.
366
+ * @param onReference Receives each element's express ID, or undefined
367
+ * for an inline element; return false to abort.
368
+ * @return {boolean} False if the walk was aborted, true otherwise.
369
+ */
370
+ forEachReferenceInField(offset: number, baseOffset: number, depth: number, onReference: (expressID: number | undefined) => boolean): boolean;
371
+ extractIntegerArrayInto(offset: number, baseOffset: number, depth: number, sink: Uint32Sink): number;
310
372
  /**
311
373
  * Extract a number at the particular vtable offset (i.e. the position
312
374
  * in the matching step object).
@@ -1 +1 @@
1
- {"version":3,"file":"step_entity_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_entity_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAajD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,2BAC+B,MAAM,kCAAkC,CAAA;AAC9E,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAG7C,aAAK,YAAY;IACf,OAAO,IAAI;IACX,MAAM,IAAA;IACN,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,KAAK,IAAA;IACL,SAAS,IAAA;IACT,OAAO,IAAA;IACP,QAAQ,IAAA;CACT;AAmDD;;GAEG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,cAAc,CAAC,aAAa,SAAS,MAAM,CAAE,YAAW,MAAM;aA28BxE,OAAO,EAAE,MAAM;IAC/B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;aACnB,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC;IA58BrD;;OAEG;IACH,aAAoB,IAAI,IAAI,aAAa,CAAA;IAEzC;;;;OAIG;IACH,IAAW,QAAQ,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAKtD;IAED;;;;;;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;;;;OAKG;IACH,SAAS,CAAC,eAAe,CAAE,KAAK,EAAE,MAAM,GACtC,QAAQ,CAAE,2BAA2B,CAAC,aAAa,CAAC,CAAE;IAgDxD;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;CAKlC"}
@@ -1,4 +1,6 @@
1
- import { stepExtractArray, stepExtractBinary, stepExtractBoolean, stepExtractInlineElemement, stepExtractLogical, stepExtractNumber, stepExtractOptional, stepExtractReference, stepExtractString, } from "./parsing/step_deserialization_functions.js";
1
+ import { wasmHeapView } from "../core/wasm_heap.js";
2
+ import { skipValue, stepExtractArray, stepExtractArrayBegin, stepExtractArrayToken, stepExtractBinary, stepExtractBoolean, stepExtractInlineElemement, stepExtractLogical, stepExtractNumber, stepExtractOptional, stepExtractReference, stepExtractString, } from "./parsing/step_deserialization_functions.js";
3
+ import { extractIntegerArrayAt } from "./parsing/uint32_sink.js";
2
4
  import { stepBufferBase } from "./step_buffer_provider.js";
3
5
  var IfcTokenType;
4
6
  (function (IfcTokenType) {
@@ -184,6 +186,27 @@ export default class StepEntityBase {
184
186
  }
185
187
  return value;
186
188
  }
189
+ /**
190
+ * Extract a number at the particular vtable offset (i.e. the position
191
+ * in the matching step object).
192
+ *
193
+ * Used by other extraction methods with wrappers to perform
194
+ * semantically correct extraction.
195
+ *
196
+ * Unlike the other extractors this has a single signature rather than an
197
+ * optional/non-optional overload pair, because LOGICAL is three-valued:
198
+ * `.U.` is a legitimate value that reads as null, so a non-optional LOGICAL
199
+ * is null-valued too and `optional` only decides whether a *missing* value
200
+ * throws. The old `optional: false` overload promised a bare `boolean` and
201
+ * was a lie for exactly the `.U.` case this extractor exists to handle.
202
+ *
203
+ * @param offset The offset in the vtable to extract from
204
+ * @param baseOffset The base offset in the vtable to extract from
205
+ * @param depth The depth of the vtable to extract from
206
+ * @param optional Is this an optional field?
207
+ * @return {boolean | null} The extracted logical, or null for `.U.` and for
208
+ * an absent optional.
209
+ */
187
210
  extractLogical(offset, baseOffset, depth, optional) {
188
211
  const [cursor, endCursor, buffer] = this.getOffsetAndEndCursor(offset, baseOffset, depth);
189
212
  const value = stepExtractLogical(buffer, cursor, endCursor);
@@ -217,6 +240,39 @@ export default class StepEntityBase {
217
240
  }
218
241
  return value;
219
242
  }
243
+ /**
244
+ * Resolve a single reference field to its local ID without
245
+ * constructing the target entity. Prep maps that only store
246
+ * `Item.localID` (IfcStyledItem → faceset) must not hydrate the
247
+ * target: on a windowed source that would pin the faceset record
248
+ * (often megabytes) for every styled item at once.
249
+ *
250
+ * @param offset The offset in the vtable to extract from.
251
+ * @param baseOffset The base offset of the class in the vtable.
252
+ * @param depth The depth in the inheritance hierarchy.
253
+ * @param optional Is this an optional field?
254
+ * @return {number | null} The referenced local ID, or null if the
255
+ * field is unset/optional-null.
256
+ */
257
+ extractReferenceLocalID(offset, baseOffset, depth, optional) {
258
+ const [cursor, endCursor, buffer] = this.getOffsetAndEndCursor(offset, baseOffset, depth);
259
+ const expressID = stepExtractReference(buffer, cursor, endCursor);
260
+ if (expressID !== void 0) {
261
+ return this.model.resolveExpressID(expressID) ?? null;
262
+ }
263
+ const inline = this.model.getInlineElementByAddress(extractInlineElementAddress(buffer, cursor, endCursor));
264
+ if (inline !== void 0) {
265
+ return inline.localID;
266
+ }
267
+ if (!optional) {
268
+ throw new Error("Value in STEP was incorrectly typed");
269
+ }
270
+ if (!this.model.nullOnErrors &&
271
+ stepExtractOptional(buffer, cursor, endCursor) !== null) {
272
+ throw new Error("Value in STEP was incorrectly typed");
273
+ }
274
+ return null;
275
+ }
220
276
  /**
221
277
  *
222
278
  * @param buffer
@@ -428,6 +484,8 @@ export default class StepEntityBase {
428
484
  */
429
485
  extractParseBuffer(offset, baseOffset, depth, result, module, optional) {
430
486
  offset -= this.multiReference_ !== void 0 ? baseOffset : 0;
487
+ // releaseSourceViews keeps the vtable and drops `buffer`.
488
+ this.guaranteeBuffer();
431
489
  const internalReference = this.guaranteeVTable(depth);
432
490
  if (offset >= internalReference.vtableCount) {
433
491
  throw new Error("Couldn't read field due to too few fields in record");
@@ -445,10 +503,77 @@ export default class StepEntityBase {
445
503
  if (optional && stepExtractOptional(buffer, cursor, endCursor) === null) {
446
504
  return false;
447
505
  }
448
- const dataPtr = result.resize(endCursor - cursor);
449
- module.HEAPU8.set(buffer.subarray(cursor, endCursor), dataPtr);
506
+ const length = endCursor - cursor;
507
+ // resize() can grow the wasm heap, which on the MT build can leave the
508
+ // module's cached HEAPU8 bound to the pre-growth buffer - so the
509
+ // destination view is taken through wasmHeapView, after the resize, rather
510
+ // than off module.HEAPU8 (#485).
511
+ const dataPtr = result.resize(length);
512
+ wasmHeapView(module, Uint8Array, dataPtr, length)
513
+ .set(buffer.subarray(cursor, endCursor));
450
514
  return true;
451
515
  }
516
+ /**
517
+ * Append an unsigned-integer list field straight from the STEP buffer
518
+ * into `sink`, without materialising an intermediate `Array< number >`.
519
+ *
520
+ * Semantically identical to the generated array getters (same
521
+ * optional handling, same element extraction, same "incorrectly
522
+ * typed" error), but it neither allocates nor caches a per-record
523
+ * array — the caller owns one reusable sink for the whole batch. On
524
+ * tessellated models this removes millions of short-lived arrays and
525
+ * the retained heap that goes with them; see Uint32Sink.
526
+ *
527
+ * @param offset The offset in the vtable to extract from.
528
+ * @param baseOffset The base offset of the class in the vtable.
529
+ * @param depth The depth in the inheritance hierarchy.
530
+ * @param sink Receives the appended values.
531
+ * @return {number} How many values were appended (0 when the field is
532
+ * unset/optional-null).
533
+ */
534
+ /**
535
+ * Walk a reference-list field, handing each element's express ID to
536
+ * `onReference` without resolving it to an entity.
537
+ *
538
+ * Lets hot loops decide per element how to read the referenced record
539
+ * (see StepModelBase.extractIntegerArrayByExpressIDInto) instead of
540
+ * paying for an entity per element the way the generated list getters
541
+ * do. Inline (non-reference) elements yield `undefined`, and
542
+ * `onReference` returning false aborts the walk — together those let
543
+ * a caller bail out to the generated getter for anything it is not
544
+ * prepared to handle.
545
+ *
546
+ * @param offset The offset in the vtable to extract from.
547
+ * @param baseOffset The base offset of the class in the vtable.
548
+ * @param depth The depth in the inheritance hierarchy.
549
+ * @param onReference Receives each element's express ID, or undefined
550
+ * for an inline element; return false to abort.
551
+ * @return {boolean} False if the walk was aborted, true otherwise.
552
+ */
553
+ forEachReferenceInField(offset, baseOffset, depth, onReference) {
554
+ let cursor = this.getOffsetCursor(offset, baseOffset, depth);
555
+ const buffer = this.buffer;
556
+ const endCursor = buffer.length;
557
+ if (stepExtractOptional(buffer, cursor, endCursor) === null) {
558
+ return true;
559
+ }
560
+ let signedCursor0 = stepExtractArrayBegin(buffer, cursor, endCursor);
561
+ cursor = Math.abs(signedCursor0);
562
+ while (signedCursor0 >= 0) {
563
+ if (!onReference(stepExtractReference(buffer, cursor, endCursor))) {
564
+ return false;
565
+ }
566
+ cursor = skipValue(buffer, cursor, endCursor);
567
+ signedCursor0 = stepExtractArrayToken(buffer, cursor, endCursor);
568
+ cursor = Math.abs(signedCursor0);
569
+ }
570
+ return true;
571
+ }
572
+ extractIntegerArrayInto(offset, baseOffset, depth, sink) {
573
+ const cursor = this.getOffsetCursor(offset, baseOffset, depth);
574
+ const buffer = this.buffer;
575
+ return extractIntegerArrayAt(buffer, cursor, buffer.length, sink);
576
+ }
452
577
  /**
453
578
  * Extract a number at the particular vtable offset (i.e. the position
454
579
  * in the matching step object).
@@ -484,6 +609,7 @@ export default class StepEntityBase {
484
609
  * @return {Uint8Array} The buffer for this.
485
610
  */
486
611
  get buffer() {
612
+ this.guaranteeBuffer();
487
613
  return this.internalReference_.buffer;
488
614
  }
489
615
  /**
@@ -578,6 +704,9 @@ export default class StepEntityBase {
578
704
  throw new Error("Entity does not have matching table entry to read from model");
579
705
  }
580
706
  }
707
+ if (classReference.buffer === void 0) {
708
+ this.model.populateBufferEntry(this.localID);
709
+ }
581
710
  // Sync on EVERY access (not just first populate): generated
582
711
  // getters read `this.buffer` right after resolving a cursor for
583
712
  // this depth, and with a windowed provider each class reference
@@ -593,6 +722,9 @@ export default class StepEntityBase {
593
722
  throw new Error("Entity does not have matching table entry to read from model");
594
723
  }
595
724
  }
725
+ if (internalReference.buffer === void 0) {
726
+ this.guaranteeBuffer();
727
+ }
596
728
  return internalReference;
597
729
  }
598
730
  /**