@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
|
@@ -105,11 +105,19 @@ describe("AP214 Geometry Extraction", () => {
|
|
|
105
105
|
expect(extractGearGeometry()).toBe(ExtractResult.COMPLETE);
|
|
106
106
|
});
|
|
107
107
|
test("tubeGeometryArrayLength()", () => {
|
|
108
|
-
|
|
108
|
+
// Dropped from 9108 with conway-geom#153: cylindrical faces CDT their
|
|
109
|
+
// trim loops in a (theta, z) unwrap instead of refining earcut chords
|
|
110
|
+
// until the triangle budget ran out.
|
|
111
|
+
const testParameter = 828;
|
|
109
112
|
expect(getTubeMeshSize()).toBe(testParameter);
|
|
110
113
|
});
|
|
111
114
|
test("gearGeometryArrayLength()", () => {
|
|
112
|
-
|
|
115
|
+
// Raised from 48108 with the extent-relative deflection thresholds
|
|
116
|
+
// (conway-geom relativeCurveDeflectionSquared): the gear's involute
|
|
117
|
+
// flank splines are a few mm across, so the old absolute 1mm chord
|
|
118
|
+
// tolerance sampled them with ~3 chords per flank; 0.1%-of-extent
|
|
119
|
+
// tolerance resolves the involute curvature the profile actually has.
|
|
120
|
+
const testParameter = 154644;
|
|
113
121
|
expect(getGearMeshSize()).toBe(testParameter);
|
|
114
122
|
});
|
|
115
123
|
test("uniformScaleAffine scales basis AND translation, preserves bottom row", () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap214_logical_attribute.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_logical_attribute.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// ISO 10303-42 declares `b_spline_surface.u_closed`, `v_closed` and
|
|
2
|
+
// `self_intersect` (and the matching attributes on `b_spline_curve`,
|
|
3
|
+
// `composite_curve`, `offset_curve_2d/3d`, `offset_surface` and
|
|
4
|
+
// `shape_aspect`) as LOGICAL, which is three-valued - `.T.`, `.F.`, `.U.`.
|
|
5
|
+
// The generator used to emit `extractBoolean` for them, so a `.U.` threw
|
|
6
|
+
// 'Value in STEP was incorrectly typed' out of the getter and took the whole
|
|
7
|
+
// face - and in the NIST AP242 exports, whole solids - with it.
|
|
8
|
+
//
|
|
9
|
+
// The generator now carries a distinct `logical` token, so a bare EXPRESS
|
|
10
|
+
// LOGICAL selects `extractLogical` and reads `.U.` as null. This test pins
|
|
11
|
+
// that against the regenerated tree: it fails on the pre-regen output, where
|
|
12
|
+
// the `.U.` reads throw. BOOLEAN attributes are asserted alongside, because
|
|
13
|
+
// the failure mode of an over-broad fix is every BOOLEAN quietly becoming a
|
|
14
|
+
// LOGICAL. See bldrs-ai/conway#480 and IFC-gen-internal#2.
|
|
15
|
+
import { beforeAll, describe, expect, test } from "@jest/globals";
|
|
16
|
+
import AP214StepParser from "./ap214_step_parser.js";
|
|
17
|
+
import ParsingBuffer from "../parsing/parsing_buffer.js";
|
|
18
|
+
import { ParseResult } from "../step/parsing/step_parser.js";
|
|
19
|
+
import { b_spline_surface_with_knots, edge_curve } from "./AP214E3_2010_gen/index.js";
|
|
20
|
+
import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
|
|
21
|
+
const conwayGeom = new ConwayGeometry();
|
|
22
|
+
/**
|
|
23
|
+
* Initialize the wasm.
|
|
24
|
+
*/
|
|
25
|
+
async function initializeWasm() {
|
|
26
|
+
await conwayGeom.initialize();
|
|
27
|
+
}
|
|
28
|
+
const parser = AP214StepParser.Instance;
|
|
29
|
+
// A bilinear patch, so the fixture stays readable, carrying the same
|
|
30
|
+
// attribute shape as the bicubic patches in `nist_ftc_07_asme1_ap242-e2.stp`
|
|
31
|
+
// that this defect dropped: `.UNSPECIFIED.` surface form followed by
|
|
32
|
+
// u_closed / v_closed / self_intersect all written `.U.`. That file has 20
|
|
33
|
+
// such surfaces, and each one lost an ADVANCED_FACE.
|
|
34
|
+
const UNKNOWN_SURFACE = `
|
|
35
|
+
#1 = CARTESIAN_POINT('',(0.,0.,0.));
|
|
36
|
+
#2 = CARTESIAN_POINT('',(1.,0.,0.));
|
|
37
|
+
#3 = CARTESIAN_POINT('',(0.,1.,0.));
|
|
38
|
+
#4 = CARTESIAN_POINT('',(1.,1.,0.));
|
|
39
|
+
#10 = B_SPLINE_SURFACE_WITH_KNOTS('',1,1,((#1,#2),(#3,#4)),.UNSPECIFIED.,
|
|
40
|
+
.U.,.U.,.U.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
|
41
|
+
`;
|
|
42
|
+
// The same surface with the three LOGICALs written as the two determinate
|
|
43
|
+
// values. A fix that read every LOGICAL as null would pass the `.U.` case
|
|
44
|
+
// and fail here.
|
|
45
|
+
const DETERMINATE_SURFACE = `
|
|
46
|
+
#1 = CARTESIAN_POINT('',(0.,0.,0.));
|
|
47
|
+
#2 = CARTESIAN_POINT('',(1.,0.,0.));
|
|
48
|
+
#3 = CARTESIAN_POINT('',(0.,1.,0.));
|
|
49
|
+
#4 = CARTESIAN_POINT('',(1.,1.,0.));
|
|
50
|
+
#10 = B_SPLINE_SURFACE_WITH_KNOTS('',1,1,((#1,#2),(#3,#4)),.UNSPECIFIED.,
|
|
51
|
+
.T.,.F.,.F.,(2,2),(2,2),(0.,1.),(0.,1.),.UNSPECIFIED.);
|
|
52
|
+
`;
|
|
53
|
+
const SURFACE_EXPRESS_ID = 10;
|
|
54
|
+
// `edge_curve.same_sense` is a genuine BOOLEAN and must keep reading as one.
|
|
55
|
+
// The edge's vertex and curve references are left dangling: only the trailing
|
|
56
|
+
// BOOLEAN is read here, and resolving the rest would need a curve definition
|
|
57
|
+
// that has nothing to do with what is being pinned.
|
|
58
|
+
const BOOLEAN_EDGES = `
|
|
59
|
+
#20 = EDGE_CURVE('',#21,#22,#23,.T.);
|
|
60
|
+
#30 = EDGE_CURVE('',#21,#22,#23,.F.);
|
|
61
|
+
`;
|
|
62
|
+
const TRUE_EDGE_EXPRESS_ID = 20;
|
|
63
|
+
const FALSE_EDGE_EXPRESS_ID = 30;
|
|
64
|
+
/**
|
|
65
|
+
* Parse a STEP fragment and return the model it produced.
|
|
66
|
+
*
|
|
67
|
+
* @param source The STEP text to parse.
|
|
68
|
+
* @return {ReturnType< typeof parser.parseDataToModel >[ 1 ]} The model.
|
|
69
|
+
*/
|
|
70
|
+
function modelOf(source) {
|
|
71
|
+
const [result, model] = parser.parseDataToModel(new ParsingBuffer(new TextEncoder().encode(source)));
|
|
72
|
+
// INCOMPLETE is expected for the edge fixture, whose references dangle.
|
|
73
|
+
if (model === void 0 ||
|
|
74
|
+
(result !== ParseResult.COMPLETE && result !== ParseResult.INCOMPLETE)) {
|
|
75
|
+
throw new Error(`parse failed with result ${result}`);
|
|
76
|
+
}
|
|
77
|
+
return model;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Parse a surface fixture and read back its three LOGICAL attributes.
|
|
81
|
+
*
|
|
82
|
+
* @param source The STEP text to parse.
|
|
83
|
+
* @return {Array< boolean | null >} u_closed, v_closed, self_intersect.
|
|
84
|
+
*/
|
|
85
|
+
function surfaceLogicalsOf(source) {
|
|
86
|
+
const surface = modelOf(source).getElementByExpressID(SURFACE_EXPRESS_ID);
|
|
87
|
+
if (!(surface instanceof b_spline_surface_with_knots)) {
|
|
88
|
+
throw new Error("expected a b_spline_surface_with_knots");
|
|
89
|
+
}
|
|
90
|
+
return [surface.u_closed, surface.v_closed, surface.self_intersect];
|
|
91
|
+
}
|
|
92
|
+
beforeAll(async () => {
|
|
93
|
+
await initializeWasm();
|
|
94
|
+
});
|
|
95
|
+
describe("a LOGICAL attribute", () => {
|
|
96
|
+
test(".U. reads as null instead of throwing", () => {
|
|
97
|
+
expect(surfaceLogicalsOf(UNKNOWN_SURFACE)).toEqual([null, null, null]);
|
|
98
|
+
});
|
|
99
|
+
test(".T. and .F. still read as true and false", () => {
|
|
100
|
+
expect(surfaceLogicalsOf(DETERMINATE_SURFACE)).toEqual([true, false, false]);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe("a BOOLEAN attribute", () => {
|
|
104
|
+
test(".T. and .F. are unaffected", () => {
|
|
105
|
+
const model = modelOf(BOOLEAN_EDGES);
|
|
106
|
+
const trueEdge = model.getElementByExpressID(TRUE_EDGE_EXPRESS_ID);
|
|
107
|
+
const falseEdge = model.getElementByExpressID(FALSE_EDGE_EXPRESS_ID);
|
|
108
|
+
if (!(trueEdge instanceof edge_curve) || !(falseEdge instanceof edge_curve)) {
|
|
109
|
+
throw new Error("expected two edge_curves");
|
|
110
|
+
}
|
|
111
|
+
expect(trueEdge.same_sense).toBe(true);
|
|
112
|
+
expect(falseEdge.same_sense).toBe(false);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -13,6 +13,12 @@ export declare class AP214ModelGeometry implements ModelGeometry {
|
|
|
13
13
|
/**
|
|
14
14
|
* Add a mesh to this geometry collection.
|
|
15
15
|
*
|
|
16
|
+
* Freezes the native float vertex mirror at add time, exactly like
|
|
17
|
+
* IfcModelGeometry.add (see its note): consumers read float vertices
|
|
18
|
+
* whose frame must match the scene transforms, which are authored
|
|
19
|
+
* against the geometry AS CREATED — later count-preserving native
|
|
20
|
+
* mutations (normalize's centering) must not shift the served frame.
|
|
21
|
+
*
|
|
16
22
|
* @param mesh
|
|
17
23
|
* @param parentLocalID
|
|
18
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap214_model_geometry.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_model_geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAG7C;;GAEG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IAEtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAE1D;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED
|
|
1
|
+
{"version":3,"file":"ap214_model_geometry.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_model_geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAG7C;;GAEG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IAEtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAE1D;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;;;;;OAWG;IACI,GAAG,CAAE,IAAI,EAAE,aAAa,EAAE,aAAa,CAAC,EAAG,MAAM,GAAI,IAAI;IAsBhE;;;;OAIG;IACI,MAAM,CAAE,OAAO,EAAE,MAAM;IAe9B;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAgBhC;;;;;OAKG;IACI,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAIlE;;;;OAIG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAI/D;;;OAGG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,aAAa,CAAC;IAI3D;;;OAGG;IACI,qBAAqB,IAAI,MAAM;CAoBvC"}
|
|
@@ -16,10 +16,19 @@ export class AP214ModelGeometry {
|
|
|
16
16
|
/**
|
|
17
17
|
* Add a mesh to this geometry collection.
|
|
18
18
|
*
|
|
19
|
+
* Freezes the native float vertex mirror at add time, exactly like
|
|
20
|
+
* IfcModelGeometry.add (see its note): consumers read float vertices
|
|
21
|
+
* whose frame must match the scene transforms, which are authored
|
|
22
|
+
* against the geometry AS CREATED — later count-preserving native
|
|
23
|
+
* mutations (normalize's centering) must not shift the served frame.
|
|
24
|
+
*
|
|
19
25
|
* @param mesh
|
|
20
26
|
* @param parentLocalID
|
|
21
27
|
*/
|
|
22
28
|
add(mesh, parentLocalID) {
|
|
29
|
+
if (mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
|
|
30
|
+
mesh.geometry.GetVertexData();
|
|
31
|
+
}
|
|
23
32
|
this.meshes_.set(mesh.localID, mesh);
|
|
24
33
|
if (parentLocalID !== void 0) {
|
|
25
34
|
let children = this.children_.get(parentLocalID);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap214_pcurve_basis_surfaces.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { describe, expect, test, beforeAll } from "@jest/globals";
|
|
3
|
+
import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
|
|
4
|
+
import Logger, { LogLevel } from "../logging/logger.js";
|
|
5
|
+
import ParsingBuffer from "../parsing/parsing_buffer.js";
|
|
6
|
+
import { ParseResult } from "../step/parsing/step_parser.js";
|
|
7
|
+
import { AP214GeometryExtraction } from "./ap214_geometry_extraction.js";
|
|
8
|
+
import { pcurve } from "./AP214E3_2010_gen/index.js";
|
|
9
|
+
import AP214StepParser from "./ap214_step_parser.js";
|
|
10
|
+
let extraction;
|
|
11
|
+
let model;
|
|
12
|
+
// Coordinates round-trip through the native curve at float precision (a
|
|
13
|
+
// CurveObject's get3d hands back ~1e-7 relative of what went in), so the
|
|
14
|
+
// checks here are geometric and to four decimal places rather than bit-exact.
|
|
15
|
+
const PRECISION_DIGITS = 4;
|
|
16
|
+
const MONOTONIC_EPSILON = 0.0001;
|
|
17
|
+
const CYLINDER_RADIUS = 25;
|
|
18
|
+
const CYLINDER_TOP = 20;
|
|
19
|
+
const CONE_ORIGIN_X = 5;
|
|
20
|
+
const CONE_ORIGIN_Y = -3;
|
|
21
|
+
const CONE_ORIGIN_Z = 50;
|
|
22
|
+
const CONE_BASE_RADIUS = 10;
|
|
23
|
+
const CONE_HEIGHT = 20;
|
|
24
|
+
const CONE_SEMI_ANGLE = Math.PI / 6;
|
|
25
|
+
const CONE_TOP_RADIUS = CONE_BASE_RADIUS + (CONE_HEIGHT * Math.tan(CONE_SEMI_ANGLE));
|
|
26
|
+
const SPHERE_RADIUS = 10;
|
|
27
|
+
const SPHERE_HEIGHT = 5;
|
|
28
|
+
const SPHERE_LATITUDE = Math.PI / 6;
|
|
29
|
+
const SPHERE_RING_RADIUS = SPHERE_RADIUS * Math.cos(SPHERE_LATITUDE);
|
|
30
|
+
const TORUS_MAJOR_RADIUS = 20;
|
|
31
|
+
const TORUS_MINOR_RADIUS = 5;
|
|
32
|
+
const TORUS_OUTER = 25;
|
|
33
|
+
const TORUS_INNER = 15;
|
|
34
|
+
const PLANE_ORIGIN = { x: 1, y: 2, z: 3 };
|
|
35
|
+
const PLANE_END = { x: 5, y: 9, z: 3 };
|
|
36
|
+
const CURVE_3D_END_Y = 40;
|
|
37
|
+
const PARAMETER_SAMPLES = 3;
|
|
38
|
+
/**
|
|
39
|
+
* Parse the fixture and set up geometry extraction.
|
|
40
|
+
*
|
|
41
|
+
* @return {Promise<boolean>} True if initialization succeeded.
|
|
42
|
+
*/
|
|
43
|
+
async function initialize() {
|
|
44
|
+
const parser = AP214StepParser.Instance;
|
|
45
|
+
const buffer = fs.readFileSync("data/pcurve-basis-surfaces.step");
|
|
46
|
+
const bufferInput = new ParsingBuffer(buffer);
|
|
47
|
+
if (parser.parseHeader(bufferInput)[1] !== ParseResult.COMPLETE) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const conwayGeometry = new ConwayGeometry();
|
|
51
|
+
if (!(await conwayGeometry.initialize())) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const [, parsedModel] = parser.parseDataToModel(bufferInput);
|
|
55
|
+
if (parsedModel === void 0) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
model = parsedModel;
|
|
59
|
+
extraction = new AP214GeometryExtraction(conwayGeometry, model);
|
|
60
|
+
return extraction.isInitialized();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Find the fixture's pcurve carrying a given name.
|
|
64
|
+
*
|
|
65
|
+
* @param name The PCURVE's name attribute.
|
|
66
|
+
* @return {pcurve} The matching pcurve.
|
|
67
|
+
*/
|
|
68
|
+
function pcurveNamed(name) {
|
|
69
|
+
const found = Array.from(model.types(pcurve)).find((item) => item.name === name);
|
|
70
|
+
expect(found).toBeDefined();
|
|
71
|
+
return found;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Extract a pcurve through extractCurve - the arm that dispatches to
|
|
75
|
+
* extractPScurve1 - and read its points out.
|
|
76
|
+
*
|
|
77
|
+
* @param name The PCURVE's name attribute.
|
|
78
|
+
* @return {Vector3[]} The extracted curve's points, empty if it was dropped.
|
|
79
|
+
*/
|
|
80
|
+
function extractedPoints(name) {
|
|
81
|
+
const curve = extraction.extractCurve(pcurveNamed(name));
|
|
82
|
+
if (curve === void 0) {
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
const points = [];
|
|
86
|
+
for (let index = 0; index < curve.getPointsSize(); ++index) {
|
|
87
|
+
points.push(curve.get3d(index));
|
|
88
|
+
}
|
|
89
|
+
return points;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Find a buffered warning containing a given fragment.
|
|
93
|
+
*
|
|
94
|
+
* @param fragment Text the message must contain.
|
|
95
|
+
* @return {LogEntry | undefined} The matching entry.
|
|
96
|
+
*/
|
|
97
|
+
function warningContaining(fragment) {
|
|
98
|
+
return Logger.getLogs().find((entry) => entry.level === "warning" && entry.message.includes(fragment));
|
|
99
|
+
}
|
|
100
|
+
describe("AP214 pcurve basis surfaces (bldrs-ai/conway#505)", () => {
|
|
101
|
+
beforeAll(async () => {
|
|
102
|
+
Logger.clearLogs();
|
|
103
|
+
// The b-spline basis surface warns by design below, and the echo would be
|
|
104
|
+
// noise in the test console. The buffer these tests read is filled
|
|
105
|
+
// regardless of the console threshold.
|
|
106
|
+
const threshold = Logger.getLogLevel();
|
|
107
|
+
Logger.setLogLevel(LogLevel.OFF);
|
|
108
|
+
try {
|
|
109
|
+
expect(await initialize()).toBe(true);
|
|
110
|
+
}
|
|
111
|
+
finally {
|
|
112
|
+
Logger.setLogLevel(threshold);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// (u, v) walks a straight line from (0, 0) to (pi, 20): a half turn of the
|
|
116
|
+
// cylinder while climbing its full height, which is a helix arc and not the
|
|
117
|
+
// chord across it.
|
|
118
|
+
test("a cylindrical basis surface maps (u, v) onto the cylinder", () => {
|
|
119
|
+
const points = extractedPoints("cylinder");
|
|
120
|
+
// More points than the parameter curve has: the angular span is
|
|
121
|
+
// subdivided rather than chorded across.
|
|
122
|
+
expect(points.length).toBeGreaterThan(PARAMETER_SAMPLES);
|
|
123
|
+
let previousZ = -Infinity;
|
|
124
|
+
for (const point of points) {
|
|
125
|
+
expect(Math.sqrt((point.x * point.x) + (point.y * point.y)))
|
|
126
|
+
.toBeCloseTo(CYLINDER_RADIUS, PRECISION_DIGITS);
|
|
127
|
+
// v maps to height along the axis, so it climbs with the parameter.
|
|
128
|
+
expect(point.z).toBeGreaterThanOrEqual(previousZ - MONOTONIC_EPSILON);
|
|
129
|
+
previousZ = point.z;
|
|
130
|
+
}
|
|
131
|
+
const first = points[0];
|
|
132
|
+
const last = points[points.length - 1];
|
|
133
|
+
expect(first.x).toBeCloseTo(CYLINDER_RADIUS, PRECISION_DIGITS);
|
|
134
|
+
expect(first.y).toBeCloseTo(0, PRECISION_DIGITS);
|
|
135
|
+
expect(first.z).toBeCloseTo(0, PRECISION_DIGITS);
|
|
136
|
+
expect(last.x).toBeCloseTo(-CYLINDER_RADIUS, PRECISION_DIGITS);
|
|
137
|
+
expect(last.y).toBeCloseTo(0, PRECISION_DIGITS);
|
|
138
|
+
expect(last.z).toBeCloseTo(CYLINDER_TOP, PRECISION_DIGITS);
|
|
139
|
+
});
|
|
140
|
+
// A generator line at u = 0 on a cone whose placement is offset and turned a
|
|
141
|
+
// quarter turn about z, so the local frame has to be applied for the mapped
|
|
142
|
+
// points to land: local +x is world +y here.
|
|
143
|
+
//
|
|
144
|
+
// This also pins the cone's v convention, the point a review of this code
|
|
145
|
+
// queried (bldrs-ai/conway#520): ISO 10303-42 measures v along the axis, so
|
|
146
|
+
// the far end is a ring of 10 + 20 tan(30 deg) = 21.547005 at an axial 20,
|
|
147
|
+
// landing at (5, 18.547005, 70). Were v distance along the generator, the
|
|
148
|
+
// same (0, 20) would give a ring of 10 + 20 sin(30 deg) = 20 at an axial
|
|
149
|
+
// 20 cos(30 deg), i.e. (5, 17, 67.320508), and both of the assertions on
|
|
150
|
+
// `last` below would fail.
|
|
151
|
+
test("a conical basis surface applies the taper and the placement frame", () => {
|
|
152
|
+
const points = extractedPoints("cone");
|
|
153
|
+
expect(points.length).toBeGreaterThan(1);
|
|
154
|
+
const first = points[0];
|
|
155
|
+
const last = points[points.length - 1];
|
|
156
|
+
expect(first.x).toBeCloseTo(CONE_ORIGIN_X, PRECISION_DIGITS);
|
|
157
|
+
expect(first.y).toBeCloseTo(CONE_ORIGIN_Y + CONE_BASE_RADIUS, PRECISION_DIGITS);
|
|
158
|
+
expect(first.z).toBeCloseTo(CONE_ORIGIN_Z, PRECISION_DIGITS);
|
|
159
|
+
// Radius at the far end is base + height * tan(30 degrees).
|
|
160
|
+
expect(last.x).toBeCloseTo(CONE_ORIGIN_X, PRECISION_DIGITS);
|
|
161
|
+
expect(last.y).toBeCloseTo(CONE_ORIGIN_Y + CONE_TOP_RADIUS, PRECISION_DIGITS);
|
|
162
|
+
expect(last.z).toBeCloseTo(CONE_ORIGIN_Z + CONE_HEIGHT, PRECISION_DIGITS);
|
|
163
|
+
});
|
|
164
|
+
// u sweeps a quarter turn at a fixed latitude of 30 degrees.
|
|
165
|
+
test("a spherical basis surface maps latitude to height", () => {
|
|
166
|
+
const points = extractedPoints("sphere");
|
|
167
|
+
expect(points.length).toBeGreaterThan(2);
|
|
168
|
+
for (const point of points) {
|
|
169
|
+
expect(Math.sqrt((point.x * point.x) + (point.y * point.y) + (point.z * point.z)))
|
|
170
|
+
.toBeCloseTo(SPHERE_RADIUS, PRECISION_DIGITS);
|
|
171
|
+
expect(point.z).toBeCloseTo(SPHERE_HEIGHT, PRECISION_DIGITS);
|
|
172
|
+
}
|
|
173
|
+
const first = points[0];
|
|
174
|
+
const last = points[points.length - 1];
|
|
175
|
+
expect(first.x).toBeCloseTo(SPHERE_RING_RADIUS, PRECISION_DIGITS);
|
|
176
|
+
expect(first.y).toBeCloseTo(0, PRECISION_DIGITS);
|
|
177
|
+
expect(last.x).toBeCloseTo(0, PRECISION_DIGITS);
|
|
178
|
+
expect(last.y).toBeCloseTo(SPHERE_RING_RADIUS, PRECISION_DIGITS);
|
|
179
|
+
});
|
|
180
|
+
// v walks half way around the tube at a fixed u, from the outer equator to
|
|
181
|
+
// the inner one.
|
|
182
|
+
test("a toroidal basis surface maps the tube angle", () => {
|
|
183
|
+
const points = extractedPoints("torus");
|
|
184
|
+
expect(points.length).toBeGreaterThan(2);
|
|
185
|
+
for (const point of points) {
|
|
186
|
+
const planar = Math.sqrt((point.x * point.x) + (point.y * point.y));
|
|
187
|
+
const fromTubeCentre = Math.sqrt(((planar - TORUS_MAJOR_RADIUS) * (planar - TORUS_MAJOR_RADIUS)) +
|
|
188
|
+
(point.z * point.z));
|
|
189
|
+
expect(fromTubeCentre).toBeCloseTo(TORUS_MINOR_RADIUS, PRECISION_DIGITS);
|
|
190
|
+
}
|
|
191
|
+
const first = points[0];
|
|
192
|
+
const last = points[points.length - 1];
|
|
193
|
+
expect(first.x).toBeCloseTo(TORUS_OUTER, PRECISION_DIGITS);
|
|
194
|
+
expect(first.z).toBeCloseTo(0, PRECISION_DIGITS);
|
|
195
|
+
expect(last.x).toBeCloseTo(TORUS_INNER, PRECISION_DIGITS);
|
|
196
|
+
expect(last.z).toBeCloseTo(0, PRECISION_DIGITS);
|
|
197
|
+
});
|
|
198
|
+
// The planar case the extractor already claimed to support: (u, v) are
|
|
199
|
+
// distances along the placement's x and y axes, so the parameter curve's
|
|
200
|
+
// (4, 7) lands 4 and 7 from an origin at (1, 2, 3).
|
|
201
|
+
test("a planar basis surface maps (u, v) along the placement axes", () => {
|
|
202
|
+
const points = extractedPoints("plane");
|
|
203
|
+
expect(points.length).toBe(2);
|
|
204
|
+
expect(points[0].x).toBeCloseTo(PLANE_ORIGIN.x, PRECISION_DIGITS);
|
|
205
|
+
expect(points[0].y).toBeCloseTo(PLANE_ORIGIN.y, PRECISION_DIGITS);
|
|
206
|
+
expect(points[0].z).toBeCloseTo(PLANE_ORIGIN.z, PRECISION_DIGITS);
|
|
207
|
+
expect(points[1].x).toBeCloseTo(PLANE_END.x, PRECISION_DIGITS);
|
|
208
|
+
expect(points[1].y).toBeCloseTo(PLANE_END.y, PRECISION_DIGITS);
|
|
209
|
+
expect(points[1].z).toBeCloseTo(PLANE_END.z, PRECISION_DIGITS);
|
|
210
|
+
});
|
|
211
|
+
// The residue: dropped, but under a message that names the basis surface so
|
|
212
|
+
// the family can be sized per type rather than as one undifferentiated row.
|
|
213
|
+
test("an unsupported basis surface is dropped with its type named", () => {
|
|
214
|
+
expect(extractedPoints("bspline").length).toBe(0);
|
|
215
|
+
const warning = warningContaining("Unsupported PCURVE basis surface");
|
|
216
|
+
expect(warning).toBeDefined();
|
|
217
|
+
expect(warning.message).toContain("B_SPLINE_SURFACE_WITH_KNOTS");
|
|
218
|
+
expect(warning.expressIDs.has(String(pcurveNamed("bspline").expressID))).toBe(true);
|
|
219
|
+
});
|
|
220
|
+
// The pcurve here is one variant of a complex instance that also carries a
|
|
221
|
+
// SURFACE_CURVE; its curve_3d runs +y from (25, 0, 0), which the pcurve's
|
|
222
|
+
// own parameter curve (a helix on the cylinder) never touches.
|
|
223
|
+
test("an explicit curve_3d on the same instance beats the mapping", () => {
|
|
224
|
+
const points = extractedPoints("complex");
|
|
225
|
+
expect(points.length).toBe(2);
|
|
226
|
+
expect(points[0].x).toBeCloseTo(CYLINDER_RADIUS, PRECISION_DIGITS);
|
|
227
|
+
expect(points[0].y).toBeCloseTo(0, PRECISION_DIGITS);
|
|
228
|
+
expect(points[0].z).toBeCloseTo(0, PRECISION_DIGITS);
|
|
229
|
+
expect(points[1].x).toBeCloseTo(CYLINDER_RADIUS, PRECISION_DIGITS);
|
|
230
|
+
expect(points[1].y).toBeCloseTo(CURVE_3D_END_Y, PRECISION_DIGITS);
|
|
231
|
+
expect(points[1].z).toBeCloseTo(0, PRECISION_DIGITS);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap214_sphere_vertex_loop.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_sphere_vertex_loop.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { describe, expect, test, beforeAll } from "@jest/globals";
|
|
3
|
+
import { AP214GeometryExtraction } from "./ap214_geometry_extraction.js";
|
|
4
|
+
import { ParseResult } from "../step/parsing/step_parser.js";
|
|
5
|
+
import AP214StepParser from "./ap214_step_parser.js";
|
|
6
|
+
import ParsingBuffer from "../parsing/parsing_buffer.js";
|
|
7
|
+
import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
|
|
8
|
+
import { ExtractResult } from "../core/shared_constants.js";
|
|
9
|
+
/* eslint-disable no-magic-numbers -- the fixture's radius, the reified vertex
|
|
10
|
+
layout (6 floats) and 4x4 matrix element indices all read more clearly as
|
|
11
|
+
literals here than as named constants. */
|
|
12
|
+
/**
|
|
13
|
+
* A whole sphere as OCCT writes one: a single `ADVANCED_FACE` on a
|
|
14
|
+
* `SPHERICAL_SURFACE`, bounded by a single `VERTEX_LOOP` at the north
|
|
15
|
+
* pole. ISO 10303-42 reads a lone degenerate loop as covering the entire
|
|
16
|
+
* surface — the vertex marks a pole, it does not trim anything.
|
|
17
|
+
*
|
|
18
|
+
* This shape used to load as ZERO meshes, silently: one point constrains
|
|
19
|
+
* no CDT, so the dual-hemisphere unwrap produced no triangles and nothing
|
|
20
|
+
* downstream could tell "trimmed away to nothing" from "never
|
|
21
|
+
* triangulated". See https://github.com/bldrs-ai/conway/issues/461.
|
|
22
|
+
*/
|
|
23
|
+
const FIXTURE = "data/sphere-vertex-loop.step";
|
|
24
|
+
/** The fixture's radius, in its own (millimetre) file coordinates. */
|
|
25
|
+
const RADIUS_MM = 15;
|
|
26
|
+
/**
|
|
27
|
+
* Fractional slack. The fallback emits a 48x24 parametric grid, which
|
|
28
|
+
* inscribes the true sphere, so every measured quantity sits slightly
|
|
29
|
+
* under the analytic value — hence a tolerance wide enough for chord
|
|
30
|
+
* error rather than one that only covers floating point.
|
|
31
|
+
*/
|
|
32
|
+
const TOLERANCE = 0.02;
|
|
33
|
+
let scene;
|
|
34
|
+
let conwayGeometry;
|
|
35
|
+
beforeAll(async () => {
|
|
36
|
+
const parser = AP214StepParser.Instance;
|
|
37
|
+
const buffer = new ParsingBuffer(fs.readFileSync(FIXTURE));
|
|
38
|
+
expect(parser.parseHeader(buffer)[1]).toBe(ParseResult.COMPLETE);
|
|
39
|
+
const [, parsed] = parser.parseDataToModel(buffer);
|
|
40
|
+
expect(parsed).not.toBe(void 0);
|
|
41
|
+
conwayGeometry = new ConwayGeometry();
|
|
42
|
+
expect(await conwayGeometry.initialize()).toBe(true);
|
|
43
|
+
const [result, sceneBuilder] = new AP214GeometryExtraction(conwayGeometry, parsed).extractAP214GeometryData();
|
|
44
|
+
expect(result).toBe(ExtractResult.COMPLETE);
|
|
45
|
+
scene = sceneBuilder;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Every vertex in the scene, in file coordinates (no transform applied —
|
|
49
|
+
* this fixture has a single mesh at the origin, and the unit scale is the
|
|
50
|
+
* subject of a different test).
|
|
51
|
+
*
|
|
52
|
+
* @return Flat [x, y, z] triples, in vertex-buffer order.
|
|
53
|
+
*/
|
|
54
|
+
function vertices() {
|
|
55
|
+
const wasm = conwayGeometry.wasmModule;
|
|
56
|
+
const points = [];
|
|
57
|
+
for (const [, , mesh] of scene.walk()) {
|
|
58
|
+
const geometry = mesh.geometry;
|
|
59
|
+
const floatCount = geometry.GetVertexDataSize();
|
|
60
|
+
// Reified layout: 6 floats per vertex, position xyz then normal xyz.
|
|
61
|
+
// Read into a copy immediately — HEAPF32 views detach on wasm growth.
|
|
62
|
+
const data = wasm.HEAPF32.slice(geometry.GetVertexData() / 4, (geometry.GetVertexData() / 4) + floatCount);
|
|
63
|
+
for (let where = 0; where < floatCount; where += 6) {
|
|
64
|
+
points.push([data[where], data[where + 1], data[where + 2]]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return points;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Every triangle in the scene, as three positions.
|
|
71
|
+
*
|
|
72
|
+
* The reified vertex buffer is NOT triangle soup — it is indexed, and its
|
|
73
|
+
* vertex count is not even a multiple of three — so triangles have to be
|
|
74
|
+
* assembled through the index buffer rather than by walking vertices in
|
|
75
|
+
* threes.
|
|
76
|
+
*
|
|
77
|
+
* @return Triples of [x, y, z] triples.
|
|
78
|
+
*/
|
|
79
|
+
function triangles() {
|
|
80
|
+
const wasm = conwayGeometry.wasmModule;
|
|
81
|
+
const result = [];
|
|
82
|
+
for (const [, , mesh] of scene.walk()) {
|
|
83
|
+
const geometry = mesh.geometry;
|
|
84
|
+
const floatCount = geometry.GetVertexDataSize();
|
|
85
|
+
const data = wasm.HEAPF32.slice(geometry.GetVertexData() / 4, (geometry.GetVertexData() / 4) + floatCount);
|
|
86
|
+
const indexCount = geometry.GetIndexDataSize();
|
|
87
|
+
const indices = wasm.HEAPU32.slice(geometry.GetIndexData() / 4, (geometry.GetIndexData() / 4) + indexCount);
|
|
88
|
+
/**
|
|
89
|
+
* @param index Vertex index into the reified buffer.
|
|
90
|
+
* @return The vertex position.
|
|
91
|
+
*/
|
|
92
|
+
const at = (index) => [data[index * 6], data[(index * 6) + 1], data[(index * 6) + 2]];
|
|
93
|
+
for (let where = 0; where + 2 < indexCount; where += 3) {
|
|
94
|
+
result.push([at(indices[where]), at(indices[where + 1]), at(indices[where + 2])]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
describe("AP214 spherical surface bounded by a vertex loop", () => {
|
|
100
|
+
test("a whole sphere produces geometry at all (issue #461)", () => {
|
|
101
|
+
// The regression this pins is silence, not wrongness: before the
|
|
102
|
+
// full-surface fallback this walked zero meshes and reported no error.
|
|
103
|
+
const points = vertices();
|
|
104
|
+
expect(points.length).toBeGreaterThan(0);
|
|
105
|
+
});
|
|
106
|
+
test("every vertex lies on the sphere of the declared radius", () => {
|
|
107
|
+
const points = vertices();
|
|
108
|
+
// Not decoration: without it this whole test passes vacuously when the
|
|
109
|
+
// sphere produces no geometry — which is the exact defect the suite
|
|
110
|
+
// exists to catch. Confirmed by disabling the fallback and watching
|
|
111
|
+
// this case stay green while its two siblings went red.
|
|
112
|
+
expect(points.length).toBeGreaterThan(0);
|
|
113
|
+
// Cheap and total, rather than sampling: if the fallback ever emits a
|
|
114
|
+
// grid on the wrong radius, centre, or axis, at least one point moves
|
|
115
|
+
// off the surface. A grid inscribes the sphere, so points may sit
|
|
116
|
+
// slightly inside, never outside.
|
|
117
|
+
for (const [x, y, z] of points) {
|
|
118
|
+
const radius = Math.hypot(x, y, z);
|
|
119
|
+
expect(radius).toBeGreaterThan(RADIUS_MM * (1 - TOLERANCE));
|
|
120
|
+
expect(radius).toBeLessThan(RADIUS_MM * (1 + 0.000001));
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
test("the sphere is closed, so the area-weighted normal sum vanishes", () => {
|
|
124
|
+
// Orientation check, and the reason it is worth having: a closed
|
|
125
|
+
// oriented surface has its triangle area-vectors cancel exactly. If
|
|
126
|
+
// the grid's winding were inconsistent — the defect class of #459 and
|
|
127
|
+
// #463 — this residual would be a large fraction of the total area
|
|
128
|
+
// while the per-vertex radius test above stayed perfectly green.
|
|
129
|
+
const faces = triangles();
|
|
130
|
+
expect(faces.length).toBeGreaterThan(0);
|
|
131
|
+
const sum = [0, 0, 0];
|
|
132
|
+
let area = 0;
|
|
133
|
+
for (const [[ax, ay, az], [bx, by, bz], [cx, cy, cz]] of faces) {
|
|
134
|
+
const ux = bx - ax, uy = by - ay, uz = bz - az;
|
|
135
|
+
const vx = cx - ax, vy = cy - ay, vz = cz - az;
|
|
136
|
+
const nx = (uy * vz) - (uz * vy);
|
|
137
|
+
const ny = (uz * vx) - (ux * vz);
|
|
138
|
+
const nz = (ux * vy) - (uy * vx);
|
|
139
|
+
sum[0] += nx;
|
|
140
|
+
sum[1] += ny;
|
|
141
|
+
sum[2] += nz;
|
|
142
|
+
area += Math.hypot(nx, ny, nz);
|
|
143
|
+
}
|
|
144
|
+
expect(area).toBeGreaterThan(0);
|
|
145
|
+
expect(Math.hypot(sum[0], sum[1], sum[2]) / area).toBeLessThan(0.001);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EntityTypesAP214 from "./AP214E3_2010_gen/entity_types_ap214.gen.js";
|
|
2
2
|
import StepModelBase from "../step/step_model_base.js";
|
|
3
3
|
import { StepIndexEntry } from "../step/parsing/step_parser.js";
|
|
4
|
+
import { StepIndexColumns } from "../step/parsing/columnar_index.js";
|
|
4
5
|
import { MultiIndexSet } from "../indexing/multi_index_set.js";
|
|
5
6
|
import { AP214ModelGeometry } from "./ap214_model_geometry.js";
|
|
6
7
|
import { AP214ModelProfile } from "./ap214_model_profile.js";
|
|
@@ -26,6 +27,6 @@ export default class AP214StepModel extends StepModelBase<EntityTypesAP214> {
|
|
|
26
27
|
* @param buffer The buffer to values from.
|
|
27
28
|
* @param elementIndex The parsed index to elements in the STEP.
|
|
28
29
|
*/
|
|
29
|
-
constructor(buffer: Uint8Array, elementIndex: StepIndexEntry<EntityTypesAP214>[]);
|
|
30
|
+
constructor(buffer: Uint8Array, elementIndex: StepIndexEntry<EntityTypesAP214>[] | StepIndexColumns<EntityTypesAP214>);
|
|
30
31
|
}
|
|
31
32
|
//# sourceMappingURL=ap214_step_model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap214_step_model.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_step_model.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAyC,MAAM,2CAA2C,CAAA;AACjG,OAAO,aAAa,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"ap214_step_model.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_step_model.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAyC,MAAM,2CAA2C,CAAA;AACjG,OAAO,aAAa,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAA;AAE/D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAKvD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAa,CAAE,gBAAgB,CAAE;IAE3E,SAAgB,SAAS,EAAE,aAAa,CAAE,gBAAgB,CAAE,CAAA;IAC5D,SAAgB,mBAAmB,kCAA2B;IAC9D,SAAgB,QAAQ,qBAA2B;IACnD,SAAgB,SAAS,qBAA2B;IACpD,SAAgB,QAAQ,oBAA0B;IAClD,SAAgB,MAAM,mBAA6B;IACnD,SAAgB,aAAa,iBAAuB;IAEpD;;;;;;OAMG;gBAEC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,cAAc,CAAE,gBAAgB,CAAE,EAAE,GAAG,gBAAgB,CAAE,gBAAgB,CAAE;CAK9F"}
|
|
@@ -28,6 +28,6 @@ export default class AP214StepModel extends StepModelBase {
|
|
|
28
28
|
this.profiles = new AP214ModelProfile();
|
|
29
29
|
this.curves = new AP214ModelCurves(this);
|
|
30
30
|
this.csgOperations = new CsgMemoization();
|
|
31
|
-
this.typeIndex = indexerInstance.
|
|
31
|
+
this.typeIndex = indexerInstance.createFor(elementIndex);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap214_typed_select_enum.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_typed_select_enum.test.ts"],"names":[],"mappings":""}
|