@ifc-lite/viewer 1.17.2 → 1.17.4
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/.turbo/turbo-build.log +34 -24
- package/.turbo/turbo-typecheck.log +1 -42
- package/CHANGELOG.md +24 -0
- package/DESKTOP_CONTRACT_VERSION +1 -0
- package/dist/assets/arrow-CZ5kQ26f.js +20 -0
- package/dist/assets/basketViewActivator-BmnNtVfZ.js +1 -0
- package/dist/assets/bcf-DOG9_WPX.js +281 -0
- package/dist/assets/{browser-BDShTXzi.js → browser-C5TFR7sH.js} +1 -1
- package/dist/assets/cesium-ADbP7waU.css +1 -0
- package/dist/assets/cesium-DUOzBlqv.js +17817 -0
- package/dist/assets/drawing-2d-gWfpdfYe.js +257 -0
- package/dist/assets/epsg-index.generated-BjJrt_0S.js +1 -0
- package/dist/assets/exporters-ChAtBmlj.js +80367 -0
- package/dist/assets/geometry.worker-BQ0rzNo-.js +1 -0
- package/dist/assets/ids-B4jTqB1O.js +1 -0
- package/dist/assets/ifc-lite_bg-BX4E7TX8.wasm +0 -0
- package/dist/assets/index-Co8E2-FE.js +106013 -0
- package/dist/assets/index-DckuDqlv.css +1 -0
- package/dist/assets/lens-CSASnhAL.js +1 -0
- package/dist/assets/maplibre-gl-CGLcoNXc.js +811 -0
- package/dist/assets/native-bridge-BRvbckFQ.js +429 -0
- package/dist/assets/{arrow2-bb-jcVEo.js → parquet-CEXmQNRO.js} +2 -2
- package/dist/assets/sandbox-DZiNLNMk.js +5933 -0
- package/dist/assets/server-client-BV8zHZ7Y.js +626 -0
- package/dist/assets/tauri-core-stub-D8Fa-u43.js +1 -0
- package/dist/assets/tauri-dialog-stub-r7Wksg7o.js +1 -0
- package/dist/assets/tauri-fs-stub-BdeRC7aK.js +1 -0
- package/dist/assets/wasm-bridge-g01g7T9b.js +1 -0
- package/dist/assets/zip-DBEtpeu6.js +12 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +1 -0
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/cesium/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/cesium/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/cesium/ThirdParty/zip-module.wasm +0 -0
- package/dist/cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +119 -0
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/cesium/Widgets/lighter.css +237 -0
- package/dist/cesium/Widgets/lighterShared.css +46 -0
- package/dist/cesium/Widgets/shared.css +103 -0
- package/dist/cesium/Widgets/widgets.css +1342 -0
- package/dist/cesium/Workers/chunk-23ZQ2IVV.js +29 -0
- package/dist/cesium/Workers/chunk-2EQO3Q56.js +26 -0
- package/dist/cesium/Workers/chunk-2MJIIVP4.js +26 -0
- package/dist/cesium/Workers/chunk-2TE5NTVD.js +26 -0
- package/dist/cesium/Workers/chunk-2ZBHLJST.js +26 -0
- package/dist/cesium/Workers/chunk-5TJMAQVL.js +26 -0
- package/dist/cesium/Workers/chunk-6BD4U3VO.js +26 -0
- package/dist/cesium/Workers/chunk-7TVGLKQF.js +26 -0
- package/dist/cesium/Workers/chunk-BTSYJ5XU.js +26 -0
- package/dist/cesium/Workers/chunk-BXMEEOCS.js +63 -0
- package/dist/cesium/Workers/chunk-BYLCY7GP.js +29 -0
- package/dist/cesium/Workers/chunk-CTHM3W6I.js +26 -0
- package/dist/cesium/Workers/chunk-CUUSNIVQ.js +26 -0
- package/dist/cesium/Workers/chunk-E3JOOS3S.js +26 -0
- package/dist/cesium/Workers/chunk-E7KYDCM5.js +26 -0
- package/dist/cesium/Workers/chunk-EDVBB7SS.js +27 -0
- package/dist/cesium/Workers/chunk-EFBN7QNX.js +26 -0
- package/dist/cesium/Workers/chunk-EQ4YRVWL.js +26 -0
- package/dist/cesium/Workers/chunk-F6PRE7D6.js +26 -0
- package/dist/cesium/Workers/chunk-FC4ZZ65J.js +26 -0
- package/dist/cesium/Workers/chunk-FFBVWF2L.js +26 -0
- package/dist/cesium/Workers/chunk-GBAA6GVX.js +26 -0
- package/dist/cesium/Workers/chunk-ICALLYLG.js +26 -0
- package/dist/cesium/Workers/chunk-ILRYTWTP.js +26 -0
- package/dist/cesium/Workers/chunk-IRNLBSEJ.js +26 -0
- package/dist/cesium/Workers/chunk-IX4VMHEV.js +26 -0
- package/dist/cesium/Workers/chunk-L6QHHACZ.js +26 -0
- package/dist/cesium/Workers/chunk-LI2ZSORM.js +26 -0
- package/dist/cesium/Workers/chunk-LSLE2RL4.js +26 -0
- package/dist/cesium/Workers/chunk-M4HLDBCG.js +26 -0
- package/dist/cesium/Workers/chunk-MJHHSGEH.js +26 -0
- package/dist/cesium/Workers/chunk-NMVKML6W.js +26 -0
- package/dist/cesium/Workers/chunk-OCWJRAXS.js +26 -0
- package/dist/cesium/Workers/chunk-OIRKANTH.js +26 -0
- package/dist/cesium/Workers/chunk-OIT7J4IC.js +26 -0
- package/dist/cesium/Workers/chunk-OLZ3FYUM.js +26 -0
- package/dist/cesium/Workers/chunk-Q5BPHJQF.js +26 -0
- package/dist/cesium/Workers/chunk-QFM5DCMQ.js +26 -0
- package/dist/cesium/Workers/chunk-QKUIYMGC.js +28 -0
- package/dist/cesium/Workers/chunk-S44JILQT.js +26 -0
- package/dist/cesium/Workers/chunk-SLT4J352.js +26 -0
- package/dist/cesium/Workers/chunk-SQMIIXB7.js +26 -0
- package/dist/cesium/Workers/chunk-TJ4XLGBQ.js +26 -0
- package/dist/cesium/Workers/chunk-TNSUQXWK.js +27 -0
- package/dist/cesium/Workers/chunk-UBOGZS7F.js +26 -0
- package/dist/cesium/Workers/chunk-V3OSTMM6.js +26 -0
- package/dist/cesium/Workers/chunk-V7QEYVP3.js +26 -0
- package/dist/cesium/Workers/chunk-VUKYSU4H.js +26 -0
- package/dist/cesium/Workers/chunk-W37FE5GR.js +26 -0
- package/dist/cesium/Workers/chunk-WBOV35NL.js +26 -0
- package/dist/cesium/Workers/chunk-WPMZLB3Y.js +26 -0
- package/dist/cesium/Workers/chunk-WWWZVEEH.js +26 -0
- package/dist/cesium/Workers/chunk-XFIQ5DEQ.js +28 -0
- package/dist/cesium/Workers/chunk-XQHLGIO7.js +26 -0
- package/dist/cesium/Workers/chunk-XUSCFAVF.js +26 -0
- package/dist/cesium/Workers/chunk-YP7I5QBZ.js +26 -0
- package/dist/cesium/Workers/chunk-Z3QF2EHT.js +26 -0
- package/dist/cesium/Workers/combineGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createGeometry.js +26 -0
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/cesium/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/createWallGeometry.js +26 -0
- package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/decodeDraco.js +26 -0
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/cesium/Workers/decodeI3S.js +26 -0
- package/dist/cesium/Workers/gaussianSplatSorter.js +26 -0
- package/dist/cesium/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/cesium/Workers/incrementallyBuildTerrainPicker.js +26 -0
- package/dist/cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/index.html +13 -2
- package/package.json +27 -19
- package/src/App.tsx +1 -17
- package/src/components/viewer/BCFPanel.tsx +46 -4
- package/src/components/viewer/CesiumOverlay.tsx +672 -0
- package/src/components/viewer/CesiumSettingsDialog.tsx +100 -0
- package/src/components/viewer/ChatPanel.tsx +54 -16
- package/src/components/viewer/CommandPalette.tsx +6 -1
- package/src/components/viewer/DesktopEntitlementBanner.tsx +74 -0
- package/src/components/viewer/ExportChangesButton.tsx +24 -4
- package/src/components/viewer/ExportDialog.tsx +38 -9
- package/src/components/viewer/HierarchyPanel.tsx +202 -6
- package/src/components/viewer/IDSPanel.tsx +52 -3
- package/src/components/viewer/KeyboardShortcutsDialog.tsx +1 -1
- package/src/components/viewer/MainToolbar.tsx +353 -27
- package/src/components/viewer/PropertiesPanel.tsx +306 -131
- package/src/components/viewer/ScriptPanel.tsx +34 -8
- package/src/components/viewer/Section2DPanel.tsx +3 -2
- package/src/components/viewer/SettingsPage.tsx +430 -0
- package/src/components/viewer/StatusBar.tsx +17 -1
- package/src/components/viewer/UpgradePage.tsx +6 -4
- package/src/components/viewer/ViewerLayout.tsx +47 -6
- package/src/components/viewer/Viewport.tsx +49 -8
- package/src/components/viewer/ViewportContainer.tsx +285 -32
- package/src/components/viewer/ViewportOverlays.tsx +129 -27
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +2 -1
- package/src/components/viewer/properties/EpsgLookupDialog.tsx +418 -0
- package/src/components/viewer/properties/GeoreferencingPanel.tsx +703 -0
- package/src/components/viewer/properties/LocationMap.tsx +730 -0
- package/src/components/viewer/properties/ModelMetadataPanel.tsx +3 -70
- package/src/components/viewer/selectionHandlers.ts +4 -3
- package/src/components/viewer/useAnimationLoop.ts +4 -0
- package/src/components/viewer/useGeometryStreaming.ts +127 -40
- package/src/components/viewer/useMouseControls.ts +4 -1
- package/src/hooks/bcfIdLookup.ts +13 -11
- package/src/hooks/ids/idsColorSystem.ts +3 -8
- package/src/hooks/ingest/viewerModelIngest.ts +275 -0
- package/src/hooks/useIDS.ts +32 -17
- package/src/hooks/useIfc.ts +7 -1
- package/src/hooks/useIfcCache.ts +28 -15
- package/src/hooks/useIfcFederation.ts +59 -227
- package/src/hooks/useIfcLoader.ts +1656 -130
- package/src/hooks/useIfcServer.ts +0 -69
- package/src/lib/desktop/ClerkDesktopEntitlementSync.tsx +175 -0
- package/src/lib/desktop/desktopEntitlementEvents.ts +39 -0
- package/src/lib/desktop-entitlement.ts +45 -0
- package/src/lib/desktop-product.ts +124 -0
- package/src/lib/geo/cesium-bridge.ts +310 -0
- package/src/lib/geo/kmz-exporter.ts +112 -0
- package/src/lib/geo/reproject.ts +370 -0
- package/src/lib/lens/adapter.ts +3 -1
- package/src/lib/recent-files.ts +2 -1
- package/src/main.tsx +1 -0
- package/src/sdk/adapters/export-adapter.ts +14 -1
- package/src/sdk/adapters/viewer-adapter.ts +5 -9
- package/src/sdk/adapters/visibility-adapter.ts +6 -9
- package/src/services/analysis-extensions.ts +125 -0
- package/src/services/app-navigation.ts +13 -0
- package/src/services/bsdd.ts +53 -4
- package/src/services/cacheService.ts +1 -1
- package/src/services/desktop-cache.ts +43 -0
- package/src/services/desktop-export.ts +77 -0
- package/src/services/desktop-harness.ts +196 -0
- package/src/services/desktop-logger.ts +20 -0
- package/src/services/desktop-native-metadata.ts +207 -0
- package/src/services/desktop-panel-actions.ts +43 -0
- package/src/services/desktop-preferences.ts +44 -0
- package/src/services/file-dialog.ts +147 -0
- package/src/services/tauri-core-stub.ts +7 -0
- package/src/services/tauri-dialog-stub.ts +7 -0
- package/src/services/tauri-fs-stub.ts +7 -0
- package/src/store/basketVisibleSet.ts +3 -4
- package/src/store/globalId.ts +79 -0
- package/src/store/index.ts +41 -2
- package/src/store/slices/cesiumSlice.ts +122 -0
- package/src/store/slices/chatSlice.ts +5 -1
- package/src/store/slices/dataSlice.ts +139 -28
- package/src/store/slices/desktopEntitlementSlice.ts +86 -0
- package/src/store/slices/loadingSlice.ts +14 -2
- package/src/store/slices/modelSlice.ts +58 -3
- package/src/store/slices/mutationSlice.ts +178 -0
- package/src/store/slices/pinboardSlice.ts +4 -8
- package/src/store/types.ts +96 -2
- package/src/store.ts +1 -1
- package/src/utils/desktopModelSnapshot.ts +358 -0
- package/src/utils/ifcConfig.ts +6 -1
- package/src/utils/nativeSpatialDataStore.ts +250 -0
- package/src/utils/serverDataModel.ts +4 -0
- package/src/utils/spatialHierarchy.ts +10 -11
- package/vite.config.ts +41 -0
- package/dist/assets/Arrow.dom-BhOg9lpn.js +0 -20
- package/dist/assets/arrow2_bg-BlXl-cSQ.js +0 -1
- package/dist/assets/basketViewActivator-BRG5DBmM.js +0 -1
- package/dist/assets/desktop-cache-oPzaWXYE.js +0 -1
- package/dist/assets/geometry.worker-kgiT_Qhh.js +0 -1
- package/dist/assets/ifc-lite_bg-FNRmpSvM.wasm +0 -0
- package/dist/assets/index-B1Ecw4AU.js +0 -189756
- package/dist/assets/index-Ba4eoTe7.css +0 -1
- package/dist/assets/index-CrgYBjTn.js +0 -229
- package/dist/assets/module-6F3E5H7Y-tx0BadV3.js +0 -6
- package/dist/assets/native-bridge-Crsb7TKz.js +0 -111
- package/dist/assets/wasm-bridge-mJUhb7uk.js +0 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
const wt={projectionDepth:10,includeHiddenLines:!0,creaseAngle:30,scale:100};function W(n,t){return`${n}:${t}`}const $=1e-7;function G(n,t,e){return{x:n,y:t,z:e}}function Z(n,t){return{x:n.x-t.x,y:n.y-t.y,z:n.z-t.z}}function _(n,t){return n.x*t.x+n.y*t.y+n.z*t.z}function Ft(n,t){return{x:n.y*t.z-n.z*t.y,y:n.z*t.x-n.x*t.z,z:n.x*t.y-n.y*t.x}}function St(n){return Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)}function J(n){const t=St(n);return t<$?{x:0,y:0,z:0}:{x:n.x/t,y:n.y/t,z:n.z/t}}function $t(n,t,e){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y),z:n.z+e*(t.z-n.z)}}function z(n,t){return{x:n.x-t.x,y:n.y-t.y}}function At(n,t){return n.x*t.x+n.y*t.y}function Pt(n){return Math.sqrt(n.x*n.x+n.y*n.y)}function R(n,t){const e=t.x-n.x,i=t.y-n.y;return Math.sqrt(e*e+i*i)}function K(n,t,e){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Lt(n){const t=Pt(n);return t<$?{x:0,y:0}:{x:n.x/t,y:n.y/t}}function Q(n,t){return n.x*t.y-n.y*t.x}function tt(n){return R(n.start,n.end)}function Y(n){return Lt(z(n.end,n.start))}function lt(){return{min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}}}function H(n,t){return{min:{x:Math.min(n.min.x,t.x),y:Math.min(n.min.y,t.y)},max:{x:Math.max(n.max.x,t.x),y:Math.max(n.max.y,t.y)}}}function Et(n,t){let e=H(n,t.start);return e=H(e,t.end),e}function kt(n){return{x:(n.min.x+n.max.x)/2,y:(n.min.y+n.max.y)/2}}function vt(n){return{x:n.max.x-n.min.x,y:n.max.y-n.min.y}}function N(n,t,e){return _(n,t)-e}function ct(n,t){const e=t?-1:1;switch(n){case"x":return{x:e,y:0,z:0};case"y":return{x:0,y:e,z:0};case"z":return{x:0,y:0,z:e}}}function ht(n){switch(n){case"x":return{u:"z",v:"y"};case"y":return{u:"x",v:"z"};case"z":return{u:"x",v:"y"}}}function D(n,t,e){const i=ht(t),s=n[i.u],o=n[i.v];return{x:e?-s:s,y:o}}function dt(n){if(n.length<3)return 0;let t=0;for(let e=0;e<n.length;e++){const i=(e+1)%n.length;t+=n[e].x*n[i].y,t-=n[i].x*n[e].y}return t/2}function ut(n){return dt(n)>0}function ft(n){return[...n].reverse()}function Tt(n){return ut(n)?n:ft(n)}function Rt(n){return ut(n)?ft(n):n}class gt{tolerance;constructor(t=1e-4){this.tolerance=t}buildPolygons(t){const e=new Map;for(const s of t){const o=W(s.modelIndex,s.entityId);e.has(o)||e.set(o,[]),e.get(o).push(s)}const i=[];for(const[s,o]of e){const r=this.buildEntityPolygons(o);i.push(r)}return i.flat()}buildEntityPolygons(t){if(t.length===0)return[];const e=t[0],{entityId:i,ifcType:s,modelIndex:o}=e,r=t.map(c=>({start:c.p0_2d,end:c.p1_2d,used:!1})),a=this.buildLoops(r);return a.length===0?[]:this.classifyLoops(a).map(c=>({polygon:{outer:c.outer,holes:c.holes},entityId:i,ifcType:s,modelIndex:o,isCut:!0}))}buildLoops(t){const e=[];for(;;){const i=t.findIndex(o=>!o.used);if(i===-1)break;const s=this.buildSingleLoop(t,i);if(s&&s.length>=3){const o=dt(s);e.push({points:s,area:o})}}return e}buildSingleLoop(t,e){const i=[],s=t[e];s.used=!0,i.push(s.start);let o=s.end;const r=s.start,a=t.length;let l=0;for(;l<a;){if(l++,R(o,r)<this.tolerance)return i;const c=this.findConnectingSegment(t,o);if(c===-1)break;const u=t[c];u.used=!0,R(u.start,o)<this.tolerance?(i.push(u.start),o=u.end):(i.push(u.end),o=u.start)}return i.length>=3?i:null}findConnectingSegment(t,e){let i=-1,s=this.tolerance;for(let o=0;o<t.length;o++){if(t[o].used)continue;const r=t[o],a=R(r.start,e);a<s&&(s=a,i=o);const l=R(r.end,e);l<s&&(s=l,i=o)}return i}classifyLoops(t){if(t.length===0)return[];const e=[...t].sort((o,r)=>Math.abs(r.area)-Math.abs(o.area)),i=[],s=new Set;for(let o=0;o<e.length;o++){if(s.has(o))continue;const r=e[o],a=Tt(r.points),l=[];for(let c=o+1;c<e.length;c++){if(s.has(c))continue;const u=e[c];this.isLoopContainedIn(u.points,a)&&(l.push(Rt(u.points)),s.add(c))}s.add(o),i.push({outer:a,holes:l})}return i}isLoopContainedIn(t,e){const i=t[0];return this.pointInPolygon(i,e)}pointInPolygon(t,e){let i=!1;const s=e.length;for(let o=0,r=s-1;o<s;r=o++){const a=e[o],l=e[r];a.y>t.y!=l.y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(i=!i)}return i}}class Dt{planeNormal;planeDistance;axis;flipped;constructor(t){this.axis=t.axis,this.flipped=t.flipped,this.planeNormal=ct(t.axis,t.flipped),this.planeDistance=t.position}cutMeshes(t){const e=performance.now(),i=[];let s=0,o=0;for(const u of t){const h=this.cutSingleMesh(u);i.push(h.segments),s+=h.trianglesProcessed,o+=h.trianglesIntersected}const r=i.flat(),l=new gt().buildPolygons(r),c=performance.now()-e;return{segments:r,polygons:l,stats:{totalTriangles:s,intersectedTriangles:o,segmentCount:r.length,polygonCount:l.length,processingTimeMs:c}}}cutSingleMesh(t){const e=[],{positions:i,indices:s,expressId:o,ifcType:r,modelIndex:a}=t,l=s.length/3;let c=0;for(let u=0;u<l;u++){const h=s[u*3],d=s[u*3+1],f=s[u*3+2],g=this.getVertex(i,h),y=this.getVertex(i,d),p=this.getVertex(i,f),m=N(g,this.planeNormal,this.planeDistance),I=N(y,this.planeNormal,this.planeDistance),w=N(p,this.planeNormal,this.planeDistance),x=this.intersectTrianglePlane(g,y,p,m,I,w);if(x){c++;const C=D(x.p0,this.axis,this.flipped),b=D(x.p1,this.axis,this.flipped),A=b.x-C.x,M=b.y-C.y;if(A*A+M*M<$*$)continue;e.push({p0:x.p0,p1:x.p1,p0_2d:C,p1_2d:b,entityId:o,ifcType:r||"Unknown",modelIndex:a||0})}}return{segments:e,trianglesProcessed:l,trianglesIntersected:c}}getVertex(t,e){const i=e*3;return G(t[i],t[i+1],t[i+2])}intersectTrianglePlane(t,e,i,s,o,r){const a=(s>$?1:0)+(o>$?1:0)+(r>$?1:0),l=(s<-$?1:0)+(o<-$?1:0)+(r<-$?1:0);if(a===3||l===3||a===0&&l===0)return null;const c=[],u=this.edgePlaneIntersection(t,e,s,o);u&&c.push(u);const h=this.edgePlaneIntersection(e,i,o,r);if(h&&c.push(h),c.length<2){const d=this.edgePlaneIntersection(i,t,r,s);d&&c.push(d)}return c.length>=2?{p0:c[0],p1:c[1]}:null}edgePlaneIntersection(t,e,i,s){if(Math.abs(i)<$&&Math.abs(s)<$)return null;if(Math.abs(i)<$)return t;if(Math.abs(s)<$)return e;if(i>0==s>0)return null;const o=i/(i-s);return $t(t,e,o)}}const pt={angleTolerance:.01,distanceTolerance:.001,gapTolerance:.01};function Wt(n,t={}){const e={...pt,...t},i=new Map;for(const o of n){const r=`${o.modelIndex}:${o.entityId}:${o.category}:${o.visibility}`;i.has(r)||i.set(r,[]),i.get(r).push(o)}const s=[];for(const o of i.values()){const r=_t(o,e);s.push(...r)}return s}function _t(n,t){if(n.length<=1)return n;const e=n.map(o=>o.line),i=zt(e,t),s=n[0];return i.map(o=>({...s,line:o}))}function zt(n,t={}){const e={...pt,...t};if(n.length<=1)return n;const i=Bt(n,e.angleTolerance),s=[];for(const o of i.values()){const r=Nt(o,e.distanceTolerance);for(const a of r){const l=Ht(a,e.gapTolerance);s.push(...l)}}return s}function Bt(n,t){const e=new Map,i=t*2;for(const s of n){const o=Y(s);let r=Math.atan2(o.y,o.x);r<0&&(r+=Math.PI),r>=Math.PI&&(r-=Math.PI);const a=Math.floor(r/i);e.has(a)||e.set(a,[]),e.get(a).push(s)}return e}function Nt(n,t){const e=[],i=new Set;for(let s=0;s<n.length;s++){if(i.has(s))continue;const o=[n[s]];i.add(s);for(let r=s+1;r<n.length;r++)i.has(r)||Ot(n[s],n[r],t)&&(o.push(n[r]),i.add(r));e.push(o)}return e}function Ot(n,t,e){const i=Y(n),s=z(t.start,n.start);if(Math.abs(Q(i,s))>e)return!1;const r=z(t.end,n.start);return Math.abs(Q(i,r))<=e}function Ht(n,t){if(n.length<=1)return n;const e=n[0],i=Y(e),s=e.start,o=n.map(l=>{const c=et(l.start,s,i),u=et(l.end,s,i);return{t0:Math.min(c,u),t1:Math.max(c,u)}});o.sort((l,c)=>l.t0-c.t0);const r=[];let a=o[0];for(let l=1;l<o.length;l++){const c=o[l];c.t0<=a.t1+t?a={t0:a.t0,t1:Math.max(a.t1,c.t1)}:(r.push(a),a=c)}return r.push(a),r.map(l=>({start:{x:s.x+i.x*l.t0,y:s.y+i.y*l.t0},end:{x:s.x+i.x*l.t1,y:s.y+i.y*l.t1}}))}function et(n,t,e){const i=z(n,t);return At(i,e)}class Ut{creaseAngle;constructor(t=30){this.creaseAngle=t*Math.PI/180}extractEdges(t){const{positions:e,indices:i,expressId:s,ifcType:o,modelIndex:r}=t,a=new Map,l=[],c=i.length/3;for(let h=0;h<c;h++){const d=i[h*3],f=i[h*3+1],g=i[h*3+2],y=this.getVertex(e,d),p=this.getVertex(e,f),m=this.getVertex(e,g),I=this.computeFaceNormal(y,p,m);l.push(I),this.registerEdge(a,d,f,h),this.registerEdge(a,f,g,h),this.registerEdge(a,g,d,h)}const u=[];for(const[,h]of a){const d=this.getVertex(e,h.v0Idx),f=this.getVertex(e,h.v1Idx);let g=null,y=null,p=0,m="smooth";if(h.faceIndices.length===1)m="boundary",g=l[h.faceIndices[0]];else if(h.faceIndices.length>=2){g=l[h.faceIndices[0]],y=l[h.faceIndices[1]];const I=Math.max(-1,Math.min(1,_(g,y)));p=Math.acos(I),p>this.creaseAngle&&(m="crease")}m!=="smooth"&&u.push({v0:d,v1:f,face0Normal:g,face1Normal:y,dihedralAngle:p,type:m,entityId:s,ifcType:o||"Unknown",modelIndex:r||0})}return u}extractEdgesFromMeshes(t){const e=[];for(const i of t){const s=this.extractEdges(i);e.push(...s)}return e}extractSilhouettes(t,e){const i=J(e);return t.filter(s=>{if(s.type==="boundary")return!0;if(!s.face0Normal||!s.face1Normal)return!1;const o=_(s.face0Normal,i),r=_(s.face1Normal,i);return o<0!=r<0})}edgesToDrawingLines(t,e,i,s,o){return t.map(r=>{const a=D(r.v0,e,i),l=D(r.v1,e,i),c=e,u=Math.min(Math.abs(r.v0[c]-o),Math.abs(r.v1[c]-o));return{line:{start:a,end:l},category:s,visibility:"visible",entityId:r.entityId,ifcType:r.ifcType,modelIndex:r.modelIndex,depth:u}})}filterEdgesByDepth(t,e,i,s,o){return t.filter(r=>{const a=r.v0[e]-i,l=r.v1[e]-i,c=o?-s:0,u=o?0:s,h=a>=c&&a<=u,d=l>=c&&l<=u,f=a<c&&l>u||l<c&&a>u;return h||d||f})}getVertex(t,e){const i=e*3;return G(t[i],t[i+1],t[i+2])}computeFaceNormal(t,e,i){const s=Z(e,t),o=Z(i,t),r=Ft(s,o);return J(r)}registerEdge(t,e,i,s){const o=Math.min(e,i),r=Math.max(e,i),a=`${o}:${r}`;t.has(a)||t.set(a,{v0Idx:o,v1Idx:r,faceIndices:[]}),t.get(a).faceIndices.push(s)}}function jt(n,t){const e=t?1:-1;switch(n){case"x":return{x:e,y:0,z:0};case"y":return{x:0,y:e,z:0};case"z":return{x:0,y:0,z:e}}}function Gt(n,t,e){const i=[];for(const s of n){if(!Yt(s,t,e))continue;nt(i,s,s.outerPoints,"projection",t);let o=0;for(let r=0;r<s.holeCounts.length;r++){const a=s.holeCounts[r];if(a<2||o+a*2>s.holePoints.length){o+=a*2;continue}const l=s.holePoints.subarray(o,o+a*2);nt(i,s,l,"projection",t),o+=a*2}}return i}function Yt(n,t,e){const{axis:i,position:s,flipped:o}=t,{min:r,max:a}=Xt(n,i),l=o?s-e:s,c=o?s:s+e;return r<=c&&a>=l}function nt(n,t,e,i,s){const o=Math.floor(e.length/2);if(o<2)return;const r=t.transform;for(let a=0;a<o;a++){const l=(a+1)%o,c=e[a*2],u=e[a*2+1],h=e[l*2],d=e[l*2+1],f=U(c,u,r),g=U(h,d,r),y=D(f,s.axis,s.flipped),p=D(g,s.axis,s.flipped);Math.abs(y.x-p.x)<1e-7&&Math.abs(y.y-p.y)<1e-7||n.push({line:{start:y,end:p},category:i,visibility:"visible",entityId:t.expressId,ifcType:t.ifcType,modelIndex:t.modelIndex,depth:qt(f,g,s.axis,s.position)})}}function U(n,t,e){return{x:e[0]*n+e[4]*t+e[12],y:e[1]*n+e[5]*t+e[13],z:e[2]*n+e[6]*t+e[14]}}function Vt(n,t){return n[12+yt(t)]}function Xt(n,t){const e=t,i=n.extrusionDir[yt(t)]*n.extrusionDepth;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;const r=a=>{const l=Math.floor(a.length/2);for(let c=0;c<l;c++){const h=U(a[c*2],a[c*2+1],n.transform)[e],d=h+i;s=Math.min(s,h,d),o=Math.max(o,h,d)}};if(r(n.outerPoints),r(n.holePoints),!Number.isFinite(s)||!Number.isFinite(o)){const a=Vt(n.transform,t),l=a+i;return{min:Math.min(a,l),max:Math.max(a,l)}}return{min:s,max:o}}function yt(n){return n==="x"?0:n==="y"?1:2}function qt(n,t,e,i){const s=(n[e]+t[e])/2;return Math.abs(s-i)}const Zt={resolution:1024,samplesPerLine:10,depthBias:.001};class Jt{options;depthBuffer=null;width=0;height=0;bounds=null;constructor(t={}){this.options={...Zt,...t}}buildDepthBuffer(t,e,i,s,o,r){r||(r=this.computeBounds(t,e,i,s,o)),this.bounds=r;const a=r.max.x-r.min.x,l=r.max.y-r.min.y;if(a<$||l<$){this.width=1,this.height=1,this.depthBuffer=new Float32Array([1/0]);return}const c=a/l;c>1?(this.width=this.options.resolution,this.height=Math.max(1,Math.floor(this.options.resolution/c))):(this.height=this.options.resolution,this.width=Math.max(1,Math.floor(this.options.resolution*c))),this.depthBuffer=new Float32Array(this.width*this.height),this.depthBuffer.fill(1/0);for(const u of t)this.rasterizeMesh(u,e,i,s,o)}classifyLines(t){if(!this.depthBuffer||!this.bounds)throw new Error("Depth buffer not built. Call buildDepthBuffer first.");const e=[];for(const i of t){const s=this.classifySingleLine(i);e.push(s)}return e}applyVisibility(t){const e=this.classifyLines(t),i=[];for(const s of e)if(s.overallVisibility==="visible")i.push({...s.line,visibility:"visible"});else if(s.overallVisibility==="hidden")i.push({...s.line,visibility:"hidden"});else for(const o of s.segments)i.push({...s.line,line:{start:o.start,end:o.end},visibility:o.visible?"visible":"hidden"});return i}computeBounds(t,e,i,s,o){let r=lt();const a=this.getProjectionAxes(e);for(const c of t){const{positions:u}=c,h=u.length/3;for(let d=0;d<h;d++){const f=u[d*3],g=u[d*3+1],y=u[d*3+2],p={x:f,y:g,z:y},m=p[e]-i;if(o?m<=0&&m>=-s:m>=0&&m<=s){const w=p[a.u],x=p[a.v],C={x:o?-w:w,y:x};r=H(r,C)}}}const l=Math.max(r.max.x-r.min.x,r.max.y-r.min.y)*.01;return r.min.x-=l,r.min.y-=l,r.max.x+=l,r.max.y+=l,r}getProjectionAxes(t){switch(t){case"x":return{u:"z",v:"y"};case"y":return{u:"x",v:"z"};case"z":return{u:"x",v:"y"}}}rasterizeMesh(t,e,i,s,o){const{positions:r,indices:a}=t,l=this.getProjectionAxes(e),c=a.length/3;for(let u=0;u<c;u++){const h=a[u*3],d=a[u*3+1],f=a[u*3+2],g=this.getVertex(r,h),y=this.getVertex(r,d),p=this.getVertex(r,f),m=g[e]-i,I=y[e]-i,w=p[e]-i,x=M=>o?M<=0&&M>=-s:M>=0&&M<=s;if(!x(m)&&!x(I)&&!x(w))continue;const C=this.projectVertex(g,l,o),b=this.projectVertex(y,l,o),A=this.projectVertex(p,l,o);this.rasterizeTriangle(C,b,A)}}getVertex(t,e){const i=e*3;return G(t[i],t[i+1],t[i+2])}projectVertex(t,e,i){const s=t[e.u],o=t[e.v],a=["x","y","z"].find(l=>l!==e.u&&l!==e.v)??"z";return{x:i?-s:s,y:o,depth:t[a]}}rasterizeTriangle(t,e,i){if(!this.bounds||!this.depthBuffer)return;const s=f=>(f-this.bounds.min.x)/(this.bounds.max.x-this.bounds.min.x)*(this.width-1),o=f=>(f-this.bounds.min.y)/(this.bounds.max.y-this.bounds.min.y)*(this.height-1),r={x:s(t.x),y:o(t.y),depth:t.depth},a={x:s(e.x),y:o(e.y),depth:e.depth},l={x:s(i.x),y:o(i.y),depth:i.depth},c=Math.max(0,Math.floor(Math.min(r.x,a.x,l.x))),u=Math.min(this.width-1,Math.ceil(Math.max(r.x,a.x,l.x))),h=Math.max(0,Math.floor(Math.min(r.y,a.y,l.y))),d=Math.min(this.height-1,Math.ceil(Math.max(r.y,a.y,l.y)));for(let f=h;f<=d;f++)for(let g=c;g<=u;g++){const y=this.barycentricCoords(g+.5,f+.5,r,a,l);if(y.u>=0&&y.v>=0&&y.w>=0){const p=y.u*r.depth+y.v*a.depth+y.w*l.depth,m=f*this.width+g;p<this.depthBuffer[m]&&(this.depthBuffer[m]=p)}}}barycentricCoords(t,e,i,s,o){const r=s.x-i.x,a=s.y-i.y,l=o.x-i.x,c=o.y-i.y,u=t-i.x,h=e-i.y,d=r*r+a*a,f=r*l+a*c,g=r*u+a*h,y=l*l+c*c,p=l*u+c*h,m=d*y-f*f;if(Math.abs(m)<1e-10)return{u:-1,v:-1,w:-1};const I=1/m,w=(y*g-f*p)*I,x=(d*p-f*g)*I;return{u:1-w-x,v:w,w:x}}classifySingleLine(t){if(!this.bounds||!this.depthBuffer)return{line:t,segments:[{start:t.line.start,end:t.line.end,visible:!0}],overallVisibility:"visible"};const{samplesPerLine:e,depthBias:i}=this.options,o=R(t.line.start,t.line.end)<$?1:Math.max(2,e),r=[];let a=t.line.start,l=this.sampleVisibility(t.line.start,t.depth,i),c=l?1:0;for(let h=1;h<=o;h++){const d=h/o,f=K(t.line.start,t.line.end,d),g=this.sampleVisibility(f,t.depth,i);if(g&&c++,g!==l&&h<o){const y=(h-.5)/o,p=K(t.line.start,t.line.end,y);r.push({start:a,end:p,visible:l}),a=p,l=g}}r.push({start:a,end:t.line.end,visible:l});let u;return c===o+1?u="visible":c===0?u="hidden":u="partial",{line:t,segments:r,overallVisibility:u}}sampleVisibility(t,e,i){if(!this.bounds||!this.depthBuffer)return!0;const s=(t.x-this.bounds.min.x)/(this.bounds.max.x-this.bounds.min.x)*(this.width-1),o=(t.y-this.bounds.min.y)/(this.bounds.max.y-this.bounds.min.y)*(this.height-1),r=Math.max(0,Math.min(this.width-1,Math.floor(s))),a=Math.max(0,Math.min(this.height-1,Math.floor(o))),l=this.depthBuffer[a*this.width+r];return e<=l+i}}const it={IfcWall:{type:"diagonal",spacing:3,angle:45,lineWeight:.18,strokeColor:"#000000"},IfcWallStandardCase:{type:"diagonal",spacing:3,angle:45,lineWeight:.18,strokeColor:"#000000"},IfcCurtainWall:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#0066CC"},IfcSlab:{type:"concrete",spacing:2.5,angle:0,lineWeight:.13,strokeColor:"#666666"},IfcRoof:{type:"cross-hatch",spacing:4,angle:45,secondaryAngle:-45,lineWeight:.13,strokeColor:"#8B4513"},IfcCovering:{type:"horizontal",spacing:8,angle:0,lineWeight:.09,strokeColor:"#999999"},IfcColumn:{type:"steel",spacing:2,angle:45,lineWeight:.25,strokeColor:"#333333"},IfcBeam:{type:"steel",spacing:2,angle:45,lineWeight:.25,strokeColor:"#333333"},IfcMember:{type:"diagonal",spacing:2.5,angle:45,lineWeight:.18,strokeColor:"#444444"},IfcPlate:{type:"steel",spacing:1.5,angle:45,lineWeight:.18,strokeColor:"#555555"},IfcFooting:{type:"concrete",spacing:3,angle:0,lineWeight:.18,strokeColor:"#777777"},IfcPile:{type:"concrete",spacing:2.5,angle:0,lineWeight:.18,strokeColor:"#666666"},IfcWindow:{type:"glass",spacing:0,angle:0,lineWeight:.13,strokeColor:"#0099CC",fillColor:"rgba(200, 230, 255, 0.3)"},IfcDoor:{type:"none",spacing:0,angle:0,lineWeight:.25,strokeColor:"#000000"},IfcOpeningElement:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#CCCCCC"},IfcStair:{type:"horizontal",spacing:5,angle:0,lineWeight:.18,strokeColor:"#444444"},IfcStairFlight:{type:"horizontal",spacing:5,angle:0,lineWeight:.18,strokeColor:"#444444"},IfcRamp:{type:"diagonal",spacing:6,angle:30,lineWeight:.13,strokeColor:"#555555"},IfcRailing:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#666666"},IfcFlowTerminal:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#0066AA"},IfcFlowSegment:{type:"none",spacing:0,angle:0,lineWeight:.18,strokeColor:"#0066AA"},IfcDistributionElement:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#006688"},IfcSpace:{type:"none",spacing:0,angle:0,lineWeight:.09,strokeColor:"#CCCCCC"},IfcFurnishingElement:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#888888"},IfcFurniture:{type:"none",spacing:0,angle:0,lineWeight:.13,strokeColor:"#888888"},default:{type:"diagonal",spacing:4,angle:45,lineWeight:.13,strokeColor:"#666666"}};function mt(n){return it[n]||it.default}const Kt={cut:{weight:.5,color:"#000000",dashPattern:[],lineCap:"round",lineJoin:"round"},projection:{weight:.25,color:"#000000",dashPattern:[],lineCap:"round",lineJoin:"round"},hidden:{weight:.18,color:"#666666",dashPattern:[2,1],lineCap:"butt",lineJoin:"round"},silhouette:{weight:.35,color:"#000000",dashPattern:[],lineCap:"round",lineJoin:"round"},crease:{weight:.18,color:"#000000",dashPattern:[],lineCap:"round",lineJoin:"round"},boundary:{weight:.25,color:"#000000",dashPattern:[],lineCap:"round",lineJoin:"round"},annotation:{weight:.13,color:"#000000",dashPattern:[],lineCap:"butt",lineJoin:"miter"}},ot={IfcWall:{cut:.7,projection:.35},IfcWallStandardCase:{cut:.7,projection:.35},IfcSlab:{cut:.5,projection:.25},IfcColumn:{cut:.5,projection:.35},IfcBeam:{cut:.5,projection:.35},IfcWindow:{cut:.35,projection:.18},IfcDoor:{cut:.35,projection:.25},IfcStair:{cut:.35,projection:.25},IfcFurnishingElement:{cut:.18,projection:.13},IfcFurniture:{cut:.18,projection:.13},IfcSpace:{cut:.09,projection:.09}};function Qt(n,t){const e=Kt[n];if(t&&ot[t]){const i=ot[t][n];if(i!==void 0)return{...e,weight:i}}return e}const O=[{name:"1:1",factor:1,useCase:"Full size details"},{name:"1:2",factor:2,useCase:"Large details"},{name:"1:5",factor:5,useCase:"Construction details"},{name:"1:10",factor:10,useCase:"Details"},{name:"1:20",factor:20,useCase:"Room plans, sections"},{name:"1:50",factor:50,useCase:"Floor plans, elevations"},{name:"1:100",factor:100,useCase:"Building plans"},{name:"1:200",factor:200,useCase:"Site plans"},{name:"1:500",factor:500,useCase:"Site context"},{name:"1:1000",factor:1e3,useCase:"Urban context"}],st={A3_LANDSCAPE:{name:"A3 Landscape",width:420,height:297}};class xt{generateHatch(t,e=100,i){const s=mt(t.ifcType),o=i?{...s,type:i.type,spacing:i.spacing??s.spacing,angle:i.angle??s.angle,secondaryAngle:i.secondaryAngle??s.secondaryAngle}:s;if(o.type==="none"||o.type==="solid"||o.type==="glass")return{lines:[],pattern:o,polygon:t};const r=o.spacing*(e/100);let a=[];const l=this.generateParallelLines(t.polygon,r,o.angle,t.entityId,t.ifcType,t.modelIndex);if(a.push(...l),o.type==="cross-hatch"&&o.secondaryAngle!==void 0){const c=this.generateParallelLines(t.polygon,r,o.secondaryAngle,t.entityId,t.ifcType,t.modelIndex);a.push(...c)}if(o.type==="concrete"){const c=this.generateParallelLines(t.polygon,r*1.5,o.angle+90,t.entityId,t.ifcType,t.modelIndex);a.push(...c)}return{lines:a,pattern:o,polygon:t}}generateHatches(t,e=100,i){return t.map(s=>{const o=i?.(s);return this.generateHatch(s,e,o)})}generateParallelLines(t,e,i,s,o,r){if(e<$)return[];const a=i*Math.PI/180,l=Math.cos(a),c=Math.sin(a),u=-c,h=l,d=this.computePolygonBounds(t);if(!d)return[];const f=[{x:d.min.x,y:d.min.y},{x:d.max.x,y:d.min.y},{x:d.max.x,y:d.max.y},{x:d.min.x,y:d.max.y}];let g=1/0,y=-1/0;for(const I of f){const w=I.x*l+I.y*c;g=Math.min(g,w),y=Math.max(y,w)}const p=Math.sqrt(Math.pow(d.max.x-d.min.x,2)+Math.pow(d.max.y-d.min.y,2))*1.5,m=[];for(let I=g;I<=y;I+=e){const w=I*l,x=I*c,C={x:w-u*p,y:x-h*p},b={x:w+u*p,y:x+h*p},A=this.clipLineToPolygon({start:C,end:b},t);for(const M of A)m.push({line:M,entityId:s,ifcType:o,modelIndex:r})}return m}clipLineToPolygon(t,e){let i=this.clipLineToRing(t,e.outer,!0);for(const s of e.holes){const o=[];for(const r of i){const a=this.clipLineToRing(r,s,!1);o.push(...a)}i=o}return i}clipLineToRing(t,e,i){const s=[],o=t.end.x-t.start.x,r=t.end.y-t.start.y;for(let h=0;h<e.length;h++){const d=(h+1)%e.length,f=e[h],g=e[d],y=this.lineLineIntersection(t.start,t.end,f,g);if(y!==null&&y.t>=0&&y.t<=1){const p=-(g.y-f.y),m=g.x-f.x,I=o*p+r*m>0;s.push({t:y.t,entering:I})}}s.sort((h,d)=>h.t-d.t);const a=[];for(const h of s)(a.length===0||Math.abs(h.t-a[a.length-1].t)>$)&&a.push(h);if(a.length===0){const h={x:(t.start.x+t.end.x)/2,y:(t.start.y+t.end.y)/2};return this.pointInRing(h,e)===i?[t]:[]}const l=[];let c=this.pointInRing(t.start,e),u=0;for(const h of a)c===i&&l.push({start:{x:t.start.x+u*o,y:t.start.y+u*r},end:{x:t.start.x+h.t*o,y:t.start.y+h.t*r}}),u=h.t,c=!c;return c===i&&l.push({start:{x:t.start.x+u*o,y:t.start.y+u*r},end:t.end}),l.filter(h=>Math.abs(h.end.x-h.start.x)+Math.abs(h.end.y-h.start.y)>$)}lineLineIntersection(t,e,i,s){const o=e.x-t.x,r=e.y-t.y,a=s.x-i.x,l=s.y-i.y,c=o*l-r*a;if(Math.abs(c)<$)return null;const u=i.x-t.x,h=i.y-t.y,d=(u*l-h*a)/c,f=(u*r-h*o)/c;return f<0||f>1?null:{t:d,u:f}}pointInRing(t,e){let i=!1;const s=e.length;for(let o=0,r=s-1;o<s;r=o++){const a=e[o],l=e[r];a.y>t.y!=l.y>t.y&&t.x<(l.x-a.x)*(t.y-a.y)/(l.y-a.y)+a.x&&(i=!i)}return i}computePolygonBounds(t){if(t.outer.length===0)return null;let e=1/0,i=1/0,s=-1/0,o=-1/0;for(const r of t.outer)e=Math.min(e,r.x),i=Math.min(i,r.y),s=Math.max(s,r.x),o=Math.max(o,r.y);return{min:{x:e,y:i},max:{x:s,y:o}}}}class te{hatchGenerator=new xt;export(t,e={}){const{paperSize:i=st.A3_LANDSCAPE,scale:s=O.find(m=>m.factor===t.config.scale)||O[5],padding:o=20,showHiddenLines:r=!0,showHatching:a=!0,showTitleBlock:l=!1,title:c="Section",projectName:u="",backgroundColor:h="#FFFFFF"}=e,d=this.computeTransform(t.bounds,i,s,o);let f=this.createHeader(i,h);if(f+=this.createDefs(t,s.factor),a&&t.cutPolygons.length>0&&(f+=this.createHatchingLayer(t.cutPolygons,d,s.factor)),r){const m=t.lines.filter(I=>I.visibility==="hidden");m.length>0&&(f+=this.createLineLayer("hidden-lines",m,d,"Hidden Lines"))}const g=t.lines.filter(m=>m.category==="projection"&&m.visibility!=="hidden");g.length>0&&(f+=this.createLineLayer("projection-lines",g,d,"Projection"));const y=t.lines.filter(m=>(m.category==="silhouette"||m.category==="crease"||m.category==="boundary")&&m.visibility!=="hidden");y.length>0&&(f+=this.createLineLayer("feature-lines",y,d,"Feature Edges"));const p=t.lines.filter(m=>m.category==="cut");return p.length>0&&(f+=this.createLineLayer("cut-lines",p,d,"Cut Lines")),l&&(f+=this.createTitleBlock(i,c,u,s)),f+="</svg>",f}exportPolygons(t,e,i={}){const{paperSize:s=st.A3_LANDSCAPE,scale:o=O[5],padding:r=20,backgroundColor:a="#FFFFFF"}=i,l=this.computeTransform(e,s,o,r);let c=this.createHeader(s,a);return c+=this.createPolygonDefs(o.factor),c+=this.createHatchingLayer(t,l,o.factor),c+="</svg>",c}computeTransform(t,e,i,s){vt(t);const o=kt(t);e.width-s*2,e.height-s*2;const r=1e3/i.factor,a=e.width/2-o.x*r,l=e.height/2+o.y*r;return{scale:r,offsetX:a,offsetY:l,flipY:!0}}transformPoint(t,e){return{x:t.x*e.scale+e.offsetX,y:e.flipY?-t.y*e.scale+e.offsetY:t.y*e.scale+e.offsetY}}createHeader(t,e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
4
|
+
width="${t.width}mm"
|
|
5
|
+
height="${t.height}mm"
|
|
6
|
+
viewBox="0 0 ${t.width} ${t.height}">
|
|
7
|
+
<rect width="100%" height="100%" fill="${e}"/>
|
|
8
|
+
`}createDefs(t,e){let i=` <defs>
|
|
9
|
+
`;return i+=this.createHatchPatternDefs(e),i+=` </defs>
|
|
10
|
+
`,i}createPolygonDefs(t){let e=` <defs>
|
|
11
|
+
`;return e+=this.createHatchPatternDefs(t),e+=` </defs>
|
|
12
|
+
`,e}createHatchPatternDefs(t){const e=3*(t/100);let i="";return i+=` <pattern id="hatch-diagonal" patternUnits="userSpaceOnUse"
|
|
13
|
+
width="${e}" height="${e}" patternTransform="rotate(45)">
|
|
14
|
+
<line x1="0" y1="0" x2="0" y2="${e}" stroke="#000" stroke-width="0.15"/>
|
|
15
|
+
</pattern>
|
|
16
|
+
`,i+=` <pattern id="hatch-cross" patternUnits="userSpaceOnUse"
|
|
17
|
+
width="${e}" height="${e}">
|
|
18
|
+
<line x1="0" y1="0" x2="${e}" y2="${e}" stroke="#000" stroke-width="0.1"/>
|
|
19
|
+
<line x1="${e}" y1="0" x2="0" y2="${e}" stroke="#000" stroke-width="0.1"/>
|
|
20
|
+
</pattern>
|
|
21
|
+
`,i+=` <pattern id="hatch-horizontal" patternUnits="userSpaceOnUse"
|
|
22
|
+
width="${e}" height="${e}">
|
|
23
|
+
<line x1="0" y1="${e/2}" x2="${e}" y2="${e/2}" stroke="#000" stroke-width="0.1"/>
|
|
24
|
+
</pattern>
|
|
25
|
+
`,i+=` <pattern id="hatch-concrete" patternUnits="userSpaceOnUse"
|
|
26
|
+
width="${e*2}" height="${e*2}">
|
|
27
|
+
<circle cx="${e*.3}" cy="${e*.3}" r="0.3" fill="#666"/>
|
|
28
|
+
<circle cx="${e*1.3}" cy="${e*1.3}" r="0.3" fill="#666"/>
|
|
29
|
+
<circle cx="${e*.8}" cy="${e*1.6}" r="0.2" fill="#888"/>
|
|
30
|
+
</pattern>
|
|
31
|
+
`,i+=` <pattern id="hatch-steel" patternUnits="userSpaceOnUse"
|
|
32
|
+
width="${e*.7}" height="${e*.7}" patternTransform="rotate(45)">
|
|
33
|
+
<line x1="0" y1="0" x2="0" y2="${e*.7}" stroke="#333" stroke-width="0.2"/>
|
|
34
|
+
</pattern>
|
|
35
|
+
`,i}createLineLayer(t,e,i,s){let o=` <g id="${t}" inkscape:label="${s}" inkscape:groupmode="layer">
|
|
36
|
+
`;for(const r of e)o+=this.renderLine(r,i);return o+=` </g>
|
|
37
|
+
`,o}renderLine(t,e){const i=Qt(t.category,t.ifcType),s=this.transformPoint(t.line.start,e),o=this.transformPoint(t.line.end,e),r=i.dashPattern.length>0?` stroke-dasharray="${i.dashPattern.join(" ")}"`:"";return` <line x1="${s.x.toFixed(3)}" y1="${s.y.toFixed(3)}" x2="${o.x.toFixed(3)}" y2="${o.y.toFixed(3)}"
|
|
38
|
+
stroke="${i.color}" stroke-width="${i.weight}"
|
|
39
|
+
stroke-linecap="${i.lineCap}"${r}
|
|
40
|
+
data-entity-id="${t.entityId}" data-ifc-type="${t.ifcType}"/>
|
|
41
|
+
`}createHatchingLayer(t,e,i){let s=` <g id="hatching" inkscape:label="Hatching" inkscape:groupmode="layer">
|
|
42
|
+
`;for(const o of t){const r=mt(o.ifcType);if(r.type!=="none"&&(s+=this.renderPolygon(o,e,r),r.type!=="solid"&&r.type!=="glass")){const a=this.hatchGenerator.generateHatch(o,i);for(const l of a.lines)s+=this.renderHatchLine(l,e,r)}}return s+=` </g>
|
|
43
|
+
`,s}renderPolygon(t,e,i){const s=this.polygonToPath(t.polygon,e);let o;return i.type==="solid"?o=i.fillColor||"#CCCCCC":i.type==="glass"?o=i.fillColor||"rgba(200, 230, 255, 0.3)":i.type==="none"?o="none":o=`url(#hatch-${i.type})`,` <path d="${s}" fill="${o}"
|
|
44
|
+
stroke="${i.strokeColor}" stroke-width="${i.lineWeight}"
|
|
45
|
+
data-entity-id="${t.entityId}" data-ifc-type="${t.ifcType}"/>
|
|
46
|
+
`}polygonToPath(t,e){let i="";if(t.outer.length>0){const s=this.transformPoint(t.outer[0],e);i+=`M ${s.x.toFixed(3)} ${s.y.toFixed(3)}`;for(let o=1;o<t.outer.length;o++){const r=this.transformPoint(t.outer[o],e);i+=` L ${r.x.toFixed(3)} ${r.y.toFixed(3)}`}i+=" Z"}for(const s of t.holes)if(s.length>0){const o=this.transformPoint(s[0],e);i+=` M ${o.x.toFixed(3)} ${o.y.toFixed(3)}`;for(let r=1;r<s.length;r++){const a=this.transformPoint(s[r],e);i+=` L ${a.x.toFixed(3)} ${a.y.toFixed(3)}`}i+=" Z"}return i}renderHatchLine(t,e,i){const s=this.transformPoint(t.line.start,e),o=this.transformPoint(t.line.end,e);return` <line x1="${s.x.toFixed(3)}" y1="${s.y.toFixed(3)}" x2="${o.x.toFixed(3)}" y2="${o.y.toFixed(3)}"
|
|
47
|
+
stroke="${i.strokeColor}" stroke-width="${i.lineWeight}" stroke-linecap="butt"/>
|
|
48
|
+
`}createTitleBlock(t,e,i,s){const a=t.width-180-10,l=t.height-50-10;return` <g id="title-block">
|
|
49
|
+
<rect x="${a}" y="${l}" width="180" height="50"
|
|
50
|
+
fill="white" stroke="black" stroke-width="0.5"/>
|
|
51
|
+
<line x1="${a}" y1="${l+20}" x2="${a+180}" y2="${l+20}" stroke="black" stroke-width="0.3"/>
|
|
52
|
+
<line x1="${a}" y1="${l+35}" x2="${a+180}" y2="${l+35}" stroke="black" stroke-width="0.3"/>
|
|
53
|
+
<line x1="${a+100}" y1="${l+20}" x2="${a+100}" y2="${l+50}" stroke="black" stroke-width="0.3"/>
|
|
54
|
+
<text x="${a+5}" y="${l+14}" font-family="Arial" font-size="10" font-weight="bold">${this.escapeXml(e)}</text>
|
|
55
|
+
<text x="${a+5}" y="${l+30}" font-family="Arial" font-size="8">${this.escapeXml(i)}</text>
|
|
56
|
+
<text x="${a+5}" y="${l+45}" font-family="Arial" font-size="8">Scale: ${s.name}</text>
|
|
57
|
+
<text x="${a+105}" y="${l+30}" font-family="Arial" font-size="7">Date:</text>
|
|
58
|
+
<text x="${a+105}" y="${l+45}" font-family="Arial" font-size="7">${new Date().toLocaleDateString()}</text>
|
|
59
|
+
</g>
|
|
60
|
+
`}escapeXml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}const ee=`
|
|
61
|
+
struct Triangle {
|
|
62
|
+
v0: vec3<f32>,
|
|
63
|
+
v1: vec3<f32>,
|
|
64
|
+
v2: vec3<f32>,
|
|
65
|
+
entityId: u32,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
struct Plane {
|
|
69
|
+
normal: vec3<f32>,
|
|
70
|
+
distance: f32,
|
|
71
|
+
// Projection axes for 2D output
|
|
72
|
+
axisU: u32, // 0=x, 1=y, 2=z
|
|
73
|
+
axisV: u32,
|
|
74
|
+
flipU: f32, // 1.0 or -1.0
|
|
75
|
+
_padding: f32,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
struct Segment {
|
|
79
|
+
p0_3d: vec3<f32>,
|
|
80
|
+
_pad0: f32,
|
|
81
|
+
p1_3d: vec3<f32>,
|
|
82
|
+
_pad1: f32,
|
|
83
|
+
p0_2d: vec2<f32>,
|
|
84
|
+
p1_2d: vec2<f32>,
|
|
85
|
+
entityId: u32,
|
|
86
|
+
valid: u32,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@group(0) @binding(0) var<storage, read> triangles: array<Triangle>;
|
|
90
|
+
@group(0) @binding(1) var<uniform> plane: Plane;
|
|
91
|
+
@group(0) @binding(2) var<storage, read_write> segments: array<Segment>;
|
|
92
|
+
@group(0) @binding(3) var<storage, read_write> segmentCount: atomic<u32>;
|
|
93
|
+
|
|
94
|
+
const EPSILON: f32 = 1e-7;
|
|
95
|
+
|
|
96
|
+
fn signedDistance(point: vec3<f32>) -> f32 {
|
|
97
|
+
return dot(point, plane.normal) - plane.distance;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
fn edgeIntersection(v0: vec3<f32>, v1: vec3<f32>, d0: f32, d1: f32) -> vec3<f32> {
|
|
101
|
+
let t = d0 / (d0 - d1);
|
|
102
|
+
return mix(v0, v1, t);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
fn projectTo2D(p: vec3<f32>) -> vec2<f32> {
|
|
106
|
+
var coords: array<f32, 3>;
|
|
107
|
+
coords[0] = p.x;
|
|
108
|
+
coords[1] = p.y;
|
|
109
|
+
coords[2] = p.z;
|
|
110
|
+
|
|
111
|
+
let u = coords[plane.axisU] * plane.flipU;
|
|
112
|
+
let v = coords[plane.axisV];
|
|
113
|
+
return vec2<f32>(u, v);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@compute @workgroup_size(64)
|
|
117
|
+
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
|
|
118
|
+
let triIdx = id.x;
|
|
119
|
+
if (triIdx >= arrayLength(&triangles)) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
let tri = triangles[triIdx];
|
|
124
|
+
|
|
125
|
+
// Signed distances from plane
|
|
126
|
+
let d0 = signedDistance(tri.v0);
|
|
127
|
+
let d1 = signedDistance(tri.v1);
|
|
128
|
+
let d2 = signedDistance(tri.v2);
|
|
129
|
+
|
|
130
|
+
// Check for intersection
|
|
131
|
+
let pos = u32(d0 > EPSILON) + u32(d1 > EPSILON) + u32(d2 > EPSILON);
|
|
132
|
+
let neg = u32(d0 < -EPSILON) + u32(d1 < -EPSILON) + u32(d2 < -EPSILON);
|
|
133
|
+
|
|
134
|
+
// No intersection if all on same side
|
|
135
|
+
if (pos == 3u || neg == 3u || (pos == 0u && neg == 0u)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Find intersection points
|
|
140
|
+
var points: array<vec3<f32>, 2>;
|
|
141
|
+
var count: u32 = 0u;
|
|
142
|
+
|
|
143
|
+
// Edge v0-v1
|
|
144
|
+
if ((d0 > EPSILON) != (d1 > EPSILON)) {
|
|
145
|
+
points[count] = edgeIntersection(tri.v0, tri.v1, d0, d1);
|
|
146
|
+
count = count + 1u;
|
|
147
|
+
} else if (abs(d0) < EPSILON) {
|
|
148
|
+
points[count] = tri.v0;
|
|
149
|
+
count = count + 1u;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Edge v1-v2
|
|
153
|
+
if ((d1 > EPSILON) != (d2 > EPSILON)) {
|
|
154
|
+
points[count] = edgeIntersection(tri.v1, tri.v2, d1, d2);
|
|
155
|
+
count = count + 1u;
|
|
156
|
+
} else if (abs(d1) < EPSILON && count < 2u) {
|
|
157
|
+
points[count] = tri.v1;
|
|
158
|
+
count = count + 1u;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Edge v2-v0
|
|
162
|
+
if (count < 2u) {
|
|
163
|
+
if ((d2 > EPSILON) != (d0 > EPSILON)) {
|
|
164
|
+
points[count] = edgeIntersection(tri.v2, tri.v0, d2, d0);
|
|
165
|
+
count = count + 1u;
|
|
166
|
+
} else if (abs(d2) < EPSILON && count < 2u) {
|
|
167
|
+
points[count] = tri.v2;
|
|
168
|
+
count = count + 1u;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (count >= 2u) {
|
|
173
|
+
// Project to 2D
|
|
174
|
+
let p0_2d = projectTo2D(points[0]);
|
|
175
|
+
let p1_2d = projectTo2D(points[1]);
|
|
176
|
+
|
|
177
|
+
// Skip degenerate segments
|
|
178
|
+
let diff = p1_2d - p0_2d;
|
|
179
|
+
if (dot(diff, diff) < EPSILON * EPSILON) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Atomically allocate output slot
|
|
184
|
+
let outIdx = atomicAdd(&segmentCount, 1u);
|
|
185
|
+
|
|
186
|
+
segments[outIdx].p0_3d = points[0];
|
|
187
|
+
segments[outIdx].p1_3d = points[1];
|
|
188
|
+
segments[outIdx].p0_2d = p0_2d;
|
|
189
|
+
segments[outIdx].p1_2d = p1_2d;
|
|
190
|
+
segments[outIdx].entityId = tri.entityId;
|
|
191
|
+
segments[outIdx].valid = 1u;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`;class ne{device;resources=null;constructor(t){this.device=t}async initialize(t){const e=t,i=this.device.createShaderModule({code:ee}),s=this.device.createComputePipeline({layout:"auto",compute:{module:i,entryPoint:"main"}}),o=t*48,r=this.device.createBuffer({size:o,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),a=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),l=e*64,c=this.device.createBuffer({size:l,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC}),u=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC}),h=this.device.createBuffer({size:l,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),d=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),f=this.device.createBindGroup({layout:s.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:r}},{binding:1,resource:{buffer:a}},{binding:2,resource:{buffer:c}},{binding:3,resource:{buffer:u}}]});this.resources={pipeline:s,triangleBuffer:r,planeBuffer:a,segmentBuffer:c,countBuffer:u,readbackBuffer:h,countReadbackBuffer:d,bindGroup:f,maxTriangles:t,maxSegments:e}}async cutMeshes(t,e){if(!this.resources)throw new Error("GPU resources not initialized. Call initialize() first.");const i=this.collectTriangles(t),s=i.count;if(s===0)return[];s>this.resources.maxTriangles&&await this.initialize(s*2);const o=this.resources;if(!o)throw new Error("GPU resources became unavailable after initialization");this.device.queue.writeBuffer(o.triangleBuffer,0,i.buffer.buffer,i.buffer.byteOffset,i.buffer.byteLength);const r=this.createPlaneData(e);this.device.queue.writeBuffer(o.planeBuffer,0,r.buffer,r.byteOffset,r.byteLength),this.device.queue.writeBuffer(o.countBuffer,0,new Uint32Array([0]));const a=this.device.createCommandEncoder(),l=a.beginComputePass();l.setPipeline(o.pipeline),l.setBindGroup(0,o.bindGroup);const c=Math.ceil(s/64);l.dispatchWorkgroups(c),l.end(),a.copyBufferToBuffer(o.countBuffer,0,o.countReadbackBuffer,0,4),this.device.queue.submit([a.finish()]),await o.countReadbackBuffer.mapAsync(GPUMapMode.READ);const h=new Uint32Array(o.countReadbackBuffer.getMappedRange())[0];if(o.countReadbackBuffer.unmap(),h===0)return[];const d=this.device.createCommandEncoder();d.copyBufferToBuffer(o.segmentBuffer,0,o.readbackBuffer,0,h*64),this.device.queue.submit([d.finish()]),await o.readbackBuffer.mapAsync(GPUMapMode.READ);const f=new Float32Array(o.readbackBuffer.getMappedRange(0,h*64)),g=this.parseSegments(f,h,i.entityMap);return o.readbackBuffer.unmap(),g}collectTriangles(t){let e=0;for(const a of t)e+=a.indices.length/3;const i=new Float32Array(e*12),s=new Map;let o=0,r=0;for(const a of t){const{positions:l,indices:c,expressId:u,ifcType:h,modelIndex:d}=a,f=c.length/3;s.set(r,{entityId:u,ifcType:h||"Unknown",modelIndex:d||0});for(let g=0;g<f;g++){const y=c[g*3],p=c[g*3+1],m=c[g*3+2],I=o*12;i[I+0]=l[y*3],i[I+1]=l[y*3+1],i[I+2]=l[y*3+2],i[I+3]=l[p*3],i[I+4]=l[p*3+1],i[I+5]=l[p*3+2],i[I+6]=l[m*3],i[I+7]=l[m*3+1],i[I+8]=l[m*3+2],new DataView(i.buffer,(I+9)*4,4).setUint32(0,r,!0),i[I+10]=0,i[I+11]=0,o++}r++}return{buffer:i,count:e,entityMap:s}}createPlaneData(t){const e=ct(t.axis,t.flipped),i=ht(t.axis),s={x:0,y:1,z:2},o=new Float32Array(8);o[0]=e.x,o[1]=e.y,o[2]=e.z,o[3]=t.position;const r=new DataView(o.buffer);return r.setUint32(16,s[i.u],!0),r.setUint32(20,s[i.v],!0),o[6]=t.flipped?-1:1,o[7]=0,o}parseSegments(t,e,i){const s=[];for(let o=0;o<e;o++){const r=o*16;if(new DataView(t.buffer,(r+14)*4,4).getUint32(0,!0)!==1)continue;const l=new DataView(t.buffer,(r+13)*4,4).getUint32(0,!0),c=i.get(l)||{entityId:0,ifcType:"Unknown",modelIndex:0};s.push({p0:{x:t[r+0],y:t[r+1],z:t[r+2]},p1:{x:t[r+4],y:t[r+5],z:t[r+6]},p0_2d:{x:t[r+8],y:t[r+9]},p1_2d:{x:t[r+10],y:t[r+11]},entityId:c.entityId,ifcType:c.ifcType,modelIndex:c.modelIndex})}return s}destroy(){this.resources&&(this.resources.triangleBuffer.destroy(),this.resources.planeBuffer.destroy(),this.resources.segmentBuffer.destroy(),this.resources.countBuffer.destroy(),this.resources.readbackBuffer.destroy(),this.resources.countReadbackBuffer.destroy(),this.resources=null)}}const ie={useGPU:!0,includeHiddenLines:!0,includeProjection:!0,includeEdges:!0,mergeLines:!0};class ke{gpuCutter=null;cpuCutter=null;polygonBuilder=new gt;edgeExtractor=new Ut(30);hiddenLineClassifier=new Jt({resolution:1024});hatchGenerator=new xt;svgExporter=new te;gpuDevice=null;initialized=!1;async initialize(t){t&&(this.gpuDevice=t,this.gpuCutter=new ne(t),await this.gpuCutter.initialize(1e5)),this.initialized=!0}async generate(t,e,i={},s){const o={...ie,...i},r=performance.now(),a=(x,C)=>{o.onProgress?.(x,C)};a("cutting",0);let l;o.useGPU&&this.gpuCutter&&this.gpuDevice?l=await this.gpuCutter.cutMeshes(t,e.plane):((!this.cpuCutter||this.cpuCutter===null)&&(this.cpuCutter=new Dt(e.plane)),l=this.cpuCutter.cutMeshes(t).segments),a("cutting",1),a("polygons",0);const c=this.polygonBuilder.buildPolygons(l);a("polygons",1);const u=l.map(x=>({line:{start:x.p0_2d,end:x.p1_2d},category:"cut",visibility:"visible",entityId:x.entityId,ifcType:x.ifcType,modelIndex:x.modelIndex,depth:0}));let h=[],d=[];if(o.includeProjection||o.includeEdges){if(a("edges",0),s&&s.length>0&&o.includeProjection&&(h=Gt(s,e.plane,e.projectionDepth)),o.includeEdges){const C=this.edgeExtractor.extractEdgesFromMeshes(t),b=this.edgeExtractor.filterEdgesByDepth(C,e.plane.axis,e.plane.position,e.projectionDepth,e.plane.flipped),A=jt(e.plane.axis,e.plane.flipped),M=this.edgeExtractor.extractSilhouettes(b,A);if(d=this.edgeExtractor.edgesToDrawingLines(M,e.plane.axis,e.plane.flipped,"silhouette",e.plane.position),o.includeProjection){const P=new Set((s??[]).map(L=>W(L.modelIndex,L.expressId))),E=b.filter(L=>L.type!=="crease"||M.includes(L)?!1:P.size===0?!0:!P.has(W(L.modelIndex,L.entityId)));h=[...h,...this.edgeExtractor.edgesToDrawingLines(E,e.plane.axis,e.plane.flipped,"projection",e.plane.position)]}}else if(o.includeProjection){const C=new Set((s??[]).map(P=>W(P.modelIndex,P.expressId))),b=this.edgeExtractor.extractEdgesFromMeshes(t),M=this.edgeExtractor.filterEdgesByDepth(b,e.plane.axis,e.plane.position,e.projectionDepth,e.plane.flipped).filter(P=>P.type!=="crease"?!1:C.size===0?!0:!C.has(W(P.modelIndex,P.entityId)));h=[...h,...this.edgeExtractor.edgesToDrawingLines(M,e.plane.axis,e.plane.flipped,"projection",e.plane.position)]}const x=this.computeBounds(u);if(x.min.x<x.max.x&&x.min.y<x.max.y){const C=x.max.x-x.min.x,b=x.max.y-x.min.y,M=Math.sqrt(C*C+b*b)*1.5;d=d.filter(P=>tt(P.line)<=M),h=h.filter(P=>tt(P.line)<=M)}a("edges",1)}let f=[...u,...h,...d];if(o.includeHiddenLines&&(h.length>0||d.length>0)){a("hidden",0);const x=this.computeBounds(f);this.hiddenLineClassifier.buildDepthBuffer(t,e.plane.axis,e.plane.position,e.projectionDepth,e.plane.flipped,x);const C=f.filter(A=>A.category!=="cut"),b=this.hiddenLineClassifier.applyVisibility(C);f=[...u,...b],a("hidden",1)}o.mergeLines&&(a("merging",0),f=Wt(f),a("merging",1));const g=this.computeBounds(f),y=performance.now()-r,p=f.filter(x=>x.category==="cut").length,m=f.filter(x=>x.category==="projection").length,I=f.filter(x=>x.visibility==="hidden").length,w=f.filter(x=>x.category==="silhouette").length;return a("complete",1),{config:e,lines:f,cutPolygons:c,projectionPolygons:[],bounds:g,stats:{cutLineCount:p,projectionLineCount:m,hiddenLineCount:I,silhouetteLineCount:w,polygonCount:c.length,totalTriangles:t.reduce((x,C)=>x+C.indices.length/3,0),processingTimeMs:y}}}exportSVG(t,e){return this.svgExporter.export(t,e)}generateHatching(t){const e=this.hatchGenerator.generateHatches(t.cutPolygons,t.config.scale),i=[];for(const s of e)for(const o of s.lines)i.push({line:o.line,category:"annotation",visibility:"visible",entityId:o.entityId,ifcType:o.ifcType,modelIndex:o.modelIndex,depth:0});return i}computeBounds(t){let e=lt();for(const i of t)e=Et(e,i.line);return e}dispose(){this.gpuCutter&&(this.gpuCutter.destroy(),this.gpuCutter=null),this.gpuDevice=null,this.initialized=!1}}function ve(n,t,e={}){return{plane:{axis:n,position:t,flipped:!1},...wt,...e}}const oe={heavy:.5,medium:.35,light:.25,hairline:.18},rt={solid:[],dashed:[2,1],dotted:[.5,.5],dashdot:[3,1,.5,1],center:[6,1,1,1]},k={fillColor:"#CCCCCC",strokeColor:"#000000",backgroundColor:"#FFFFFF",lineWeight:.25,lineCap:"round",lineJoin:"round",dashPattern:[],hatchPattern:"none",hatchSpacing:3,hatchAngle:45,hatchSecondaryAngle:-45,hatchColor:"#000000",hatchLineWeight:.13,visible:!0,opacity:1,drawOrder:0},se={IfcWall:["IfcWallStandardCase","IfcWallElementedCase"],IfcSlab:["IfcSlabStandardCase","IfcSlabElementedCase"],IfcBeam:["IfcBeamStandardCase"],IfcColumn:["IfcColumnStandardCase"],IfcDoor:["IfcDoorStandardCase"],IfcWindow:["IfcWindowStandardCase"],IfcMember:["IfcMemberStandardCase"],IfcPlate:["IfcPlateStandardCase"],IfcStair:["IfcStairFlight"],IfcRamp:["IfcRampFlight"],IfcBuildingElement:["IfcWall","IfcSlab","IfcBeam","IfcColumn","IfcDoor","IfcWindow","IfcStair","IfcRamp","IfcRoof","IfcRailing","IfcCovering"],IfcDistributionElement:["IfcDistributionFlowElement","IfcDistributionControlElement"],IfcFlowElement:["IfcFlowTerminal","IfcFlowSegment","IfcFlowFitting","IfcFlowController"]};function Ct(n){const t=se[n]||[],e=[...t];for(const i of t)e.push(...Ct(i));return e}function re(n,t,e){switch(t){case"equals":return n===e;case"notEquals":return n!==e;case"contains":return typeof n=="string"&&typeof e=="string"?n.toLowerCase().includes(e.toLowerCase()):!1;case"notContains":return typeof n=="string"&&typeof e=="string"?!n.toLowerCase().includes(e.toLowerCase()):!0;case"startsWith":return typeof n=="string"&&typeof e=="string"?n.toLowerCase().startsWith(e.toLowerCase()):!1;case"endsWith":return typeof n=="string"&&typeof e=="string"?n.toLowerCase().endsWith(e.toLowerCase()):!1;case"greaterThan":return typeof n=="number"&&typeof e=="number"?n>e:!1;case"lessThan":return typeof n=="number"&&typeof e=="number"?n<e:!1;case"greaterOrEqual":return typeof n=="number"&&typeof e=="number"?n>=e:!1;case"lessOrEqual":return typeof n=="number"&&typeof e=="number"?n<=e:!1;case"exists":return n!=null;case"notExists":return n==null;case"in":return Array.isArray(e)?e.includes(n):!1;case"notIn":return Array.isArray(e)?!e.includes(n):!0;default:return!1}}function ae(n,t){switch(n.type){case"all":return!0;case"ifcType":return!n.ifcTypes||n.ifcTypes.length===0?!0:(n.includeSubtypes?n.ifcTypes.flatMap(i=>[i,...Ct(i)]):n.ifcTypes).some(i=>i.toLowerCase()===t.ifcType.toLowerCase());case"property":{if(!n.propertyName)return!1;const e=n.operator||"equals";let i;if(n.propertySet&&t.properties)i=t.properties[n.propertySet]?.[n.propertyName];else if(t.properties){for(const s of Object.values(t.properties))if(n.propertyName in s){i=s[n.propertyName];break}}return re(i,e,n.value)}case"propertySet":{if(!n.propertySet||!t.properties)return n.operator==="notExists";const e=n.propertySet in t.properties,i=n.operator||"exists";return i==="exists"?e:i==="notExists"?!e:e}case"material":return!n.materialNames||!t.materials?!1:n.materialNames.some(e=>t.materials.some(i=>i.toLowerCase().includes(e.toLowerCase())));case"layer":return!n.layerNames||!t.layers?!1:n.layerNames.some(e=>t.layers.some(i=>i.toLowerCase().includes(e.toLowerCase())));case"expressId":return n.expressIds?n.expressIds.includes(t.expressId):!1;case"modelId":return!n.modelIds||!t.modelId?!1:n.modelIds.includes(t.modelId);default:return!1}}function It(n){return"logic"in n&&"conditions"in n}function j(n,t){if(It(n)){const e=n.conditions.map(i=>j(i,t));return n.logic==="and"?e.every(Boolean):e.some(Boolean)}return ae(n,t)}function le(n){if(n===void 0)return k.lineWeight;if(typeof n=="number")return n;const t=oe[n];return t!==void 0?t:k.lineWeight}function ce(n){return n===void 0?k.dashPattern:typeof n=="string"?rt[n]??k.dashPattern:n.custom?n.custom:n.preset?rt[n.preset]??k.dashPattern:k.dashPattern}function at(n,t){return{fillColor:t.fillColor??n.fillColor,strokeColor:t.strokeColor??n.strokeColor,backgroundColor:t.backgroundColor??n.backgroundColor,lineWeight:t.lineWeight!==void 0?le(t.lineWeight):n.lineWeight,lineCap:t.lineCap??n.lineCap,lineJoin:t.lineJoin??n.lineJoin,dashPattern:t.lineStyle?ce(t.lineStyle):n.dashPattern,hatchPattern:t.hatchPattern??n.hatchPattern,hatchSpacing:t.hatchSpacing??n.hatchSpacing,hatchAngle:t.hatchAngle??n.hatchAngle,hatchSecondaryAngle:t.hatchSecondaryAngle??n.hatchSecondaryAngle,hatchColor:t.hatchColor??n.hatchColor,hatchLineWeight:t.hatchLineWeight??n.hatchLineWeight,visible:t.visible??n.visible,opacity:t.opacity??n.opacity,drawOrder:t.drawOrder??n.drawOrder}}class bt{rules=[];constructor(t){t&&this.setRules(t)}setRules(t){this.rules=[...t].sort((e,i)=>e.priority-i.priority)}addRule(t){this.rules.push(t),this.rules.sort((e,i)=>e.priority-i.priority)}removeRule(t){this.rules=this.rules.filter(e=>e.id!==t)}getRules(){return[...this.rules]}applyOverrides(t,e){let i=e?at(k,e):{...k};const s=[];for(const o of this.rules)o.enabled&&j(o.criteria,t)&&(i=at(i,o.style),s.push(o));return{element:t,style:i,matchedRules:s}}applyOverridesToMany(t,e){const i=new Map;for(const s of t){const o=e?.get(s.expressId);i.set(s.expressId,this.applyOverrides(s,o))}return i}getMatchingRules(t){return this.rules.filter(e=>e.enabled&&j(e.criteria,t))}static validateCriteria(t){const e=[];if(It(t)){(!t.conditions||t.conditions.length===0)&&e.push("Compound criteria must have at least one condition");for(const i of t.conditions)e.push(...bt.validateCriteria(i))}else t.type||e.push("Criterion must have a type"),t.type==="property"&&!t.propertyName&&e.push("Property criterion requires propertyName"),t.type==="ifcType"&&(!t.ifcTypes||t.ifcTypes.length===0)&&e.push("IFC type criterion requires at least one type");return e}}function S(n,t=!0){return{type:"ifcType",ifcTypes:n,includeSubtypes:t}}function v(n,t,e,i){return{type:"property",propertyName:n,propertySet:i,operator:t,value:e}}function T(...n){return{logic:"and",conditions:n}}let he=0;function de(){return`builtin-rule-${++he}`}function F(n,t,e,i=100,s){return{id:de(),name:n,description:s,enabled:!0,priority:i,criteria:t,style:e}}const ue=[F("Walls - Heavy cut lines",S(["IfcWall"]),{lineWeight:"heavy",strokeColor:"#000000",hatchPattern:"diagonal",hatchSpacing:3,hatchAngle:45},100,"Standard wall representation"),F("Columns - Heavy cut lines",S(["IfcColumn"]),{lineWeight:"heavy",strokeColor:"#000000",hatchPattern:"cross-hatch",hatchSpacing:2},100),F("Slabs - Medium lines",S(["IfcSlab"]),{lineWeight:"medium",fillColor:"#E0E0E0",hatchPattern:"concrete"},90),F("Windows - Light blue tint",S(["IfcWindow"]),{lineWeight:"light",fillColor:"#E3F2FD",strokeColor:"#1976D2",hatchPattern:"none"},80),F("Doors - No fill",S(["IfcDoor"]),{lineWeight:"medium",fillColor:"#FFFFFF",strokeColor:"#000000",hatchPattern:"none"},80),F("Furniture - Hairline",S(["IfcFurnishingElement","IfcFurniture"]),{lineWeight:"hairline",strokeColor:"#666666",fillColor:"#F5F5F5",hatchPattern:"none"},60)],fe={id:"preset-architectural",name:"Architectural Standards",description:"ISO 128 compliant architectural drawing standards",icon:"PenTool",rules:ue,builtIn:!0,category:"Standards"},ge=[F("Fire Rated 2hr+ - Red",T(S(["IfcWall"]),v("FireRating","greaterOrEqual",120)),{fillColor:"#FFCDD2",strokeColor:"#C62828",lineWeight:"heavy",hatchPattern:"diagonal",hatchColor:"#C62828"},200,"2-hour or higher fire rating"),F("Fire Rated 1hr - Orange",T(S(["IfcWall"]),v("FireRating","greaterOrEqual",60)),{fillColor:"#FFE0B2",strokeColor:"#E65100",lineWeight:"heavy",hatchPattern:"diagonal",hatchColor:"#E65100"},190),F("Fire Rated 30min - Yellow",T(S(["IfcWall"]),v("FireRating","greaterOrEqual",30)),{fillColor:"#FFF9C4",strokeColor:"#F9A825",lineWeight:"medium",hatchPattern:"diagonal",hatchColor:"#F9A825"},180),F("Fire Doors - Red outline",T(S(["IfcDoor"]),v("FireRating","exists")),{strokeColor:"#C62828",lineWeight:"heavy"},200),F("Escape Routes - Green",T(S(["IfcSpace"]),v("OccupancyType","contains","CIRCULATION")),{fillColor:"#C8E6C9",strokeColor:"#2E7D32",lineWeight:"light"},150)],pe={id:"preset-fire-safety",name:"Fire Safety",description:"Highlight fire-rated elements and escape routes",icon:"Flame",rules:ge,builtIn:!0,category:"Safety"},ye=[F("Load-bearing Walls - Blue",T(S(["IfcWall"]),v("LoadBearing","equals",!0)),{fillColor:"#BBDEFB",strokeColor:"#1565C0",lineWeight:"heavy",hatchPattern:"diagonal",hatchColor:"#1565C0"},200),F("Columns - Blue heavy",S(["IfcColumn"]),{fillColor:"#90CAF9",strokeColor:"#0D47A1",lineWeight:"heavy",hatchPattern:"cross-hatch",hatchColor:"#0D47A1"},190),F("Beams - Blue medium",S(["IfcBeam"]),{fillColor:"#64B5F6",strokeColor:"#1976D2",lineWeight:"medium",hatchPattern:"diagonal"},180),F("Slabs - Light blue",S(["IfcSlab"]),{fillColor:"#E3F2FD",strokeColor:"#42A5F5",lineWeight:"medium"},170),F("Footings - Dark blue",S(["IfcFooting","IfcPile"]),{fillColor:"#1976D2",strokeColor:"#0D47A1",lineWeight:"heavy",hatchPattern:"concrete"},200),F("Non-structural - Faded",S(["IfcFurnishingElement","IfcFurniture","IfcCovering"]),{opacity:.3,lineWeight:"hairline"},50)],me={id:"preset-structural",name:"Structural Highlight",description:"Emphasize structural elements, fade non-structural",icon:"Building2",rules:ye,builtIn:!0,category:"Discipline"},xe=[F("HVAC Ducts - Blue",S(["IfcDuctSegment","IfcDuctFitting"]),{fillColor:"#E3F2FD",strokeColor:"#1976D2",lineWeight:"medium"},150),F("Air Terminals - Blue",S(["IfcAirTerminal","IfcAirTerminalBox"]),{fillColor:"#BBDEFB",strokeColor:"#1565C0",lineWeight:"light"},140),F("Pipes - Green",S(["IfcPipeSegment","IfcPipeFitting"]),{fillColor:"#E8F5E9",strokeColor:"#388E3C",lineWeight:"medium"},150),F("Plumbing Fixtures - Green",S(["IfcSanitaryTerminal","IfcWasteTerminal"]),{fillColor:"#C8E6C9",strokeColor:"#2E7D32",lineWeight:"light"},140),F("Cable Trays - Orange",S(["IfcCableCarrierSegment","IfcCableCarrierFitting"]),{fillColor:"#FFF3E0",strokeColor:"#E65100",lineWeight:"light"},150),F("Electrical Equipment - Yellow",S(["IfcElectricDistributionBoard","IfcSwitchingDevice","IfcOutlet"]),{fillColor:"#FFFDE7",strokeColor:"#F9A825",lineWeight:"light"},140),F("Architectural - Faded",S(["IfcWall","IfcSlab","IfcDoor","IfcWindow"]),{opacity:.4,strokeColor:"#9E9E9E"},50)],Ce={id:"preset-mep",name:"MEP Highlight",description:"Color-code mechanical, electrical, and plumbing systems",icon:"Wrench",rules:xe,builtIn:!0,category:"Discipline"},Ie={id:"preset-3d-colors",name:"Default",description:"By material color",icon:"Palette",rules:[],builtIn:!0,category:"Standards"},be=[F("All elements - Black and white",{type:"all"},{strokeColor:"#000000",fillColor:"#FFFFFF",hatchColor:"#000000"},1),F("Cut elements - Gray fill",S(["IfcWall","IfcColumn","IfcSlab","IfcBeam"]),{fillColor:"#E0E0E0"},10)],Me={id:"preset-monochrome",name:"Monochrome",description:"Black and white print-ready output",icon:"Printer",rules:be,builtIn:!0,category:"Output"},Te=[Ie,fe,pe,me,Ce,Me],Re={A0_LANDSCAPE:{id:"A0_LANDSCAPE",name:"A0 Landscape",category:"ISO",widthMm:1189,heightMm:841,orientation:"landscape",defaultMarginMm:20},A0_PORTRAIT:{id:"A0_PORTRAIT",name:"A0 Portrait",category:"ISO",widthMm:841,heightMm:1189,orientation:"portrait",defaultMarginMm:20},A1_LANDSCAPE:{id:"A1_LANDSCAPE",name:"A1 Landscape",category:"ISO",widthMm:841,heightMm:594,orientation:"landscape",defaultMarginMm:20},A1_PORTRAIT:{id:"A1_PORTRAIT",name:"A1 Portrait",category:"ISO",widthMm:594,heightMm:841,orientation:"portrait",defaultMarginMm:20},A2_LANDSCAPE:{id:"A2_LANDSCAPE",name:"A2 Landscape",category:"ISO",widthMm:594,heightMm:420,orientation:"landscape",defaultMarginMm:15},A2_PORTRAIT:{id:"A2_PORTRAIT",name:"A2 Portrait",category:"ISO",widthMm:420,heightMm:594,orientation:"portrait",defaultMarginMm:15},A3_LANDSCAPE:{id:"A3_LANDSCAPE",name:"A3 Landscape",category:"ISO",widthMm:420,heightMm:297,orientation:"landscape",defaultMarginMm:10},A3_PORTRAIT:{id:"A3_PORTRAIT",name:"A3 Portrait",category:"ISO",widthMm:297,heightMm:420,orientation:"portrait",defaultMarginMm:10},A4_LANDSCAPE:{id:"A4_LANDSCAPE",name:"A4 Landscape",category:"ISO",widthMm:297,heightMm:210,orientation:"landscape",defaultMarginMm:10},A4_PORTRAIT:{id:"A4_PORTRAIT",name:"A4 Portrait",category:"ISO",widthMm:210,heightMm:297,orientation:"portrait",defaultMarginMm:10},LETTER_LANDSCAPE:{id:"LETTER_LANDSCAPE",name:"US Letter Landscape",category:"ANSI",widthMm:279.4,heightMm:215.9,orientation:"landscape",defaultMarginMm:10},LETTER_PORTRAIT:{id:"LETTER_PORTRAIT",name:"US Letter Portrait",category:"ANSI",widthMm:215.9,heightMm:279.4,orientation:"portrait",defaultMarginMm:10},LEGAL_LANDSCAPE:{id:"LEGAL_LANDSCAPE",name:"US Legal Landscape",category:"ANSI",widthMm:355.6,heightMm:215.9,orientation:"landscape",defaultMarginMm:10},LEGAL_PORTRAIT:{id:"LEGAL_PORTRAIT",name:"US Legal Portrait",category:"ANSI",widthMm:215.9,heightMm:355.6,orientation:"portrait",defaultMarginMm:10},TABLOID_LANDSCAPE:{id:"TABLOID_LANDSCAPE",name:"US Tabloid Landscape",category:"ANSI",widthMm:431.8,heightMm:279.4,orientation:"landscape",defaultMarginMm:15},TABLOID_PORTRAIT:{id:"TABLOID_PORTRAIT",name:"US Tabloid Portrait",category:"ANSI",widthMm:279.4,heightMm:431.8,orientation:"portrait",defaultMarginMm:15},ANSI_C:{id:"ANSI_C",name:"ANSI C (17x22)",category:"ANSI",widthMm:558.8,heightMm:431.8,orientation:"landscape",defaultMarginMm:15},ANSI_D:{id:"ANSI_D",name:"ANSI D (22x34)",category:"ANSI",widthMm:863.6,heightMm:558.8,orientation:"landscape",defaultMarginMm:20},ANSI_E:{id:"ANSI_E",name:"ANSI E (34x44)",category:"ANSI",widthMm:1117.6,heightMm:863.6,orientation:"landscape",defaultMarginMm:20},ARCH_A:{id:"ARCH_A",name:"ARCH A (9x12)",category:"ARCH",widthMm:304.8,heightMm:228.6,orientation:"landscape",defaultMarginMm:10},ARCH_B:{id:"ARCH_B",name:"ARCH B (12x18)",category:"ARCH",widthMm:457.2,heightMm:304.8,orientation:"landscape",defaultMarginMm:15},ARCH_C:{id:"ARCH_C",name:"ARCH C (18x24)",category:"ARCH",widthMm:609.6,heightMm:457.2,orientation:"landscape",defaultMarginMm:15},ARCH_D:{id:"ARCH_D",name:"ARCH D (24x36)",category:"ARCH",widthMm:914.4,heightMm:609.6,orientation:"landscape",defaultMarginMm:20},ARCH_E:{id:"ARCH_E",name:"ARCH E (36x48)",category:"ARCH",widthMm:1219.2,heightMm:914.4,orientation:"landscape",defaultMarginMm:20},ARCH_E1:{id:"ARCH_E1",name:"ARCH E1 (30x42)",category:"ARCH",widthMm:1066.8,heightMm:762,orientation:"landscape",defaultMarginMm:20}},De={simple:{margins:{top:10,right:10,bottom:10,left:10,bindingMargin:0},border:{outerLineWeight:.7,innerLineWeight:.35,borderGap:0,showFoldMarks:!1,showTrimMarks:!1},showZoneReferences:!1,horizontalZones:0,verticalZones:0,zoneFontSize:3},professional:{margins:{top:10,right:10,bottom:10,left:20,bindingMargin:10},border:{outerLineWeight:.7,innerLineWeight:.35,borderGap:5,showFoldMarks:!0,showTrimMarks:!0},showZoneReferences:!0,horizontalZones:8,verticalZones:6,zoneFontSize:3.5},minimal:{margins:{top:5,right:5,bottom:5,left:5,bindingMargin:0},border:{outerLineWeight:.35,innerLineWeight:0,borderGap:0,showFoldMarks:!1,showTrimMarks:!1},showZoneReferences:!1,horizontalZones:0,verticalZones:0,zoneFontSize:3},iso:{margins:{top:10,right:10,bottom:10,left:20,bindingMargin:10},border:{outerLineWeight:.7,innerLineWeight:.35,borderGap:5,showFoldMarks:!0,showTrimMarks:!0},showZoneReferences:!0,horizontalZones:8,verticalZones:4,zoneFontSize:3.5},custom:{margins:{top:10,right:10,bottom:10,left:10,bindingMargin:0},border:{outerLineWeight:.5,innerLineWeight:.25,borderGap:3,showFoldMarks:!1,showTrimMarks:!1},showZoneReferences:!1,horizontalZones:0,verticalZones:0,zoneFontSize:3}},We=[{id:"project-name",label:"Project",value:"",editable:!0,autoPopulate:!0,autoPopulateSource:"project.name",fontSize:4.5,fontWeight:"bold",row:0,col:0,colSpan:2},{id:"drawing-title",label:"Drawing Title",value:"Section",editable:!0,autoPopulate:!1,fontSize:5,fontWeight:"bold",row:1,col:0,colSpan:2},{id:"drawing-number",label:"Drawing No.",value:"A-001",editable:!0,autoPopulate:!1,fontSize:4,fontWeight:"bold",row:2,col:0},{id:"revision",label:"Rev",value:"-",editable:!0,autoPopulate:!1,fontSize:3.5,fontWeight:"bold",row:2,col:1},{id:"scale",label:"Scale",value:"1:100",editable:!1,autoPopulate:!0,autoPopulateSource:"drawing.scale",fontSize:3.5,fontWeight:"normal",row:3,col:0},{id:"date",label:"Date",value:"",editable:!0,autoPopulate:!0,autoPopulateSource:"date.today",fontSize:3,fontWeight:"normal",row:3,col:1},{id:"drawn-by",label:"Drawn",value:"",editable:!0,autoPopulate:!1,fontSize:3,fontWeight:"normal",row:4,col:0},{id:"checked-by",label:"Checked",value:"",editable:!0,autoPopulate:!1,fontSize:3,fontWeight:"normal",row:4,col:1},{id:"sheet-number",label:"Sheet",value:"1 of 1",editable:!0,autoPopulate:!1,fontSize:3,fontWeight:"normal",row:5,col:0,colSpan:2}],_e={compact:{layout:"compact",position:"bottom-right",widthMm:120,heightMm:35,borderWeight:.5,gridWeight:.25,showRevisionHistory:!1,maxRevisionEntries:0},standard:{layout:"standard",position:"bottom-right",widthMm:180,heightMm:55,borderWeight:.5,gridWeight:.25,showRevisionHistory:!0,maxRevisionEntries:3},extended:{layout:"extended",position:"bottom-full",widthMm:0,heightMm:70,borderWeight:.5,gridWeight:.25,showRevisionHistory:!0,maxRevisionEntries:5},custom:{layout:"custom",position:"bottom-right",widthMm:180,heightMm:55,borderWeight:.5,gridWeight:.25,showRevisionHistory:!1,maxRevisionEntries:0}},ze={visible:!0,style:"alternating",position:"below-viewport",units:"metric",totalLengthM:5,primaryDivisions:5,subdivisions:2,heightMm:3,labelFontSize:2.5,showUnitLabel:!0,fillColor:"#000000",strokeColor:"#000000",lineWeight:.25};function Be(n,t){const i=Math.min(80,t*.8)*n/1e3,s=[.1,.2,.5,1,2,5,10,20,50,100,200,500,1e3];for(const o of s)if(o>=i*.5&&o<=i*1.5)return o;return Math.round(i)}const Ne={style:"simple",rotation:0,positionMm:{x:30,y:30},sizeMm:15};function Oe(n,t,e){const i=t.margins.left+t.margins.bindingMargin+t.border.borderGap,s=n.widthMm-t.margins.right-t.border.borderGap,o=t.margins.top+t.border.borderGap,r=n.heightMm-t.margins.bottom-t.border.borderGap;let a=i,l=o,c=s-i,u=r-o;const h=5;switch(e.position){case"bottom-right":u=r-o-e.heightMm-h;break;case"bottom-full":u=r-o-e.heightMm-h;break;case"right-strip":c=s-i-e.widthMm-h;break}return{x:a,y:l,width:c,height:u}}function He(n,t,e){const i=n.maxX-n.minX,s=n.maxY-n.minY,o=1e3/e.factor,r=i*o,a=s*o,l=.95,c=t.width*l/r,u=t.height*l/a,h=Math.min(c,u,1),d=o*h,f=i*d,g=s*d,y=t.x+(t.width-f)/2-n.minX*d,p=t.y+(t.height-g)/2+n.maxY*d;return{translateX:y,translateY:p,scaleFactor:d}}function Ue(n,t){let e=` <g id="drawing-frame">
|
|
195
|
+
`;const i=t.margins.left+t.margins.bindingMargin,s=t.margins.top,o=n.widthMm-t.margins.left-t.margins.right-t.margins.bindingMargin,r=n.heightMm-t.margins.top-t.margins.bottom;e+=` <rect x="${i.toFixed(2)}" y="${s.toFixed(2)}" `,e+=`width="${o.toFixed(2)}" height="${r.toFixed(2)}" `,e+=`fill="none" stroke="#000000" stroke-width="${t.border.outerLineWeight}"/>
|
|
196
|
+
`;let a=i,l=s,c=o,u=r;return t.border.borderGap>0&&t.border.innerLineWeight>0&&(a=i+t.border.borderGap,l=s+t.border.borderGap,c=o-2*t.border.borderGap,u=r-2*t.border.borderGap,e+=` <rect x="${a.toFixed(2)}" y="${l.toFixed(2)}" `,e+=`width="${c.toFixed(2)}" height="${u.toFixed(2)}" `,e+=`fill="none" stroke="#000000" stroke-width="${t.border.innerLineWeight}"/>
|
|
197
|
+
`),t.showZoneReferences&&t.horizontalZones>0&&(e+=we(i,s,o,r,t.border.borderGap,t.horizontalZones,t.verticalZones,t.zoneFontSize,t.border.innerLineWeight)),t.border.showFoldMarks&&(e+=Fe(n)),t.border.showTrimMarks&&(e+=Se(n)),e+=` </g>
|
|
198
|
+
`,{svgElements:e,innerBounds:{x:a,y:l,width:c,height:u}}}function we(n,t,e,i,s,o,r,a,l){let c=` <g id="zone-references">
|
|
199
|
+
`;const u=e/o,h=i/r,d="ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let f=0;f<o;f++){const g=n+u*(f+.5),y=d[f%26];if(c+=` <text x="${g.toFixed(2)}" y="${(t-s/2).toFixed(2)}" `,c+=`font-family="Arial, sans-serif" font-size="${a}" `,c+=`text-anchor="middle" dominant-baseline="middle">${y}</text>
|
|
200
|
+
`,c+=` <text x="${g.toFixed(2)}" y="${(t+i+s/2).toFixed(2)}" `,c+=`font-family="Arial, sans-serif" font-size="${a}" `,c+=`text-anchor="middle" dominant-baseline="middle">${y}</text>
|
|
201
|
+
`,f>0){const p=n+u*f;c+=` <line x1="${p.toFixed(2)}" y1="${t.toFixed(2)}" `,c+=`x2="${p.toFixed(2)}" y2="${(t-s+2).toFixed(2)}" `,c+=`stroke="#000000" stroke-width="${l}"/>
|
|
202
|
+
`,c+=` <line x1="${p.toFixed(2)}" y1="${(t+i).toFixed(2)}" `,c+=`x2="${p.toFixed(2)}" y2="${(t+i+s-2).toFixed(2)}" `,c+=`stroke="#000000" stroke-width="${l}"/>
|
|
203
|
+
`}}for(let f=0;f<r;f++){const g=t+h*(f+.5),y=(f+1).toString();if(c+=` <text x="${(n-s/2).toFixed(2)}" y="${g.toFixed(2)}" `,c+=`font-family="Arial, sans-serif" font-size="${a}" `,c+=`text-anchor="middle" dominant-baseline="middle">${y}</text>
|
|
204
|
+
`,c+=` <text x="${(n+e+s/2).toFixed(2)}" y="${g.toFixed(2)}" `,c+=`font-family="Arial, sans-serif" font-size="${a}" `,c+=`text-anchor="middle" dominant-baseline="middle">${y}</text>
|
|
205
|
+
`,f>0){const p=t+h*f;c+=` <line x1="${n.toFixed(2)}" y1="${p.toFixed(2)}" `,c+=`x2="${(n-s+2).toFixed(2)}" y2="${p.toFixed(2)}" `,c+=`stroke="#000000" stroke-width="${l}"/>
|
|
206
|
+
`,c+=` <line x1="${(n+e).toFixed(2)}" y1="${p.toFixed(2)}" `,c+=`x2="${(n+e+s-2).toFixed(2)}" y2="${p.toFixed(2)}" `,c+=`stroke="#000000" stroke-width="${l}"/>
|
|
207
|
+
`}}return c+=` </g>
|
|
208
|
+
`,c}function Fe(n,t,e,i,s){let o=` <g id="fold-marks">
|
|
209
|
+
`;if(n.heightMm>297){const u=Math.ceil(n.heightMm/297);for(let h=1;h<u;h++){const d=h*297;d<n.heightMm-20&&(o+=` <line x1="0" y1="${d.toFixed(2)}" x2="${5 .toFixed(2)}" y2="${d.toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${.25}"/>
|
|
210
|
+
`,o+=` <line x1="${(n.widthMm-5).toFixed(2)}" y1="${d.toFixed(2)}" `,o+=`x2="${n.widthMm.toFixed(2)}" y2="${d.toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${.25}"/>
|
|
211
|
+
`)}}if(n.widthMm>210){const u=Math.ceil(n.widthMm/210);for(let h=1;h<u;h++){const d=n.widthMm-h*210;d>20&&(o+=` <line x1="${d.toFixed(2)}" y1="0" x2="${d.toFixed(2)}" y2="${5 .toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${.25}"/>
|
|
212
|
+
`,o+=` <line x1="${d.toFixed(2)}" y1="${(n.heightMm-5).toFixed(2)}" `,o+=`x2="${d.toFixed(2)}" y2="${n.heightMm.toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${.25}"/>
|
|
213
|
+
`)}}return o+=` </g>
|
|
214
|
+
`,o}function Se(n){let t=` <g id="trim-marks">
|
|
215
|
+
`;return t+=` <line x1="${3 .toFixed(2)}" y1="0" x2="${3 .toFixed(2)}" y2="${8 .toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
216
|
+
`,t+=` <line x1="0" y1="${3 .toFixed(2)}" x2="${8 .toFixed(2)}" y2="${3 .toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
217
|
+
`,t+=` <line x1="${(n.widthMm-3).toFixed(2)}" y1="0" `,t+=`x2="${(n.widthMm-3).toFixed(2)}" y2="${8 .toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
218
|
+
`,t+=` <line x1="${(n.widthMm-8).toFixed(2)}" y1="${3 .toFixed(2)}" `,t+=`x2="${n.widthMm.toFixed(2)}" y2="${3 .toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
219
|
+
`,t+=` <line x1="${3 .toFixed(2)}" y1="${(n.heightMm-8).toFixed(2)}" `,t+=`x2="${3 .toFixed(2)}" y2="${n.heightMm.toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
220
|
+
`,t+=` <line x1="0" y1="${(n.heightMm-3).toFixed(2)}" `,t+=`x2="${8 .toFixed(2)}" y2="${(n.heightMm-3).toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
221
|
+
`,t+=` <line x1="${(n.widthMm-3).toFixed(2)}" y1="${(n.heightMm-8).toFixed(2)}" `,t+=`x2="${(n.widthMm-3).toFixed(2)}" y2="${n.heightMm.toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
222
|
+
`,t+=` <line x1="${(n.widthMm-8).toFixed(2)}" y1="${(n.heightMm-3).toFixed(2)}" `,t+=`x2="${n.widthMm.toFixed(2)}" y2="${(n.heightMm-3).toFixed(2)}" `,t+=`stroke="#000000" stroke-width="${.15}"/>
|
|
223
|
+
`,t+=` </g>
|
|
224
|
+
`,t}function je(n,t,e=[],i){let s,o,r,a;switch(n.position){case"bottom-right":r=n.widthMm,a=n.heightMm,s=t.x+t.width-r,o=t.y+t.height-a;break;case"bottom-full":r=t.width,a=n.heightMm,s=t.x,o=t.y+t.height-a;break;case"right-strip":r=n.widthMm,a=t.height,s=t.x+t.width-r,o=t.y;break;default:r=n.widthMm,a=n.heightMm,s=t.x+t.width-r,o=t.y+t.height-a}let l=` <g id="title-block">
|
|
225
|
+
`;return n.backgroundColor&&(l+=` <rect x="${s.toFixed(2)}" y="${o.toFixed(2)}" `,l+=`width="${r.toFixed(2)}" height="${a.toFixed(2)}" `,l+=`fill="${n.backgroundColor}"/>
|
|
226
|
+
`),l+=` <rect x="${s.toFixed(2)}" y="${o.toFixed(2)}" `,l+=`width="${r.toFixed(2)}" height="${a.toFixed(2)}" `,l+=`fill="none" stroke="#000000" stroke-width="${n.borderWeight}"/>
|
|
227
|
+
`,l+=$e(n,s,o,r,a),n.logo?.source&&(l+=Ae(n.logo,s,o,r,a)),i?.scaleBar?.visible&&i?.scale&&a>10&&(l+=Le(i.scaleBar,i.scale,s,o,r,a,n.logo!=null,i.effectiveScaleFactor)),i?.northArrow&&i.northArrow.style!=="none"&&a>15&&(l+=Ee(i.northArrow,s,o,r,a,n.logo!=null,n.position)),n.showRevisionHistory&&e.length>0&&(l+=Pe(e.slice(0,n.maxRevisionEntries),s,o,r,a,n)),l+=` </g>
|
|
228
|
+
`,{svgElements:l,bounds:{x:s,y:o,width:r,height:a}}}function $e(n,t,e,i,s){let o=` <g id="title-block-fields">
|
|
229
|
+
`;const a=n.logo?50:0,l=n.showRevisionHistory?20:0,c=i-a-5,u=s-l-4,h=new Map;for(const C of n.fields){const b=C.row??0;h.has(b)||h.set(b,[]),h.get(b).push(C)}const d=Math.max(...Array.from(h.keys()))+1,f=[];let g=0;for(let C=0;C<d;C++){const b=h.get(C)||[],A=b.length>0?Math.max(...b.map(E=>E.fontSize)):3,P=Math.min(A*.5,2.2)+1+A+2;f.push(P),g+=P}const y=g>u?u/g:1,p=f.map(C=>C*y),m=t+a+2,I=e+2,w=c/2,x=[I];for(let C=0;C<p.length-1;C++)x.push(x[C]+p[C]);for(let C=1;C<d;C++){const b=x[C];o+=` <line x1="${m.toFixed(2)}" y1="${b.toFixed(2)}" `,o+=`x2="${(m+c-4).toFixed(2)}" y2="${b.toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${n.gridWeight}"/>
|
|
230
|
+
`}for(const[C,b]of h)if(b.some(M=>(M.colSpan??1)<2)){const M=m+w,P=x[C],E=x[C]+p[C];o+=` <line x1="${M.toFixed(2)}" y1="${P.toFixed(2)}" `,o+=`x2="${M.toFixed(2)}" y2="${E.toFixed(2)}" `,o+=`stroke="#000000" stroke-width="${n.gridWeight}"/>
|
|
231
|
+
`}for(const[C,b]of h){const A=x[C];p[C];for(const M of b){const P=M.col??0;M.colSpan;const E=m+P*w+1.5,L=y<1?y:1,V=Math.min(M.fontSize*.45,2.2)*Math.max(L,.7),X=M.fontSize*Math.max(L,.7),q=A+.5+V;o+=` <text x="${E.toFixed(2)}" y="${q.toFixed(2)}" `,o+=`font-family="Arial, sans-serif" font-size="${V.toFixed(2)}" `,o+=`fill="#666666">${B(M.label)}</text>
|
|
232
|
+
`;const Mt=q+.8+X*.8;o+=` <text x="${E.toFixed(2)}" y="${Mt.toFixed(2)}" `,o+=`font-family="Arial, sans-serif" font-size="${X.toFixed(2)}" `,o+=`font-weight="${M.fontWeight}" fill="#000000">${B(M.value)}</text>
|
|
233
|
+
`}}return o+=` </g>
|
|
234
|
+
`,o}function Ae(n,t,e,i,s){let o=` <g id="title-block-logo">
|
|
235
|
+
`,r,a;switch(n.position){case"top-left":r=t+3,a=e+3;break;case"top-right":r=t+i-n.widthMm-3,a=e+3;break;case"bottom-left":default:r=t+3,a=e+s-n.heightMm-3;break}return o+=` <image x="${r.toFixed(2)}" y="${a.toFixed(2)}" `,o+=`width="${n.widthMm.toFixed(2)}" height="${n.heightMm.toFixed(2)}" `,o+=`href="${B(n.source)}" preserveAspectRatio="xMidYMid meet"/>
|
|
236
|
+
`,o+=` </g>
|
|
237
|
+
`,o}function Pe(n,t,e,i,s,o){let r=` <g id="revision-history">
|
|
238
|
+
`;const l=e-18-2,c=4,u=2.2;r+=` <rect x="${t.toFixed(2)}" y="${l.toFixed(2)}" `,r+=`width="${i.toFixed(2)}" height="${18 .toFixed(2)}" `,r+=`fill="none" stroke="#000000" stroke-width="${o.gridWeight}"/>
|
|
239
|
+
`;const h=[{label:"REV",width:i*.1},{label:"DESCRIPTION",width:i*.5},{label:"DATE",width:i*.2},{label:"BY",width:i*.2}];let d=t;for(const f of h)r+=` <text x="${(d+1).toFixed(2)}" y="${(l+3).toFixed(2)}" `,r+=`font-family="Arial, sans-serif" font-size="${u}" `,r+=`font-weight="bold" fill="#000000">${f.label}</text>
|
|
240
|
+
`,d>t&&(r+=` <line x1="${d.toFixed(2)}" y1="${l.toFixed(2)}" `,r+=`x2="${d.toFixed(2)}" y2="${(l+18).toFixed(2)}" `,r+=`stroke="#000000" stroke-width="${o.gridWeight}"/>
|
|
241
|
+
`),d+=f.width;r+=` <line x1="${t.toFixed(2)}" y1="${(l+c).toFixed(2)}" `,r+=`x2="${(t+i).toFixed(2)}" y2="${(l+c).toFixed(2)}" `,r+=`stroke="#000000" stroke-width="${o.gridWeight}"/>
|
|
242
|
+
`;for(let f=0;f<n.length&&f<o.maxRevisionEntries;f++){const g=n[f],y=l+c*(f+1.5);d=t;const p=[g.revision,g.description,g.date,g.author];for(let m=0;m<h.length;m++){const I=Math.floor(h[m].width/2),w=p[m].length>I?p[m].substring(0,I-2)+"..":p[m];r+=` <text x="${(d+1).toFixed(2)}" y="${y.toFixed(2)}" `,r+=`font-family="Arial, sans-serif" font-size="${u}" `,r+=`fill="#000000">${B(w)}</text>
|
|
243
|
+
`,d+=h[m].width}f<n.length-1&&(r+=` <line x1="${t.toFixed(2)}" y1="${(l+c*(f+2)).toFixed(2)}" `,r+=`x2="${(t+i).toFixed(2)}" y2="${(l+c*(f+2)).toFixed(2)}" `,r+=`stroke="#000000" stroke-width="${o.gridWeight*.5}"/>
|
|
244
|
+
`)}return r+=` </g>
|
|
245
|
+
`,r}function Le(n,t,e,i,s,o,r,a){let l=` <g id="title-block-scale-bar">
|
|
246
|
+
`;const c=a??t.factor,u=e+3,h=i+o-8,d=Math.min(s*.3,50),f=n.totalLengthM*1e3/c,g=Math.min(f,d),y=Math.min(n.heightMm,3),p=g*c/1e3,m=n.primaryDivisions,I=g/m;for(let b=0;b<m;b++){const A=u+b*I,M=b%2===0?n.fillColor:"#ffffff";l+=` <rect x="${A.toFixed(2)}" y="${h.toFixed(2)}" `,l+=`width="${I.toFixed(2)}" height="${y.toFixed(2)}" `,l+=`fill="${M}" stroke="${n.strokeColor}" stroke-width="${n.lineWeight}"/>
|
|
247
|
+
`}const w=1.8,x=h+y+w+.3;l+=` <text x="${u.toFixed(2)}" y="${x.toFixed(2)}" `,l+=`font-family="Arial, sans-serif" font-size="${w}" `,l+=`text-anchor="start" fill="#000000">0</text>
|
|
248
|
+
`;const C=p<1?`${(p*100).toFixed(0)}cm`:`${p.toFixed(0)}m`;return l+=` <text x="${(u+g).toFixed(2)}" y="${x.toFixed(2)}" `,l+=`font-family="Arial, sans-serif" font-size="${w}" `,l+=`text-anchor="end" fill="#000000">${C}</text>
|
|
249
|
+
`,l+=` </g>
|
|
250
|
+
`,l}function Ee(n,t,e,i,s,o,r){let a=` <g id="title-block-north-arrow">
|
|
251
|
+
`;const l=Math.min(n.sizeMm,8,s*.6),c=t+i-l-5,u=e+s-l/2-3,h=n.rotation;a+=` <g transform="translate(${c.toFixed(2)}, ${u.toFixed(2)}) rotate(${h})">
|
|
252
|
+
`;const d=l/2;a+=` <polygon points="0,${(-d).toFixed(2)} ${(-d/3).toFixed(2)},${(d/2).toFixed(2)} ${(d/3).toFixed(2)},${(d/2).toFixed(2)}" `,a+=`fill="#000000" stroke="none"/>
|
|
253
|
+
`,a+=` <polygon points="0,${(d/3).toFixed(2)} ${(-d/3).toFixed(2)},${(d/2).toFixed(2)} ${(d/3).toFixed(2)},${(d/2).toFixed(2)}" `,a+=`fill="#ffffff" stroke="#000000" stroke-width="0.25"/>
|
|
254
|
+
`;const f=l*.4;return a+=` <text x="0" y="${(-d-1).toFixed(2)}" `,a+=`font-family="Arial, sans-serif" font-size="${f.toFixed(2)}" font-weight="bold" `,a+=`text-anchor="middle" fill="#000000">N</text>
|
|
255
|
+
`,a+=` </g>
|
|
256
|
+
`,a+=` </g>
|
|
257
|
+
`,a}function B(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export{Te as B,O as C,We as D,De as F,bt as G,Re as P,_e as T,Oe as a,Ne as b,Be as c,ze as d,He as e,ke as f,ve as g,je as h,Ue as r};
|