@roomle/web-sdk 3.6.0-alpha.3 → 3.6.0-alpha.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/lib/BufferGeometry-DLEagG41.mjs +1022 -0
- package/lib/BufferGeometry-DLEagG41.mjs.map +1 -0
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/GLTFExporter-D8qsdwDK.mjs +1092 -0
- package/lib/GLTFExporter-D8qsdwDK.mjs.map +1 -0
- package/lib/Object3D-DSjIOhON.mjs +1713 -0
- package/lib/Object3D-DSjIOhON.mjs.map +1 -0
- package/lib/PointLightHelper-BnjxGaOG.mjs +257 -0
- package/lib/PointLightHelper-BnjxGaOG.mjs.map +1 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/SpotLightHelper-DqsfqCrs.mjs +154 -0
- package/lib/SpotLightHelper-DqsfqCrs.mjs.map +1 -0
- package/lib/USDZExporter-DxIqi8St.mjs +296 -0
- package/lib/USDZExporter-DxIqi8St.mjs.map +1 -0
- package/lib/Vector4-DGmBYfpK.mjs +204 -0
- package/lib/Vector4-DGmBYfpK.mjs.map +1 -0
- package/lib/api-CNoIBuvr.mjs +55 -0
- package/lib/api-CNoIBuvr.mjs.map +1 -0
- package/lib/banana-for-scale-C_iNmlCT.mjs +36 -0
- package/lib/banana-for-scale-C_iNmlCT.mjs.map +1 -0
- package/lib/common-utils-DMSTohiS.mjs +187 -0
- package/lib/common-utils-DMSTohiS.mjs.map +1 -0
- package/lib/component-dimensioning-CvRmUja4.mjs +162 -0
- package/lib/component-dimensioning-CvRmUja4.mjs.map +1 -0
- package/lib/component-raycast-helper-CEp7wy9c.mjs +97 -0
- package/lib/component-raycast-helper-CEp7wy9c.mjs.map +1 -0
- package/lib/configurator-B_5XVG2O.mjs +45 -0
- package/lib/configurator-B_5XVG2O.mjs.map +1 -0
- package/lib/configurator-DCdvMM0o.mjs +2 -0
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs +42 -0
- package/lib/continuous-drawing-helper-v_5UAM9A.mjs.map +1 -0
- package/lib/decorate-C1QnXPYw.mjs +35 -0
- package/lib/decorate-C1QnXPYw.mjs.map +1 -0
- package/lib/dimensioning-helper-DTcW85Oq.mjs +2 -0
- package/lib/dimensioning-helper-Fwpt1HTT.mjs +268 -0
- package/lib/dimensioning-helper-Fwpt1HTT.mjs.map +1 -0
- package/lib/fflate.module-dFNj5UPI.mjs +536 -0
- package/lib/fflate.module-dFNj5UPI.mjs.map +1 -0
- package/lib/glb-viewer-cP8g6bcm.mjs +315 -0
- package/lib/glb-viewer-cP8g6bcm.mjs.map +1 -0
- package/lib/glb-viewer-dZThmlwM.mjs +2 -0
- package/lib/homag-intelligence-LoOJ7roM.mjs +381 -0
- package/lib/homag-intelligence-LoOJ7roM.mjs.map +1 -0
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs +161 -0
- package/lib/imos-ix-poc-export-helper-CQh94HsO.mjs.map +1 -0
- package/lib/kernel-BAQSG9r5.mjs +46 -0
- package/lib/kernel-BAQSG9r5.mjs.map +1 -0
- package/lib/kernel-utils-H74uNY1h.mjs +44 -0
- package/lib/kernel-utils-H74uNY1h.mjs.map +1 -0
- package/lib/layer-C_JtkhdO.mjs +8 -0
- package/lib/layer-C_JtkhdO.mjs.map +1 -0
- package/lib/main-BxEZ11ag.mjs +20461 -0
- package/lib/main-BxEZ11ag.mjs.map +1 -0
- package/lib/material-viewer-njBFF0Zg.mjs +292 -0
- package/lib/material-viewer-njBFF0Zg.mjs.map +1 -0
- package/lib/planner-Cr495Cyn.mjs +2 -0
- package/lib/planner-DY73rplC.mjs +44 -0
- package/lib/planner-DY73rplC.mjs.map +1 -0
- package/lib/plugin-system-D9K46xJk.mjs +55 -0
- package/lib/plugin-system-D9K46xJk.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +15 -2
- package/lib/roomle-sdk.js +7 -36
- package/lib/scene-renderer-D8HkTFeZ.mjs +3826 -0
- package/lib/scene-renderer-D8HkTFeZ.mjs.map +1 -0
- package/lib/script-loader-KBq8SjP6.mjs +45 -0
- package/lib/script-loader-KBq8SjP6.mjs.map +1 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.js +34 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_encoder.js +33 -0
- package/lib/static/draco/node_modules/three/examples/jsm/libs/draco/draco_wasm_wrapper.js +117 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -0
- package/lib/static/roomle-core-hsc/{src → node_modules/roomle-core-hsc/src}/embind/plannerCoreInterface.d.ts +2 -0
- package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/{RoomleCore.wasm → node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm} +0 -0
- package/lib/static/roomle-core-hsc/{wasm_modern → node_modules/roomle-core-hsc/wasm_modern}/RoomleToolsCore.wasm +0 -0
- package/lib/stats-helper-HM0TaIM5.mjs +95 -0
- package/lib/stats-helper-HM0TaIM5.mjs.map +1 -0
- package/lib/three.core-CLIofecG.mjs +7629 -0
- package/lib/three.core-CLIofecG.mjs.map +1 -0
- package/lib/three.module-C4Q1skJQ.mjs +5795 -0
- package/lib/three.module-C4Q1skJQ.mjs.map +1 -0
- package/lib/three.webgpu-dFspy2yF.mjs +16057 -0
- package/lib/three.webgpu-dFspy2yF.mjs.map +1 -0
- package/lib/threejs-utils-jEzvlJF1.mjs +2233 -0
- package/lib/threejs-utils-jEzvlJF1.mjs.map +1 -0
- package/lib/tools-core-CZbPygRC.mjs +30 -0
- package/lib/tools-core-CZbPygRC.mjs.map +1 -0
- package/package.json +1 -1
- package/lib/BufferGeometry-C1o0MiFL.mjs +0 -2064
- package/lib/BufferGeometry-C1o0MiFL.mjs.map +0 -1
- package/lib/GLTFExporter-CXMBueJw.mjs +0 -1323
- package/lib/GLTFExporter-CXMBueJw.mjs.map +0 -1
- package/lib/PointLightHelper-ICWLqwjK.mjs +0 -522
- package/lib/PointLightHelper-ICWLqwjK.mjs.map +0 -1
- package/lib/SpotLightHelper-CW5lDGFp.mjs +0 -222
- package/lib/SpotLightHelper-CW5lDGFp.mjs.map +0 -1
- package/lib/USDZExporter-CUp3dX08.mjs +0 -552
- package/lib/USDZExporter-CUp3dX08.mjs.map +0 -1
- package/lib/banana-for-scale-CfQ8dnY2.mjs +0 -50
- package/lib/banana-for-scale-CfQ8dnY2.mjs.map +0 -1
- package/lib/component-dimensioning-C9AWhxvj.mjs +0 -237
- package/lib/component-dimensioning-C9AWhxvj.mjs.map +0 -1
- package/lib/continuous-drawing-helper-B5BlbPPz.mjs +0 -48
- package/lib/continuous-drawing-helper-B5BlbPPz.mjs.map +0 -1
- package/lib/homag-intelligence-UFo9Z8FS.mjs +0 -549
- package/lib/homag-intelligence-UFo9Z8FS.mjs.map +0 -1
- package/lib/imos-ix-poc-export-helper-CGSk-8yx.mjs +0 -180
- package/lib/imos-ix-poc-export-helper-CGSk-8yx.mjs.map +0 -1
- package/lib/index-DIyMlQBA.mjs +0 -100947
- package/lib/index-DIyMlQBA.mjs.map +0 -1
- package/lib/material-viewer-QTlidNBs.mjs +0 -451
- package/lib/material-viewer-QTlidNBs.mjs.map +0 -1
- package/lib/roomle-sdk.js.map +0 -1
- package/lib/static/draco/gltf/draco_decoder.js +0 -33
- package/lib/static/draco/gltf/draco_decoder.wasm +0 -0
- package/lib/static/draco/gltf/draco_encoder.js +0 -33
- package/lib/static/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleToolsCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.d.ts +0 -82
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.js +0 -355
- package/lib/static/roomle-core-hsc/embind/configuratorCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorCore.d.ts +0 -19
- package/lib/static/roomle-core-hsc/embind/configuratorCore.js +0 -50
- package/lib/static/roomle-core-hsc/embind/configuratorCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.d.ts +0 -746
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js +0 -99
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.d.ts +0 -3
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.js +0 -52
- package/lib/static/roomle-core-hsc/embind/configuratorUtils.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/coreModue.d.ts +0 -4
- package/lib/static/roomle-core-hsc/embind/coreModue.js +0 -3
- package/lib/static/roomle-core-hsc/embind/coreModue.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/coreModule.d.ts +0 -11
- package/lib/static/roomle-core-hsc/embind/coreModule.js +0 -19
- package/lib/static/roomle-core-hsc/embind/coreModule.js.map +0 -1
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.d.ts +0 -851
- package/lib/static/roomle-core-hsc/loader/configurableObject.d.ts +0 -30
- package/lib/static/roomle-core-hsc/loader/configurableObject.js +0 -111
- package/lib/static/roomle-core-hsc/loader/configurableObject.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.d.ts +0 -21
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js +0 -90
- package/lib/static/roomle-core-hsc/loader/configurationGeometryConstructor.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationLoader.d.ts +0 -116
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js +0 -345
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js.map +0 -1
- package/lib/static/roomle-core-hsc/loader/configurationManager.d.ts +0 -41
- package/lib/static/roomle-core-hsc/loader/configurationManager.js +0 -147
- package/lib/static/roomle-core-hsc/loader/configurationManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/loaderUtility.d.ts +0 -81
- package/lib/static/roomle-core-hsc/loaderUtility.js +0 -141
- package/lib/static/roomle-core-hsc/loaderUtility.js.map +0 -1
- package/lib/static/roomle-core-hsc/logger.d.ts +0 -29
- package/lib/static/roomle-core-hsc/logger.js +0 -61
- package/lib/static/roomle-core-hsc/logger.js.map +0 -1
- package/lib/static/roomle-core-hsc/package.json +0 -1
- package/lib/static/roomle-core-hsc/planElementManager.d.ts +0 -96
- package/lib/static/roomle-core-hsc/planElementManager.js +0 -300
- package/lib/static/roomle-core-hsc/planElementManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCore.d.ts +0 -31
- package/lib/static/roomle-core-hsc/plannerCore.js +0 -111
- package/lib/static/roomle-core-hsc/plannerCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCoreCallback.d.ts +0 -39
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js +0 -116
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/plannerCoreInterface.d.ts +0 -851
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js +0 -93
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/rapiAccess.d.ts +0 -70
- package/lib/static/roomle-core-hsc/rapiAccess.js +0 -227
- package/lib/static/roomle-core-hsc/rapiAccess.js.map +0 -1
- package/lib/static/roomle-core-hsc/serviceCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/serviceCore.js +0 -54
- package/lib/static/roomle-core-hsc/serviceCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/serviceCoreInterface.d.ts +0 -13
- package/lib/static/roomle-core-hsc/serviceCoreInterface.js +0 -3
- package/lib/static/roomle-core-hsc/serviceCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.d.ts +0 -82
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js +0 -355
- package/lib/static/roomle-core-hsc/src/embind/configuratorCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.d.ts +0 -19
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js +0 -50
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +0 -746
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js +0 -99
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.d.ts +0 -3
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js +0 -52
- package/lib/static/roomle-core-hsc/src/embind/configuratorUtils.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/coreModue.d.ts +0 -4
- package/lib/static/roomle-core-hsc/src/embind/coreModue.js +0 -3
- package/lib/static/roomle-core-hsc/src/embind/coreModue.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/coreModule.d.ts +0 -11
- package/lib/static/roomle-core-hsc/src/embind/coreModule.js +0 -19
- package/lib/static/roomle-core-hsc/src/embind/coreModule.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.d.ts +0 -31
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.js +0 -111
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +0 -39
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js +0 -116
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js +0 -93
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.js +0 -54
- package/lib/static/roomle-core-hsc/src/embind/serviceCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.d.ts +0 -13
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js +0 -3
- package/lib/static/roomle-core-hsc/src/embind/serviceCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.d.ts +0 -17
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.js +0 -75
- package/lib/static/roomle-core-hsc/src/embind/toolsCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.d.ts +0 -40
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js +0 -8
- package/lib/static/roomle-core-hsc/src/embind/toolsCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.d.ts +0 -30
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.js +0 -111
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts +0 -21
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js +0 -90
- package/lib/static/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.d.ts +0 -116
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js +0 -345
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.d.ts +0 -41
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js +0 -147
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.d.ts +0 -81
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js +0 -141
- package/lib/static/roomle-core-hsc/src/loader/loaderUtility.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/logger.d.ts +0 -29
- package/lib/static/roomle-core-hsc/src/loader/logger.js +0 -61
- package/lib/static/roomle-core-hsc/src/loader/logger.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.d.ts +0 -96
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.js +0 -300
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.js.map +0 -1
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.d.ts +0 -70
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js +0 -227
- package/lib/static/roomle-core-hsc/src/loader/rapiAccess.js.map +0 -1
- package/lib/static/roomle-core-hsc/toolsCore.d.ts +0 -17
- package/lib/static/roomle-core-hsc/toolsCore.js +0 -75
- package/lib/static/roomle-core-hsc/toolsCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/toolsCoreInterface.d.ts +0 -40
- package/lib/static/roomle-core-hsc/toolsCoreInterface.js +0 -8
- package/lib/static/roomle-core-hsc/toolsCoreInterface.js.map +0 -1
- package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +0 -74
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.js +0 -79
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.js +0 -74
- package/lib/stats-helper-cTITQsAT.mjs +0 -108
- package/lib/stats-helper-cTITQsAT.mjs.map +0 -1
- package/lib/tools-core-CCWbo8fD.mjs +0 -36
- package/lib/tools-core-CCWbo8fD.mjs.map +0 -1
- /package/lib/static/draco/{README.md → node_modules/three/examples/jsm/libs/draco/README.md} +0 -0
- /package/lib/static/draco/{draco_decoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.js} +0 -0
- /package/lib/static/draco/{draco_decoder.wasm → node_modules/three/examples/jsm/libs/draco/gltf/draco_decoder.wasm} +0 -0
- /package/lib/static/draco/{draco_encoder.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_encoder.js} +0 -0
- /package/lib/static/draco/{draco_wasm_wrapper.js → node_modules/three/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js} +0 -0
- /package/lib/static/{asset-loader.worker.js → packages/workers/generated/asset-loader.worker.js} +0 -0
- /package/lib/static/{budgeteer.sw.js → packages/workers/generated/budgeteer.sw.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.js → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCallback.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCore.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCore.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCore.js → node_modules/roomle-core-hsc/src/embind/configuratorCore.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCore.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCore.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorCoreInterface.js.map → node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.d.ts → node_modules/roomle-core-hsc/src/embind/configuratorUtils.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.js → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configuratorUtils.js.map → node_modules/roomle-core-hsc/src/embind/configuratorUtils.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.d.ts → node_modules/roomle-core-hsc/src/embind/coreModue.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.js → node_modules/roomle-core-hsc/src/embind/coreModue.js} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModue.js.map → node_modules/roomle-core-hsc/src/embind/coreModue.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.d.ts → node_modules/roomle-core-hsc/src/embind/coreModule.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.js → node_modules/roomle-core-hsc/src/embind/coreModule.js} +0 -0
- /package/lib/static/roomle-core-hsc/{coreModule.js.map → node_modules/roomle-core-hsc/src/embind/coreModule.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreCallback.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreInterface.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/plannerCoreInterface.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/serviceCoreInterface.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCore.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js +0 -0
- /package/lib/static/roomle-core-hsc/{embind → node_modules/roomle-core-hsc/src/embind}/toolsCoreInterface.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{configurableObject.d.ts → node_modules/roomle-core-hsc/src/loader/configurableObject.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configurableObject.js → node_modules/roomle-core-hsc/src/loader/configurableObject.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configurableObject.js.map → node_modules/roomle-core-hsc/src/loader/configurableObject.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.d.ts → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationGeometryConstructor.js.map → node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationLoader.d.ts → node_modules/roomle-core-hsc/src/loader/configurationLoader.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationLoader.js → node_modules/roomle-core-hsc/src/loader/configurationLoader.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationLoader.js.map → node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationManager.d.ts → node_modules/roomle-core-hsc/src/loader/configurationManager.d.ts} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationManager.js → node_modules/roomle-core-hsc/src/loader/configurationManager.js} +0 -0
- /package/lib/static/roomle-core-hsc/{configurationManager.js.map → node_modules/roomle-core-hsc/src/loader/configurationManager.js.map} +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/loaderUtility.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/logger.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/planElementManager.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.d.ts +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js +0 -0
- /package/lib/static/roomle-core-hsc/{loader → node_modules/roomle-core-hsc/src/loader}/rapiAccess.js.map +0 -0
- /package/lib/static/roomle-core-hsc/{ConfiguratorKernel.js → node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js} +0 -0
- /package/lib/static/roomle-core-hsc/{RoomleCore.js → node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js} +0 -0
- /package/lib/static/roomle-core-hsc/{RoomleToolsCore.js → node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.js} +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { h as e } from "./three.core-CLIofecG.mjs";
|
|
2
|
+
import { r as t, t as n } from "./fflate.module-dFNj5UPI.mjs";
|
|
3
|
+
//#region ../../node_modules/three/examples/jsm/exporters/USDZExporter.js
|
|
4
|
+
var r = class {
|
|
5
|
+
constructor(e, t = "", n = [], r = []) {
|
|
6
|
+
this.name = e, this.type = t, this.metadata = n, this.properties = r, this.children = [];
|
|
7
|
+
}
|
|
8
|
+
addMetadata(e, t) {
|
|
9
|
+
this.metadata.push({
|
|
10
|
+
key: e,
|
|
11
|
+
value: t
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
addProperty(e, t = []) {
|
|
15
|
+
this.properties.push({
|
|
16
|
+
property: e,
|
|
17
|
+
metadata: t
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
addChild(e) {
|
|
21
|
+
this.children.push(e);
|
|
22
|
+
}
|
|
23
|
+
toString(e = 0) {
|
|
24
|
+
let t = " ".repeat(e), n = this.metadata.map((e) => {
|
|
25
|
+
let n = e.key, r = e.value;
|
|
26
|
+
if (Array.isArray(r)) {
|
|
27
|
+
let e = [];
|
|
28
|
+
return e.push(`${n} = {`), r.forEach((n) => {
|
|
29
|
+
e.push(`${t}\t\t${n}`);
|
|
30
|
+
}), e.push(`${t}\t}`), e.join("\n");
|
|
31
|
+
} else return `${n} = ${r}`;
|
|
32
|
+
}), r = n.length ? ` (\n${n.map((e) => `${t}\t${e}`).join("\n")}\n${t})` : "", i = this.properties.map((e) => `${t}\t${e.property}${e.metadata.length ? ` (\n${e.metadata.map((e) => `${t}\t\t${e}`).join("\n")}\n${t}\t)` : ""}`), a = this.children.map((t) => t.toString(e + 1)), o = [];
|
|
33
|
+
if (i.length > 0 && o.push(...i), a.length > 0) {
|
|
34
|
+
i.length > 0 && o.push("");
|
|
35
|
+
for (let e = 0; e < a.length; e++) o.push(a[e]), e < a.length - 1 && o.push("");
|
|
36
|
+
}
|
|
37
|
+
let s = o.join("\n");
|
|
38
|
+
return `${t}def ${this.type ? this.type + " " : ""}"${this.name}"${r}\n${t}{\n${s}\n${t}}`;
|
|
39
|
+
}
|
|
40
|
+
}, i = class {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.textureUtils = null;
|
|
43
|
+
}
|
|
44
|
+
setTextureUtils(e) {
|
|
45
|
+
this.textureUtils = e;
|
|
46
|
+
}
|
|
47
|
+
parse(e, t, n, r) {
|
|
48
|
+
this.parseAsync(e, r).then(t).catch(n);
|
|
49
|
+
}
|
|
50
|
+
async parseAsync(e, i = {}) {
|
|
51
|
+
i = Object.assign({
|
|
52
|
+
ar: {
|
|
53
|
+
anchoring: { type: "plane" },
|
|
54
|
+
planeAnchoring: { alignment: "horizontal" }
|
|
55
|
+
},
|
|
56
|
+
includeAnchoringProperties: !0,
|
|
57
|
+
onlyVisible: !0,
|
|
58
|
+
quickLookCompatible: !1,
|
|
59
|
+
maxTextureSize: 1024
|
|
60
|
+
}, i);
|
|
61
|
+
let a = /* @__PURE__ */ new Set(), s = {}, u = "model.usda";
|
|
62
|
+
s[u] = null;
|
|
63
|
+
let d = new r("Root", "Xform"), f = new r("Scenes", "Scope");
|
|
64
|
+
f.addMetadata("kind", "\"sceneLibrary\""), d.addChild(f);
|
|
65
|
+
let p = "Scene", m = new r(p, "Xform");
|
|
66
|
+
m.addMetadata("customData", ["bool preliminary_collidesWithEnvironment = 0", `string sceneName = "${p}"`]), m.addMetadata("sceneName", `"${p}"`), i.includeAnchoringProperties && (m.addProperty(`token preliminary:anchoring:type = "${i.ar.anchoring.type}"`), m.addProperty(`token preliminary:planeAnchoring:alignment = "${i.ar.planeAnchoring.alignment}"`)), f.addChild(m);
|
|
67
|
+
let h, g = {}, _ = {};
|
|
68
|
+
l(e, m, g, a, s, i);
|
|
69
|
+
let v = b(g, _, i.quickLookCompatible);
|
|
70
|
+
h = c() + "\n" + d.toString() + "\n\n" + v.toString(), s[u] = n(h), h = null;
|
|
71
|
+
for (let e in _) {
|
|
72
|
+
let t = _[e];
|
|
73
|
+
if (t.isCompressedTexture === !0) {
|
|
74
|
+
if (this.textureUtils === null) throw Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");
|
|
75
|
+
t = await this.textureUtils.decompress(t);
|
|
76
|
+
}
|
|
77
|
+
let n = o(t.image, t.flipY, i.maxTextureSize), r = await new Promise((e) => n.toBlob(e, "image/png", 1));
|
|
78
|
+
s[`textures/Texture_${e}.png`] = new Uint8Array(await r.arrayBuffer());
|
|
79
|
+
}
|
|
80
|
+
let y = 0;
|
|
81
|
+
for (let e in s) {
|
|
82
|
+
let t = s[e], n = 34 + e.length;
|
|
83
|
+
y += n;
|
|
84
|
+
let r = y & 63;
|
|
85
|
+
if (r !== 4) {
|
|
86
|
+
let n = 64 - r, i = new Uint8Array(n);
|
|
87
|
+
s[e] = [t, { extra: { 12345: i } }];
|
|
88
|
+
}
|
|
89
|
+
y = t.length;
|
|
90
|
+
}
|
|
91
|
+
return t(s, { level: 0 });
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function a(e, t) {
|
|
95
|
+
let n = e.name;
|
|
96
|
+
return n = n.replace(/[^A-Za-z0-9_]/g, ""), /^[0-9]/.test(n) && (n = "_" + n), n === "" && (n = e.isCamera ? "Camera" : "Object"), t.has(n) && (n = n + "_" + e.id), t.add(n), n;
|
|
97
|
+
}
|
|
98
|
+
function o(e, t, n) {
|
|
99
|
+
if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas || typeof ImageBitmap < "u" && e instanceof ImageBitmap) {
|
|
100
|
+
let r = n / Math.max(e.width, e.height), i = document.createElement("canvas");
|
|
101
|
+
i.width = e.width * Math.min(1, r), i.height = e.height * Math.min(1, r);
|
|
102
|
+
let a = i.getContext("2d");
|
|
103
|
+
return t === !0 && (a.translate(0, i.height), a.scale(1, -1)), a.drawImage(e, 0, 0, i.width, i.height), i;
|
|
104
|
+
} else throw Error("THREE.USDZExporter: No valid image data found. Unable to process texture.");
|
|
105
|
+
}
|
|
106
|
+
var s = 7;
|
|
107
|
+
function c() {
|
|
108
|
+
return "#usda 1.0\n(\n customLayerData = {\n string creator = \"Three.js USDZExporter\"\n }\n defaultPrim = \"Root\"\n metersPerUnit = 1\n upAxis = \"Y\"\n)\n";
|
|
109
|
+
}
|
|
110
|
+
function l(e, t, r, i, a, o) {
|
|
111
|
+
for (let s = 0, f = e.children.length; s < f; s++) {
|
|
112
|
+
let f = e.children[s];
|
|
113
|
+
if (f.visible === !1 && o.onlyVisible === !0) continue;
|
|
114
|
+
let p;
|
|
115
|
+
if (f.isMesh) {
|
|
116
|
+
let e = f.geometry, t = f.material;
|
|
117
|
+
if (t.isMeshStandardMaterial) {
|
|
118
|
+
let o = "geometries/Geometry_" + e.id + ".usda";
|
|
119
|
+
if (!(o in a)) {
|
|
120
|
+
let t = m(e);
|
|
121
|
+
a[o] = n(c() + "\n" + t.toString());
|
|
122
|
+
}
|
|
123
|
+
t.uuid in r || (r[t.uuid] = t), p = d(f, e, r[t.uuid], i);
|
|
124
|
+
} else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)", f);
|
|
125
|
+
} else p = f.isCamera ? T(f, i) : u(f, i);
|
|
126
|
+
p && (t.addChild(p), l(f, p, r, i, a, o));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function u(e, t) {
|
|
130
|
+
let n = a(e, t);
|
|
131
|
+
e.matrix.determinant() < 0 && console.warn("THREE.USDZExporter: USDZ does not support negative scales", e);
|
|
132
|
+
let i = new r(n, "Xform");
|
|
133
|
+
if (e.pivot !== null) {
|
|
134
|
+
let t = e.position, n = e.quaternion, r = e.scale, a = e.pivot;
|
|
135
|
+
i.addProperty(`float3 xformOp:translate = (${t.x.toPrecision(s)}, ${t.y.toPrecision(s)}, ${t.z.toPrecision(s)})`), i.addProperty(`float3 xformOp:translate:pivot = (${a.x.toPrecision(s)}, ${a.y.toPrecision(s)}, ${a.z.toPrecision(s)})`), i.addProperty(`quatf xformOp:orient = (${n.w.toPrecision(s)}, ${n.x.toPrecision(s)}, ${n.y.toPrecision(s)}, ${n.z.toPrecision(s)})`), i.addProperty(`float3 xformOp:scale = (${r.x.toPrecision(s)}, ${r.y.toPrecision(s)}, ${r.z.toPrecision(s)})`), i.addProperty("uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:translate:pivot\", \"xformOp:orient\", \"xformOp:scale\", \"!invert!xformOp:translate:pivot\"]");
|
|
136
|
+
} else {
|
|
137
|
+
let t = f(e.matrix);
|
|
138
|
+
i.addProperty(`matrix4d xformOp:transform = ${t}`), i.addProperty("uniform token[] xformOpOrder = [\"xformOp:transform\"]");
|
|
139
|
+
}
|
|
140
|
+
return i;
|
|
141
|
+
}
|
|
142
|
+
function d(e, t, n, r) {
|
|
143
|
+
let i = u(e, r);
|
|
144
|
+
return i.addMetadata("prepend references", `@./geometries/Geometry_${t.id}.usda@</Geometry>`), i.addMetadata("prepend apiSchemas", "[\"MaterialBindingAPI\"]"), i.addProperty(`rel material:binding = </Materials/Material_${n.id}>`), i;
|
|
145
|
+
}
|
|
146
|
+
function f(e) {
|
|
147
|
+
let t = e.elements;
|
|
148
|
+
return `( ${p(t, 0)}, ${p(t, 4)}, ${p(t, 8)}, ${p(t, 12)} )`;
|
|
149
|
+
}
|
|
150
|
+
function p(e, t) {
|
|
151
|
+
return `(${e[t + 0]}, ${e[t + 1]}, ${e[t + 2]}, ${e[t + 3]})`;
|
|
152
|
+
}
|
|
153
|
+
function m(e) {
|
|
154
|
+
let t = new r("Geometry"), n = h(e);
|
|
155
|
+
return t.addChild(n), t;
|
|
156
|
+
}
|
|
157
|
+
function h(e) {
|
|
158
|
+
let t = e.attributes, n = t.position.count, i = new r("Geometry", "Mesh");
|
|
159
|
+
i.addProperty(`int[] faceVertexCounts = [${g(e)}]`), i.addProperty(`int[] faceVertexIndices = [${_(e)}]`), i.addProperty(`normal3f[] normals = [${v(t.normal, n)}]`, ["interpolation = \"vertex\""]), i.addProperty(`point3f[] points = [${v(t.position, n)}]`);
|
|
160
|
+
for (let e = 0; e < 4; e++) {
|
|
161
|
+
let n = e > 0 ? e : "", r = t["uv" + n];
|
|
162
|
+
r !== void 0 && i.addProperty(`texCoord2f[] primvars:st${n} = [${y(r)}]`, ["interpolation = \"vertex\""]);
|
|
163
|
+
}
|
|
164
|
+
let a = t.color;
|
|
165
|
+
return a !== void 0 && i.addProperty(`color3f[] primvars:displayColor = [${v(a, n)}]`, ["interpolation = \"vertex\""]), i.addProperty("uniform token subdivisionScheme = \"none\""), i;
|
|
166
|
+
}
|
|
167
|
+
function g(e) {
|
|
168
|
+
let t = e.index === null ? e.attributes.position.count : e.index.count;
|
|
169
|
+
return Array(t / 3).fill(3).join(", ");
|
|
170
|
+
}
|
|
171
|
+
function _(e) {
|
|
172
|
+
let t = e.index, n = [];
|
|
173
|
+
if (t !== null) for (let e = 0; e < t.count; e++) n.push(t.getX(e));
|
|
174
|
+
else {
|
|
175
|
+
let t = e.attributes.position.count;
|
|
176
|
+
for (let e = 0; e < t; e++) n.push(e);
|
|
177
|
+
}
|
|
178
|
+
return n.join(", ");
|
|
179
|
+
}
|
|
180
|
+
function v(e, t) {
|
|
181
|
+
if (e === void 0) return console.warn("USDZExporter: Normals missing."), Array(t).fill("(0, 0, 0)").join(", ");
|
|
182
|
+
let n = [];
|
|
183
|
+
for (let t = 0; t < e.count; t++) {
|
|
184
|
+
let r = e.getX(t), i = e.getY(t), a = e.getZ(t);
|
|
185
|
+
n.push(`(${r.toPrecision(s)}, ${i.toPrecision(s)}, ${a.toPrecision(s)})`);
|
|
186
|
+
}
|
|
187
|
+
return n.join(", ");
|
|
188
|
+
}
|
|
189
|
+
function y(e) {
|
|
190
|
+
let t = [];
|
|
191
|
+
for (let n = 0; n < e.count; n++) {
|
|
192
|
+
let r = e.getX(n), i = e.getY(n);
|
|
193
|
+
t.push(`(${r.toPrecision(s)}, ${1 - i.toPrecision(s)})`);
|
|
194
|
+
}
|
|
195
|
+
return t.join(", ");
|
|
196
|
+
}
|
|
197
|
+
function b(e, t, n = !1) {
|
|
198
|
+
let i = new r("Materials");
|
|
199
|
+
for (let r in e) {
|
|
200
|
+
let a = e[r];
|
|
201
|
+
i.addChild(x(a, t, n));
|
|
202
|
+
}
|
|
203
|
+
return i;
|
|
204
|
+
}
|
|
205
|
+
function x(t, n, i = !1) {
|
|
206
|
+
let a = new r(`Material_${t.id}`, "Material");
|
|
207
|
+
function o(e, a, o) {
|
|
208
|
+
let c = e.source.id + "_" + e.flipY;
|
|
209
|
+
n[c] = e;
|
|
210
|
+
let l = e.channel > 0 ? "st" + e.channel : "st", u = {
|
|
211
|
+
1e3: "repeat",
|
|
212
|
+
1001: "clamp",
|
|
213
|
+
1002: "mirror"
|
|
214
|
+
}, d = e.repeat.clone(), f = e.offset.clone(), p = e.rotation, m = Math.sin(p), h = Math.cos(p);
|
|
215
|
+
f.y = 1 - f.y - d.y, i ? (f.x /= d.x, f.y /= d.y, f.x += m / d.x, f.y += h - 1) : (f.x += m * d.x, f.y += (1 - h) * d.y);
|
|
216
|
+
let g = new r(`PrimvarReader_${a}`, "Shader");
|
|
217
|
+
g.addProperty("uniform token info:id = \"UsdPrimvarReader_float2\""), g.addProperty("float2 inputs:fallback = (0.0, 0.0)"), g.addProperty(`string inputs:varname = "${l}"`), g.addProperty("float2 outputs:result");
|
|
218
|
+
let _ = new r(`Transform2d_${a}`, "Shader");
|
|
219
|
+
_.addProperty("uniform token info:id = \"UsdTransform2d\""), _.addProperty(`float2 inputs:in.connect = </Materials/Material_${t.id}/PrimvarReader_${a}.outputs:result>`), _.addProperty(`float inputs:rotation = ${(180 / Math.PI * p).toFixed(s)}`), _.addProperty(`float2 inputs:scale = ${w(d)}`), _.addProperty(`float2 inputs:translation = ${w(f)}`), _.addProperty("float2 outputs:result");
|
|
220
|
+
let v = new r(`Texture_${e.id}_${a}`, "Shader");
|
|
221
|
+
return v.addProperty("uniform token info:id = \"UsdUVTexture\""), v.addProperty(`asset inputs:file = @textures/Texture_${c}.png@`), v.addProperty(`float2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${a}.outputs:result>`), o !== void 0 && v.addProperty(`float4 inputs:scale = ${C(o)}`), a === "normal" && (v.addProperty("float4 inputs:scale = (2, 2, 2, 1)"), v.addProperty("float4 inputs:bias = (-1, -1, -1, 0)")), v.addProperty(`token inputs:sourceColorSpace = "${e.colorSpace === "" ? "raw" : "sRGB"}"`), v.addProperty(`token inputs:wrapS = "${u[e.wrapS]}"`), v.addProperty(`token inputs:wrapT = "${u[e.wrapT]}"`), v.addProperty("float outputs:r"), v.addProperty("float outputs:g"), v.addProperty("float outputs:b"), v.addProperty("float3 outputs:rgb"), (t.transparent || t.alphaTest > 0) && v.addProperty("float outputs:a"), [
|
|
222
|
+
g,
|
|
223
|
+
_,
|
|
224
|
+
v
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
t.side === 2 && console.warn("THREE.USDZExporter: USDZ does not support double sided materials", t);
|
|
228
|
+
let c = new r("PreviewSurface", "Shader");
|
|
229
|
+
if (c.addProperty("uniform token info:id = \"UsdPreviewSurface\""), t.map === null ? c.addProperty(`color3f inputs:diffuseColor = ${S(t.color)}`) : (c.addProperty(`color3f inputs:diffuseColor.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:rgb>`), t.transparent ? c.addProperty(`float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`) : t.alphaTest > 0 && (c.addProperty(`float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`), c.addProperty(`float inputs:opacityThreshold = ${t.alphaTest}`)), o(t.map, "diffuse", t.color).forEach((e) => a.addChild(e))), t.emissiveMap !== null) {
|
|
230
|
+
c.addProperty(`color3f inputs:emissiveColor.connect = </Materials/Material_${t.id}/Texture_${t.emissiveMap.id}_emissive.outputs:rgb>`);
|
|
231
|
+
let n = new e(t.emissive.r * t.emissiveIntensity, t.emissive.g * t.emissiveIntensity, t.emissive.b * t.emissiveIntensity);
|
|
232
|
+
o(t.emissiveMap, "emissive", n).forEach((e) => a.addChild(e));
|
|
233
|
+
} else t.emissive.getHex() > 0 && c.addProperty(`color3f inputs:emissiveColor = ${S(t.emissive)}`);
|
|
234
|
+
if (t.normalMap !== null && (c.addProperty(`normal3f inputs:normal.connect = </Materials/Material_${t.id}/Texture_${t.normalMap.id}_normal.outputs:rgb>`), o(t.normalMap, "normal").forEach((e) => a.addChild(e))), t.aoMap !== null) {
|
|
235
|
+
c.addProperty(`float inputs:occlusion.connect = </Materials/Material_${t.id}/Texture_${t.aoMap.id}_occlusion.outputs:r>`);
|
|
236
|
+
let n = new e(t.aoMapIntensity, t.aoMapIntensity, t.aoMapIntensity);
|
|
237
|
+
o(t.aoMap, "occlusion", n).forEach((e) => a.addChild(e));
|
|
238
|
+
}
|
|
239
|
+
if (t.roughnessMap !== null) {
|
|
240
|
+
c.addProperty(`float inputs:roughness.connect = </Materials/Material_${t.id}/Texture_${t.roughnessMap.id}_roughness.outputs:g>`);
|
|
241
|
+
let n = new e(t.roughness, t.roughness, t.roughness);
|
|
242
|
+
o(t.roughnessMap, "roughness", n).forEach((e) => a.addChild(e));
|
|
243
|
+
} else c.addProperty(`float inputs:roughness = ${t.roughness}`);
|
|
244
|
+
if (t.metalnessMap !== null) {
|
|
245
|
+
c.addProperty(`float inputs:metallic.connect = </Materials/Material_${t.id}/Texture_${t.metalnessMap.id}_metallic.outputs:b>`);
|
|
246
|
+
let n = new e(t.metalness, t.metalness, t.metalness);
|
|
247
|
+
o(t.metalnessMap, "metallic", n).forEach((e) => a.addChild(e));
|
|
248
|
+
} else c.addProperty(`float inputs:metallic = ${t.metalness}`);
|
|
249
|
+
if (t.alphaMap === null ? c.addProperty(`float inputs:opacity = ${t.opacity}`) : (c.addProperty(`float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.alphaMap.id}_opacity.outputs:r>`), c.addProperty("float inputs:opacityThreshold = 0.0001"), o(t.alphaMap, "opacity").forEach((e) => a.addChild(e))), t.isMeshPhysicalMaterial) {
|
|
250
|
+
if (t.clearcoatMap !== null) {
|
|
251
|
+
c.addProperty(`float inputs:clearcoat.connect = </Materials/Material_${t.id}/Texture_${t.clearcoatMap.id}_clearcoat.outputs:r>`);
|
|
252
|
+
let n = new e(t.clearcoat, t.clearcoat, t.clearcoat);
|
|
253
|
+
o(t.clearcoatMap, "clearcoat", n).forEach((e) => a.addChild(e));
|
|
254
|
+
} else c.addProperty(`float inputs:clearcoat = ${t.clearcoat}`);
|
|
255
|
+
if (t.clearcoatRoughnessMap !== null) {
|
|
256
|
+
c.addProperty(`float inputs:clearcoatRoughness.connect = </Materials/Material_${t.id}/Texture_${t.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`);
|
|
257
|
+
let n = new e(t.clearcoatRoughness, t.clearcoatRoughness, t.clearcoatRoughness);
|
|
258
|
+
o(t.clearcoatRoughnessMap, "clearcoatRoughness", n).forEach((e) => a.addChild(e));
|
|
259
|
+
} else c.addProperty(`float inputs:clearcoatRoughness = ${t.clearcoatRoughness}`);
|
|
260
|
+
c.addProperty(`float inputs:ior = ${t.ior}`);
|
|
261
|
+
}
|
|
262
|
+
return c.addProperty("int inputs:useSpecularWorkflow = 0"), c.addProperty("token outputs:surface"), a.addChild(c), a.addProperty(`token outputs:surface.connect = </Materials/Material_${t.id}/PreviewSurface.outputs:surface>`), a;
|
|
263
|
+
}
|
|
264
|
+
function S(e) {
|
|
265
|
+
return `(${e.r}, ${e.g}, ${e.b})`;
|
|
266
|
+
}
|
|
267
|
+
function C(e) {
|
|
268
|
+
return `(${e.r}, ${e.g}, ${e.b}, 1.0)`;
|
|
269
|
+
}
|
|
270
|
+
function w(e) {
|
|
271
|
+
return `(${e.x}, ${e.y})`;
|
|
272
|
+
}
|
|
273
|
+
function T(e, t) {
|
|
274
|
+
let n = a(e, t), i = f(e.matrix);
|
|
275
|
+
e.matrix.determinant() < 0 && console.warn("THREE.USDZExporter: USDZ does not support negative scales", e);
|
|
276
|
+
let o = new r(n, "Camera");
|
|
277
|
+
o.addProperty(`matrix4d xformOp:transform = ${i}`), o.addProperty("uniform token[] xformOpOrder = [\"xformOp:transform\"]");
|
|
278
|
+
let c = e.isOrthographicCamera ? "orthographic" : "perspective";
|
|
279
|
+
o.addProperty(`token projection = "${c}"`);
|
|
280
|
+
let l = `(${e.near.toPrecision(s)}, ${e.far.toPrecision(s)})`;
|
|
281
|
+
o.addProperty(`float2 clippingRange = ${l}`);
|
|
282
|
+
let u;
|
|
283
|
+
u = e.isOrthographicCamera ? ((Math.abs(e.left) + Math.abs(e.right)) * 10).toPrecision(s) : e.getFilmWidth().toPrecision(s), o.addProperty(`float horizontalAperture = ${u}`);
|
|
284
|
+
let d;
|
|
285
|
+
if (d = e.isOrthographicCamera ? ((Math.abs(e.top) + Math.abs(e.bottom)) * 10).toPrecision(s) : e.getFilmHeight().toPrecision(s), o.addProperty(`float verticalAperture = ${d}`), e.isPerspectiveCamera) {
|
|
286
|
+
let t = e.getFocalLength().toPrecision(s);
|
|
287
|
+
o.addProperty(`float focalLength = ${t}`);
|
|
288
|
+
let n = e.focus.toPrecision(s);
|
|
289
|
+
o.addProperty(`float focusDistance = ${n}`);
|
|
290
|
+
}
|
|
291
|
+
return o;
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
export { i as USDZExporter };
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=USDZExporter-DxIqi8St.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"USDZExporter-DxIqi8St.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/exporters/USDZExporter.js"],"sourcesContent":["import {\n\tNoColorSpace,\n\tDoubleSide,\n\tColor,\n} from 'three';\n\nimport {\n\tstrToU8,\n\tzipSync,\n} from '../libs/fflate.module.js';\n\nclass USDNode {\n\n\tconstructor( name, type = '', metadata = [], properties = [] ) {\n\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tthis.metadata = metadata;\n\t\tthis.properties = properties;\n\t\tthis.children = [];\n\n\t}\n\n\taddMetadata( key, value ) {\n\n\t\tthis.metadata.push( { key, value } );\n\n\t}\n\n\taddProperty( property, metadata = [] ) {\n\n\t\tthis.properties.push( { property, metadata } );\n\n\t}\n\n\taddChild( child ) {\n\n\t\tthis.children.push( child );\n\n\t}\n\n\ttoString( indent = 0 ) {\n\n\t\tconst pad = '\\t'.repeat( indent );\n\n\t\tconst formattedMetadata = this.metadata.map( ( item ) => {\n\n\t\t\tconst key = item.key;\n\t\t\tconst value = item.value;\n\n\t\t\tif ( Array.isArray( value ) ) {\n\n\t\t\t\tconst lines = [];\n\t\t\t\tlines.push( `${key} = {` );\n\t\t\t\tvalue.forEach( ( line ) => {\n\n\t\t\t\t\tlines.push( `${pad}\\t\\t${line}` );\n\n\t\t\t\t} );\n\t\t\t\tlines.push( `${pad}\\t}` );\n\t\t\t\treturn lines.join( '\\n' );\n\n\t\t\t} else {\n\n\t\t\t\treturn `${key} = ${value}`;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst meta = formattedMetadata.length\n\t\t\t? ` (\\n${formattedMetadata\n\t\t\t\t.map( ( l ) => `${pad}\\t${l}` )\n\t\t\t\t.join( '\\n' )}\\n${pad})`\n\t\t\t: '';\n\n\t\tconst properties = this.properties.map( ( l ) => {\n\n\t\t\tconst property = l.property;\n\t\t\tconst metadata = l.metadata.length\n\t\t\t\t? ` (\\n${l.metadata.map( ( m ) => `${pad}\\t\\t${m}` ).join( '\\n' )}\\n${pad}\\t)`\n\t\t\t\t: '';\n\t\t\treturn `${pad}\\t${property}${metadata}`;\n\n\t\t} );\n\t\tconst children = this.children.map( ( c ) => c.toString( indent + 1 ) );\n\n\t\tconst bodyLines = [];\n\n\t\tif ( properties.length > 0 ) {\n\n\t\t\tbodyLines.push( ...properties );\n\n\t\t}\n\n\t\tif ( children.length > 0 ) {\n\n\t\t\tif ( properties.length > 0 ) {\n\n\t\t\t\tbodyLines.push( '' );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tbodyLines.push( children[ i ] );\n\t\t\t\tif ( i < children.length - 1 ) {\n\n\t\t\t\t\tbodyLines.push( '' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bodyContent = bodyLines.join( '\\n' );\n\n\t\tconst type = this.type ? this.type + ' ' : '';\n\n\t\treturn `${pad}def ${type}\"${this.name}\"${meta}\\n${pad}{\\n${bodyContent}\\n${pad}}`;\n\n\t}\n\n}\n\n/**\n * An exporter for USDZ.\n *\n * ```js\n * const exporter = new USDZExporter();\n * const arraybuffer = await exporter.parseAsync( scene );\n * ```\n *\n * @three_import import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';\n */\nclass USDZExporter {\n\n\t/**\n\t * Constructs a new USDZ exporter.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A reference to a texture utils module.\n\t\t *\n\t\t * @type {?(WebGLTextureUtils|WebGPUTextureUtils)}\n\t\t * @default null\n\t\t */\n\t\tthis.textureUtils = null;\n\n\t}\n\n\t/**\n\t * Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.\n\t *\n\t * Depending on whether you use {@link WebGLRenderer} or {@link WebGPURenderer}, you must inject the\n\t * corresponding texture utils {@link WebGLTextureUtils} or {@link WebGPUTextureUtils}.\n\t *\n\t * @param {WebGLTextureUtils|WebGPUTextureUtils} utils - The texture utils.\n\t */\n\tsetTextureUtils( utils ) {\n\n\t\tthis.textureUtils = utils;\n\n\t}\n\n\t/**\n\t * Parse the given 3D object and generates the USDZ output.\n\t *\n\t * @param {Object3D} scene - The 3D object to export.\n\t * @param {USDZExporter~OnDone} onDone - A callback function that is executed when the export has finished.\n\t * @param {USDZExporter~OnError} onError - A callback function that is executed when an error happens.\n\t * @param {USDZExporter~Options} options - The export options.\n\t */\n\tparse( scene, onDone, onError, options ) {\n\n\t\tthis.parseAsync( scene, options ).then( onDone ).catch( onError );\n\n\t}\n\n\t/**\n\t * Async version of {@link USDZExporter#parse}.\n\t *\n\t * @async\n\t * @param {Object3D} scene - The 3D object to export.\n\t * @param {USDZExporter~Options} options - The export options.\n\t * @return {Promise<ArrayBuffer>} A Promise that resolved with the exported USDZ data.\n\t */\n\tasync parseAsync( scene, options = {} ) {\n\n\t\toptions = Object.assign(\n\t\t\t{\n\t\t\t\tar: {\n\t\t\t\t\tanchoring: { type: 'plane' },\n\t\t\t\t\tplaneAnchoring: { alignment: 'horizontal' },\n\t\t\t\t},\n\t\t\t\tincludeAnchoringProperties: true,\n\t\t\t\tonlyVisible: true,\n\t\t\t\tquickLookCompatible: false,\n\t\t\t\tmaxTextureSize: 1024,\n\t\t\t},\n\t\t\toptions\n\t\t);\n\n\t\tconst usedNames = new Set();\n\n\t\tconst files = {};\n\t\tconst modelFileName = 'model.usda';\n\n\t\t// model file should be first in USDZ archive so we init it here\n\t\tfiles[ modelFileName ] = null;\n\n\t\tconst root = new USDNode( 'Root', 'Xform' );\n\t\tconst scenesNode = new USDNode( 'Scenes', 'Scope' );\n\t\tscenesNode.addMetadata( 'kind', '\"sceneLibrary\"' );\n\t\troot.addChild( scenesNode );\n\n\t\tconst sceneName = 'Scene';\n\t\tconst sceneNode = new USDNode( sceneName, 'Xform' );\n\t\tsceneNode.addMetadata( 'customData', [\n\t\t\t'bool preliminary_collidesWithEnvironment = 0',\n\t\t\t`string sceneName = \"${sceneName}\"`,\n\t\t] );\n\t\tsceneNode.addMetadata( 'sceneName', `\"${sceneName}\"` );\n\t\tif ( options.includeAnchoringProperties ) {\n\n\t\t\tsceneNode.addProperty(\n\t\t\t\t`token preliminary:anchoring:type = \"${options.ar.anchoring.type}\"`\n\t\t\t);\n\t\t\tsceneNode.addProperty(\n\t\t\t\t`token preliminary:planeAnchoring:alignment = \"${options.ar.planeAnchoring.alignment}\"`\n\t\t\t);\n\n\t\t}\n\n\t\tscenesNode.addChild( sceneNode );\n\n\t\tlet output;\n\n\t\tconst materials = {};\n\t\tconst textures = {};\n\n\t\tbuildHierarchy( scene, sceneNode, materials, usedNames, files, options );\n\n\t\tconst materialsNode = buildMaterials(\n\t\t\tmaterials,\n\t\t\ttextures,\n\t\t\toptions.quickLookCompatible\n\t\t);\n\n\t\toutput =\n\t\t\tbuildHeader() +\n\t\t\t'\\n' +\n\t\t\troot.toString() +\n\t\t\t'\\n\\n' +\n\t\t\tmaterialsNode.toString();\n\n\t\tfiles[ modelFileName ] = strToU8( output );\n\t\toutput = null;\n\n\t\tfor ( const id in textures ) {\n\n\t\t\tlet texture = textures[ id ];\n\n\t\t\tif ( texture.isCompressedTexture === true ) {\n\n\t\t\t\tif ( this.textureUtils === null ) {\n\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.'\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = await this.textureUtils.decompress( texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst canvas = imageToCanvas(\n\t\t\t\ttexture.image,\n\t\t\t\ttexture.flipY,\n\t\t\t\toptions.maxTextureSize\n\t\t\t);\n\t\t\tconst blob = await new Promise( ( resolve ) =>\n\t\t\t\tcanvas.toBlob( resolve, 'image/png', 1 )\n\t\t\t);\n\n\t\t\tfiles[ `textures/Texture_${id}.png` ] = new Uint8Array(\n\t\t\t\tawait blob.arrayBuffer()\n\t\t\t);\n\n\t\t}\n\n\t\t// 64 byte alignment\n\t\t// https://github.com/101arrowz/fflate/issues/39#issuecomment-777263109\n\n\t\tlet offset = 0;\n\n\t\tfor ( const filename in files ) {\n\n\t\t\tconst file = files[ filename ];\n\t\t\tconst headerSize = 34 + filename.length;\n\n\t\t\toffset += headerSize;\n\n\t\t\tconst offsetMod64 = offset & 63;\n\n\t\t\tif ( offsetMod64 !== 4 ) {\n\n\t\t\t\tconst padLength = 64 - offsetMod64;\n\t\t\t\tconst padding = new Uint8Array( padLength );\n\n\t\t\t\tfiles[ filename ] = [ file, { extra: { 12345: padding } } ];\n\n\t\t\t}\n\n\t\t\toffset = file.length;\n\n\t\t}\n\n\t\treturn zipSync( files, { level: 0 } );\n\n\t}\n\n}\n\nfunction getName( object, namesSet ) {\n\n\tlet name = object.name;\n\tname = name.replace( /[^A-Za-z0-9_]/g, '' );\n\tif ( /^[0-9]/.test( name ) ) {\n\n\t\tname = '_' + name;\n\n\t}\n\n\tif ( name === '' ) {\n\n\t\tif ( object.isCamera ) {\n\n\t\t\tname = 'Camera';\n\n\t\t} else {\n\n\t\t\tname = 'Object';\n\n\t\t}\n\n\t}\n\n\tif ( namesSet.has( name ) ) {\n\n\t\tname = name + '_' + object.id;\n\n\t}\n\n\tnamesSet.add( name );\n\n\treturn name;\n\n}\n\nfunction imageToCanvas( image, flipY, maxTextureSize ) {\n\n\tif (\n\t\t( typeof HTMLImageElement !== 'undefined' &&\n\t\t\timage instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' &&\n\t\t\timage instanceof HTMLCanvasElement ) ||\n\t\t( typeof OffscreenCanvas !== 'undefined' &&\n\t\t\timage instanceof OffscreenCanvas ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap )\n\t) {\n\n\t\tconst scale = maxTextureSize / Math.max( image.width, image.height );\n\n\t\tconst canvas = document.createElement( 'canvas' );\n\t\tcanvas.width = image.width * Math.min( 1, scale );\n\t\tcanvas.height = image.height * Math.min( 1, scale );\n\n\t\tconst context = canvas.getContext( '2d' );\n\n\t\t// TODO: We should be able to do this in the UsdTransform2d?\n\n\t\tif ( flipY === true ) {\n\n\t\t\tcontext.translate( 0, canvas.height );\n\t\t\tcontext.scale( 1, - 1 );\n\n\t\t}\n\n\t\tcontext.drawImage( image, 0, 0, canvas.width, canvas.height );\n\n\t\treturn canvas;\n\n\t} else {\n\n\t\tthrow new Error(\n\t\t\t'THREE.USDZExporter: No valid image data found. Unable to process texture.'\n\t\t);\n\n\t}\n\n}\n\n//\n\nconst PRECISION = 7;\n\nfunction buildHeader() {\n\n\treturn `#usda 1.0\n(\n\tcustomLayerData = {\n\t\tstring creator = \"Three.js USDZExporter\"\n\t}\n\tdefaultPrim = \"Root\"\n\tmetersPerUnit = 1\n\tupAxis = \"Y\"\n)\n`;\n\n}\n\n// Xform\n\nfunction buildHierarchy( object, parentNode, materials, usedNames, files, options ) {\n\n\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\tconst child = object.children[ i ];\n\n\t\tif ( child.visible === false && options.onlyVisible === true ) continue;\n\n\t\tlet childNode;\n\n\t\tif ( child.isMesh ) {\n\n\t\t\tconst geometry = child.geometry;\n\t\t\tconst material = child.material;\n\n\t\t\tif ( material.isMeshStandardMaterial ) {\n\n\t\t\t\tconst geometryFileName = 'geometries/Geometry_' + geometry.id + '.usda';\n\n\t\t\t\tif ( ! ( geometryFileName in files ) ) {\n\n\t\t\t\t\tconst meshObject = buildMeshObject( geometry );\n\t\t\t\t\tfiles[ geometryFileName ] = strToU8(\n\t\t\t\t\t\tbuildHeader() + '\\n' + meshObject.toString()\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! ( material.uuid in materials ) ) {\n\n\t\t\t\t\tmaterials[ material.uuid ] = material;\n\n\t\t\t\t}\n\n\t\t\t\tchildNode = buildMesh(\n\t\t\t\t\tchild,\n\t\t\t\t\tgeometry,\n\t\t\t\t\tmaterials[ material.uuid ],\n\t\t\t\t\tusedNames\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)',\n\t\t\t\t\tchild\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t} else if ( child.isCamera ) {\n\n\t\t\tchildNode = buildCamera( child, usedNames );\n\n\t\t} else {\n\n\t\t\tchildNode = buildXform( child, usedNames );\n\n\t\t}\n\n\t\tif ( childNode ) {\n\n\t\t\tparentNode.addChild( childNode );\n\t\t\tbuildHierarchy( child, childNode, materials, usedNames, files, options );\n\n\t\t}\n\n\t}\n\n}\n\nfunction buildXform( object, usedNames ) {\n\n\tconst name = getName( object, usedNames );\n\n\tif ( object.matrix.determinant() < 0 ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support negative scales',\n\t\t\tobject\n\t\t);\n\n\t}\n\n\tconst node = new USDNode( name, 'Xform' );\n\n\tif ( object.pivot !== null ) {\n\n\t\t// Export with pivot using separate transform ops\n\t\tconst p = object.position;\n\t\tconst q = object.quaternion;\n\t\tconst s = object.scale;\n\t\tconst piv = object.pivot;\n\n\t\tnode.addProperty( `float3 xformOp:translate = (${p.x.toPrecision( PRECISION )}, ${p.y.toPrecision( PRECISION )}, ${p.z.toPrecision( PRECISION )})` );\n\t\tnode.addProperty( `float3 xformOp:translate:pivot = (${piv.x.toPrecision( PRECISION )}, ${piv.y.toPrecision( PRECISION )}, ${piv.z.toPrecision( PRECISION )})` );\n\t\tnode.addProperty( `quatf xformOp:orient = (${q.w.toPrecision( PRECISION )}, ${q.x.toPrecision( PRECISION )}, ${q.y.toPrecision( PRECISION )}, ${q.z.toPrecision( PRECISION )})` );\n\t\tnode.addProperty( `float3 xformOp:scale = (${s.x.toPrecision( PRECISION )}, ${s.y.toPrecision( PRECISION )}, ${s.z.toPrecision( PRECISION )})` );\n\t\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:translate:pivot\", \"xformOp:orient\", \"xformOp:scale\", \"!invert!xformOp:translate:pivot\"]' );\n\n\t} else {\n\n\t\t// Export as single transform matrix\n\t\tconst transform = buildMatrix( object.matrix );\n\t\tnode.addProperty( `matrix4d xformOp:transform = ${transform}` );\n\t\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:transform\"]' );\n\n\t}\n\n\treturn node;\n\n}\n\nfunction buildMesh( object, geometry, material, usedNames ) {\n\n\tconst node = buildXform( object, usedNames );\n\n\tnode.addMetadata(\n\t\t'prepend references',\n\t\t`@./geometries/Geometry_${geometry.id}.usda@</Geometry>`\n\t);\n\tnode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\n\tnode.addProperty(\n\t\t`rel material:binding = </Materials/Material_${material.id}>`\n\t);\n\n\treturn node;\n\n}\n\nfunction buildMatrix( matrix ) {\n\n\tconst array = matrix.elements;\n\n\treturn `( ${buildMatrixRow( array, 0 )}, ${buildMatrixRow(\n\t\tarray,\n\t\t4\n\t)}, ${buildMatrixRow( array, 8 )}, ${buildMatrixRow( array, 12 )} )`;\n\n}\n\nfunction buildMatrixRow( array, offset ) {\n\n\treturn `(${array[ offset + 0 ]}, ${array[ offset + 1 ]}, ${array[ offset + 2 ]}, ${\n\t\tarray[ offset + 3 ]\n\t})`;\n\n}\n\n// Mesh\n\nfunction buildMeshObject( geometry ) {\n\n\tconst node = new USDNode( 'Geometry' );\n\n\tconst meshNode = buildMeshNode( geometry );\n\tnode.addChild( meshNode );\n\n\treturn node;\n\n}\n\nfunction buildMeshNode( geometry ) {\n\n\tconst name = 'Geometry';\n\tconst attributes = geometry.attributes;\n\tconst count = attributes.position.count;\n\n\tconst node = new USDNode( name, 'Mesh' );\n\n\tnode.addProperty(\n\t\t`int[] faceVertexCounts = [${buildMeshVertexCount( geometry )}]`\n\t);\n\tnode.addProperty(\n\t\t`int[] faceVertexIndices = [${buildMeshVertexIndices( geometry )}]`\n\t);\n\tnode.addProperty(\n\t\t`normal3f[] normals = [${buildVector3Array( attributes.normal, count )}]`,\n\t\t[ 'interpolation = \"vertex\"' ]\n\t);\n\tnode.addProperty(\n\t\t`point3f[] points = [${buildVector3Array( attributes.position, count )}]`\n\t);\n\n\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\tconst id = i > 0 ? i : '';\n\t\tconst attribute = attributes[ 'uv' + id ];\n\t\tif ( attribute !== undefined ) {\n\n\t\t\tnode.addProperty(\n\t\t\t\t`texCoord2f[] primvars:st${id} = [${buildVector2Array( attribute )}]`,\n\t\t\t\t[ 'interpolation = \"vertex\"' ]\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\tconst colorAttribute = attributes.color;\n\tif ( colorAttribute !== undefined ) {\n\n\t\tnode.addProperty(\n\t\t\t`color3f[] primvars:displayColor = [${buildVector3Array(\n\t\t\t\tcolorAttribute,\n\t\t\t\tcount\n\t\t\t)}]`,\n\t\t\t[ 'interpolation = \"vertex\"' ]\n\t\t);\n\n\t}\n\n\tnode.addProperty( 'uniform token subdivisionScheme = \"none\"' );\n\n\treturn node;\n\n}\n\nfunction buildMeshVertexCount( geometry ) {\n\n\tconst count =\n\t\tgeometry.index !== null\n\t\t\t? geometry.index.count\n\t\t\t: geometry.attributes.position.count;\n\n\treturn Array( count / 3 )\n\t\t.fill( 3 )\n\t\t.join( ', ' );\n\n}\n\nfunction buildMeshVertexIndices( geometry ) {\n\n\tconst index = geometry.index;\n\tconst array = [];\n\n\tif ( index !== null ) {\n\n\t\tfor ( let i = 0; i < index.count; i ++ ) {\n\n\t\t\tarray.push( index.getX( i ) );\n\n\t\t}\n\n\t} else {\n\n\t\tconst length = geometry.attributes.position.count;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tarray.push( i );\n\n\t\t}\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\nfunction buildVector3Array( attribute, count ) {\n\n\tif ( attribute === undefined ) {\n\n\t\tconsole.warn( 'USDZExporter: Normals missing.' );\n\t\treturn Array( count ).fill( '(0, 0, 0)' ).join( ', ' );\n\n\t}\n\n\tconst array = [];\n\n\tfor ( let i = 0; i < attribute.count; i ++ ) {\n\n\t\tconst x = attribute.getX( i );\n\t\tconst y = attribute.getY( i );\n\t\tconst z = attribute.getZ( i );\n\n\t\tarray.push(\n\t\t\t`(${x.toPrecision( PRECISION )}, ${y.toPrecision(\n\t\t\t\tPRECISION\n\t\t\t)}, ${z.toPrecision( PRECISION )})`\n\t\t);\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\nfunction buildVector2Array( attribute ) {\n\n\tconst array = [];\n\n\tfor ( let i = 0; i < attribute.count; i ++ ) {\n\n\t\tconst x = attribute.getX( i );\n\t\tconst y = attribute.getY( i );\n\n\t\tarray.push(\n\t\t\t`(${x.toPrecision( PRECISION )}, ${1 - y.toPrecision( PRECISION )})`\n\t\t);\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\n// Materials\n\nfunction buildMaterials( materials, textures, quickLookCompatible = false ) {\n\n\tconst materialsNode = new USDNode( 'Materials' );\n\n\tfor ( const uuid in materials ) {\n\n\t\tconst material = materials[ uuid ];\n\n\t\tmaterialsNode.addChild(\n\t\t\tbuildMaterial( material, textures, quickLookCompatible )\n\t\t);\n\n\t}\n\n\treturn materialsNode;\n\n}\n\nfunction buildMaterial( material, textures, quickLookCompatible = false ) {\n\n\t// https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html\n\n\tconst materialNode = new USDNode( `Material_${material.id}`, 'Material' );\n\n\tfunction buildTextureNodes( texture, mapType, color ) {\n\n\t\tconst id = texture.source.id + '_' + texture.flipY;\n\n\t\ttextures[ id ] = texture;\n\n\t\tconst uv = texture.channel > 0 ? 'st' + texture.channel : 'st';\n\n\t\tconst WRAPPINGS = {\n\t\t\t1000: 'repeat', // RepeatWrapping\n\t\t\t1001: 'clamp', // ClampToEdgeWrapping\n\t\t\t1002: 'mirror', // MirroredRepeatWrapping\n\t\t};\n\n\t\tconst repeat = texture.repeat.clone();\n\t\tconst offset = texture.offset.clone();\n\t\tconst rotation = texture.rotation;\n\n\t\t// rotation is around the wrong point. after rotation we need to shift offset again so that we're rotating around the right spot\n\t\tconst xRotationOffset = Math.sin( rotation );\n\t\tconst yRotationOffset = Math.cos( rotation );\n\n\t\t// texture coordinates start in the opposite corner, need to correct\n\t\toffset.y = 1 - offset.y - repeat.y;\n\n\t\t// turns out QuickLook is buggy and interprets texture repeat inverted/applies operations in a different order.\n\t\t// Apple Feedback: \tFB10036297 and FB11442287\n\t\tif ( quickLookCompatible ) {\n\n\t\t\t// This is NOT correct yet in QuickLook, but comes close for a range of models.\n\t\t\t// It becomes more incorrect the bigger the offset is\n\n\t\t\toffset.x = offset.x / repeat.x;\n\t\t\toffset.y = offset.y / repeat.y;\n\n\t\t\toffset.x += xRotationOffset / repeat.x;\n\t\t\toffset.y += yRotationOffset - 1;\n\n\t\t} else {\n\n\t\t\t// results match glTF results exactly. verified correct in usdview.\n\t\t\toffset.x += xRotationOffset * repeat.x;\n\t\t\toffset.y += ( 1 - yRotationOffset ) * repeat.y;\n\n\t\t}\n\n\t\tconst primvarReaderNode = new USDNode( `PrimvarReader_${mapType}`, 'Shader' );\n\t\tprimvarReaderNode.addProperty(\n\t\t\t'uniform token info:id = \"UsdPrimvarReader_float2\"'\n\t\t);\n\t\tprimvarReaderNode.addProperty( 'float2 inputs:fallback = (0.0, 0.0)' );\n\t\tprimvarReaderNode.addProperty( `string inputs:varname = \"${uv}\"` );\n\t\tprimvarReaderNode.addProperty( 'float2 outputs:result' );\n\n\t\tconst transform2dNode = new USDNode( `Transform2d_${mapType}`, 'Shader' );\n\t\ttransform2dNode.addProperty( 'uniform token info:id = \"UsdTransform2d\"' );\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:in.connect = </Materials/Material_${material.id}/PrimvarReader_${mapType}.outputs:result>`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float inputs:rotation = ${( rotation * ( 180 / Math.PI ) ).toFixed(\n\t\t\t\tPRECISION\n\t\t\t)}`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:scale = ${buildVector2( repeat )}`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:translation = ${buildVector2( offset )}`\n\t\t);\n\t\ttransform2dNode.addProperty( 'float2 outputs:result' );\n\n\t\tconst textureNode = new USDNode(\n\t\t\t`Texture_${texture.id}_${mapType}`,\n\t\t\t'Shader'\n\t\t);\n\t\ttextureNode.addProperty( 'uniform token info:id = \"UsdUVTexture\"' );\n\t\ttextureNode.addProperty( `asset inputs:file = @textures/Texture_${id}.png@` );\n\t\ttextureNode.addProperty(\n\t\t\t`float2 inputs:st.connect = </Materials/Material_${material.id}/Transform2d_${mapType}.outputs:result>`\n\t\t);\n\n\t\tif ( color !== undefined ) {\n\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = ${buildColor4( color )}` );\n\n\t\t}\n\n\t\tif ( mapType === 'normal' ) {\n\n\t\t\ttextureNode.addProperty( 'float4 inputs:scale = (2, 2, 2, 1)' );\n\t\t\ttextureNode.addProperty( 'float4 inputs:bias = (-1, -1, -1, 0)' );\n\n\t\t}\n\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:sourceColorSpace = \"${\n\t\t\t\ttexture.colorSpace === NoColorSpace ? 'raw' : 'sRGB'\n\t\t\t}\"`\n\t\t);\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:wrapS = \"${WRAPPINGS[ texture.wrapS ]}\"`\n\t\t);\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:wrapT = \"${WRAPPINGS[ texture.wrapT ]}\"`\n\t\t);\n\t\ttextureNode.addProperty( 'float outputs:r' );\n\t\ttextureNode.addProperty( 'float outputs:g' );\n\t\ttextureNode.addProperty( 'float outputs:b' );\n\t\ttextureNode.addProperty( 'float3 outputs:rgb' );\n\n\t\tif ( material.transparent || material.alphaTest > 0.0 ) {\n\n\t\t\ttextureNode.addProperty( 'float outputs:a' );\n\n\t\t}\n\n\t\treturn [ primvarReaderNode, transform2dNode, textureNode ];\n\n\t}\n\n\tif ( material.side === DoubleSide ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support double sided materials',\n\t\t\tmaterial\n\t\t);\n\n\t}\n\n\tconst previewSurfaceNode = new USDNode( 'PreviewSurface', 'Shader' );\n\tpreviewSurfaceNode.addProperty( 'uniform token info:id = \"UsdPreviewSurface\"' );\n\n\tif ( material.map !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:diffuseColor.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:rgb>`\n\t\t);\n\n\t\tif ( material.transparent ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:a>`\n\t\t\t);\n\n\t\t} else if ( material.alphaTest > 0.0 ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:a>`\n\t\t\t);\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacityThreshold = ${material.alphaTest}`\n\t\t\t);\n\n\t\t}\n\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.map,\n\t\t\t'diffuse',\n\t\t\tmaterial.color\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:diffuseColor = ${buildColor( material.color )}`\n\t\t);\n\n\t}\n\n\tif ( material.emissiveMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:emissiveColor.connect = </Materials/Material_${material.id}/Texture_${material.emissiveMap.id}_emissive.outputs:rgb>`\n\t\t);\n\n\t\tconst emissiveColor = new Color(\n\t\t\tmaterial.emissive.r * material.emissiveIntensity,\n\t\t\tmaterial.emissive.g * material.emissiveIntensity,\n\t\t\tmaterial.emissive.b * material.emissiveIntensity\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.emissiveMap,\n\t\t\t'emissive',\n\t\t\temissiveColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else if ( material.emissive.getHex() > 0 ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:emissiveColor = ${buildColor( material.emissive )}`\n\t\t);\n\n\t}\n\n\tif ( material.normalMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`normal3f inputs:normal.connect = </Materials/Material_${material.id}/Texture_${material.normalMap.id}_normal.outputs:rgb>`\n\t\t);\n\n\t\tconst textureNodes = buildTextureNodes( material.normalMap, 'normal' );\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t}\n\n\tif ( material.aoMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:occlusion.connect = </Materials/Material_${material.id}/Texture_${material.aoMap.id}_occlusion.outputs:r>`\n\t\t);\n\n\t\tconst aoColor = new Color(\n\t\t\tmaterial.aoMapIntensity,\n\t\t\tmaterial.aoMapIntensity,\n\t\t\tmaterial.aoMapIntensity\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.aoMap,\n\t\t\t'occlusion',\n\t\t\taoColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t}\n\n\tif ( material.roughnessMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:roughness.connect = </Materials/Material_${material.id}/Texture_${material.roughnessMap.id}_roughness.outputs:g>`\n\t\t);\n\n\t\tconst roughnessColor = new Color(\n\t\t\tmaterial.roughness,\n\t\t\tmaterial.roughness,\n\t\t\tmaterial.roughness\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.roughnessMap,\n\t\t\t'roughness',\n\t\t\troughnessColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:roughness = ${material.roughness}`\n\t\t);\n\n\t}\n\n\tif ( material.metalnessMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:metallic.connect = </Materials/Material_${material.id}/Texture_${material.metalnessMap.id}_metallic.outputs:b>`\n\t\t);\n\n\t\tconst metalnessColor = new Color(\n\t\t\tmaterial.metalness,\n\t\t\tmaterial.metalness,\n\t\t\tmaterial.metalness\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.metalnessMap,\n\t\t\t'metallic',\n\t\t\tmetalnessColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:metallic = ${material.metalness}`\n\t\t);\n\n\t}\n\n\tif ( material.alphaMap !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.alphaMap.id}_opacity.outputs:r>`\n\t\t);\n\t\tpreviewSurfaceNode.addProperty( 'float inputs:opacityThreshold = 0.0001' );\n\n\t\tconst textureNodes = buildTextureNodes( material.alphaMap, 'opacity' );\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:opacity = ${material.opacity}`\n\t\t);\n\n\t}\n\n\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\tif ( material.clearcoatMap !== null ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoat.connect = </Materials/Material_${material.id}/Texture_${material.clearcoatMap.id}_clearcoat.outputs:r>`\n\t\t\t);\n\n\t\t\tconst clearcoatColor = new Color(\n\t\t\t\tmaterial.clearcoat,\n\t\t\t\tmaterial.clearcoat,\n\t\t\t\tmaterial.clearcoat\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.clearcoatMap,\n\t\t\t\t'clearcoat',\n\t\t\t\tclearcoatColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoat = ${material.clearcoat}`\n\t\t\t);\n\n\t\t}\n\n\t\tif ( material.clearcoatRoughnessMap !== null ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoatRoughness.connect = </Materials/Material_${material.id}/Texture_${material.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`\n\t\t\t);\n\n\t\t\tconst clearcoatRoughnessColor = new Color(\n\t\t\t\tmaterial.clearcoatRoughness,\n\t\t\t\tmaterial.clearcoatRoughness,\n\t\t\t\tmaterial.clearcoatRoughness\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.clearcoatRoughnessMap,\n\t\t\t\t'clearcoatRoughness',\n\t\t\t\tclearcoatRoughnessColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoatRoughness = ${material.clearcoatRoughness}`\n\t\t\t);\n\n\t\t}\n\n\t\tpreviewSurfaceNode.addProperty( `float inputs:ior = ${material.ior}` );\n\n\t}\n\n\tpreviewSurfaceNode.addProperty( 'int inputs:useSpecularWorkflow = 0' );\n\tpreviewSurfaceNode.addProperty( 'token outputs:surface' );\n\n\tmaterialNode.addChild( previewSurfaceNode );\n\n\tmaterialNode.addProperty(\n\t\t`token outputs:surface.connect = </Materials/Material_${material.id}/PreviewSurface.outputs:surface>`\n\t);\n\n\treturn materialNode;\n\n}\n\nfunction buildColor( color ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b})`;\n\n}\n\nfunction buildColor4( color ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b}, 1.0)`;\n\n}\n\nfunction buildVector2( vector ) {\n\n\treturn `(${vector.x}, ${vector.y})`;\n\n}\n\nfunction buildCamera( camera, usedNames ) {\n\n\tconst name = getName( camera, usedNames );\n\n\tconst transform = buildMatrix( camera.matrix );\n\n\tif ( camera.matrix.determinant() < 0 ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support negative scales',\n\t\t\tcamera\n\t\t);\n\n\t}\n\n\tconst node = new USDNode( name, 'Camera' );\n\tnode.addProperty( `matrix4d xformOp:transform = ${transform}` );\n\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:transform\"]' );\n\n\tconst projection = camera.isOrthographicCamera\n\t\t? 'orthographic'\n\t\t: 'perspective';\n\tnode.addProperty( `token projection = \"${projection}\"` );\n\n\tconst clippingRange = `(${camera.near.toPrecision(\n\t\tPRECISION\n\t)}, ${camera.far.toPrecision( PRECISION )})`;\n\tnode.addProperty( `float2 clippingRange = ${clippingRange}` );\n\n\tlet horizontalAperture;\n\tif ( camera.isOrthographicCamera ) {\n\n\t\thorizontalAperture = (\n\t\t\t( Math.abs( camera.left ) + Math.abs( camera.right ) ) *\n\t\t\t10\n\t\t).toPrecision( PRECISION );\n\n\t} else {\n\n\t\thorizontalAperture = camera.getFilmWidth().toPrecision( PRECISION );\n\n\t}\n\n\tnode.addProperty( `float horizontalAperture = ${horizontalAperture}` );\n\n\tlet verticalAperture;\n\tif ( camera.isOrthographicCamera ) {\n\n\t\tverticalAperture = (\n\t\t\t( Math.abs( camera.top ) + Math.abs( camera.bottom ) ) *\n\t\t\t10\n\t\t).toPrecision( PRECISION );\n\n\t} else {\n\n\t\tverticalAperture = camera.getFilmHeight().toPrecision( PRECISION );\n\n\t}\n\n\tnode.addProperty( `float verticalAperture = ${verticalAperture}` );\n\n\tif ( camera.isPerspectiveCamera ) {\n\n\t\tconst focalLength = camera.getFocalLength().toPrecision( PRECISION );\n\t\tnode.addProperty( `float focalLength = ${focalLength}` );\n\n\t\tconst focusDistance = camera.focus.toPrecision( PRECISION );\n\t\tnode.addProperty( `float focusDistance = ${focusDistance}` );\n\n\t}\n\n\treturn node;\n\n}\n\n/**\n * Export options of `USDZExporter`.\n *\n * @typedef {Object} USDZExporter~Options\n * @property {number} [maxTextureSize=1024] - The maximum texture size that is going to be exported.\n * @property {boolean} [includeAnchoringProperties=true] - Whether to include anchoring properties or not.\n * @property {boolean} [onlyVisible=true] - Export only visible 3D objects.\n * @property {Object} [ar] - If `includeAnchoringProperties` is set to `true`, the anchoring type and alignment\n * can be configured via `ar.anchoring.type` and `ar.planeAnchoring.alignment`.\n * @property {boolean} [quickLookCompatible=false] - Whether to make the exported USDZ compatible to QuickLook\n * which means the asset is modified to accommodate the bugs FB10036297 and FB11442287 (Apple Feedback).\n **/\n\n/**\n * onDone callback of `USDZExporter`.\n *\n * @callback USDZExporter~OnDone\n * @param {ArrayBuffer} result - The generated USDZ.\n */\n\n/**\n * onError callback of `USDZExporter`.\n *\n * @callback USDZExporter~OnError\n * @param {Error} error - The error object.\n */\n\nexport { USDZExporter };\n"],"x_google_ignoreList":[0],"mappings":";;;AAWA,IAAM,IAAN,MAAc;CAEb,YAAa,GAAM,IAAO,IAAI,IAAW,EAAE,EAAE,IAAa,EAAE,EAAG;AAM9D,EAJA,KAAK,OAAO,GACZ,KAAK,OAAO,GACZ,KAAK,WAAW,GAChB,KAAK,aAAa,GAClB,KAAK,WAAW,EAAE;;CAInB,YAAa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,IAAK,EAAO,MAAO,IACpD,IACC,YAAa,EAAW,GAIL,EAAO,cAAc,CAAC,YAAa,EAAW,EAIpE,EAAK,YAAa,8BAA8B,IAAsB;CAEtE,IAAI;AAgBJ,KAfA,AASC,IATI,EAAO,yBAGR,KAAK,IAAK,EAAO,IAAK,GAAG,KAAK,IAAK,EAAO,OAAQ,IACpD,IACC,YAAa,EAAW,GAIP,EAAO,eAAe,CAAC,YAAa,EAAW,EAInE,EAAK,YAAa,4BAA4B,IAAoB,EAE7D,EAAO,qBAAsB;EAEjC,IAAM,IAAc,EAAO,gBAAgB,CAAC,YAAa,EAAW;AACpE,IAAK,YAAa,uBAAuB,IAAe;EAExD,IAAM,IAAgB,EAAO,MAAM,YAAa,EAAW;AAC3D,IAAK,YAAa,yBAAyB,IAAiB;;AAI7D,QAAO"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { p as e } from "./Object3D-DSjIOhON.mjs";
|
|
2
|
+
//#region ../../node_modules/three/src/math/Vector4.js
|
|
3
|
+
var t = class t {
|
|
4
|
+
constructor(e = 0, n = 0, r = 0, i = 1) {
|
|
5
|
+
t.prototype.isVector4 = !0, this.x = e, this.y = n, this.z = r, this.w = i;
|
|
6
|
+
}
|
|
7
|
+
get width() {
|
|
8
|
+
return this.z;
|
|
9
|
+
}
|
|
10
|
+
set width(e) {
|
|
11
|
+
this.z = e;
|
|
12
|
+
}
|
|
13
|
+
get height() {
|
|
14
|
+
return this.w;
|
|
15
|
+
}
|
|
16
|
+
set height(e) {
|
|
17
|
+
this.w = e;
|
|
18
|
+
}
|
|
19
|
+
set(e, t, n, r) {
|
|
20
|
+
return this.x = e, this.y = t, this.z = n, this.w = r, this;
|
|
21
|
+
}
|
|
22
|
+
setScalar(e) {
|
|
23
|
+
return this.x = e, this.y = e, this.z = e, this.w = e, this;
|
|
24
|
+
}
|
|
25
|
+
setX(e) {
|
|
26
|
+
return this.x = e, this;
|
|
27
|
+
}
|
|
28
|
+
setY(e) {
|
|
29
|
+
return this.y = e, this;
|
|
30
|
+
}
|
|
31
|
+
setZ(e) {
|
|
32
|
+
return this.z = e, this;
|
|
33
|
+
}
|
|
34
|
+
setW(e) {
|
|
35
|
+
return this.w = e, this;
|
|
36
|
+
}
|
|
37
|
+
setComponent(e, t) {
|
|
38
|
+
switch (e) {
|
|
39
|
+
case 0:
|
|
40
|
+
this.x = t;
|
|
41
|
+
break;
|
|
42
|
+
case 1:
|
|
43
|
+
this.y = t;
|
|
44
|
+
break;
|
|
45
|
+
case 2:
|
|
46
|
+
this.z = t;
|
|
47
|
+
break;
|
|
48
|
+
case 3:
|
|
49
|
+
this.w = t;
|
|
50
|
+
break;
|
|
51
|
+
default: throw Error("index is out of range: " + e);
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
getComponent(e) {
|
|
56
|
+
switch (e) {
|
|
57
|
+
case 0: return this.x;
|
|
58
|
+
case 1: return this.y;
|
|
59
|
+
case 2: return this.z;
|
|
60
|
+
case 3: return this.w;
|
|
61
|
+
default: throw Error("index is out of range: " + e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
clone() {
|
|
65
|
+
return new this.constructor(this.x, this.y, this.z, this.w);
|
|
66
|
+
}
|
|
67
|
+
copy(e) {
|
|
68
|
+
return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w === void 0 ? 1 : e.w, this;
|
|
69
|
+
}
|
|
70
|
+
add(e) {
|
|
71
|
+
return this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this;
|
|
72
|
+
}
|
|
73
|
+
addScalar(e) {
|
|
74
|
+
return this.x += e, this.y += e, this.z += e, this.w += e, this;
|
|
75
|
+
}
|
|
76
|
+
addVectors(e, t) {
|
|
77
|
+
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this;
|
|
78
|
+
}
|
|
79
|
+
addScaledVector(e, t) {
|
|
80
|
+
return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this;
|
|
81
|
+
}
|
|
82
|
+
sub(e) {
|
|
83
|
+
return this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this;
|
|
84
|
+
}
|
|
85
|
+
subScalar(e) {
|
|
86
|
+
return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this;
|
|
87
|
+
}
|
|
88
|
+
subVectors(e, t) {
|
|
89
|
+
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this;
|
|
90
|
+
}
|
|
91
|
+
multiply(e) {
|
|
92
|
+
return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this;
|
|
93
|
+
}
|
|
94
|
+
multiplyScalar(e) {
|
|
95
|
+
return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this;
|
|
96
|
+
}
|
|
97
|
+
applyMatrix4(e) {
|
|
98
|
+
let t = this.x, n = this.y, r = this.z, i = this.w, a = e.elements;
|
|
99
|
+
return this.x = a[0] * t + a[4] * n + a[8] * r + a[12] * i, this.y = a[1] * t + a[5] * n + a[9] * r + a[13] * i, this.z = a[2] * t + a[6] * n + a[10] * r + a[14] * i, this.w = a[3] * t + a[7] * n + a[11] * r + a[15] * i, this;
|
|
100
|
+
}
|
|
101
|
+
divide(e) {
|
|
102
|
+
return this.x /= e.x, this.y /= e.y, this.z /= e.z, this.w /= e.w, this;
|
|
103
|
+
}
|
|
104
|
+
divideScalar(e) {
|
|
105
|
+
return this.multiplyScalar(1 / e);
|
|
106
|
+
}
|
|
107
|
+
setAxisAngleFromQuaternion(e) {
|
|
108
|
+
this.w = 2 * Math.acos(e.w);
|
|
109
|
+
let t = Math.sqrt(1 - e.w * e.w);
|
|
110
|
+
return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this;
|
|
111
|
+
}
|
|
112
|
+
setAxisAngleFromRotationMatrix(e) {
|
|
113
|
+
let t, n, r, i, a = .01, o = .1, s = e.elements, c = s[0], l = s[4], u = s[8], d = s[1], f = s[5], p = s[9], m = s[2], h = s[6], g = s[10];
|
|
114
|
+
if (Math.abs(l - d) < a && Math.abs(u - m) < a && Math.abs(p - h) < a) {
|
|
115
|
+
if (Math.abs(l + d) < o && Math.abs(u + m) < o && Math.abs(p + h) < o && Math.abs(c + f + g - 3) < o) return this.set(1, 0, 0, 0), this;
|
|
116
|
+
t = Math.PI;
|
|
117
|
+
let e = (c + 1) / 2, s = (f + 1) / 2, _ = (g + 1) / 2, v = (l + d) / 4, y = (u + m) / 4, b = (p + h) / 4;
|
|
118
|
+
return e > s && e > _ ? e < a ? (n = 0, r = .707106781, i = .707106781) : (n = Math.sqrt(e), r = v / n, i = y / n) : s > _ ? s < a ? (n = .707106781, r = 0, i = .707106781) : (r = Math.sqrt(s), n = v / r, i = b / r) : _ < a ? (n = .707106781, r = .707106781, i = 0) : (i = Math.sqrt(_), n = y / i, r = b / i), this.set(n, r, i, t), this;
|
|
119
|
+
}
|
|
120
|
+
let _ = Math.sqrt((h - p) * (h - p) + (u - m) * (u - m) + (d - l) * (d - l));
|
|
121
|
+
return Math.abs(_) < .001 && (_ = 1), this.x = (h - p) / _, this.y = (u - m) / _, this.z = (d - l) / _, this.w = Math.acos((c + f + g - 1) / 2), this;
|
|
122
|
+
}
|
|
123
|
+
setFromMatrixPosition(e) {
|
|
124
|
+
let t = e.elements;
|
|
125
|
+
return this.x = t[12], this.y = t[13], this.z = t[14], this.w = t[15], this;
|
|
126
|
+
}
|
|
127
|
+
min(e) {
|
|
128
|
+
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this;
|
|
129
|
+
}
|
|
130
|
+
max(e) {
|
|
131
|
+
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this;
|
|
132
|
+
}
|
|
133
|
+
clamp(t, n) {
|
|
134
|
+
return this.x = e(this.x, t.x, n.x), this.y = e(this.y, t.y, n.y), this.z = e(this.z, t.z, n.z), this.w = e(this.w, t.w, n.w), this;
|
|
135
|
+
}
|
|
136
|
+
clampScalar(t, n) {
|
|
137
|
+
return this.x = e(this.x, t, n), this.y = e(this.y, t, n), this.z = e(this.z, t, n), this.w = e(this.w, t, n), this;
|
|
138
|
+
}
|
|
139
|
+
clampLength(t, n) {
|
|
140
|
+
let r = this.length();
|
|
141
|
+
return this.divideScalar(r || 1).multiplyScalar(e(r, t, n));
|
|
142
|
+
}
|
|
143
|
+
floor() {
|
|
144
|
+
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
|
|
145
|
+
}
|
|
146
|
+
ceil() {
|
|
147
|
+
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
|
|
148
|
+
}
|
|
149
|
+
round() {
|
|
150
|
+
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
|
|
151
|
+
}
|
|
152
|
+
roundToZero() {
|
|
153
|
+
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
|
|
154
|
+
}
|
|
155
|
+
negate() {
|
|
156
|
+
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
|
|
157
|
+
}
|
|
158
|
+
dot(e) {
|
|
159
|
+
return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
|
|
160
|
+
}
|
|
161
|
+
lengthSq() {
|
|
162
|
+
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
|
|
163
|
+
}
|
|
164
|
+
length() {
|
|
165
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
|
|
166
|
+
}
|
|
167
|
+
manhattanLength() {
|
|
168
|
+
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
|
|
169
|
+
}
|
|
170
|
+
normalize() {
|
|
171
|
+
return this.divideScalar(this.length() || 1);
|
|
172
|
+
}
|
|
173
|
+
setLength(e) {
|
|
174
|
+
return this.normalize().multiplyScalar(e);
|
|
175
|
+
}
|
|
176
|
+
lerp(e, t) {
|
|
177
|
+
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this;
|
|
178
|
+
}
|
|
179
|
+
lerpVectors(e, t, n) {
|
|
180
|
+
return this.x = e.x + (t.x - e.x) * n, this.y = e.y + (t.y - e.y) * n, this.z = e.z + (t.z - e.z) * n, this.w = e.w + (t.w - e.w) * n, this;
|
|
181
|
+
}
|
|
182
|
+
equals(e) {
|
|
183
|
+
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;
|
|
184
|
+
}
|
|
185
|
+
fromArray(e, t = 0) {
|
|
186
|
+
return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this;
|
|
187
|
+
}
|
|
188
|
+
toArray(e = [], t = 0) {
|
|
189
|
+
return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e;
|
|
190
|
+
}
|
|
191
|
+
fromBufferAttribute(e, t) {
|
|
192
|
+
return this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this;
|
|
193
|
+
}
|
|
194
|
+
random() {
|
|
195
|
+
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
|
|
196
|
+
}
|
|
197
|
+
*[Symbol.iterator]() {
|
|
198
|
+
yield this.x, yield this.y, yield this.z, yield this.w;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { t };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=Vector4-DGmBYfpK.mjs.map
|