@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.
- package/README.md +36 -22
- package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
- package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
- package/compiled/examples/browser-bundled.cjs +1569 -51
- package/compiled/examples/cli-bundled.cjs +2790 -436
- package/compiled/examples/cli-step-bundled.cjs +1904 -229
- package/compiled/examples/validator-bundled.cjs +1569 -51
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
- package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
- package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.js +66 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.test.js +69 -0
- package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
- package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.js +223 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.test.js +133 -0
- package/compiled/src/core/demand_residency_pump.d.ts +93 -0
- package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.js +120 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.test.js +148 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.js +76 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
- package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
- package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.js +104 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.test.js +180 -0
- package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
- package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.js +149 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.test.js +63 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.js +113 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
- package/compiled/src/core/model_registry.d.ts +87 -0
- package/compiled/src/core/model_registry.d.ts.map +1 -0
- package/compiled/src/core/model_registry.js +101 -0
- package/compiled/src/core/model_registry.test.d.ts +2 -0
- package/compiled/src/core/model_registry.test.d.ts.map +1 -0
- package/compiled/src/core/model_registry.test.js +60 -0
- package/compiled/src/core/model_uri.d.ts +57 -0
- package/compiled/src/core/model_uri.d.ts.map +1 -0
- package/compiled/src/core/model_uri.js +101 -0
- package/compiled/src/core/model_uri.test.d.ts +2 -0
- package/compiled/src/core/model_uri.test.d.ts.map +1 -0
- package/compiled/src/core/model_uri.test.js +49 -0
- package/compiled/src/core/progress.d.ts +16 -2
- package/compiled/src/core/progress.d.ts.map +1 -1
- package/compiled/src/core/progress.js +31 -5
- package/compiled/src/core/progress.test.js +11 -2
- package/compiled/src/core/progress_log.d.ts +1 -0
- package/compiled/src/core/progress_log.d.ts.map +1 -1
- package/compiled/src/core/progress_log.js +7 -2
- package/compiled/src/core/progress_log.test.js +21 -0
- package/compiled/src/core/shared_byte_budget.d.ts +60 -0
- package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.js +85 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.test.js +55 -0
- package/compiled/src/core/wasm_heap.d.ts +208 -0
- package/compiled/src/core/wasm_heap.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.js +417 -0
- package/compiled/src/core/wasm_heap.test.d.ts +2 -0
- package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.test.js +546 -0
- package/compiled/src/demand/index.d.ts +23 -0
- package/compiled/src/demand/index.d.ts.map +1 -0
- package/compiled/src/demand/index.js +22 -0
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_model_geometry.js +15 -0
- package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
- package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
- package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_model.js +6 -4
- package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +64 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.js +116 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
- package/compiled/src/index.d.ts +21 -1
- package/compiled/src/index.d.ts.map +1 -1
- package/compiled/src/index.js +28 -1
- package/compiled/src/logging/logger.d.ts +16 -2
- package/compiled/src/logging/logger.d.ts.map +1 -1
- package/compiled/src/logging/logger.js +34 -7
- package/compiled/src/logging/logger.test.js +30 -0
- package/compiled/src/mem/index.d.ts +17 -0
- package/compiled/src/mem/index.d.ts.map +1 -0
- package/compiled/src/mem/index.js +16 -0
- package/compiled/src/namespace_surface.test.d.ts +2 -0
- package/compiled/src/namespace_surface.test.d.ts.map +1 -0
- package/compiled/src/namespace_surface.test.js +43 -0
- package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
- package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
- package/compiled/src/parsing/parsing_buffer.js +31 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
- package/compiled/src/scripts/model_report_displacement.test.js +104 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
- package/compiled/src/scripts/render_glb_paths.test.js +115 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
- package/compiled/src/step/indexing/step_type_indexer.js +67 -0
- package/compiled/src/step/parsing/byte_source.d.ts +153 -0
- package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.js +106 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.test.js +47 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source_node.js +54 -0
- package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
- package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.js +224 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.test.js +155 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
- package/compiled/src/step/parsing/decode_utf8.js +28 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.js +91 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.js +283 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.js +207 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.js +78 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
- package/compiled/src/step/parsing/record_event.d.ts +23 -0
- package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_event.js +1 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_field_cursor.js +189 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
- package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
- package/compiled/src/step/parsing/step_parser.d.ts +66 -1
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +164 -10
- package/compiled/src/step/parsing/step_string_parser.js +8 -8
- package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
- package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.js +180 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
- package/compiled/src/step/step_buffer_provider.d.ts +48 -3
- package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
- package/compiled/src/step/step_buffer_provider.js +60 -11
- package/compiled/src/step/step_buffer_provider.test.js +14 -0
- package/compiled/src/step/step_entity_base.d.ts +65 -3
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +135 -3
- package/compiled/src/step/step_model_base.d.ts +221 -8
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +542 -7
- package/compiled/src/stream/index.d.ts +34 -0
- package/compiled/src/stream/index.d.ts.map +1 -0
- package/compiled/src/stream/index.js +32 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
import { CanonicalMeshType } from "../../index.js";
|
|
2
|
+
import IfcStepModel from "../../ifc/ifc_step_model.js";
|
|
3
|
+
import { IfcGeometryExtraction } from "../../ifc/ifc_geometry_extraction.js";
|
|
4
|
+
import { IfcBuildingStorey, IfcProduct, IfcProject, IfcRelAggregates, IfcUnitAssignment, } from "../../ifc/ifc4_gen/index.js";
|
|
5
|
+
import { cursorIterator } from "../../indexing/cursor_utilities.js";
|
|
6
|
+
import { WindowedStepBufferProvider } from "../../step/step_buffer_provider.js";
|
|
7
|
+
import * as glmatrix from "gl-matrix";
|
|
8
|
+
import { composeTransformF64, deriveCoordinationF64, IDENTITY_MAT4, NORMALIZE_MAT_F64, } from "./coordination_f64.js";
|
|
9
|
+
import { emitSpatialStructureImposters } from "./spatial_imposter.js";
|
|
10
|
+
import { releaseModelGeometry, } from "./streamed_preview_channel.js";
|
|
11
|
+
/* eslint-disable no-magic-numbers */
|
|
12
|
+
const TICK_INTERVAL_MS = 150;
|
|
13
|
+
const TICK_INTERVAL_MAX_MS = 600;
|
|
14
|
+
const TICK_INTERVAL_GROWTH = 1.1;
|
|
15
|
+
/**
|
|
16
|
+
* Extraction + capture budget per tick, mirroring
|
|
17
|
+
* {@link StreamedPreviewChannel}'s. The store path used to extract
|
|
18
|
+
* exactly ONE product per tick on the interval below, i.e. 2-7
|
|
19
|
+
* products/second — which is why PSB's preview arrived girder by girder
|
|
20
|
+
* where the resident path delivered batches (conway#518).
|
|
21
|
+
*/
|
|
22
|
+
const TICK_BUDGET_MS = 20;
|
|
23
|
+
/**
|
|
24
|
+
* Products a single tick may attempt, whatever the clock says.
|
|
25
|
+
*
|
|
26
|
+
* `deferDanglingPlacements` (Share#1744) defers any product whose
|
|
27
|
+
* placement records the prefix does not hold yet, and Revit writes
|
|
28
|
+
* per-product placements toward the file tail — so early ticks meet long
|
|
29
|
+
* runs of products that cannot extract. Each such attempt still pages
|
|
30
|
+
* source through the windowed provider, so a run of them is not free;
|
|
31
|
+
* this caps the run rather than letting the deadline be the only bound.
|
|
32
|
+
*/
|
|
33
|
+
const TICK_MAX_ATTEMPTS = 32;
|
|
34
|
+
const FIRST_GENERATION_MIN_RECORDS = 1024;
|
|
35
|
+
const GENERATION_GROWTH_FACTOR = 2;
|
|
36
|
+
const DEFAULT_MAX_PREVIEW_UNITS = 512;
|
|
37
|
+
const DEFAULT_MAX_PREVIEW_BYTES = 48 * 1024 * 1024;
|
|
38
|
+
const FLOATS_PER_VERTEX = 6;
|
|
39
|
+
const BYTES_PER_FLOAT = 4;
|
|
40
|
+
const DEFAULT_COLOR = [0.8, 0.8, 0.8, 1];
|
|
41
|
+
const FLUSH_BUDGET_MS = 100;
|
|
42
|
+
/**
|
|
43
|
+
* Parse-time placed-mesh preview for a windowed (store-backed) open.
|
|
44
|
+
*
|
|
45
|
+
* Twin of {@link StreamedPreviewChannel}: same capture math and
|
|
46
|
+
* COORDINATE_TO_ORIGIN frame, same time-budgeted tick, but the prefix
|
|
47
|
+
* model pages product closures from `store` instead of a resident
|
|
48
|
+
* buffer. After each product the pins drop, so peak source residency
|
|
49
|
+
* stays the windowed LRU — not the file.
|
|
50
|
+
*
|
|
51
|
+
* It also runs the spatial-structure walk off its own prefix
|
|
52
|
+
* generations, so the building's skeleton goes up in the first seconds
|
|
53
|
+
* of a long parse rather than after it — see
|
|
54
|
+
* {@link maybeEmitEarlySpatialPlates_}.
|
|
55
|
+
*/
|
|
56
|
+
export class StorePreviewChannel {
|
|
57
|
+
/**
|
|
58
|
+
* @param store_ External source (OPFS / file).
|
|
59
|
+
* @param sink_ Live columnar sink the parse is filling.
|
|
60
|
+
* @param conwaywasm_ Shared wasm wrapper.
|
|
61
|
+
* @param coordinateToOrigin_ Open COORDINATE_TO_ORIGIN.
|
|
62
|
+
* @param onMesh_ Preview consumer.
|
|
63
|
+
* @param maxUnits Cap on products preview-extracted.
|
|
64
|
+
* @param maxBytes Cap on copied payload bytes.
|
|
65
|
+
* @param firstGenerationMinRecords Records before the first snapshot.
|
|
66
|
+
*/
|
|
67
|
+
constructor(store_, sink_, conwaywasm_, coordinateToOrigin_, onMesh_, maxUnits = DEFAULT_MAX_PREVIEW_UNITS, maxBytes = DEFAULT_MAX_PREVIEW_BYTES, firstGenerationMinRecords = FIRST_GENERATION_MIN_RECORDS) {
|
|
68
|
+
this.store_ = store_;
|
|
69
|
+
this.sink_ = sink_;
|
|
70
|
+
this.conwaywasm_ = conwaywasm_;
|
|
71
|
+
this.coordinateToOrigin_ = coordinateToOrigin_;
|
|
72
|
+
this.onMesh_ = onMesh_;
|
|
73
|
+
this.maxUnits = maxUnits;
|
|
74
|
+
this.maxBytes = maxBytes;
|
|
75
|
+
this.firstGenerationMinRecords = firstGenerationMinRecords;
|
|
76
|
+
this.stopped_ = false;
|
|
77
|
+
this.emittedUnits_ = 0;
|
|
78
|
+
this.emittedBytes_ = 0;
|
|
79
|
+
this.unitOrdinal_ = 0;
|
|
80
|
+
this.lastInlineTick_ = 0;
|
|
81
|
+
this.tickIntervalMs_ = TICK_INTERVAL_MS;
|
|
82
|
+
this.lastSnapshotRecords_ = 0;
|
|
83
|
+
this.lastFailedSnapshotRecords_ = 0;
|
|
84
|
+
// Fields rather than the constants directly, so a test can lift the
|
|
85
|
+
// wall-clock bounds the way ifc_api_preview_channel.test.ts already
|
|
86
|
+
// lifts the streamed channel's: asserting "this tick ran N products"
|
|
87
|
+
// against a real 20ms budget is a coin flip on a loaded runner.
|
|
88
|
+
this.tickBudgetMs_ = TICK_BUDGET_MS;
|
|
89
|
+
this.tickMaxAttempts_ = TICK_MAX_ATTEMPTS;
|
|
90
|
+
/** Set once a prefix-generation spatial walk has emitted a plate. */
|
|
91
|
+
this.earlyPlatesEmitted_ = 0;
|
|
92
|
+
/**
|
|
93
|
+
* Whether those plates were composed under the walk's own fallback
|
|
94
|
+
* frame because no preview instance had latched one yet. They get one
|
|
95
|
+
* re-emission on a later generation once a real frame exists — see
|
|
96
|
+
* {@link maybeEmitEarlySpatialPlates_}.
|
|
97
|
+
*/
|
|
98
|
+
this.earlyPlatesUsedFallbackFrame_ = false;
|
|
99
|
+
this.emittedGeometry_ = new Set();
|
|
100
|
+
}
|
|
101
|
+
get capped() {
|
|
102
|
+
return this.emittedUnits_ >= this.maxUnits ||
|
|
103
|
+
this.emittedBytes_ >= this.maxBytes;
|
|
104
|
+
}
|
|
105
|
+
get emittedUnits() {
|
|
106
|
+
return this.emittedUnits_;
|
|
107
|
+
}
|
|
108
|
+
/** Products the current generation would run (test seam). */
|
|
109
|
+
get productCount() {
|
|
110
|
+
return this.generation_?.products.length ?? 0;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Plates the prefix-generation spatial walk emitted, 0 while it has
|
|
114
|
+
* not succeeded (see {@link maybeEmitEarlySpatialPlates_}).
|
|
115
|
+
*/
|
|
116
|
+
get earlyPlateCount() {
|
|
117
|
+
return this.earlyPlatesEmitted_;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* One cadence-gated, time-budgeted tick. No-op until the interval
|
|
121
|
+
* elapses or the index can support a generation. Safe to call from
|
|
122
|
+
* parse progress.
|
|
123
|
+
*
|
|
124
|
+
* **Cadence and budget interact once, not twice.** The interval is
|
|
125
|
+
* measured tick-start to tick-start (`lastInlineTick_` is stamped
|
|
126
|
+
* before the work, as on the streamed channel), so a tick that spends
|
|
127
|
+
* its whole budget shortens the gap to the next one by that budget
|
|
128
|
+
* rather than adding to it. And the decay is charged only to ticks
|
|
129
|
+
* that actually attempted a product: a tick that found no generation —
|
|
130
|
+
* which is every tick through the opening seconds of a big parse, when
|
|
131
|
+
* the index has not yet reached FIRST_GENERATION_MIN_RECORDS — used to
|
|
132
|
+
* decay the interval anyway, so by the time there was anything to
|
|
133
|
+
* extract the cadence had already cooled toward
|
|
134
|
+
* TICK_INTERVAL_MAX_MS. Deliberately divergent from
|
|
135
|
+
* {@link StreamedPreviewChannel}, which decays unconditionally; the
|
|
136
|
+
* cost is that a channel which never finds a generation keeps probing
|
|
137
|
+
* at TICK_INTERVAL_MS, and a probe that finds nothing is a record
|
|
138
|
+
* count compared against two thresholds.
|
|
139
|
+
*
|
|
140
|
+
* @return {Promise<void>} Settles when this tick's products (if any)
|
|
141
|
+
* are captured.
|
|
142
|
+
*/
|
|
143
|
+
async maybeTickAsync() {
|
|
144
|
+
if (this.stopped_ || this.capped) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const now = Date.now();
|
|
148
|
+
if (now - this.lastInlineTick_ < this.tickIntervalMs_) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.lastInlineTick_ = now;
|
|
152
|
+
try {
|
|
153
|
+
if ((await this.tickBudgeted_()) > 0) {
|
|
154
|
+
this.tickIntervalMs_ = Math.min(this.tickIntervalMs_ * TICK_INTERVAL_GROWTH, TICK_INTERVAL_MAX_MS);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
this.stopped_ = true;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Attempt products until the time budget or the attempt cap runs out,
|
|
163
|
+
* whichever comes first.
|
|
164
|
+
*
|
|
165
|
+
* @return {Promise<number>} Products attempted this tick.
|
|
166
|
+
*/
|
|
167
|
+
async tickBudgeted_() {
|
|
168
|
+
const deadline = Date.now() + this.tickBudgetMs_;
|
|
169
|
+
let attempts = 0;
|
|
170
|
+
while (!this.capped &&
|
|
171
|
+
attempts < this.tickMaxAttempts_ &&
|
|
172
|
+
Date.now() < deadline) {
|
|
173
|
+
if (!(await this.tickOnce_())) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
++attempts;
|
|
177
|
+
}
|
|
178
|
+
return attempts;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* After parse: extract a short burst so small files (and prefixes
|
|
182
|
+
* that never crossed a progress tick) still emit placed meshes
|
|
183
|
+
* before open returns.
|
|
184
|
+
*
|
|
185
|
+
* @return {Promise<void>} Settles when the burst ends.
|
|
186
|
+
*/
|
|
187
|
+
async flushAsync() {
|
|
188
|
+
if (this.stopped_ || this.capped) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const deadline = Date.now() + FLUSH_BUDGET_MS;
|
|
192
|
+
try {
|
|
193
|
+
while (!this.capped && Date.now() < deadline) {
|
|
194
|
+
const did = await this.tickOnce_();
|
|
195
|
+
if (!did) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
this.stopped_ = true;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** Drop the throwaway prefix generation. Idempotent. */
|
|
205
|
+
stop() {
|
|
206
|
+
this.stopped_ = true;
|
|
207
|
+
this.disposeGeneration_();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Test seam: drain until the current sink is exhausted or a cap hits.
|
|
211
|
+
*
|
|
212
|
+
* @return {Promise<void>} Settles when idle.
|
|
213
|
+
*/
|
|
214
|
+
async drainForTest() {
|
|
215
|
+
this.lastInlineTick_ = 0;
|
|
216
|
+
this.tickIntervalMs_ = 0;
|
|
217
|
+
for (;;) {
|
|
218
|
+
if (this.capped) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const did = await this.tickOnce_();
|
|
222
|
+
if (!did) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @return {Promise<boolean>} True when a product was attempted.
|
|
229
|
+
*/
|
|
230
|
+
async tickOnce_() {
|
|
231
|
+
if (!(await this.ensureGeneration_())) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const active = this.generation_;
|
|
235
|
+
if (this.unitOrdinal_ >= active.products.length) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
const localID = active.products[this.unitOrdinal_++];
|
|
239
|
+
const model = active.model;
|
|
240
|
+
const pins = new Set();
|
|
241
|
+
const leafSpans = [];
|
|
242
|
+
try {
|
|
243
|
+
await active.extraction.ensureResidentForProductExtract(localID, pins, leafSpans);
|
|
244
|
+
if (active.extraction.extractProductGeometryByLocalID(localID)) {
|
|
245
|
+
this.captureNewInstances_();
|
|
246
|
+
++this.emittedUnits_;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// Forward-ref / unplaced — durable pump extracts later.
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
model.releaseSourceViews(pins);
|
|
254
|
+
model.unpinLocalIDs(pins);
|
|
255
|
+
for (const span of leafSpans) {
|
|
256
|
+
model.unpinAddressRange(span.address, span.length);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* @return {Promise<boolean>} True when a generation with pending units exists.
|
|
263
|
+
*/
|
|
264
|
+
async ensureGeneration_() {
|
|
265
|
+
const active = this.generation_;
|
|
266
|
+
if (active !== void 0 && this.unitOrdinal_ < active.products.length) {
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
const records = this.sink_.topLevelCount;
|
|
270
|
+
if (records < this.firstGenerationMinRecords) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
if (active !== void 0 &&
|
|
274
|
+
records < this.lastSnapshotRecords_ * GENERATION_GROWTH_FACTOR) {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
if (records < this.lastFailedSnapshotRecords_ * GENERATION_GROWTH_FACTOR) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const columns = this.sink_.snapshot();
|
|
282
|
+
const provider = new WindowedStepBufferProvider(this.store_);
|
|
283
|
+
const model = new IfcStepModel(void 0, columns, provider);
|
|
284
|
+
const products = [];
|
|
285
|
+
for (const localID of cursorIterator(model.typeIndex.cursor(...IfcProduct.query))) {
|
|
286
|
+
products.push(localID);
|
|
287
|
+
}
|
|
288
|
+
if (products.length === 0) {
|
|
289
|
+
this.lastFailReason = `no products in ${records} records`;
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
if (products.length <= this.unitOrdinal_) {
|
|
293
|
+
this.lastFailReason = `ordinal ${this.unitOrdinal_} >= ${products.length}`;
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
const extraction = new IfcGeometryExtraction(this.conwaywasm_, model);
|
|
297
|
+
extraction.quietRecoverableLogging = true;
|
|
298
|
+
extraction.deferDanglingPlacements = true;
|
|
299
|
+
const prepPins = await extraction.ensureResidentForDemandPrep();
|
|
300
|
+
try {
|
|
301
|
+
extraction.prepareDemandExtraction(true);
|
|
302
|
+
}
|
|
303
|
+
finally {
|
|
304
|
+
model.releaseSourceViews(prepPins);
|
|
305
|
+
model.unpinLocalIDs(prepPins);
|
|
306
|
+
}
|
|
307
|
+
this.disposeGeneration_();
|
|
308
|
+
this.generation_ = {
|
|
309
|
+
model,
|
|
310
|
+
extraction,
|
|
311
|
+
products,
|
|
312
|
+
capturedCounts: new Map(),
|
|
313
|
+
};
|
|
314
|
+
this.lastSnapshotRecords_ = records;
|
|
315
|
+
this.lastFailedSnapshotRecords_ = 0;
|
|
316
|
+
this.lastFailReason = void 0;
|
|
317
|
+
await this.maybeEmitEarlySpatialPlates_(model, extraction);
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
this.lastFailedSnapshotRecords_ = records;
|
|
322
|
+
this.lastFailReason = error instanceof Error ? error.message : String(error);
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Put the spatial skeleton up from a PREFIX generation, seconds into
|
|
328
|
+
* the parse instead of after it (conway#518).
|
|
329
|
+
*
|
|
330
|
+
* The spatial records sit at the file head on Revit exports — on PSB
|
|
331
|
+
* `IFCSITE` is record #211 — and a prefix generation is already
|
|
332
|
+
* everything the walk needs: a columns snapshot over a windowed
|
|
333
|
+
* provider, with `prepareDemandExtraction(true)` done, which is what
|
|
334
|
+
* makes `getLinearScalingFactor()` report real units rather than 1.
|
|
335
|
+
* So the plates can lead the first extracted product rather than
|
|
336
|
+
* trailing the whole parse, which is what the store path's three
|
|
337
|
+
* stacked latency gates (one product per tick, early products
|
|
338
|
+
* deferring on late placements, the walk waiting for the full index)
|
|
339
|
+
* added up to: a blank screen through the first ~60% of a 16.7 s
|
|
340
|
+
* parse.
|
|
341
|
+
*
|
|
342
|
+
* **Runs at most once successfully, on the parse's cooperative path.**
|
|
343
|
+
* The walk is reused as-is, with no internal budget: it awaits a
|
|
344
|
+
* residency ensure per spatial node and per sampled product placement
|
|
345
|
+
* (PRODUCT_SAMPLE per node), so its cost tracks the prefix's spatial
|
|
346
|
+
* tree, not the file. On the first qualifying generation that tree is
|
|
347
|
+
* small by construction — the storeys exist but few
|
|
348
|
+
* `IfcRelContainedInSpatialStructure` do — which is the same property
|
|
349
|
+
* that makes these early plates coarse. Retries are bounded without a
|
|
350
|
+
* counter: generations only rebuild on a GENERATION_GROWTH_FACTOR
|
|
351
|
+
* doubling of the index, so there are O(log records) of them.
|
|
352
|
+
*
|
|
353
|
+
* **The end-of-parse walk in the proxy is the refresh, not a
|
|
354
|
+
* duplicate.** It re-emits the same expressIDs with contained-product
|
|
355
|
+
* samples the prefix did not hold and under the frame the channel
|
|
356
|
+
* latched, and the consumer contract is that an `aabb` payload
|
|
357
|
+
* REPLACES the prior plate for its expressID. Double emission is the
|
|
358
|
+
* design; see PreviewMeshPayload.
|
|
359
|
+
*
|
|
360
|
+
* **Known gap in that contract, and it is a gap, not a subtlety.**
|
|
361
|
+
* Replacement only reaches nodes the final walk still emits, and the
|
|
362
|
+
* emit set is not stable between the two: `aabbMostlyEqual` collapses
|
|
363
|
+
* a single-child wrapper (Project over Site over Building) once its
|
|
364
|
+
* box matches its child's, which a prefix generation's degenerate
|
|
365
|
+
* boxes may not yet do. A wrapper emitted here and collapsed there is
|
|
366
|
+
* never replaced and never removed — the payload contract has no
|
|
367
|
+
* delete — so its early box lingers as one small plate until Share
|
|
368
|
+
* tears the preview scenery down at load end. Bounded (the wrapper
|
|
369
|
+
* chain is a handful of nodes, and the collapse needs exactly one
|
|
370
|
+
* child), but real. Closing it properly needs either a delete/
|
|
371
|
+
* generation channel in the payload contract or an emit set the two
|
|
372
|
+
* walks agree on, and both are consumer-side changes.
|
|
373
|
+
*
|
|
374
|
+
* @param model The prefix model.
|
|
375
|
+
* @param extraction Its prepared extraction.
|
|
376
|
+
* @return {Promise<void>} Settles when the walk has run or been skipped.
|
|
377
|
+
*/
|
|
378
|
+
async maybeEmitEarlySpatialPlates_(model, extraction) {
|
|
379
|
+
// Same choice the proxy's imposterCoordination() makes: the latched
|
|
380
|
+
// preview frame when the open asked to coordinate, else identity.
|
|
381
|
+
const coordination = this.coordinateToOrigin_ ?
|
|
382
|
+
this.coordinationMatrix : IDENTITY_MAT4;
|
|
383
|
+
// This runs as a generation is BUILT, before that tick captures its
|
|
384
|
+
// first product — and capture is the only thing that latches a
|
|
385
|
+
// frame. So the first walk on a coordinating open always finds
|
|
386
|
+
// `undefined` here and takes the walk's fallback derivation, which
|
|
387
|
+
// its own docs describe as capable of a full site-offset on a file
|
|
388
|
+
// that bakes absolute coordinates into vertices behind identity
|
|
389
|
+
// placements. Waiting for a latched frame instead would put the
|
|
390
|
+
// skeleton back behind the deferred-placement gate this whole change
|
|
391
|
+
// exists to get in front of, so: emit now, and re-emit ONCE on a
|
|
392
|
+
// later generation as soon as a real frame exists. That second
|
|
393
|
+
// emission is exactly what the replace-by-expressID contract is for.
|
|
394
|
+
const usingFallbackFrame = coordination === void 0;
|
|
395
|
+
const canImproveFrame = this.earlyPlatesUsedFallbackFrame_ && !usingFallbackFrame;
|
|
396
|
+
if (this.earlyPlatesEmitted_ > 0 && !canImproveFrame) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
// Cheap prefix-sum reads, so this is affordable per generation.
|
|
401
|
+
// No storeys or no aggregate chain means the walk would emit
|
|
402
|
+
// nothing but still pay for the type scans. IfcProject and
|
|
403
|
+
// IfcUnitAssignment are in the guard for a different reason:
|
|
404
|
+
// `extractLinearScalingFactor` returns with the factor still at 1
|
|
405
|
+
// when it cannot resolve the project's UnitsInContext (it only
|
|
406
|
+
// logs), and a silent 1 on a millimetre model scales the whole
|
|
407
|
+
// skeleton 1000x — the conway#515 symptom. The project alone is
|
|
408
|
+
// not enough: a valid file may forward-reference its
|
|
409
|
+
// IfcUnitAssignment, so a prefix can hold the project while the
|
|
410
|
+
// units record is still ahead of the parse cursor, and because a
|
|
411
|
+
// successful walk latches `earlyPlatesEmitted_`, mis-scaled early
|
|
412
|
+
// plates would stand until the frame-improvement re-emit or the
|
|
413
|
+
// post-parse refresh (Codex review on #519). The guard therefore
|
|
414
|
+
// defers plates until the units record is indexed; a file with
|
|
415
|
+
// genuinely no unit assignment never emits EARLY plates and is
|
|
416
|
+
// covered by the end-of-parse walk instead.
|
|
417
|
+
if (model.typeCount(IfcProject) < 1 ||
|
|
418
|
+
model.typeCount(IfcUnitAssignment) < 1 ||
|
|
419
|
+
model.typeCount(IfcBuildingStorey) < 1 ||
|
|
420
|
+
model.typeCount(IfcRelAggregates) < 1) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const emitted = await emitSpatialStructureImposters(model, this.onMesh_, coordination, extraction.getLinearScalingFactor());
|
|
424
|
+
if (emitted > 0) {
|
|
425
|
+
this.earlyPlatesEmitted_ = emitted;
|
|
426
|
+
this.earlyPlatesUsedFallbackFrame_ = usingFallbackFrame;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
// A failed early walk retries on the next generation; the
|
|
431
|
+
// end-of-parse walk covers it regardless.
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
disposeGeneration_() {
|
|
435
|
+
const active = this.generation_;
|
|
436
|
+
if (active === void 0) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
try {
|
|
440
|
+
releaseModelGeometry(active.model.geometry);
|
|
441
|
+
}
|
|
442
|
+
catch {
|
|
443
|
+
// Never let a free break the open.
|
|
444
|
+
}
|
|
445
|
+
this.generation_ = void 0;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Copy newly extracted instances out of wasm — same placement math
|
|
449
|
+
* as {@link StreamedPreviewChannel}.
|
|
450
|
+
*/
|
|
451
|
+
captureNewInstances_() {
|
|
452
|
+
const active = this.generation_;
|
|
453
|
+
if (active === void 0) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
const { extraction, capturedCounts } = active;
|
|
457
|
+
const scene = extraction.scene;
|
|
458
|
+
const seenThisPass = new Map();
|
|
459
|
+
for (const walked of scene.walk()) {
|
|
460
|
+
const [, nativeTransform, geometry, material, entity] = walked;
|
|
461
|
+
if (entity?.localID === void 0 || entity.expressID === void 0) {
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
const walkIndex = seenThisPass.get(entity.localID) ?? 0;
|
|
465
|
+
seenThisPass.set(entity.localID, walkIndex + 1);
|
|
466
|
+
if (walkIndex < (capturedCounts.get(entity.localID) ?? 0)) {
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
capturedCounts.set(entity.localID, walkIndex + 1);
|
|
470
|
+
if (geometry.type !== CanonicalMeshType.BUFFER_GEOMETRY ||
|
|
471
|
+
geometry.temporary) {
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
const material_ = material ?? {
|
|
475
|
+
name: "",
|
|
476
|
+
baseColor: DEFAULT_COLOR,
|
|
477
|
+
legacyColor: DEFAULT_COLOR,
|
|
478
|
+
doubleSided: true,
|
|
479
|
+
blend: 0,
|
|
480
|
+
};
|
|
481
|
+
let nativePt;
|
|
482
|
+
if (this.coordinationMatrix === void 0 && this.coordinateToOrigin_) {
|
|
483
|
+
nativePt = geometry.geometry.getPoint(0);
|
|
484
|
+
}
|
|
485
|
+
const center = geometry.geometry.normalize();
|
|
486
|
+
const geometryExpressID = active.model.getElementByLocalID(geometry.localID)?.expressID ??
|
|
487
|
+
geometry.localID;
|
|
488
|
+
const geometryTransform = nativeTransform?.getValues();
|
|
489
|
+
if (this.coordinationMatrix === void 0 && this.coordinateToOrigin_) {
|
|
490
|
+
this.coordinationMatrix = deriveCoordinationF64(geometryTransform, nativePt, NORMALIZE_MAT_F64, extraction.getLinearScalingFactor());
|
|
491
|
+
}
|
|
492
|
+
const coordination = this.coordinationMatrix ?? glmatrix.mat4.create();
|
|
493
|
+
const newTransform = composeTransformF64(coordination, geometryTransform, center);
|
|
494
|
+
const payload = {
|
|
495
|
+
expressID: entity.expressID,
|
|
496
|
+
geometryExpressID,
|
|
497
|
+
color: {
|
|
498
|
+
x: material_.legacyColor[0],
|
|
499
|
+
y: material_.legacyColor[1],
|
|
500
|
+
z: material_.legacyColor[2],
|
|
501
|
+
w: material_.legacyColor[3],
|
|
502
|
+
},
|
|
503
|
+
flatTransformation: Array.from(newTransform),
|
|
504
|
+
};
|
|
505
|
+
if (!this.emittedGeometry_.has(geometryExpressID)) {
|
|
506
|
+
const nativeGeometry = geometry.geometry;
|
|
507
|
+
const vertexData = this.conwaywasm_.floatHeapSlice(nativeGeometry.GetVertexData(), nativeGeometry.GetVertexDataSize()).slice();
|
|
508
|
+
const indexData = this.conwaywasm_.uint32HeapSlice(nativeGeometry.GetIndexData(), nativeGeometry.GetIndexDataSize()).slice();
|
|
509
|
+
if (vertexData.length < FLOATS_PER_VERTEX || indexData.length === 0) {
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
payload.vertexData = vertexData;
|
|
513
|
+
payload.indexData = indexData;
|
|
514
|
+
this.emittedGeometry_.add(geometryExpressID);
|
|
515
|
+
this.emittedBytes_ +=
|
|
516
|
+
(vertexData.length + indexData.length) * BYTES_PER_FLOAT;
|
|
517
|
+
}
|
|
518
|
+
this.onMesh_(payload);
|
|
519
|
+
if (this.emittedBytes_ >= this.maxBytes) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store_preview_channel.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/store_preview_channel.test.ts"],"names":[],"mappings":""}
|