@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,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Float64 coordinate-to-origin (COORDINATE_TO_ORIGIN) math.
|
|
3
|
+
*
|
|
4
|
+
* gl-matrix's `mat4`/`vec4` are backed by `Float32Array`
|
|
5
|
+
* (`ARRAY_TYPE = Float32Array` in gl-matrix/common.js), so the recentre
|
|
6
|
+
* derivation — which subtracts a large world reference point
|
|
7
|
+
* (`transformedPt = placement * nativePoint`, on the order of 1e5 m for a
|
|
8
|
+
* Swiss/CHE georeferenced IFC, up to ~2.6e6 m in LV95 easting/northing) —
|
|
9
|
+
* loses precision: float32 ULP is ~7.6 mm at 100 km and ~60 mm at 2.6 M m.
|
|
10
|
+
* Baked into the emitted FlatMesh transform that quantization forms a
|
|
11
|
+
* spatial grid that reads as rotational jitter when the camera is zoomed
|
|
12
|
+
* to detail.
|
|
13
|
+
*
|
|
14
|
+
* The native placement crosses the wasm boundary as `glm::dmat4` and the
|
|
15
|
+
* reference point as `glm::dvec3` — both full float64 (see
|
|
16
|
+
* conway-api.cpp `getMatrixValues4x4` / the `glmdVec3` value object), so
|
|
17
|
+
* `nativeTransform.getValues()` and `geometry.getPoint()` deliver doubles.
|
|
18
|
+
* Feeding those doubles straight through a double-precision composition
|
|
19
|
+
* (rather than gl-matrix's float32 path, and without the intermediate
|
|
20
|
+
* `mat4.fromValues` truncation to `Float32Array`) fully recovers the
|
|
21
|
+
* precision for georeferenced models.
|
|
22
|
+
*
|
|
23
|
+
* All layout/multiply conventions match gl-matrix exactly (column-major,
|
|
24
|
+
* `out = a * b`), so near-origin models — where float32 and float64 agree
|
|
25
|
+
* to well under a micron — stay bit-comparable across the
|
|
26
|
+
* classic / deferred / preview paths that share this recentre.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The Z-up -> Y-up normalize matrix baked into every coordination frame
|
|
30
|
+
* (column-major).
|
|
31
|
+
*
|
|
32
|
+
* Every producer of a coordination frame MUST use the same matrix, or
|
|
33
|
+
* the frames it derives disagree with the durable walk's — which is
|
|
34
|
+
* exactly how the spatial-imposter plates ended up in a different space
|
|
35
|
+
* from the meshes (conway#515).
|
|
36
|
+
*
|
|
37
|
+
* This is the definition for everything that imports it: both preview
|
|
38
|
+
* channels and the spatial-imposter walk. Three identical literals
|
|
39
|
+
* remain, the public `NormalizeMat` field on `IfcAPI`, `IfcApiProxyIfc`
|
|
40
|
+
* and `IfcApiProxyAP214` — the web-ifc shim surface, typed
|
|
41
|
+
* `glmatrix.mat4`. They are the durable frame's producers, so they must
|
|
42
|
+
* stay bit-identical to this; folding them in is worth doing and was
|
|
43
|
+
* left out of conway#516 only to keep that diff to the imposter path.
|
|
44
|
+
*/
|
|
45
|
+
export declare const NORMALIZE_MAT_F64: readonly number[];
|
|
46
|
+
/** Identity, for callers that need a "no coordination" frame. */
|
|
47
|
+
export declare const IDENTITY_MAT4: readonly number[];
|
|
48
|
+
/**
|
|
49
|
+
* A 3D point with double-precision components, as delivered by
|
|
50
|
+
* conway-geom's `getPoint` / `normalize` (glm::dvec3 across the boundary).
|
|
51
|
+
*/
|
|
52
|
+
export interface Point3Like {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
z: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Multiply two column-major 4x4 matrices in float64.
|
|
59
|
+
*
|
|
60
|
+
* Computes `out = a * b`, the identical formula (and operand order) to
|
|
61
|
+
* gl-matrix `mat4.multiply(out, a, b)`, but retaining double precision.
|
|
62
|
+
*
|
|
63
|
+
* @param a Left matrix (16 elements, column-major).
|
|
64
|
+
* @param b Right matrix (16 elements, column-major).
|
|
65
|
+
* @return {number[]} The product as a fresh 16-element `number[]`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function mat4MultiplyF64(a: ArrayLike<number>, b: ArrayLike<number>): number[];
|
|
68
|
+
/**
|
|
69
|
+
* Grid (metres) a recentre snaps to once it is needed at all.
|
|
70
|
+
*
|
|
71
|
+
* The anchor a recentre is derived from is the *first geometry* the walk
|
|
72
|
+
* reaches, which is an arbitrary interior element: whichever one the file
|
|
73
|
+
* happens to declare first. Left as-is, that makes a model's world
|
|
74
|
+
* position a function of its element order, with two consequences users
|
|
75
|
+
* see (conway#87, "not a sound basis for a camera in the permalink"):
|
|
76
|
+
*
|
|
77
|
+
* - Two exports of one object — the same logo as IFC and as STEP, a part
|
|
78
|
+
* re-exported by a different CAD kernel — land in different places,
|
|
79
|
+
* because they disagree about which element comes first. Share#1749
|
|
80
|
+
* hit exactly this: `index.step` sat 76m off `index.ifc` because the
|
|
81
|
+
* IFC declares the x=76 block first and the STEP the x=0 one.
|
|
82
|
+
* - Re-exporting a model with the element order shuffled moves it, so
|
|
83
|
+
* every camera permalink saved against it is silently wrong.
|
|
84
|
+
*
|
|
85
|
+
* `quantizeRecentre` answers that in two stages, because the two ranges
|
|
86
|
+
* want different things:
|
|
87
|
+
*
|
|
88
|
+
* - **Inside LARGE_COORDINATE_BUDGET_M, do not recentre at all.** There
|
|
89
|
+
* is no float32 benefit below the budget — that constant *is* the
|
|
90
|
+
* threshold where quantization becomes visible — so a model within
|
|
91
|
+
* 10km of the origin simply keeps the coordinates its file authored.
|
|
92
|
+
* That is model-zero, conway#87's proposal, and it makes the frame
|
|
93
|
+
* exactly order-independent for the overwhelming majority of models
|
|
94
|
+
* rather than order-independent-per-cell.
|
|
95
|
+
* - **Above it, snap to this grid.** A georeferenced model has to come
|
|
96
|
+
* back near the origin, and snapping keeps that repeatable across
|
|
97
|
+
* exports. Half a cell (500m) out of a 1e4 m budget costs ~0.05mm of
|
|
98
|
+
* float32 resolution, and a whole-kilometre translation is exactly
|
|
99
|
+
* representable where the raw anchor was not, so the recentre itself
|
|
100
|
+
* stops contributing rounding.
|
|
101
|
+
*
|
|
102
|
+
* **Quantizing cannot remove the discontinuity, only move it**, and it
|
|
103
|
+
* is worth being precise about where this one sits, because it is not
|
|
104
|
+
* where you would guess. Snapping *everything* to the grid would put a
|
|
105
|
+
* 1km step at every cell edge, including around the near-origin models
|
|
106
|
+
* that make up almost the whole corpus. Staging moves it to the budget:
|
|
107
|
+
* inside, every anchor derives model-zero and there is no edge at all;
|
|
108
|
+
* the single remaining edge is the budget itself, where the step is
|
|
109
|
+
* `LARGE_COORDINATE_BUDGET_M` (1e4), not the grid (1e3) — an anchor at
|
|
110
|
+
* 9900 derives zero and one at 10100 derives -10000.
|
|
111
|
+
*
|
|
112
|
+
* That edge is also invisible to the adopted-preview-frame gate, which
|
|
113
|
+
* re-derives only when a durable placement lands beyond the budget: a
|
|
114
|
+
* preview anchored at 10100 and a durable first placement at 9900 probe
|
|
115
|
+
* at ~100m, so the preview frame is kept and the model renders 10km off
|
|
116
|
+
* a classic open. The trade is deliberate — one edge that a georeferenced
|
|
117
|
+
* model may sit near, rather than an edge every kilometre through the
|
|
118
|
+
* range where nearly every model lives — but it is a real residual, not
|
|
119
|
+
* an eliminated one. design/new/coordination-frame.md tracks it, and
|
|
120
|
+
* conway#87's relative-to-centre direction is what removes it properly.
|
|
121
|
+
*/
|
|
122
|
+
export declare const COORDINATION_SNAP_M = 1000;
|
|
123
|
+
/**
|
|
124
|
+
* Derive the coordination (recentre) matrix in float64, matching the
|
|
125
|
+
* gl-matrix op sequence exactly:
|
|
126
|
+
* `scale * NormalizeMat * translate(-quantize(placement * point))`.
|
|
127
|
+
*
|
|
128
|
+
* The quantization is what keeps the derived frame independent of which
|
|
129
|
+
* element a file declares first — see COORDINATION_SNAP_M for why that
|
|
130
|
+
* matters, and why it is staged around LARGE_COORDINATE_BUDGET_M.
|
|
131
|
+
*
|
|
132
|
+
* @param placement The native placement (16 elements, column-major
|
|
133
|
+
* float64 from `getValues()`); `undefined` is treated as identity.
|
|
134
|
+
* @param point The world reference point (`getPoint(0)`), float64.
|
|
135
|
+
* @param normalizeMat The Z-up -> Y-up normalize matrix (16 elements).
|
|
136
|
+
* @param scaleFactor The linear scaling factor.
|
|
137
|
+
* @return {number[]} The coordination matrix as a 16-element `number[]`.
|
|
138
|
+
*/
|
|
139
|
+
export declare function deriveCoordinationF64(placement: ArrayLike<number> | undefined, point: Point3Like, normalizeMat: ArrayLike<number>, scaleFactor: number): number[];
|
|
140
|
+
/**
|
|
141
|
+
* Compose the emitted world transform in float64:
|
|
142
|
+
* `coordination * placement [ * translate(geomCenter) ]`.
|
|
143
|
+
*
|
|
144
|
+
* @param coordination The coordination matrix (16 elements).
|
|
145
|
+
* @param placement The native placement (16 elements, column-major
|
|
146
|
+
* float64 from `getValues()`); `undefined` is treated as identity.
|
|
147
|
+
* @param geomCenter The per-leaf normalize centre; omit for the bare
|
|
148
|
+
* composition used by the AP214 shared-buffer path (issue #308).
|
|
149
|
+
* @return {number[]} The flat transform as a 16-element `number[]`,
|
|
150
|
+
* ready to hand back as a FlatMesh `flatTransformation`.
|
|
151
|
+
*/
|
|
152
|
+
export declare function composeTransformF64(coordination: ArrayLike<number>, placement: ArrayLike<number> | undefined, geomCenter?: Point3Like): number[];
|
|
153
|
+
export declare const TRANSLATION_X = 12;
|
|
154
|
+
export declare const TRANSLATION_Y = 13;
|
|
155
|
+
export declare const TRANSLATION_Z = 14;
|
|
156
|
+
/**
|
|
157
|
+
* Placement-magnitude budget (metres) above which a coordination frame
|
|
158
|
+
* has failed to recentre a model: float32 (the GPU vertex format and
|
|
159
|
+
* BatchedMesh matrix texture) quantizes at ~1mm per 1e4 m of
|
|
160
|
+
* coordinate, the visible-jitter threshold established in Share#1631.
|
|
161
|
+
* Used to validate an adopted preview coordination frame against the
|
|
162
|
+
* durable walk's first geometry (Share#1634).
|
|
163
|
+
*/
|
|
164
|
+
export declare const LARGE_COORDINATE_BUDGET_M = 10000;
|
|
165
|
+
//# sourceMappingURL=coordination_f64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordination_f64.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/coordination_f64.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAK9C,CAAA;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAa,CAAA;AA8CxD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAkBxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,mBAAmB,OAAM,CAAA;AAoCtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,EAC/B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAgCjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAC/B,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,EAC/B,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,EACxC,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,CAerC;AAGD,eAAO,MAAM,aAAa,KAAK,CAAA;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAA;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAA;AAE/B;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAM,CAAA"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Float64 coordinate-to-origin (COORDINATE_TO_ORIGIN) math.
|
|
3
|
+
*
|
|
4
|
+
* gl-matrix's `mat4`/`vec4` are backed by `Float32Array`
|
|
5
|
+
* (`ARRAY_TYPE = Float32Array` in gl-matrix/common.js), so the recentre
|
|
6
|
+
* derivation — which subtracts a large world reference point
|
|
7
|
+
* (`transformedPt = placement * nativePoint`, on the order of 1e5 m for a
|
|
8
|
+
* Swiss/CHE georeferenced IFC, up to ~2.6e6 m in LV95 easting/northing) —
|
|
9
|
+
* loses precision: float32 ULP is ~7.6 mm at 100 km and ~60 mm at 2.6 M m.
|
|
10
|
+
* Baked into the emitted FlatMesh transform that quantization forms a
|
|
11
|
+
* spatial grid that reads as rotational jitter when the camera is zoomed
|
|
12
|
+
* to detail.
|
|
13
|
+
*
|
|
14
|
+
* The native placement crosses the wasm boundary as `glm::dmat4` and the
|
|
15
|
+
* reference point as `glm::dvec3` — both full float64 (see
|
|
16
|
+
* conway-api.cpp `getMatrixValues4x4` / the `glmdVec3` value object), so
|
|
17
|
+
* `nativeTransform.getValues()` and `geometry.getPoint()` deliver doubles.
|
|
18
|
+
* Feeding those doubles straight through a double-precision composition
|
|
19
|
+
* (rather than gl-matrix's float32 path, and without the intermediate
|
|
20
|
+
* `mat4.fromValues` truncation to `Float32Array`) fully recovers the
|
|
21
|
+
* precision for georeferenced models.
|
|
22
|
+
*
|
|
23
|
+
* All layout/multiply conventions match gl-matrix exactly (column-major,
|
|
24
|
+
* `out = a * b`), so near-origin models — where float32 and float64 agree
|
|
25
|
+
* to well under a micron — stay bit-comparable across the
|
|
26
|
+
* classic / deferred / preview paths that share this recentre.
|
|
27
|
+
*/
|
|
28
|
+
const IDENTITY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
29
|
+
/**
|
|
30
|
+
* The Z-up -> Y-up normalize matrix baked into every coordination frame
|
|
31
|
+
* (column-major).
|
|
32
|
+
*
|
|
33
|
+
* Every producer of a coordination frame MUST use the same matrix, or
|
|
34
|
+
* the frames it derives disagree with the durable walk's — which is
|
|
35
|
+
* exactly how the spatial-imposter plates ended up in a different space
|
|
36
|
+
* from the meshes (conway#515).
|
|
37
|
+
*
|
|
38
|
+
* This is the definition for everything that imports it: both preview
|
|
39
|
+
* channels and the spatial-imposter walk. Three identical literals
|
|
40
|
+
* remain, the public `NormalizeMat` field on `IfcAPI`, `IfcApiProxyIfc`
|
|
41
|
+
* and `IfcApiProxyAP214` — the web-ifc shim surface, typed
|
|
42
|
+
* `glmatrix.mat4`. They are the durable frame's producers, so they must
|
|
43
|
+
* stay bit-identical to this; folding them in is worth doing and was
|
|
44
|
+
* left out of conway#516 only to keep that diff to the imposter path.
|
|
45
|
+
*/
|
|
46
|
+
export const NORMALIZE_MAT_F64 = [
|
|
47
|
+
1, 0, 0, 0,
|
|
48
|
+
0, 0, -1, 0,
|
|
49
|
+
0, 1, 0, 0,
|
|
50
|
+
0, 0, 0, 1,
|
|
51
|
+
];
|
|
52
|
+
/** Identity, for callers that need a "no coordination" frame. */
|
|
53
|
+
export const IDENTITY_MAT4 = IDENTITY;
|
|
54
|
+
/**
|
|
55
|
+
* Smallest positive magnitude representable in single precision
|
|
56
|
+
* (2 ** -149, the smallest float32 subnormal). The previous code path
|
|
57
|
+
* built the placement with gl-matrix `mat4.fromValues(...)` — a
|
|
58
|
+
* `Float32Array` — so any transform component below this magnitude was
|
|
59
|
+
* stored as exactly zero. Valid geometry never produces a non-zero
|
|
60
|
+
* component this small (positions are metres/kilometres, rotation and
|
|
61
|
+
* scale terms are O(1) or exactly zero), so the only inputs it affects
|
|
62
|
+
* are denormal garbage from degenerate/uninitialised native transforms
|
|
63
|
+
* (e.g. a released-then-reopened model whose `getValues()` returns
|
|
64
|
+
* subnormals). Flushing those to zero here keeps the classic, deferred
|
|
65
|
+
* and preview paths bit-identical on such inputs — matching the old
|
|
66
|
+
* Float32Array behaviour — while leaving every valid value at full
|
|
67
|
+
* double precision.
|
|
68
|
+
*/
|
|
69
|
+
const FLOAT32_MIN_SUBNORMAL = 2 ** -149;
|
|
70
|
+
/**
|
|
71
|
+
* Flush non-finite and float32-underflow garbage to zero; pass every
|
|
72
|
+
* valid value through untouched at full double precision.
|
|
73
|
+
*
|
|
74
|
+
* @param v A transform component.
|
|
75
|
+
* @return {number} v, or 0 if it is non-finite or below float32 range.
|
|
76
|
+
*/
|
|
77
|
+
function flushGarbage(v) {
|
|
78
|
+
return Number.isFinite(v) &&
|
|
79
|
+
(v === 0 || Math.abs(v) >= FLOAT32_MIN_SUBNORMAL) ? v : 0;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Copy 16 matrix components into a fresh `number[]`, flushing float32
|
|
83
|
+
* underflow / non-finite garbage to zero (see FLOAT32_MIN_SUBNORMAL).
|
|
84
|
+
*
|
|
85
|
+
* @param m A 16-element matrix.
|
|
86
|
+
* @return {number[]} The sanitized copy.
|
|
87
|
+
*/
|
|
88
|
+
function sanitize16(m) {
|
|
89
|
+
const out = new Array(16);
|
|
90
|
+
for (let i = 0; i < 16; ++i) {
|
|
91
|
+
out[i] = flushGarbage(m[i]);
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Multiply two column-major 4x4 matrices in float64.
|
|
97
|
+
*
|
|
98
|
+
* Computes `out = a * b`, the identical formula (and operand order) to
|
|
99
|
+
* gl-matrix `mat4.multiply(out, a, b)`, but retaining double precision.
|
|
100
|
+
*
|
|
101
|
+
* @param a Left matrix (16 elements, column-major).
|
|
102
|
+
* @param b Right matrix (16 elements, column-major).
|
|
103
|
+
* @return {number[]} The product as a fresh 16-element `number[]`.
|
|
104
|
+
*/
|
|
105
|
+
export function mat4MultiplyF64(a, b) {
|
|
106
|
+
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
|
|
107
|
+
const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
|
|
108
|
+
const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
109
|
+
const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
110
|
+
const out = new Array(16);
|
|
111
|
+
for (let i = 0; i < 4; ++i) {
|
|
112
|
+
const b0 = b[i * 4], b1 = b[i * 4 + 1], b2 = b[i * 4 + 2], b3 = b[i * 4 + 3];
|
|
113
|
+
out[i * 4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
|
|
114
|
+
out[i * 4 + 1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
|
|
115
|
+
out[i * 4 + 2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
|
|
116
|
+
out[i * 4 + 3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Grid (metres) a recentre snaps to once it is needed at all.
|
|
122
|
+
*
|
|
123
|
+
* The anchor a recentre is derived from is the *first geometry* the walk
|
|
124
|
+
* reaches, which is an arbitrary interior element: whichever one the file
|
|
125
|
+
* happens to declare first. Left as-is, that makes a model's world
|
|
126
|
+
* position a function of its element order, with two consequences users
|
|
127
|
+
* see (conway#87, "not a sound basis for a camera in the permalink"):
|
|
128
|
+
*
|
|
129
|
+
* - Two exports of one object — the same logo as IFC and as STEP, a part
|
|
130
|
+
* re-exported by a different CAD kernel — land in different places,
|
|
131
|
+
* because they disagree about which element comes first. Share#1749
|
|
132
|
+
* hit exactly this: `index.step` sat 76m off `index.ifc` because the
|
|
133
|
+
* IFC declares the x=76 block first and the STEP the x=0 one.
|
|
134
|
+
* - Re-exporting a model with the element order shuffled moves it, so
|
|
135
|
+
* every camera permalink saved against it is silently wrong.
|
|
136
|
+
*
|
|
137
|
+
* `quantizeRecentre` answers that in two stages, because the two ranges
|
|
138
|
+
* want different things:
|
|
139
|
+
*
|
|
140
|
+
* - **Inside LARGE_COORDINATE_BUDGET_M, do not recentre at all.** There
|
|
141
|
+
* is no float32 benefit below the budget — that constant *is* the
|
|
142
|
+
* threshold where quantization becomes visible — so a model within
|
|
143
|
+
* 10km of the origin simply keeps the coordinates its file authored.
|
|
144
|
+
* That is model-zero, conway#87's proposal, and it makes the frame
|
|
145
|
+
* exactly order-independent for the overwhelming majority of models
|
|
146
|
+
* rather than order-independent-per-cell.
|
|
147
|
+
* - **Above it, snap to this grid.** A georeferenced model has to come
|
|
148
|
+
* back near the origin, and snapping keeps that repeatable across
|
|
149
|
+
* exports. Half a cell (500m) out of a 1e4 m budget costs ~0.05mm of
|
|
150
|
+
* float32 resolution, and a whole-kilometre translation is exactly
|
|
151
|
+
* representable where the raw anchor was not, so the recentre itself
|
|
152
|
+
* stops contributing rounding.
|
|
153
|
+
*
|
|
154
|
+
* **Quantizing cannot remove the discontinuity, only move it**, and it
|
|
155
|
+
* is worth being precise about where this one sits, because it is not
|
|
156
|
+
* where you would guess. Snapping *everything* to the grid would put a
|
|
157
|
+
* 1km step at every cell edge, including around the near-origin models
|
|
158
|
+
* that make up almost the whole corpus. Staging moves it to the budget:
|
|
159
|
+
* inside, every anchor derives model-zero and there is no edge at all;
|
|
160
|
+
* the single remaining edge is the budget itself, where the step is
|
|
161
|
+
* `LARGE_COORDINATE_BUDGET_M` (1e4), not the grid (1e3) — an anchor at
|
|
162
|
+
* 9900 derives zero and one at 10100 derives -10000.
|
|
163
|
+
*
|
|
164
|
+
* That edge is also invisible to the adopted-preview-frame gate, which
|
|
165
|
+
* re-derives only when a durable placement lands beyond the budget: a
|
|
166
|
+
* preview anchored at 10100 and a durable first placement at 9900 probe
|
|
167
|
+
* at ~100m, so the preview frame is kept and the model renders 10km off
|
|
168
|
+
* a classic open. The trade is deliberate — one edge that a georeferenced
|
|
169
|
+
* model may sit near, rather than an edge every kilometre through the
|
|
170
|
+
* range where nearly every model lives — but it is a real residual, not
|
|
171
|
+
* an eliminated one. design/new/coordination-frame.md tracks it, and
|
|
172
|
+
* conway#87's relative-to-centre direction is what removes it properly.
|
|
173
|
+
*/
|
|
174
|
+
export const COORDINATION_SNAP_M = 1e3;
|
|
175
|
+
/**
|
|
176
|
+
* The recentre for an anchor: all zeros while the anchor is close enough
|
|
177
|
+
* to the origin not to need one, else each component snapped to
|
|
178
|
+
* COORDINATION_SNAP_M.
|
|
179
|
+
*
|
|
180
|
+
* The stage decision is made **once, on the anchor's distance from the
|
|
181
|
+
* origin**, and applied to all three components together. Deciding per
|
|
182
|
+
* component would leave a model offset diagonally — say (9km, 9km, 9km),
|
|
183
|
+
* 15.6km out and well past the budget — with no recentre at all, since
|
|
184
|
+
* no single component crosses the threshold. That silently regresses the
|
|
185
|
+
* float32 jitter fix (Share#1631) the budget exists to enforce.
|
|
186
|
+
*
|
|
187
|
+
* Works in source units: the values are pre-scale, so both the budget
|
|
188
|
+
* and the grid convert by the same `scaleFactor` the caller is about to
|
|
189
|
+
* apply (a millimetre model snaps every 1e6 source units, a metre model
|
|
190
|
+
* every 1e3).
|
|
191
|
+
*
|
|
192
|
+
* @param values The three translation components, in source units.
|
|
193
|
+
* @param scaleFactor The linear scaling factor to metres; already
|
|
194
|
+
* sanitized by the caller.
|
|
195
|
+
* @return {number[]} The recentre per component, in source units.
|
|
196
|
+
*/
|
|
197
|
+
function quantizeRecentre(values, scaleFactor) {
|
|
198
|
+
const finite = values.map((v) => (Number.isFinite(v) ? v : 0));
|
|
199
|
+
if (Math.hypot(...finite) * scaleFactor <= LARGE_COORDINATE_BUDGET_M) {
|
|
200
|
+
return [0, 0, 0];
|
|
201
|
+
}
|
|
202
|
+
const gridSourceUnits = COORDINATION_SNAP_M / scaleFactor;
|
|
203
|
+
return finite.map((v) => Math.round(v / gridSourceUnits) * gridSourceUnits);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Derive the coordination (recentre) matrix in float64, matching the
|
|
207
|
+
* gl-matrix op sequence exactly:
|
|
208
|
+
* `scale * NormalizeMat * translate(-quantize(placement * point))`.
|
|
209
|
+
*
|
|
210
|
+
* The quantization is what keeps the derived frame independent of which
|
|
211
|
+
* element a file declares first — see COORDINATION_SNAP_M for why that
|
|
212
|
+
* matters, and why it is staged around LARGE_COORDINATE_BUDGET_M.
|
|
213
|
+
*
|
|
214
|
+
* @param placement The native placement (16 elements, column-major
|
|
215
|
+
* float64 from `getValues()`); `undefined` is treated as identity.
|
|
216
|
+
* @param point The world reference point (`getPoint(0)`), float64.
|
|
217
|
+
* @param normalizeMat The Z-up -> Y-up normalize matrix (16 elements).
|
|
218
|
+
* @param scaleFactor The linear scaling factor.
|
|
219
|
+
* @return {number[]} The coordination matrix as a 16-element `number[]`.
|
|
220
|
+
*/
|
|
221
|
+
export function deriveCoordinationF64(placement, point, normalizeMat, scaleFactor) {
|
|
222
|
+
const p = placement !== undefined ? sanitize16(placement) : IDENTITY;
|
|
223
|
+
const { x, y, z } = point;
|
|
224
|
+
// Sanitized once, here, so the promise the rest of this function makes
|
|
225
|
+
// about degenerate input actually holds: a NaN/Infinite factor from a
|
|
226
|
+
// malformed unit-assignment chain would otherwise pass the recentre
|
|
227
|
+
// guard and then poison every component through the scale matrix below.
|
|
228
|
+
const scale1 = Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1;
|
|
229
|
+
// transformedPt = placement * (x, y, z, 1)
|
|
230
|
+
const tx = p[0] * x + p[4] * y + p[8] * z + p[12];
|
|
231
|
+
const ty = p[1] * x + p[5] * y + p[9] * z + p[13];
|
|
232
|
+
const tz = p[2] * x + p[6] * y + p[10] * z + p[14];
|
|
233
|
+
// translate(-quantize(transformedPt))
|
|
234
|
+
const recentre = quantizeRecentre([-tx, -ty, -tz], scale1);
|
|
235
|
+
const translate = IDENTITY.slice();
|
|
236
|
+
translate[12] = recentre[0];
|
|
237
|
+
translate[13] = recentre[1];
|
|
238
|
+
translate[14] = recentre[2];
|
|
239
|
+
// scale(scaleFactor)
|
|
240
|
+
const scale = [
|
|
241
|
+
scale1, 0, 0, 0,
|
|
242
|
+
0, scale1, 0, 0,
|
|
243
|
+
0, 0, scale1, 0,
|
|
244
|
+
0, 0, 0, 1,
|
|
245
|
+
];
|
|
246
|
+
// scale * (NormalizeMat * translate)
|
|
247
|
+
return mat4MultiplyF64(scale, mat4MultiplyF64(normalizeMat, translate));
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Compose the emitted world transform in float64:
|
|
251
|
+
* `coordination * placement [ * translate(geomCenter) ]`.
|
|
252
|
+
*
|
|
253
|
+
* @param coordination The coordination matrix (16 elements).
|
|
254
|
+
* @param placement The native placement (16 elements, column-major
|
|
255
|
+
* float64 from `getValues()`); `undefined` is treated as identity.
|
|
256
|
+
* @param geomCenter The per-leaf normalize centre; omit for the bare
|
|
257
|
+
* composition used by the AP214 shared-buffer path (issue #308).
|
|
258
|
+
* @return {number[]} The flat transform as a 16-element `number[]`,
|
|
259
|
+
* ready to hand back as a FlatMesh `flatTransformation`.
|
|
260
|
+
*/
|
|
261
|
+
export function composeTransformF64(coordination, placement, geomCenter) {
|
|
262
|
+
let out = placement !== undefined ?
|
|
263
|
+
mat4MultiplyF64(coordination, sanitize16(placement)) :
|
|
264
|
+
Array.from(coordination);
|
|
265
|
+
if (geomCenter !== undefined) {
|
|
266
|
+
const gm = IDENTITY.slice();
|
|
267
|
+
gm[12] = geomCenter.x;
|
|
268
|
+
gm[13] = geomCenter.y;
|
|
269
|
+
gm[14] = geomCenter.z;
|
|
270
|
+
out = mat4MultiplyF64(out, gm);
|
|
271
|
+
}
|
|
272
|
+
return out;
|
|
273
|
+
}
|
|
274
|
+
// Column-major mat4 translation component indices.
|
|
275
|
+
export const TRANSLATION_X = 12;
|
|
276
|
+
export const TRANSLATION_Y = 13;
|
|
277
|
+
export const TRANSLATION_Z = 14;
|
|
278
|
+
/**
|
|
279
|
+
* Placement-magnitude budget (metres) above which a coordination frame
|
|
280
|
+
* has failed to recentre a model: float32 (the GPU vertex format and
|
|
281
|
+
* BatchedMesh matrix texture) quantizes at ~1mm per 1e4 m of
|
|
282
|
+
* coordinate, the visible-jitter threshold established in Share#1631.
|
|
283
|
+
* Used to validate an adopted preview coordination frame against the
|
|
284
|
+
* durable walk's first geometry (Share#1634).
|
|
285
|
+
*/
|
|
286
|
+
export const LARGE_COORDINATE_BUDGET_M = 1e4;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordination_f64.test.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/coordination_f64.test.ts"],"names":[],"mappings":""}
|