@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
@@ -0,0 +1,65 @@
1
+ // A select member whose type is an enum may be written bare or in its typed
2
+ // form - `.NULL.` or `NULL_STYLE(.NULL.)`. Inside a SELECT the typed form is
3
+ // how a reader tells which member the value is, so exporters use it, and the
4
+ // NIST AP242 set uses it throughout.
5
+ //
6
+ // Reading the typed form used to throw 'Value in select must be populated',
7
+ // because the generated getter's enum fallback is a bare parse starting at
8
+ // the cursor and the wrapper made it fail. Entity-valued members were never
9
+ // affected - the parser indexes an inline TYPENAME(...) entity and
10
+ // extractBufferReference resolves it by address - so this was specific to
11
+ // enum members, and `null_style` is the only enum inside a select in either
12
+ // schema. It accounted for 274 of the public regression baseline's error
13
+ // rows, every one of them a lost styled item. See bldrs-ai/conway#489.
14
+ import { beforeAll, describe, expect, test } from "@jest/globals";
15
+ import AP214StepParser from "./ap214_step_parser.js";
16
+ import ParsingBuffer from "../parsing/parsing_buffer.js";
17
+ import { ParseResult } from "../step/parsing/step_parser.js";
18
+ import { null_style, presentation_style_assignment } from "./AP214E3_2010_gen/index.js";
19
+ import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
20
+ const conwayGeom = new ConwayGeometry();
21
+ /**
22
+ * Initialize the wasm.
23
+ */
24
+ async function initializeWasm() {
25
+ await conwayGeom.initialize();
26
+ }
27
+ const parser = AP214StepParser.Instance;
28
+ // Lifted from nist_stc_06_asme1_ap242-e3.stp, which produces 82 of these.
29
+ // The surrounding ANNOTATION_PLANE is what actually got dropped in the
30
+ // corpus: the throw escaped the styled-item extraction and was caught per
31
+ // representation item.
32
+ const TYPED_STYLE = `#10028 = PRESENTATION_STYLE_ASSIGNMENT((NULL_STYLE(.NULL.)));`;
33
+ // The same value written bare, which always worked. Kept alongside so a
34
+ // change that fixes one by breaking the other cannot pass.
35
+ const BARE_STYLE = `#10028 = PRESENTATION_STYLE_ASSIGNMENT((.NULL.));`;
36
+ const STYLE_EXPRESS_ID = 10028;
37
+ /**
38
+ * Parse one PRESENTATION_STYLE_ASSIGNMENT and read back its styles.
39
+ *
40
+ * @param source The STEP text to parse.
41
+ * @return {Array<unknown>} The resolved styles array.
42
+ */
43
+ function stylesOf(source) {
44
+ const [result, model] = parser.parseDataToModel(new ParsingBuffer(new TextEncoder().encode(source)));
45
+ if (model === void 0 ||
46
+ (result !== ParseResult.COMPLETE && result !== ParseResult.INCOMPLETE)) {
47
+ throw new Error(`parse failed with result ${result}`);
48
+ }
49
+ const assignment = model.getElementByExpressID(STYLE_EXPRESS_ID);
50
+ if (!(assignment instanceof presentation_style_assignment)) {
51
+ throw new Error("expected a presentation_style_assignment");
52
+ }
53
+ return assignment.styles;
54
+ }
55
+ beforeAll(async () => {
56
+ await initializeWasm();
57
+ });
58
+ describe("a typed enum in a select", () => {
59
+ test("NULL_STYLE(.NULL.) resolves instead of throwing", () => {
60
+ expect(stylesOf(TYPED_STYLE)).toEqual([null_style.NULL]);
61
+ });
62
+ test("the bare form still resolves", () => {
63
+ expect(stylesOf(BARE_STYLE)).toEqual([null_style.NULL]);
64
+ });
65
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ap214_unit_scale.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ap214_unit_scale.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_unit_scale.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,111 @@
1
+ import fs from "fs";
2
+ import { describe, expect, test, beforeAll } from "@jest/globals";
3
+ import { AP214GeometryExtraction } from "./ap214_geometry_extraction.js";
4
+ import { ParseResult } from "../step/parsing/step_parser.js";
5
+ import AP214StepParser from "./ap214_step_parser.js";
6
+ import ParsingBuffer from "../parsing/parsing_buffer.js";
7
+ import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
8
+ import { ExtractResult } from "../core/shared_constants.js";
9
+ /* eslint-disable no-magic-numbers -- fixture dimensions, reified vertex
10
+ layout (6 floats) and 4x4 matrix element indices are all clearer as
11
+ literals here than as named constants. */
12
+ /**
13
+ * A millimetre-declared STEP part (`SI_UNIT(.MILLI.,.METRE.)`): a tube
14
+ * 50 x 50 x 100 mm. Any mm fixture would do — what matters is that the
15
+ * declared unit is not the world unit, so the root unit-scale transform
16
+ * has to do real work and its direction is observable.
17
+ */
18
+ const FIXTURE = "data/create-a-tube.step";
19
+ /** Metres per millimetre — the factor a `.MILLI.` file must scale by. */
20
+ const MM_IN_M = 0.001;
21
+ /** The fixture's size in its own (millimetre) file coordinates. */
22
+ const EXPECTED_FILE_SIZE_MM = [50, 50, 100];
23
+ /** Fractional slack, covering tessellation chord error on the tube's curves. */
24
+ const TOLERANCE = 0.02;
25
+ let scene;
26
+ let conwayGeometry;
27
+ beforeAll(async () => {
28
+ const parser = AP214StepParser.Instance;
29
+ const buffer = new ParsingBuffer(fs.readFileSync(FIXTURE));
30
+ expect(parser.parseHeader(buffer)[1]).toBe(ParseResult.COMPLETE);
31
+ const [, parsed] = parser.parseDataToModel(buffer);
32
+ expect(parsed).not.toBe(void 0);
33
+ conwayGeometry = new ConwayGeometry();
34
+ expect(await conwayGeometry.initialize()).toBe(true);
35
+ const [result, sceneBuilder] = new AP214GeometryExtraction(conwayGeometry, parsed).extractAP214GeometryData();
36
+ expect(result).toBe(ExtractResult.COMPLETE);
37
+ scene = sceneBuilder;
38
+ });
39
+ /**
40
+ * Axis-aligned bounds of the whole scene, with each mesh's absolute
41
+ * transform applied — i.e. the model as the renderer sees it, which is
42
+ * where the root unit scale actually lands (vertices stay in file
43
+ * coordinates).
44
+ *
45
+ * @return The size along x, y and z.
46
+ */
47
+ function worldSize() {
48
+ const mins = [Infinity, Infinity, Infinity];
49
+ const maxs = [-Infinity, -Infinity, -Infinity];
50
+ const wasm = conwayGeometry.wasmModule;
51
+ for (const [transform, , mesh] of scene.walk()) {
52
+ const geometry = mesh.geometry;
53
+ const vertexFloatCount = geometry.GetVertexDataSize();
54
+ // Reified layout: 6 floats per vertex, position xyz then normal xyz.
55
+ const vertexData = wasm.HEAPF32.subarray(geometry.GetVertexData() / 4, (geometry.GetVertexData() / 4) + vertexFloatCount);
56
+ for (let where = 0; where < vertexFloatCount; where += 6) {
57
+ const x = vertexData[where];
58
+ const y = vertexData[where + 1];
59
+ const z = vertexData[where + 2];
60
+ const point = transform !== void 0 ? [
61
+ (transform[0] * x) + (transform[4] * y) + (transform[8] * z) + transform[12],
62
+ (transform[1] * x) + (transform[5] * y) + (transform[9] * z) + transform[13],
63
+ (transform[2] * x) + (transform[6] * y) + (transform[10] * z) + transform[14],
64
+ ] : [x, y, z];
65
+ for (let axis = 0; axis < 3; ++axis) {
66
+ mins[axis] = Math.min(mins[axis], point[axis]);
67
+ maxs[axis] = Math.max(maxs[axis], point[axis]);
68
+ }
69
+ }
70
+ }
71
+ return maxs.map((max, axis) => max - mins[axis]);
72
+ }
73
+ describe("AP214 root unit scale", () => {
74
+ test("a millimetre model lands in world space in metres (issue #458)", () => {
75
+ const size = worldSize();
76
+ EXPECTED_FILE_SIZE_MM.forEach((millimetres, axis) => {
77
+ const expectedMetres = millimetres * MM_IN_M;
78
+ expect(size[axis]).toBeGreaterThan(expectedMetres * (1 - TOLERANCE));
79
+ expect(size[axis]).toBeLessThan(expectedMetres * (1 + TOLERANCE));
80
+ });
81
+ });
82
+ test("the scale is metres-per-file-unit, not its reciprocal (issue #458)", () => {
83
+ // The bug this pins was a sign-of-exponent error, not a missing
84
+ // conversion: the root transform scaled by 1/unitInM, so a millimetre
85
+ // model came out 1000x too LARGE rather than 1000x too small. Reading
86
+ // the scale straight off the absolute transform's basis keeps that
87
+ // direction pinned independently of how big the fixture happens to be.
88
+ //
89
+ // Measured per mesh from the basis rather than from a bounds ratio,
90
+ // because instance placements move parts around: a whole-scene bounds
91
+ // ratio starts failing on correct code the moment the fixture gains a
92
+ // second occurrence. Placements are rigid, so the column norm carries
93
+ // the unit scale alone.
94
+ //
95
+ // This expects ONE scale across the scene, which holds because the
96
+ // fixture is single-unit. A mixed-unit assembly is a different case —
97
+ // there `doTransforms` reconciles each child into its parent's unit,
98
+ // so a metre-declared sub-part legitimately ends up at basis norm 1.0
99
+ // — and swapping FIXTURE for one would need the expectation taken per
100
+ // representation's own declared unit rather than as a constant.
101
+ let meshCount = 0;
102
+ for (const [transform] of scene.walk()) {
103
+ expect(transform).toBeDefined();
104
+ const basisColumnLength = Math.hypot(transform[0], transform[1], transform[2]);
105
+ expect(basisColumnLength).toBeCloseTo(MM_IN_M, 6);
106
+ ++meshCount;
107
+ }
108
+ // A scene that walked nothing would pass the loop vacuously.
109
+ expect(meshCount).toBeGreaterThan(0);
110
+ });
111
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ap214_streamed_open.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ap214_streamed_open.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ap214_streamed_open.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,190 @@
1
+ /* eslint-disable no-magic-numbers */
2
+ // STEP demand parity phase 1: the streamed columnar open for AP214 must
3
+ // reproduce the classic open exactly — same entities, same placed
4
+ // instances and transforms, and byte-identical GetGeometry vertex
5
+ // content (the served float frame must match the scene transforms; see
6
+ // AP214ModelGeometry.add's mirror-freeze note).
7
+ import * as fs from "fs";
8
+ import { beforeAll, describe, expect, test } from "@jest/globals";
9
+ import { IfcAPI } from "./ifc_api.js";
10
+ const SETTINGS = { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true };
11
+ // Fixtures with real served geometry (as1-assembly is structure-only —
12
+ // zero meshes even classically; ap214-multibody-part's geometry ids
13
+ // serve no vertex data through GetGeometry on the classic path either).
14
+ const FIXTURES = [
15
+ "data/nema-23-76mm.step",
16
+ "data/a-gear-with-3-inch-diameter-and-20-curved-teeth.step",
17
+ ];
18
+ let api;
19
+ /**
20
+ * Capture per-entity placed instances from a model.
21
+ *
22
+ * @param modelID The open model.
23
+ * @return {Map} expressID -> {geometryExpressID, flatTransformation}[].
24
+ */
25
+ function capture(modelID) {
26
+ const instances = new Map();
27
+ api.StreamAllMeshes(modelID, (mesh) => {
28
+ const list = instances.get(mesh.expressID) ?? [];
29
+ for (let where = 0; where < mesh.geometries.size(); ++where) {
30
+ const placed = mesh.geometries.get(where);
31
+ list.push({
32
+ geometryExpressID: placed.geometryExpressID,
33
+ flatTransformation: [...placed.flatTransformation],
34
+ });
35
+ }
36
+ instances.set(mesh.expressID, list);
37
+ });
38
+ return instances;
39
+ }
40
+ beforeAll(async () => {
41
+ api = new IfcAPI();
42
+ await api.Init();
43
+ }, 120000);
44
+ describe("OpenModelStreamed on AP214 STEP input", () => {
45
+ test.each(FIXTURES)("streamed open matches classic exactly: %s", async (fixture) => {
46
+ const data = new Uint8Array(fs.readFileSync(fixture));
47
+ const classicID = api.OpenModel(data, SETTINGS);
48
+ const classic = capture(classicID);
49
+ expect(classic.size).toBeGreaterThan(0);
50
+ const streamedID = await api.OpenModelStreamed(data, SETTINGS);
51
+ expect(streamedID).toBeGreaterThanOrEqual(0);
52
+ const streamed = capture(streamedID);
53
+ expect(streamed.size).toBe(classic.size);
54
+ for (const [expressID, classicList] of classic) {
55
+ const streamedList = streamed.get(expressID);
56
+ expect(streamedList).toBeDefined();
57
+ expect(streamedList.length).toBe(classicList.length);
58
+ for (let where = 0; where < classicList.length; ++where) {
59
+ expect(streamedList[where].geometryExpressID)
60
+ .toBe(classicList[where].geometryExpressID);
61
+ expect(streamedList[where].flatTransformation)
62
+ .toEqual(classicList[where].flatTransformation);
63
+ }
64
+ }
65
+ // Vertex content: the streamed open's GetGeometry must serve
66
+ // byte-identical floats to classic for every placed geometry.
67
+ const geometryIDs = new Set();
68
+ for (const list of classic.values()) {
69
+ for (const placed of list) {
70
+ geometryIDs.add(placed.geometryExpressID);
71
+ }
72
+ }
73
+ let compared = 0;
74
+ for (const geometryID of geometryIDs) {
75
+ const classicGeometry = api.GetGeometry(classicID, geometryID);
76
+ const streamedGeometry = api.GetGeometry(streamedID, geometryID);
77
+ const classicSize = classicGeometry.GetVertexDataSize();
78
+ if (classicSize === 0) {
79
+ continue;
80
+ }
81
+ expect(streamedGeometry.GetVertexDataSize()).toBe(classicSize);
82
+ expect(api.GetVertexArray(streamedGeometry.GetVertexData(), classicSize))
83
+ .toEqual(api.GetVertexArray(classicGeometry.GetVertexData(), classicSize));
84
+ ++compared;
85
+ }
86
+ expect(compared).toBeGreaterThan(0);
87
+ // No CloseModel here: closing destroys the shared wasm processor
88
+ // and poisons later opens (pre-existing multi-open quirk).
89
+ }, 240000);
90
+ test.each(FIXTURES)("deferred unit pump to completion matches classic exactly: %s", async (fixture) => {
91
+ const data = new Uint8Array(fs.readFileSync(fixture));
92
+ const classicID = api.OpenModel(data, SETTINGS);
93
+ const classic = capture(classicID);
94
+ expect(classic.size).toBeGreaterThan(0);
95
+ const deferredID = await api.OpenModelStreamed(data, { ...SETTINGS, DEFER_GEOMETRY: true });
96
+ expect(deferredID).toBeGreaterThanOrEqual(0);
97
+ // Pump in deliberately small unit batches, accumulating delta
98
+ // emissions additively per entity.
99
+ const pumped = new Map();
100
+ let rounds = 0;
101
+ for (;;) {
102
+ const { extracted, remaining } = api.ExtractGeometryBatch(deferredID, 2, (mesh) => {
103
+ const list = pumped.get(mesh.expressID) ?? [];
104
+ for (let where = 0; where < mesh.geometries.size(); ++where) {
105
+ const placed = mesh.geometries.get(where);
106
+ list.push({
107
+ geometryExpressID: placed.geometryExpressID,
108
+ flatTransformation: [...placed.flatTransformation],
109
+ });
110
+ }
111
+ pumped.set(mesh.expressID, list);
112
+ });
113
+ ++rounds;
114
+ if (remaining === 0 && extracted === 0) {
115
+ break;
116
+ }
117
+ }
118
+ expect(rounds).toBeGreaterThan(1);
119
+ expect(pumped.size).toBe(classic.size);
120
+ for (const [expressID, classicList] of classic) {
121
+ const pumpedList = pumped.get(expressID);
122
+ expect(pumpedList).toBeDefined();
123
+ expect(pumpedList.length).toBe(classicList.length);
124
+ // Instance sets match (order may differ across unit batches):
125
+ // every classic instance has an exactly-matching pumped one.
126
+ const unmatched = pumpedList.map((entry) => entry);
127
+ for (const reference of classicList) {
128
+ const matchIndex = unmatched.findIndex((candidate) => candidate.geometryExpressID === reference.geometryExpressID &&
129
+ candidate.flatTransformation.every((value, where) => Math.abs(value - reference.flatTransformation[where]) < 1e-9));
130
+ expect(matchIndex).toBeGreaterThanOrEqual(0);
131
+ unmatched.splice(matchIndex, 1);
132
+ }
133
+ }
134
+ // No CloseModel: closing destroys the shared wasm processor and
135
+ // degrades later opens (pre-existing multi-open quirk).
136
+ }, 240000);
137
+ test("ON_PREVIEW_MESH emits classic-parity payloads for STEP (phase 3)", async () => {
138
+ // The gear parses in one cooperative slice, so the timer-driven
139
+ // channel never fires during a real open here — drive the channel
140
+ // directly over a finished sink (prefix == whole file), like the
141
+ // IFC channel test: a full drain must reproduce the classic
142
+ // instance set with the AP214 capture math (bare composition).
143
+ const fs2 = await import("fs");
144
+ const { ConwayGeometry } = await import("../../../dependencies/conway-geom/index.js");
145
+ const { buildIndexStreaming } = await import("../../step/parsing/streaming_index_builder.js");
146
+ const { ColumnarIndexSink } = await import("../../step/parsing/columnar_index.js");
147
+ const { BufferByteSource } = await import("../../step/parsing/byte_source.js");
148
+ const AP214StepParser = (await import("../../AP214E3_2010/ap214_step_parser.js")).default;
149
+ const { ap214PreviewAdapter, StreamedPreviewChannel } = await import("./streamed_preview_channel.js");
150
+ const data = new Uint8Array(fs2.readFileSync(FIXTURES[1]));
151
+ const classicID = api.OpenModel(data, SETTINGS);
152
+ const classic = capture(classicID);
153
+ let classicTotal = 0;
154
+ for (const list of classic.values()) {
155
+ classicTotal += list.length;
156
+ }
157
+ expect(classicTotal).toBeGreaterThan(0);
158
+ const conwayGeometry = new ConwayGeometry();
159
+ expect(await conwayGeometry.initialize()).toBe(true);
160
+ const sink = new ColumnarIndexSink();
161
+ const { result } = buildIndexStreaming(new BufferByteSource(data), AP214StepParser.Instance, 1024 * 1024, void 0, sink);
162
+ expect(result).toBe(0);
163
+ const payloads = [];
164
+ const channel = new StreamedPreviewChannel(data, conwayGeometry, sink, ap214PreviewAdapter(), true, (mesh) => payloads.push(mesh), void 0, void 0, 1);
165
+ channel.drainForTest();
166
+ expect(payloads.length).toBe(classicTotal);
167
+ for (const payload of payloads) {
168
+ const candidates = classic.get(payload.expressID);
169
+ expect(candidates).toBeDefined();
170
+ const matchIndex = candidates.findIndex((candidate) => candidate.geometryExpressID === payload.geometryExpressID &&
171
+ candidate.flatTransformation.every((value, where) => Math.abs(value - payload.flatTransformation[where]) < 0.000001));
172
+ expect(matchIndex).toBeGreaterThanOrEqual(0);
173
+ }
174
+ const carriers = payloads.filter((payload) => payload.vertexData !== void 0);
175
+ expect(carriers.length).toBeGreaterThan(0);
176
+ }, 240000);
177
+ test("StreamAllMeshes on a deferred STEP model drains the pump and matches classic", async () => {
178
+ const data = new Uint8Array(fs.readFileSync(FIXTURES[0]));
179
+ const classicID = api.OpenModel(data, SETTINGS);
180
+ const classic = capture(classicID);
181
+ const deferredID = await api.OpenModelStreamed(data, { ...SETTINGS, DEFER_GEOMETRY: true });
182
+ // No pump calls at all — the whole-model consumer must still get
183
+ // the complete mesh set (the proxy drains internally).
184
+ const drained = capture(deferredID);
185
+ expect(drained.size).toBe(classic.size);
186
+ for (const [expressID, classicList] of classic) {
187
+ expect(drained.get(expressID)?.length).toBe(classicList.length);
188
+ }
189
+ }, 240000);
190
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=coordination_export_order.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordination_export_order.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/coordination_export_order.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,110 @@
1
+ /* eslint-disable no-magic-numbers */
2
+ // Export-order independence of the COORDINATE_TO_ORIGIN frame (Share#1749).
3
+ //
4
+ // The recentre anchors on the first geometry the walk reaches, which is
5
+ // whichever element the file happens to declare first. Unsnapped, that
6
+ // makes a model's rendered position a function of its element order:
7
+ // Share shipped the Bldrs logo as both `index.ifc` and `index.step`, and
8
+ // the STEP rendered 76m off the IFC because the two files disagree about
9
+ // which block comes first. Every camera permalink spanning the pair was
10
+ // wrong, and auto-framing hid it — the models look identical until a
11
+ // `#c:` camera pins them.
12
+ //
13
+ // This drives the same surface Share does (the compat IfcAPI, not the
14
+ // CLI's native writer, which has its own recentre convention) and pins
15
+ // the properties the snap has to hold together: a near-origin model
16
+ // keeps the coordinates its file authored — which is what makes two
17
+ // exports of one object coincide — a georeferenced model still
18
+ // recentres, and the classic and streamed opens agree.
19
+ //
20
+ // Not covered here: the AP214 arm. Its placements come back at the
21
+ // origin with the geometry carrying the world transform, so neither
22
+ // placement bounds nor a fixture pair in two element orders reproduces
23
+ // the defect through this surface; the cross-format claim is pinned
24
+ // Share-side instead (`src/Containers/indexStepLogo.spec.ts`, which
25
+ // compares the rendered bounds of `index.ifc` and `index.step`).
26
+ import * as fs from "fs";
27
+ import { beforeAll, describe, expect, test } from "@jest/globals";
28
+ import { LARGE_COORDINATE_BUDGET_M, COORDINATION_SNAP_M } from "./coordination_f64.js";
29
+ import { IfcAPI } from "./ifc_api.js";
30
+ const SETTINGS = { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true };
31
+ let api;
32
+ let local;
33
+ let georeferenced;
34
+ /**
35
+ * World-space bounds of every placed geometry in a model, as the
36
+ * consumer sees them: the placement translation is what Share stamps
37
+ * onto its instances.
38
+ *
39
+ * @param modelID An open model.
40
+ * @return {{min: number[], max: number[]}} Translation bounds.
41
+ */
42
+ function placementBounds(modelID) {
43
+ const min = [Infinity, Infinity, Infinity];
44
+ const max = [-Infinity, -Infinity, -Infinity];
45
+ api.StreamAllMeshes(modelID, (mesh) => {
46
+ for (let where = 0; where < mesh.geometries.size(); ++where) {
47
+ const t = mesh.geometries.get(where).flatTransformation;
48
+ for (let axis = 0; axis < 3; ++axis) {
49
+ min[axis] = Math.min(min[axis], t[12 + axis]);
50
+ max[axis] = Math.max(max[axis], t[12 + axis]);
51
+ }
52
+ }
53
+ });
54
+ return { min, max };
55
+ }
56
+ beforeAll(async () => {
57
+ api = new IfcAPI();
58
+ await api.Init();
59
+ local = new Uint8Array(fs.readFileSync("data/index.ifc"));
60
+ georeferenced = new Uint8Array(fs.readFileSync("data/index_georeferenced.ifc"));
61
+ }, 120000);
62
+ describe("COORDINATE_TO_ORIGIN export-order independence (Share#1749)", () => {
63
+ test("a near-origin model keeps its authored coordinates", async () => {
64
+ const modelID = await api.OpenModel(local, { ...SETTINGS });
65
+ const { min, max } = placementBounds(modelID);
66
+ expect(Number.isFinite(min[0])).toBe(true);
67
+ // The logo's first-declared block sits at x=76, so the unsnapped
68
+ // frame used to drag the whole model 76m negative. Snapped, the
69
+ // anchor lands in the origin cell and the model stays where the file
70
+ // put it — which is what makes a second export of the same object
71
+ // coincide with it regardless of element order.
72
+ expect(Math.max(...min.map(Math.abs), ...max.map(Math.abs)))
73
+ .toBeLessThan(COORDINATION_SNAP_M);
74
+ expect(min[0]).toBeGreaterThanOrEqual(0);
75
+ api.CloseModel(modelID);
76
+ }, 120000);
77
+ test("a georeferenced model still recentres, inside the budget", async () => {
78
+ const modelID = await api.OpenModel(georeferenced, { ...SETTINGS });
79
+ const { min, max } = placementBounds(modelID);
80
+ // Snapping costs at most half a cell on top of the model's own
81
+ // extent; the budget is the threshold above which float32 jitter
82
+ // becomes visible (Share#1631).
83
+ expect(Math.max(...min.map(Math.abs), ...max.map(Math.abs)))
84
+ .toBeLessThan(LARGE_COORDINATE_BUDGET_M);
85
+ // The applied-frame report (Share#1634) is not asserted here: only
86
+ // the deferred pump records it, and
87
+ // `ifc_api_preview_coordination.test.ts` already covers that path.
88
+ api.CloseModel(modelID);
89
+ }, 120000);
90
+ test("the classic and streamed opens agree on the frame", async () => {
91
+ // Both paths derive through deriveCoordinationF64, so the snap has
92
+ // to leave them identical — otherwise one model renders in two
93
+ // places depending on which open Share happened to take. Compared
94
+ // through the emitted placements rather than
95
+ // GetAppliedCoordinationMatrix, which only the deferred pump fills
96
+ // in: on these two opens it reports the identity contract for both,
97
+ // so comparing it would pass no matter what the frames did.
98
+ const classicID = await api.OpenModel(georeferenced, { ...SETTINGS });
99
+ const classic = placementBounds(classicID);
100
+ api.CloseModel(classicID);
101
+ const streamedID = await api.OpenModelStreamed(georeferenced, { ...SETTINGS });
102
+ const streamed = placementBounds(streamedID);
103
+ api.CloseModel(streamedID);
104
+ expect(Number.isFinite(classic.min[0])).toBe(true);
105
+ for (let axis = 0; axis < 3; ++axis) {
106
+ expect(streamed.min[axis]).toBeCloseTo(classic.min[axis], 6);
107
+ expect(streamed.max[axis]).toBeCloseTo(classic.max[axis], 6);
108
+ }
109
+ }, 120000);
110
+ });