@roomle/web-sdk 5.1.0-alpha.2 → 5.1.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.
Files changed (113) hide show
  1. package/lib/{BufferGeometry-Cd2ewNVQ.mjs → BufferGeometry-Bl5whHAB.mjs} +1 -1
  2. package/lib/{BufferGeometry-Cd2ewNVQ.mjs.map → BufferGeometry-Bl5whHAB.mjs.map} +1 -1
  3. package/lib/ConfiguratorKernel.js +2 -2
  4. package/lib/ConfiguratorKernel.wasm +0 -0
  5. package/lib/{GLTFExporter-n80QLoDf.mjs → GLTFExporter-yQ7mMauu.mjs} +1 -1
  6. package/lib/{GLTFExporter-n80QLoDf.mjs.map → GLTFExporter-yQ7mMauu.mjs.map} +1 -1
  7. package/lib/{GaussianBlurNode-Cwy3kx8H.mjs → GaussianBlurNode-DNBEf5-n.mjs} +14 -14
  8. package/lib/{GaussianBlurNode-Cwy3kx8H.mjs.map → GaussianBlurNode-DNBEf5-n.mjs.map} +1 -1
  9. package/lib/{PointLightHelper-DlPLsDNy.mjs → PointLightHelper-CuPSBuDU.mjs} +2 -2
  10. package/lib/{PointLightHelper-DlPLsDNy.mjs.map → PointLightHelper-CuPSBuDU.mjs.map} +1 -1
  11. package/lib/RoomleCore.wasm +0 -0
  12. package/lib/RoomleToolsCore.wasm +0 -0
  13. package/lib/{SpotLightHelper-YWHbVXAF.mjs → SpotLightHelper-m-Rh8vGU.mjs} +2 -2
  14. package/lib/{SpotLightHelper-YWHbVXAF.mjs.map → SpotLightHelper-m-Rh8vGU.mjs.map} +1 -1
  15. package/lib/{USDZExporter-Bm-c5e_n.mjs → USDZExporter-MdkuT226.mjs} +1 -1
  16. package/lib/{USDZExporter-Bm-c5e_n.mjs.map → USDZExporter-MdkuT226.mjs.map} +1 -1
  17. package/lib/{api-B5wIZIHt.mjs → api-Bznmr-xZ.mjs} +2 -2
  18. package/lib/{api-B5wIZIHt.mjs.map → api-Bznmr-xZ.mjs.map} +1 -1
  19. package/lib/{asset-loader.worker-CE4O0JU-.mjs → asset-loader.worker-CzI1oyTY.mjs} +1 -1
  20. package/lib/asset-loader.worker-CzI1oyTY.mjs.map +1 -0
  21. package/lib/{banana-for-scale-D0bw51dn.mjs → banana-for-scale-DpKXNBt_.mjs} +2 -2
  22. package/lib/{banana-for-scale-D0bw51dn.mjs.map → banana-for-scale-DpKXNBt_.mjs.map} +1 -1
  23. package/lib/{budgeteer.sw-yR2xApHT.mjs → budgeteer.sw-D80jTmYa.mjs} +1 -1
  24. package/lib/budgeteer.sw-D80jTmYa.mjs.map +1 -0
  25. package/lib/{component-dimensioning-VIUcXV7r.mjs → component-dimensioning-BaUqwqYJ.mjs} +4 -4
  26. package/lib/{component-dimensioning-VIUcXV7r.mjs.map → component-dimensioning-BaUqwqYJ.mjs.map} +1 -1
  27. package/lib/{component-raycast-helper-CEAdBcdx.mjs → component-raycast-helper-4i8b4E5B.mjs} +3 -3
  28. package/lib/{component-raycast-helper-CEAdBcdx.mjs.map → component-raycast-helper-4i8b4E5B.mjs.map} +1 -1
  29. package/lib/configurator-BYQdWEvf.mjs +2 -0
  30. package/lib/{configurator-CxlLvBCx.mjs → configurator-CDw_c6tB.mjs} +4 -4
  31. package/lib/{configurator-CxlLvBCx.mjs.map → configurator-CDw_c6tB.mjs.map} +1 -1
  32. package/lib/{continuous-drawing-helper-Dr1r-5N2.mjs → continuous-drawing-helper-DqHIR_qF.mjs} +1 -1
  33. package/lib/{continuous-drawing-helper-Dr1r-5N2.mjs.map → continuous-drawing-helper-DqHIR_qF.mjs.map} +1 -1
  34. package/lib/{dimensioning-helper-ChQDwSjn.mjs → dimensioning-helper-CGPjS2hW.mjs} +2 -2
  35. package/lib/{dimensioning-helper-ChQDwSjn.mjs.map → dimensioning-helper-CGPjS2hW.mjs.map} +1 -1
  36. package/lib/dimensioning-helper-VndKlIXS.mjs +2 -0
  37. package/lib/{glb-viewer-27e6wfY4.mjs → glb-viewer-B-Zr743e.mjs} +4 -4
  38. package/lib/{glb-viewer-27e6wfY4.mjs.map → glb-viewer-B-Zr743e.mjs.map} +1 -1
  39. package/lib/glb-viewer-Bd5Xn6Oq.mjs +2 -0
  40. package/lib/{highlight-coordinator-C05kDjj5.mjs → highlight-coordinator-4gkjde82.mjs} +2 -2
  41. package/lib/{highlight-coordinator-C05kDjj5.mjs.map → highlight-coordinator-4gkjde82.mjs.map} +1 -1
  42. package/lib/{homag-intelligence-BRQ1WoQo.mjs → homag-intelligence-D7S7r-Gc.mjs} +3 -3
  43. package/lib/{homag-intelligence-BRQ1WoQo.mjs.map → homag-intelligence-D7S7r-Gc.mjs.map} +1 -1
  44. package/lib/hosek-wilkie-sky-iMar2iw-.mjs +3755 -0
  45. package/lib/hosek-wilkie-sky-iMar2iw-.mjs.map +1 -0
  46. package/lib/{imos-ix-poc-export-helper-DhxAAMc9.mjs → imos-ix-poc-export-helper-CyGqK7nu.mjs} +1 -1
  47. package/lib/{imos-ix-poc-export-helper-DhxAAMc9.mjs.map → imos-ix-poc-export-helper-CyGqK7nu.mjs.map} +1 -1
  48. package/lib/kernel-BWfRHWkW.mjs.map +1 -1
  49. package/lib/{layer-DaGoZ5YI.mjs → layer-DRMDGxT7.mjs} +2 -2
  50. package/lib/layer-DRMDGxT7.mjs.map +1 -0
  51. package/lib/{material-viewer-Byi5t7-x.mjs → material-viewer-CTsSfTfL.mjs} +4 -4
  52. package/lib/{material-viewer-Byi5t7-x.mjs.map → material-viewer-CTsSfTfL.mjs.map} +1 -1
  53. package/lib/{packages-3jOdcfbr.mjs → packages-BXAZEcKa.mjs} +5 -5
  54. package/lib/{packages-3jOdcfbr.mjs.map → packages-BXAZEcKa.mjs.map} +1 -1
  55. package/lib/planner-DMk3T4ts.mjs +2 -0
  56. package/lib/{planner-BeINcWRR.mjs → planner-jvLAnYww.mjs} +3 -3
  57. package/lib/{planner-BeINcWRR.mjs.map → planner-jvLAnYww.mjs.map} +1 -1
  58. package/lib/{plugin-system-DR5maiUo.mjs → plugin-system-CRaC04G5.mjs} +2 -2
  59. package/lib/{plugin-system-DR5maiUo.mjs.map → plugin-system-CRaC04G5.mjs.map} +1 -1
  60. package/lib/roomle-headless.d.ts +183 -8
  61. package/lib/roomle-headless.js +11 -11
  62. package/lib/roomle-renderer-Ato6RMrd.mjs.map +1 -1
  63. package/lib/{roomle-sdk-CsSQAqQG.mjs → roomle-sdk-CBwhwX_e.mjs} +3364 -3158
  64. package/lib/roomle-sdk-CBwhwX_e.mjs.map +1 -0
  65. package/lib/roomle-sdk.d.ts +183 -8
  66. package/lib/roomle-sdk.js +8 -8
  67. package/lib/{roomle-webgpu-renderer-BBE14A8V.mjs → roomle-webgpu-renderer-BfZKcXSz.mjs} +349 -344
  68. package/lib/{roomle-webgpu-renderer-BBE14A8V.mjs.map → roomle-webgpu-renderer-BfZKcXSz.mjs.map} +1 -1
  69. package/lib/{scene-renderer-B8SBMSQ7.mjs → scene-renderer-BHYZac3H.mjs} +3 -3
  70. package/lib/{scene-renderer-B8SBMSQ7.mjs.map → scene-renderer-BHYZac3H.mjs.map} +1 -1
  71. package/lib/{script-loader-Dx3gOiB3.mjs → script-loader-CvnG6LgL.mjs} +2 -2
  72. package/lib/{script-loader-Dx3gOiB3.mjs.map → script-loader-CvnG6LgL.mjs.map} +1 -1
  73. package/lib/src-Bbq3Hqzn.mjs +2 -0
  74. package/lib/src-HhklrVDg.mjs +1950 -0
  75. package/lib/src-HhklrVDg.mjs.map +1 -0
  76. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  77. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +16 -0
  78. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js +5 -1
  79. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
  80. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +2 -8
  81. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js +1 -5
  82. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
  83. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +2 -2
  84. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  85. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  86. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  87. package/lib/{stats-helper-W654V5ay.mjs → stats-helper-PndcZCzL.mjs} +2 -2
  88. package/lib/{stats-helper-W654V5ay.mjs.map → stats-helper-PndcZCzL.mjs.map} +1 -1
  89. package/lib/three.tsl-BTc4fg8T.mjs +2 -0
  90. package/lib/{three.tsl-B7hcNZE8.mjs → three.tsl-Cf0-sCqB.mjs} +70 -66
  91. package/lib/{three.tsl-B7hcNZE8.mjs.map → three.tsl-Cf0-sCqB.mjs.map} +1 -1
  92. package/lib/{threejs-utils-WK7Uu2TS.mjs → threejs-utils-v1uOvccg.mjs} +175 -184
  93. package/lib/threejs-utils-v1uOvccg.mjs.map +1 -0
  94. package/lib/{tools-core-CWrR_N9g.mjs → tools-core-B29U-88K.mjs} +3 -3
  95. package/lib/{tools-core-CWrR_N9g.mjs.map → tools-core-B29U-88K.mjs.map} +1 -1
  96. package/lib/webgpu-BHAP6BLI.mjs +3140 -0
  97. package/lib/webgpu-BHAP6BLI.mjs.map +1 -0
  98. package/lib/workers-B_wmKVL0.mjs +6 -0
  99. package/lib/{workers-B-AqdQMe.mjs.map → workers-B_wmKVL0.mjs.map} +1 -1
  100. package/package.json +2 -2
  101. package/lib/asset-loader.worker-CE4O0JU-.mjs.map +0 -1
  102. package/lib/budgeteer.sw-yR2xApHT.mjs.map +0 -1
  103. package/lib/configurator-h8QoUnMz.mjs +0 -2
  104. package/lib/dimensioning-helper-BEGkpZFA.mjs +0 -2
  105. package/lib/glb-viewer-Dc2Tl8Ef.mjs +0 -2
  106. package/lib/layer-DaGoZ5YI.mjs.map +0 -1
  107. package/lib/planner-Ler1UMAp.mjs +0 -2
  108. package/lib/roomle-sdk-CsSQAqQG.mjs.map +0 -1
  109. package/lib/three.tsl-BBUCm-uB.mjs +0 -2
  110. package/lib/threejs-utils-WK7Uu2TS.mjs.map +0 -1
  111. package/lib/webgpu-DSecxaB8.mjs +0 -5084
  112. package/lib/webgpu-DSecxaB8.mjs.map +0 -1
  113. package/lib/workers-B-AqdQMe.mjs +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"USDZExporter-Bm-c5e_n.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/exporters/USDZExporter.js"],"sourcesContent":["import {\n\tNoColorSpace,\n\tDoubleSide,\n\tColor,\n\tPropertyBinding,\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.replace( /\\n/g, '\\n' + pad + '\\t' );\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\tanimations: [],\n\t\t\t\tanimationFrameRate: 60,\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 animationTracks = buildAnimationTracks( scene, options.animations );\n\t\toptions.animationTracks = animationTracks;\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\tif ( scene.isScene ) {\n\n\t\t\tbuildHierarchy( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t} else {\n\n\t\t\tbuildNode( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t}\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\tconst timeRange = animationTracks.size > 0\n\t\t\t? { fps: options.animationFrameRate, endTimeCode: getMaxClipDuration( options.animations ) * options.animationFrameRate }\n\t\t\t: null;\n\n\t\toutput =\n\t\t\tbuildHeader( timeRange ) +\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\n\t\t\tconst mimeType = ( texture.userData.mimeType === 'image/jpeg' ) ? 'image/jpeg' : 'image/png';\n\n\t\t\tconst blob = await new Promise( ( resolve ) =>\n\t\t\t\tcanvas.toBlob( resolve, mimeType )\n\t\t\t);\n\n\t\t\tfiles[ `textures/Texture_${id}.${getTextureExtension( texture )}` ] = 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 getTextureExtension( texture ) {\n\n\treturn texture.userData.mimeType === 'image/jpeg' ? 'jpg' : 'png';\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( timeRange = null ) {\n\n\tconst timeMetadata = timeRange\n\t\t? `\n\tstartTimeCode = 0\n\tendTimeCode = ${timeRange.endTimeCode}\n\ttimeCodesPerSecond = ${timeRange.fps}\n\tframesPerSecond = ${timeRange.fps}`\n\t\t: '';\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\"${timeMetadata}\n)\n`;\n\n}\n\nfunction buildAnimationTracks( scene, clips ) {\n\n\t// Map<Object3D, { position?: KeyframeTrack, quaternion?: KeyframeTrack, scale?: KeyframeTrack }>\n\tconst tracksByObject = new Map();\n\n\tfor ( let c = 0; c < clips.length; c ++ ) {\n\n\t\tconst clip = clips[ c ];\n\n\t\tfor ( let t = 0; t < clip.tracks.length; t ++ ) {\n\n\t\t\tconst track = clip.tracks[ t ];\n\t\t\tconst binding = PropertyBinding.parseTrackName( track.name );\n\t\t\tconst target = PropertyBinding.findNode( scene, binding.nodeName );\n\n\t\t\tif ( target === null || target === undefined ) continue;\n\n\t\t\tconst property = binding.propertyName;\n\t\t\tif ( property !== 'position' && property !== 'quaternion' && property !== 'scale' ) continue;\n\n\t\t\tlet entry = tracksByObject.get( target );\n\t\t\tif ( entry === undefined ) {\n\n\t\t\t\tentry = {};\n\t\t\t\ttracksByObject.set( target, entry );\n\n\t\t\t}\n\n\t\t\tentry[ property ] = track;\n\n\t\t}\n\n\t}\n\n\treturn tracksByObject;\n\n}\n\nfunction getMaxClipDuration( clips ) {\n\n\tlet max = 0;\n\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\tif ( clips[ i ].duration > max ) max = clips[ i ].duration;\n\n\t}\n\n\treturn max;\n\n}\n\nfunction buildVector3TimeSamples( opName, opType, track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 3;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `${opType} ${opName}.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\n}`;\n\n}\n\nfunction buildQuaternionTimeSamples( track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\t// three.js quaternion order: (x, y, z, w); USD quatf order: (w, x, y, z)\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 4;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o + 3 ].toPrecision( PRECISION )}, ${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `quatf xformOp:orient.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\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\tbuildNode( object.children[ i ], parentNode, materials, usedNames, files, options );\n\n\t}\n\n}\n\nfunction buildNode( object, parentNode, materials, usedNames, files, options ) {\n\n\tif ( object.visible === false && options.onlyVisible === true ) return;\n\n\tlet childNode;\n\n\tif ( object.isMesh ) {\n\n\t\tconst geometry = object.geometry;\n\t\tconst isMultiMaterial = Array.isArray( object.material );\n\n\t\tconst meshMaterials = isMultiMaterial ? object.material : [ object.material ];\n\n\t\tfor ( let i = 0; i < meshMaterials.length; i ++ ) {\n\n\t\t\tconst material = meshMaterials[ i ];\n\n\t\t\tif ( ! material.isMeshStandardMaterial ) {\n\n\t\t\t\tconsole.warn( 'THREE.USDZExporter: Use MeshStandardMaterial for best results.' );\n\n\t\t\t}\n\n\t\t\tif ( ! ( material.uuid in materials ) ) {\n\n\t\t\t\tmaterials[ material.uuid ] = material;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst resolvedMaterials = meshMaterials.map( ( m ) => materials[ m.uuid ] );\n\n\t\tif ( isMultiMaterial === false ) {\n\n\t\t\tconst geometryFileName = `geometries/Geometry_${geometry.id}.usda`;\n\n\t\t\tif ( ! ( geometryFileName in files ) ) {\n\n\t\t\t\tconst meshObject = buildMeshObject( geometry );\n\t\t\t\tfiles[ geometryFileName ] = strToU8(\n\t\t\t\t\tbuildHeader() + '\\n' + meshObject.toString()\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tchildNode = buildMesh(\n\t\t\tobject,\n\t\t\tgeometry,\n\t\t\tresolvedMaterials,\n\t\t\tusedNames,\n\t\t\toptions\n\t\t);\n\n\t} else if ( object.isCamera ) {\n\n\t\tchildNode = buildCamera( object, usedNames, options );\n\n\t} else {\n\n\t\tchildNode = buildXform( object, usedNames, options );\n\n\t}\n\n\tparentNode.addChild( childNode );\n\tbuildHierarchy( object, childNode, materials, usedNames, files, options );\n\n}\n\nfunction addTransformProperties( node, object, options ) {\n\n\tconst animTracks = options.animationTracks.get( object );\n\tconst hasPivot = object.pivot !== null;\n\n\tif ( ! hasPivot && animTracks === undefined ) {\n\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\t\treturn;\n\n\t}\n\n\t// Per-op layout: animated channels use timeSamples, others stay static.\n\t// Pivot ops (when present) are always static.\n\n\tconst fps = options.animationFrameRate;\n\tconst p = object.position;\n\tconst q = object.quaternion;\n\tconst s = object.scale;\n\n\tif ( animTracks !== undefined && animTracks.position !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:translate', 'float3', animTracks.position, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:translate = (${p.x.toPrecision( PRECISION )}, ${p.y.toPrecision( PRECISION )}, ${p.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\n\t\tconst piv = object.pivot;\n\t\tnode.addProperty( `float3 xformOp:translate:pivot = (${piv.x.toPrecision( PRECISION )}, ${piv.y.toPrecision( PRECISION )}, ${piv.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.quaternion !== undefined ) {\n\n\t\tnode.addProperty( buildQuaternionTimeSamples( animTracks.quaternion, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `quatf xformOp:orient = (${q.w.toPrecision( PRECISION )}, ${q.x.toPrecision( PRECISION )}, ${q.y.toPrecision( PRECISION )}, ${q.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.scale !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:scale', 'float3', animTracks.scale, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:scale = (${s.x.toPrecision( PRECISION )}, ${s.y.toPrecision( PRECISION )}, ${s.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\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\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:orient\", \"xformOp:scale\"]' );\n\n\t}\n\n}\n\nfunction buildXform( object, usedNames, options ) {\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\taddTransformProperties( node, object, options );\n\n\treturn node;\n\n}\n\nfunction buildMesh( object, geometry, materials, usedNames, options ) {\n\n\tconst node = buildXform( object, usedNames, options );\n\n\tif ( materials.length === 1 ) {\n\n\t\tnode.addMetadata(\n\t\t\t'prepend references',\n\t\t\t`@./geometries/Geometry_${geometry.id}.usda@</Geometry>`\n\t\t);\n\t\tnode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\tnode.addProperty(\n\t\t\t`rel material:binding = </Materials/Material_${materials[ 0 ].id}>`\n\t\t);\n\n\t} else {\n\n\t\tnode.addChild( buildMeshNode( geometry, materials ) );\n\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, materials = null ) {\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\tif ( materials !== null ) {\n\n\t\tconst groups = geometry.groups;\n\n\t\tconst totalFaces = ( geometry.index !== null\n\t\t\t? geometry.index.count\n\t\t\t: attributes.position.count ) / 3;\n\n\t\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tconst material = materials[ group.materialIndex ];\n\n\t\t\tif ( material === undefined ) continue;\n\n\t\t\tconst startFace = Math.floor( group.start / 3 );\n\t\t\tconst endFace = Math.min( startFace + Math.floor( group.count / 3 ), totalFaces );\n\n\t\t\tconst indices = [];\n\t\t\tfor ( let j = startFace; j < endFace; j ++ ) indices.push( j );\n\n\t\t\tconst subsetNode = new USDNode( `subset_${i}`, 'GeomSubset' );\n\t\t\tsubsetNode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\t\tsubsetNode.addProperty( 'uniform token elementType = \"face\"' );\n\t\t\tsubsetNode.addProperty( 'uniform token familyName = \"materialBind\"' );\n\t\t\tsubsetNode.addProperty( `int[] indices = [${indices.join( ', ' )}]` );\n\t\t\tsubsetNode.addProperty(\n\t\t\t\t`rel material:binding = </Materials/Material_${material.id}>`\n\t\t\t);\n\t\t\tnode.addChild( subsetNode );\n\n\t\t}\n\n\t}\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}.${getTextureExtension( texture )}@` );\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\tconst alpha = ( mapType === 'diffuse' ) ? material.opacity : 1;\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = ${buildColor4( color, alpha )}` );\n\n\t\t}\n\n\t\tif ( mapType === 'normal' ) {\n\n\t\t\t// Similar to GLTFExporter, only the x component is used so the y-negation that\n\t\t\t// GLTFLoader applies to tangent-less glTF assets is not baked into the export.\n\n\t\t\tconst scale = material.normalScale.x;\n\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = (${ 2 * scale }, ${ 2 * scale }, 2, 1)` );\n\t\t\ttextureNode.addProperty( `float4 inputs:bias = (${ - scale }, ${ - scale }, -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.emissive ) {\n\n\t\tconst emissiveIntensity = material.emissiveIntensity ?? 1;\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor.connect = </Materials/Material_${material.id}/Texture_${material.emissiveMap.id}_emissive.outputs:rgb>`\n\t\t\t);\n\n\t\t\tconst emissiveColor = new Color(\n\t\t\t\tmaterial.emissive.r * emissiveIntensity,\n\t\t\t\tmaterial.emissive.g * emissiveIntensity,\n\t\t\t\tmaterial.emissive.b * emissiveIntensity\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.emissiveMap,\n\t\t\t\t'emissive',\n\t\t\t\temissiveColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else if ( material.emissive.getHex() > 0 ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor = ${buildColor( material.emissive )}`\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\tif ( material.normalMap ) {\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 ) {\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 aoMapIntensity = material.aoMapIntensity ?? 1;\n\t\tconst aoColor = new Color(\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity\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 ) {\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 ?? 1}`\n\t\t);\n\n\t}\n\n\tif ( material.metalnessMap ) {\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 ?? 0}`\n\t\t);\n\n\t}\n\n\tif ( material.alphaMap ) {\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, alpha = 1 ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b}, ${alpha})`;\n\n}\n\nfunction buildVector2( vector ) {\n\n\treturn `(${vector.x}, ${vector.y})`;\n\n}\n\nfunction buildCamera( camera, usedNames, options ) {\n\n\tconst name = getName( camera, usedNames );\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\taddTransformProperties( node, camera, options );\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 * @property {Array<AnimationClip>} [animations=[]] - Animation clips to bake into `xformOp` time samples on the\n * targeted objects. Only `position`, `quaternion`, and `scale` tracks are exported.\n * @property {number} [animationFrameRate=60] - Time codes per second used when writing animation samples.\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":";;;AAYA,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,GAAK,GAAQ;AAEzB,OAAK,SAAS,KAAM;GAAE;GAAK;GAAO,CAAE;;CAIrC,YAAa,GAAU,IAAW,EAAE,EAAG;AAEtC,OAAK,WAAW,KAAM;GAAE;GAAU;GAAU,CAAE;;CAI/C,SAAU,GAAQ;AAEjB,OAAK,SAAS,KAAM,EAAO;;CAI5B,SAAU,IAAS,GAAI;EAEtB,IAAM,IAAM,IAAK,OAAQ,EAAQ,EAE3B,IAAoB,KAA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AE7D,IAAI;AAcJ,CAbA,AASC,IATI,EAAO,yBAGR,KAAK,IAAK,EAAO,KAAM,GAAG,KAAK,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"}
1
+ {"version":3,"file":"USDZExporter-MdkuT226.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/exporters/USDZExporter.js"],"sourcesContent":["import {\n\tNoColorSpace,\n\tDoubleSide,\n\tColor,\n\tPropertyBinding,\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.replace( /\\n/g, '\\n' + pad + '\\t' );\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\tanimations: [],\n\t\t\t\tanimationFrameRate: 60,\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 animationTracks = buildAnimationTracks( scene, options.animations );\n\t\toptions.animationTracks = animationTracks;\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\tif ( scene.isScene ) {\n\n\t\t\tbuildHierarchy( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t} else {\n\n\t\t\tbuildNode( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t}\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\tconst timeRange = animationTracks.size > 0\n\t\t\t? { fps: options.animationFrameRate, endTimeCode: getMaxClipDuration( options.animations ) * options.animationFrameRate }\n\t\t\t: null;\n\n\t\toutput =\n\t\t\tbuildHeader( timeRange ) +\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\n\t\t\tconst mimeType = ( texture.userData.mimeType === 'image/jpeg' ) ? 'image/jpeg' : 'image/png';\n\n\t\t\tconst blob = await new Promise( ( resolve ) =>\n\t\t\t\tcanvas.toBlob( resolve, mimeType )\n\t\t\t);\n\n\t\t\tfiles[ `textures/Texture_${id}.${getTextureExtension( texture )}` ] = 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 getTextureExtension( texture ) {\n\n\treturn texture.userData.mimeType === 'image/jpeg' ? 'jpg' : 'png';\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( timeRange = null ) {\n\n\tconst timeMetadata = timeRange\n\t\t? `\n\tstartTimeCode = 0\n\tendTimeCode = ${timeRange.endTimeCode}\n\ttimeCodesPerSecond = ${timeRange.fps}\n\tframesPerSecond = ${timeRange.fps}`\n\t\t: '';\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\"${timeMetadata}\n)\n`;\n\n}\n\nfunction buildAnimationTracks( scene, clips ) {\n\n\t// Map<Object3D, { position?: KeyframeTrack, quaternion?: KeyframeTrack, scale?: KeyframeTrack }>\n\tconst tracksByObject = new Map();\n\n\tfor ( let c = 0; c < clips.length; c ++ ) {\n\n\t\tconst clip = clips[ c ];\n\n\t\tfor ( let t = 0; t < clip.tracks.length; t ++ ) {\n\n\t\t\tconst track = clip.tracks[ t ];\n\t\t\tconst binding = PropertyBinding.parseTrackName( track.name );\n\t\t\tconst target = PropertyBinding.findNode( scene, binding.nodeName );\n\n\t\t\tif ( target === null || target === undefined ) continue;\n\n\t\t\tconst property = binding.propertyName;\n\t\t\tif ( property !== 'position' && property !== 'quaternion' && property !== 'scale' ) continue;\n\n\t\t\tlet entry = tracksByObject.get( target );\n\t\t\tif ( entry === undefined ) {\n\n\t\t\t\tentry = {};\n\t\t\t\ttracksByObject.set( target, entry );\n\n\t\t\t}\n\n\t\t\tentry[ property ] = track;\n\n\t\t}\n\n\t}\n\n\treturn tracksByObject;\n\n}\n\nfunction getMaxClipDuration( clips ) {\n\n\tlet max = 0;\n\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\tif ( clips[ i ].duration > max ) max = clips[ i ].duration;\n\n\t}\n\n\treturn max;\n\n}\n\nfunction buildVector3TimeSamples( opName, opType, track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 3;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `${opType} ${opName}.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\n}`;\n\n}\n\nfunction buildQuaternionTimeSamples( track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\t// three.js quaternion order: (x, y, z, w); USD quatf order: (w, x, y, z)\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 4;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o + 3 ].toPrecision( PRECISION )}, ${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `quatf xformOp:orient.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\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\tbuildNode( object.children[ i ], parentNode, materials, usedNames, files, options );\n\n\t}\n\n}\n\nfunction buildNode( object, parentNode, materials, usedNames, files, options ) {\n\n\tif ( object.visible === false && options.onlyVisible === true ) return;\n\n\tlet childNode;\n\n\tif ( object.isMesh ) {\n\n\t\tconst geometry = object.geometry;\n\t\tconst isMultiMaterial = Array.isArray( object.material );\n\n\t\tconst meshMaterials = isMultiMaterial ? object.material : [ object.material ];\n\n\t\tfor ( let i = 0; i < meshMaterials.length; i ++ ) {\n\n\t\t\tconst material = meshMaterials[ i ];\n\n\t\t\tif ( ! material.isMeshStandardMaterial ) {\n\n\t\t\t\tconsole.warn( 'THREE.USDZExporter: Use MeshStandardMaterial for best results.' );\n\n\t\t\t}\n\n\t\t\tif ( ! ( material.uuid in materials ) ) {\n\n\t\t\t\tmaterials[ material.uuid ] = material;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst resolvedMaterials = meshMaterials.map( ( m ) => materials[ m.uuid ] );\n\n\t\tif ( isMultiMaterial === false ) {\n\n\t\t\tconst geometryFileName = `geometries/Geometry_${geometry.id}.usda`;\n\n\t\t\tif ( ! ( geometryFileName in files ) ) {\n\n\t\t\t\tconst meshObject = buildMeshObject( geometry );\n\t\t\t\tfiles[ geometryFileName ] = strToU8(\n\t\t\t\t\tbuildHeader() + '\\n' + meshObject.toString()\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tchildNode = buildMesh(\n\t\t\tobject,\n\t\t\tgeometry,\n\t\t\tresolvedMaterials,\n\t\t\tusedNames,\n\t\t\toptions\n\t\t);\n\n\t} else if ( object.isCamera ) {\n\n\t\tchildNode = buildCamera( object, usedNames, options );\n\n\t} else {\n\n\t\tchildNode = buildXform( object, usedNames, options );\n\n\t}\n\n\tparentNode.addChild( childNode );\n\tbuildHierarchy( object, childNode, materials, usedNames, files, options );\n\n}\n\nfunction addTransformProperties( node, object, options ) {\n\n\tconst animTracks = options.animationTracks.get( object );\n\tconst hasPivot = object.pivot !== null;\n\n\tif ( ! hasPivot && animTracks === undefined ) {\n\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\t\treturn;\n\n\t}\n\n\t// Per-op layout: animated channels use timeSamples, others stay static.\n\t// Pivot ops (when present) are always static.\n\n\tconst fps = options.animationFrameRate;\n\tconst p = object.position;\n\tconst q = object.quaternion;\n\tconst s = object.scale;\n\n\tif ( animTracks !== undefined && animTracks.position !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:translate', 'float3', animTracks.position, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:translate = (${p.x.toPrecision( PRECISION )}, ${p.y.toPrecision( PRECISION )}, ${p.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\n\t\tconst piv = object.pivot;\n\t\tnode.addProperty( `float3 xformOp:translate:pivot = (${piv.x.toPrecision( PRECISION )}, ${piv.y.toPrecision( PRECISION )}, ${piv.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.quaternion !== undefined ) {\n\n\t\tnode.addProperty( buildQuaternionTimeSamples( animTracks.quaternion, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `quatf xformOp:orient = (${q.w.toPrecision( PRECISION )}, ${q.x.toPrecision( PRECISION )}, ${q.y.toPrecision( PRECISION )}, ${q.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.scale !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:scale', 'float3', animTracks.scale, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:scale = (${s.x.toPrecision( PRECISION )}, ${s.y.toPrecision( PRECISION )}, ${s.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\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\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:orient\", \"xformOp:scale\"]' );\n\n\t}\n\n}\n\nfunction buildXform( object, usedNames, options ) {\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\taddTransformProperties( node, object, options );\n\n\treturn node;\n\n}\n\nfunction buildMesh( object, geometry, materials, usedNames, options ) {\n\n\tconst node = buildXform( object, usedNames, options );\n\n\tif ( materials.length === 1 ) {\n\n\t\tnode.addMetadata(\n\t\t\t'prepend references',\n\t\t\t`@./geometries/Geometry_${geometry.id}.usda@</Geometry>`\n\t\t);\n\t\tnode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\tnode.addProperty(\n\t\t\t`rel material:binding = </Materials/Material_${materials[ 0 ].id}>`\n\t\t);\n\n\t} else {\n\n\t\tnode.addChild( buildMeshNode( geometry, materials ) );\n\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, materials = null ) {\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\tif ( materials !== null ) {\n\n\t\tconst groups = geometry.groups;\n\n\t\tconst totalFaces = ( geometry.index !== null\n\t\t\t? geometry.index.count\n\t\t\t: attributes.position.count ) / 3;\n\n\t\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tconst material = materials[ group.materialIndex ];\n\n\t\t\tif ( material === undefined ) continue;\n\n\t\t\tconst startFace = Math.floor( group.start / 3 );\n\t\t\tconst endFace = Math.min( startFace + Math.floor( group.count / 3 ), totalFaces );\n\n\t\t\tconst indices = [];\n\t\t\tfor ( let j = startFace; j < endFace; j ++ ) indices.push( j );\n\n\t\t\tconst subsetNode = new USDNode( `subset_${i}`, 'GeomSubset' );\n\t\t\tsubsetNode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\t\tsubsetNode.addProperty( 'uniform token elementType = \"face\"' );\n\t\t\tsubsetNode.addProperty( 'uniform token familyName = \"materialBind\"' );\n\t\t\tsubsetNode.addProperty( `int[] indices = [${indices.join( ', ' )}]` );\n\t\t\tsubsetNode.addProperty(\n\t\t\t\t`rel material:binding = </Materials/Material_${material.id}>`\n\t\t\t);\n\t\t\tnode.addChild( subsetNode );\n\n\t\t}\n\n\t}\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}.${getTextureExtension( texture )}@` );\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\tconst alpha = ( mapType === 'diffuse' ) ? material.opacity : 1;\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = ${buildColor4( color, alpha )}` );\n\n\t\t}\n\n\t\tif ( mapType === 'normal' ) {\n\n\t\t\t// Similar to GLTFExporter, only the x component is used so the y-negation that\n\t\t\t// GLTFLoader applies to tangent-less glTF assets is not baked into the export.\n\n\t\t\tconst scale = material.normalScale.x;\n\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = (${ 2 * scale }, ${ 2 * scale }, 2, 1)` );\n\t\t\ttextureNode.addProperty( `float4 inputs:bias = (${ - scale }, ${ - scale }, -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.emissive ) {\n\n\t\tconst emissiveIntensity = material.emissiveIntensity ?? 1;\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor.connect = </Materials/Material_${material.id}/Texture_${material.emissiveMap.id}_emissive.outputs:rgb>`\n\t\t\t);\n\n\t\t\tconst emissiveColor = new Color(\n\t\t\t\tmaterial.emissive.r * emissiveIntensity,\n\t\t\t\tmaterial.emissive.g * emissiveIntensity,\n\t\t\t\tmaterial.emissive.b * emissiveIntensity\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.emissiveMap,\n\t\t\t\t'emissive',\n\t\t\t\temissiveColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else if ( material.emissive.getHex() > 0 ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor = ${buildColor( material.emissive )}`\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\tif ( material.normalMap ) {\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 ) {\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 aoMapIntensity = material.aoMapIntensity ?? 1;\n\t\tconst aoColor = new Color(\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity\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 ) {\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 ?? 1}`\n\t\t);\n\n\t}\n\n\tif ( material.metalnessMap ) {\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 ?? 0}`\n\t\t);\n\n\t}\n\n\tif ( material.alphaMap ) {\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, alpha = 1 ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b}, ${alpha})`;\n\n}\n\nfunction buildVector2( vector ) {\n\n\treturn `(${vector.x}, ${vector.y})`;\n\n}\n\nfunction buildCamera( camera, usedNames, options ) {\n\n\tconst name = getName( camera, usedNames );\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\taddTransformProperties( node, camera, options );\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 * @property {Array<AnimationClip>} [animations=[]] - Animation clips to bake into `xformOp` time samples on the\n * targeted objects. Only `position`, `quaternion`, and `scale` tracks are exported.\n * @property {number} [animationFrameRate=60] - Time codes per second used when writing animation samples.\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":";;;AAYA,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,GAAK,GAAQ;AAEzB,OAAK,SAAS,KAAM;GAAE;GAAK;GAAO,CAAE;;CAIrC,YAAa,GAAU,IAAW,EAAE,EAAG;AAEtC,OAAK,WAAW,KAAM;GAAE;GAAU;GAAU,CAAE;;CAI/C,SAA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AExD,IAAM,IAAgB,IAAI,EAAO,KAAK,YACrC,EACA,CAAC,IAAI,EAAO,IAAI,YAAa,EAAW,CAAC;AAC1C,GAAK,YAAa,0BAA0B,IAAiB;CAE7D,IAAI;AAcJ,CAbA,AASC,IATI,EAAO,yBAGR,KAAK,IAAK,EAAO,KAAM,GAAG,KAAK,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"}
@@ -1,4 +1,4 @@
1
- import { B as e, z as t } from "./roomle-sdk-CsSQAqQG.mjs";
1
+ import { B as e, z as t } from "./roomle-sdk-CBwhwX_e.mjs";
2
2
  //#region packages/homag-intelligence/src/api.ts
3
3
  var n = class {
4
4
  constructor(e) {
@@ -52,4 +52,4 @@ var n = class {
52
52
  //#endregion
53
53
  export { n as t };
54
54
 
55
- //# sourceMappingURL=api-B5wIZIHt.mjs.map
55
+ //# sourceMappingURL=api-Bznmr-xZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-B5wIZIHt.mjs","names":[],"sources":["../../packages/homag-intelligence/src/api.ts"],"sourcesContent":["import type { RoomDesignerRequests } from './glue-logic';\nimport type { MasterData, PosGroup } from './model/oc-scripts-domain.model';\nimport type { PlanRoomGeometryMode } from './external-object-api';\nimport { PLAN_ROOM_GEOMETRY_MODE } from './external-object-api';\nimport type { RoomlePlannerType } from '../../typings/external-objects';\nimport {\n HI_CONTEXT_ACTION,\n type LoadExternalObjectOptions,\n} from './external-object-api';\n\nexport interface ExternalObjectModuleIdMap {\n originalModuleId: string;\n newModuleId: string;\n}\n\nexport class RoomDesignerApi implements RoomDesignerRequests {\n private _roomlePlanner: RoomlePlannerType;\n\n constructor(roomlePlanner: RoomlePlannerType) {\n this._roomlePlanner = roomlePlanner;\n }\n\n public loadMasterData(masterData: MasterData) {\n this._roomlePlanner.loadExternalObjectMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.loadExternalObjectGroups(posDataArray, options);\n }\n\n completelyLoaded(): void {\n this._roomlePlanner.externalObjectsCompletelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n groupId,\n null,\n HI_CONTEXT_ACTION.ROOM,\n );\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n null,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n subModuleId,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n this._roomlePlanner.openOrCloseGeometryOfExternalObject(\n groupOrRootModuleId,\n subModuleId ?? null,\n open,\n animate,\n );\n return Promise.resolve();\n }\n\n public deleteGroup(groupId: string) {\n this._roomlePlanner.removeExternalObject(groupId);\n }\n\n public deleteRootModule(rootModuleId: string) {\n this._roomlePlanner.removeExternalObject(rootModuleId);\n }\n\n public async getPosDataOfAllGroups() {\n const groups =\n (await this._roomlePlanner.getExternalObjectGroups()) as PosGroup[];\n return groups;\n }\n\n public async getRoomInformation(mode?: PlanRoomGeometryMode) {\n const rooms = await this._roomlePlanner.getExternalRoomInformation(\n mode ?? PLAN_ROOM_GEOMETRY_MODE.FLOOR,\n );\n return rooms;\n }\n\n public async saveExternalObjectSnapshot() {\n return this._roomlePlanner.saveExternalObjectSnapshot();\n }\n\n public async saveCurrentPlanSnapshot() {\n return this._roomlePlanner.saveCurrentPlanSnapshot();\n }\n\n public async renderPosDataImage(posDataJson: object) {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.renderImagesOfExternalObjectGroup(posDataArray);\n }\n}\n"],"mappings":";;AAeA,IAAa,IAAb,MAA6D;CAG3D,YAAY,GAAkC;AAC5C,OAAK,iBAAiB;;CAGxB,eAAsB,GAAwB;AAC5C,OAAK,eAAe,6BAA6B,EAAW;;CAG9D,MAAa,cACX,GACA,GACe;EACf,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,yBAAyB,GAAc,EAAQ;;CAG3E,mBAAyB;AACvB,OAAK,eAAe,iCAAiC;;CAGvD,MAAa,YAAY,GAAgC;AACvD,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,KACnB;;CAGH,MAAa,WAAW,GAAqC;AAC3D,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,UACnB;;CAGH,MAAa,aACX,GACA,GACe;AACf,QAAM,KAAK,eAAe,qBACxB,GACA,GACA,EAAkB,UACnB;;CAGH,eACE,GACA,GACA,GACA,GACA;AAOA,SANA,KAAK,eAAe,oCAClB,GACA,KAAe,MACf,GACA,EACD,EACM,QAAQ,SAAS;;CAG1B,YAAmB,GAAiB;AAClC,OAAK,eAAe,qBAAqB,EAAQ;;CAGnD,iBAAwB,GAAsB;AAC5C,OAAK,eAAe,qBAAqB,EAAa;;CAGxD,MAAa,wBAAwB;AAGnC,SADG,MAAM,KAAK,eAAe,yBAAyB;;CAIxD,MAAa,mBAAmB,GAA6B;AAI3D,SAHc,MAAM,KAAK,eAAe,2BACtC,KAAQ,EAAwB,MACjC;;CAIH,MAAa,6BAA6B;AACxC,SAAO,KAAK,eAAe,4BAA4B;;CAGzD,MAAa,0BAA0B;AACrC,SAAO,KAAK,eAAe,yBAAyB;;CAGtD,MAAa,mBAAmB,GAAqB;EACnD,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,kCAAkC,EAAa"}
1
+ {"version":3,"file":"api-Bznmr-xZ.mjs","names":[],"sources":["../../packages/homag-intelligence/src/api.ts"],"sourcesContent":["import type { RoomDesignerRequests } from './glue-logic';\nimport type { MasterData, PosGroup } from './model/oc-scripts-domain.model';\nimport type { PlanRoomGeometryMode } from './external-object-api';\nimport { PLAN_ROOM_GEOMETRY_MODE } from './external-object-api';\nimport type { RoomlePlannerType } from '../../typings/external-objects';\nimport {\n HI_CONTEXT_ACTION,\n type LoadExternalObjectOptions,\n} from './external-object-api';\n\nexport interface ExternalObjectModuleIdMap {\n originalModuleId: string;\n newModuleId: string;\n}\n\nexport class RoomDesignerApi implements RoomDesignerRequests {\n private _roomlePlanner: RoomlePlannerType;\n\n constructor(roomlePlanner: RoomlePlannerType) {\n this._roomlePlanner = roomlePlanner;\n }\n\n public loadMasterData(masterData: MasterData) {\n this._roomlePlanner.loadExternalObjectMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.loadExternalObjectGroups(posDataArray, options);\n }\n\n completelyLoaded(): void {\n this._roomlePlanner.externalObjectsCompletelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n groupId,\n null,\n HI_CONTEXT_ACTION.ROOM,\n );\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n null,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n subModuleId,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n this._roomlePlanner.openOrCloseGeometryOfExternalObject(\n groupOrRootModuleId,\n subModuleId ?? null,\n open,\n animate,\n );\n return Promise.resolve();\n }\n\n public deleteGroup(groupId: string) {\n this._roomlePlanner.removeExternalObject(groupId);\n }\n\n public deleteRootModule(rootModuleId: string) {\n this._roomlePlanner.removeExternalObject(rootModuleId);\n }\n\n public async getPosDataOfAllGroups() {\n const groups =\n (await this._roomlePlanner.getExternalObjectGroups()) as PosGroup[];\n return groups;\n }\n\n public async getRoomInformation(mode?: PlanRoomGeometryMode) {\n const rooms = await this._roomlePlanner.getExternalRoomInformation(\n mode ?? PLAN_ROOM_GEOMETRY_MODE.FLOOR,\n );\n return rooms;\n }\n\n public async saveExternalObjectSnapshot() {\n return this._roomlePlanner.saveExternalObjectSnapshot();\n }\n\n public async saveCurrentPlanSnapshot() {\n return this._roomlePlanner.saveCurrentPlanSnapshot();\n }\n\n public async renderPosDataImage(posDataJson: object) {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.renderImagesOfExternalObjectGroup(posDataArray);\n }\n}\n"],"mappings":";;AAeA,IAAa,IAAb,MAA6D;CAG3D,YAAY,GAAkC;AAC5C,OAAK,iBAAiB;;CAGxB,eAAsB,GAAwB;AAC5C,OAAK,eAAe,6BAA6B,EAAW;;CAG9D,MAAa,cACX,GACA,GACe;EACf,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,yBAAyB,GAAc,EAAQ;;CAG3E,mBAAyB;AACvB,OAAK,eAAe,iCAAiC;;CAGvD,MAAa,YAAY,GAAgC;AACvD,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,KACnB;;CAGH,MAAa,WAAW,GAAqC;AAC3D,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,UACnB;;CAGH,MAAa,aACX,GACA,GACe;AACf,QAAM,KAAK,eAAe,qBACxB,GACA,GACA,EAAkB,UACnB;;CAGH,eACE,GACA,GACA,GACA,GACA;AAOA,SANA,KAAK,eAAe,oCAClB,GACA,KAAe,MACf,GACA,EACD,EACM,QAAQ,SAAS;;CAG1B,YAAmB,GAAiB;AAClC,OAAK,eAAe,qBAAqB,EAAQ;;CAGnD,iBAAwB,GAAsB;AAC5C,OAAK,eAAe,qBAAqB,EAAa;;CAGxD,MAAa,wBAAwB;AAGnC,SADG,MAAM,KAAK,eAAe,yBAAyB;;CAIxD,MAAa,mBAAmB,GAA6B;AAI3D,SAHc,MAAM,KAAK,eAAe,2BACtC,KAAQ,EAAwB,MACjC;;CAIH,MAAa,6BAA6B;AACxC,SAAO,KAAK,eAAe,4BAA4B;;CAGzD,MAAa,0BAA0B;AACrC,SAAO,KAAK,eAAe,yBAAyB;;CAGtD,MAAa,mBAAmB,GAAqB;EACnD,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,kCAAkC,EAAa"}
@@ -3,4 +3,4 @@ var e = "" + new URL("asset-loader.worker.js", import.meta.url).href;
3
3
  //#endregion
4
4
  export { e as default };
5
5
 
6
- //# sourceMappingURL=asset-loader.worker-CE4O0JU-.mjs.map
6
+ //# sourceMappingURL=asset-loader.worker-CzI1oyTY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-loader.worker-CzI1oyTY.mjs","names":[],"sources":["../../packages/workers/generated/asset-loader.worker.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__ZoP2ebLT5e$hm8jPkF9mgA__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,0BAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Ci as e } from "./three.core-0KaTx8dm.mjs";
2
2
  import { n as t, r as n, t as r } from "./decorate-Bl-JF_YY.mjs";
3
- import { n as i } from "./plugin-system-DR5maiUo.mjs";
3
+ import { n as i } from "./plugin-system-CRaC04G5.mjs";
4
4
  //#region packages/configurator-core/public/geometry/banana.glb?no-inline?url
5
5
  var a = "" + new URL("banana.glb", import.meta.url).href, o = class extends i {
6
6
  setScene(e) {
@@ -33,4 +33,4 @@ r([n, t("design:type", Object)], o.prototype, "_staticItemLoader", void 0);
33
33
  //#endregion
34
34
  export { o as default };
35
35
 
36
- //# sourceMappingURL=banana-for-scale-D0bw51dn.mjs.map
36
+ //# sourceMappingURL=banana-for-scale-DpKXNBt_.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-D0bw51dn.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__6MQCagmCrZzS5dHPKhXWKQ__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3 | null) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAAA,KAAA,IAAA,CAAA,MCOM,IAArB,cAA4C,EAAiC;CAQ3E,SAAgB,GAAc;AAiB5B,EAhBA,KAAK,SAAS,GAEd,KAAK,kBAAkB,QAAQ,EAAiB,CAAC,MAAM,MAAQ;AAE7D,GADA,KAAK,UAAU,EAAI,OACnB,KAAK,aAAa,KAAK;IACvB,EAEF,QAAQ,IACN,wDACA,iBACD,EACD,QAAQ,IACN,mGAEA,iBACD,EACD,QAAQ,IACN,uFAEA,iBACD;;CAGH,aAAoB,GAAqB;AACvC,MAAI,MACF,KAAK,UAAU,IAEZ,KAAK,SAGV;OAAI,KAAK,SAAS;IAChB,IAAM,IAAO,KAAK,QAAQ,QAAQ,IAAI,GAAS,CAAC,EAE1C,IADS,KAAK,QAAQ,UAAU,IAAI,GAAS,CAAC,CAC5B,OAAO;AAG/B,IAFA,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,IAAI;IACb,IAAI,IAAQ;AAGZ,IAFA,KAAK,QAAQ,MAAM,KAAK,IAAI,EAAQ,GAAO,GAAO,EAAM,CAAC,EACzD,KAAK,QAAQ,SAAS,IAAI,IAC1B,KAAK,QAAQ,SAAS,KAAK,EAAS;;AAEtC,GAAK,KAAK,OAAO,SAAS,SAAS,KAAK,QAAQ,IAC9C,KAAK,YAAY;;;CAIrB,WAAkB,GAAc,GAAsB;AAGpD,EAFA,MAAM,WAAW,GAAO,EAAQ,EAEhC,KAAK,iBAAiB;;CAGxB,aAA0B;AACpB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,IAAI,KAAK,QAAQ;;CAG/B,kBAA+B;AACzB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,OAAO,KAAK,QAAQ;;;GApEjC,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"banana-for-scale-DpKXNBt_.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__6MQCagmCrZzS5dHPKhXWKQ__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3 | null) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAAA,KAAA,IAAA,CAAA,MCOM,IAArB,cAA4C,EAAiC;CAQ3E,SAAgB,GAAc;AAiB5B,EAhBA,KAAK,SAAS,GAEd,KAAK,kBAAkB,QAAQ,EAA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80jTmYa.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budgeteer.sw-D80jTmYa.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__cLZLOsSELI_GmwKcVOKKRw__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,mBAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -1,10 +1,10 @@
1
- import { B as e } from "./threejs-utils-WK7Uu2TS.mjs";
1
+ import { B as e } from "./threejs-utils-v1uOvccg.mjs";
2
2
  import { Bt as t, Ci as n, Tn as r, Vt as i, h as a, m as o, zt as s } from "./three.core-0KaTx8dm.mjs";
3
3
  import { t as c } from "./render-order-BPF2wDMw.mjs";
4
4
  import { n as l, r as u, t as d } from "./decorate-Bl-JF_YY.mjs";
5
- import { c as f, t as p } from "./dimensioning-helper-ChQDwSjn.mjs";
5
+ import { c as f, t as p } from "./dimensioning-helper-CGPjS2hW.mjs";
6
6
  import { a as m } from "./kernel-utils-BvatnA7U.mjs";
7
- import { t as h } from "./layer-DaGoZ5YI.mjs";
7
+ import { t as h } from "./layer-DRMDGxT7.mjs";
8
8
  //#region packages/configurator-core/src/utils/component-dimensioning-html-util.ts
9
9
  function g(e, t, n, r) {
10
10
  let i = document.createElement("div");
@@ -166,4 +166,4 @@ d([u, l("design:type", Object)], T.prototype, "_cacheHolder", void 0), d([u, l("
166
166
  //#endregion
167
167
  export { T as default };
168
168
 
169
- //# sourceMappingURL=component-dimensioning-VIUcXV7r.mjs.map
169
+ //# sourceMappingURL=component-dimensioning-BaUqwqYJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-dimensioning-VIUcXV7r.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/component-dimensioning-html-util.ts","../../packages/configurator-core/src/utils/component-dimensioning.ts"],"sourcesContent":["export function createDimensioningTextLabelHtmlDiv(\n labelText: string,\n dimensioningLevel: number,\n interactionKey: string | undefined,\n editingFinishedCallback: (interactionKey: string, value: string) => void,\n): HTMLDivElement {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add('dimension-label');\n\n if (dimensioningLevel === 0) {\n labelHtmlDiv.classList.add('dimension-label--primary');\n } else {\n labelHtmlDiv.classList.add('dimension-label--secondary');\n }\n\n if (!interactionKey) {\n labelHtmlDiv.classList.add('dimension-label--disabled');\n } else {\n labelHtmlDiv.onclick = () => {\n labelHtmlDiv.classList.add('dimension-label--editing');\n while (labelHtmlDiv.firstChild) {\n labelHtmlDiv.removeChild(labelHtmlDiv.firstChild);\n }\n const labelHtmlInput = createDimensioningLabelHtmlInput(\n labelText,\n interactionKey,\n editingFinishedCallback,\n );\n labelHtmlDiv.appendChild(labelHtmlInput);\n labelHtmlInput.focus();\n labelHtmlInput.select();\n };\n }\n\n resetChildren(labelHtmlDiv, labelText);\n\n return labelHtmlDiv;\n}\n\nfunction createDimensioningLabelHtmlInput(\n originalValue: string,\n interactionKey: string,\n editingFinishedCallback: (interactionKey: string, value: string) => void,\n): HTMLInputElement {\n const labelHtmlInput = document.createElement('input');\n labelHtmlInput.id = interactionKey;\n labelHtmlInput.type = 'text';\n labelHtmlInput.enterKeyHint = 'done';\n labelHtmlInput.classList.add('dimension-label__input');\n labelHtmlInput.inputMode = 'numeric';\n labelHtmlInput.pattern = '[0-9]*';\n labelHtmlInput.value = originalValue;\n\n function finishEditing(interactionKey: string, valueToSet: string): void {\n // avoid race conditions\n if (labelHtmlInput.id !== interactionKey) {\n return;\n }\n labelHtmlInput.id = '';\n\n const numValue = parseFloat(valueToSet);\n\n if (isNaN(numValue) || numValue <= 0) {\n editingFinishedCallback(interactionKey, originalValue);\n return;\n }\n\n editingFinishedCallback(interactionKey, valueToSet);\n }\n\n labelHtmlInput.onkeydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' || event.key === 'Esc') {\n finishEditing(interactionKey, originalValue);\n } else if (event.key === 'Enter') {\n finishEditing(interactionKey, labelHtmlInput.value);\n }\n };\n\n labelHtmlInput.onblur = () => {\n finishEditing(interactionKey, labelHtmlInput.value);\n };\n\n return labelHtmlInput;\n}\n\nfunction resetChildren(labelHtmlDiv: HTMLDivElement, labelText: string): void {\n while (labelHtmlDiv.firstChild) {\n labelHtmlDiv.removeChild(labelHtmlDiv.firstChild);\n }\n\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.dataset.testId = 'dimension-label-value';\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n}\n","import type CacheHolder from '../../../common-core/src/services/cache-holder';\nimport type UnitFormatter from '../services/unit-formatter';\nimport type { Dimensioning, DimensioningAxis } from '../../../typings/kernel';\n\nimport type { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Object3D,\n Vector3,\n} from 'three';\nimport { kernelDimensioningToThree } from '../../../common-core/src/utils/threejs-utils';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport { DIMENSIONING_GEOMETRY } from './dimensioning-helper';\nimport inject from '../../../common-core/src/di/inject';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\nimport { MESH_RENDER_ORDER } from '../../../common-core/src/webgl/render-order';\nimport { createDimensioningTextLabelHtmlDiv } from './component-dimensioning-html-util';\n\nconst LINE_MATERIAL = 'component_dimensioning_line_material';\nconst LINE_COLOR = 0x373737;\nconst LINE_SPACING = 0.05;\n\nconst TEXT_SPACING = 0.02;\nconst TEXT_SIZE = 0.025;\n\nexport interface DimensioningAndAxis {\n dimensioning: Dimensioning;\n axis?: DimensioningAxis;\n}\n\nclass ComponentDimensioningAxis {\n private _origin: Vector3;\n private readonly _direction: Vector3;\n private readonly _labelDirection: Vector3;\n\n constructor(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n cameraPosition: Vector3,\n ) {\n this._direction =\n ComponentDimensioningAxis._getDirection(dimensioningAndAxis);\n const defaultLabelDirection =\n ComponentDimensioningAxis._getDefaultLabelDirection(\n dimensioningAndAxis,\n this._direction,\n );\n const lookAtOppositeSide = cameraPosition.dot(defaultLabelDirection) >= 0;\n this._labelDirection =\n ComponentDimensioningAxis._calculateActualLabelDirection(\n dimensioningAndAxis,\n lookAtOppositeSide,\n defaultLabelDirection,\n );\n this._origin = ComponentDimensioningAxis._calculateOrigin(\n dimensioningAndAxis,\n boundingBox,\n lookAtOppositeSide,\n );\n }\n\n get direction(): Vector3 {\n return this._direction;\n }\n\n get labelDirection(): Vector3 {\n return this._labelDirection;\n }\n\n getEdge(from: number, to: number, lineOffset: number): Line3 {\n const start = this._origin\n .clone()\n .add(this._direction.clone().multiplyScalar(from))\n .add(this._labelDirection.clone().multiplyScalar(lineOffset));\n const end = this._origin\n .clone()\n .add(this._direction.clone().multiplyScalar(to))\n .add(this._labelDirection.clone().multiplyScalar(lineOffset));\n return new Line3(start, end);\n }\n\n private static _getDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n ): Vector3 {\n if (dimensioningAndAxis.axis) {\n return convertToTHREE(dimensioningAndAxis.axis.direction).normalize();\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(1, 0, 0);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(0, 0, 1);\n }\n return new Vector3(0, 1, 0);\n }\n\n private static _getDefaultLabelDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n direction: Vector3,\n ): Vector3 {\n if (dimensioningAndAxis.axis) {\n const labelDirection = convertToTHREE(\n dimensioningAndAxis.axis.labelDirection,\n );\n const planeNormal = direction.clone().cross(labelDirection);\n return planeNormal.cross(direction).normalize();\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(0, 1, 0);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(-1, 0, 0);\n }\n return new Vector3(-1, 0, 0);\n }\n\n private static _calculateActualLabelDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n lookAtOppositeSide: boolean,\n labelDirection: Vector3,\n ): Vector3 {\n if (lookAtOppositeSide) {\n if (dimensioningAndAxis.axis) {\n if (dimensioningAndAxis.axis.alternativeOrigin) {\n return labelDirection.clone().multiplyScalar(-1);\n }\n } else if (\n dimensioningAndAxis.dimensioning.axis === 'y' ||\n dimensioningAndAxis.dimensioning.axis === 'z'\n ) {\n return labelDirection.clone().multiplyScalar(-1);\n }\n }\n return labelDirection;\n }\n\n private static _calculateOrigin(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n lookAtOppositeSide: boolean,\n ): Vector3 {\n const center = boundingBox.getCenter(new Vector3());\n const size = boundingBox.getSize(new Vector3());\n if (dimensioningAndAxis.axis) {\n return lookAtOppositeSide && dimensioningAndAxis.axis.alternativeOrigin\n ? convertToTHREE(dimensioningAndAxis.axis.alternativeOrigin)\n : convertToTHREE(dimensioningAndAxis.axis.origin);\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(0, center.y + size.y * 0.5, center.z - size.z * 0.5);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(\n center.x + size.x * (lookAtOppositeSide ? 0.5 : -0.5),\n center.y - size.y * 0.5,\n 0,\n );\n }\n return new Vector3(\n center.x + size.x * (lookAtOppositeSide ? 0.5 : -0.5),\n 0,\n center.z - size.z * 0.5,\n );\n }\n}\n\nexport default class ComponentDimensioning extends Object3D {\n @inject\n private _cacheHolder: CacheHolder;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _dimensioning: Dimensioning;\n private _axis: ComponentDimensioningAxis;\n private _size: Vector3;\n private _dimensionInMM: number;\n\n private readonly editingFinishedCallback: (\n interactionKey: string,\n value: number,\n ) => void;\n\n private readonly _level: number;\n private _lineMaterial: LineBasicMaterial;\n\n private _textLabel: CSS2DObject;\n\n private _mainLineObject: Line | null = null;\n\n constructor(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n relativeCameraDirection: Vector3,\n editingFinishedCallback: (interactionKey: string, value: number) => void,\n ) {\n super();\n this.name = DIMENSIONING_GEOMETRY;\n\n this._size = boundingBox.getSize(new Vector3());\n this._dimensioning = kernelDimensioningToThree(\n dimensioningAndAxis.dimensioning,\n );\n this._axis = new ComponentDimensioningAxis(\n dimensioningAndAxis,\n boundingBox,\n relativeCameraDirection,\n );\n this._level = this._dimensioning.maxLevel - this._dimensioning.level;\n\n this.editingFinishedCallback = editingFinishedCallback;\n\n this._init();\n }\n\n clone() {\n console.warn(\n 'Will not clone ComponentDimensioning because this can break the generation of perspective images. ' +\n 'If the ComponentDimensioning is visible during the generation of the perspective image, ' +\n 'three.js tries to clone it but clone does not give any parameters to the constructor and therefore the clone breaks.',\n );\n // Since we do not need to clone ComponentDimensioning, we return undefined\n return undefined as any;\n }\n\n private _initMaterials() {\n if (!this._cacheHolder.materialCache) {\n return;\n }\n\n if (this._cacheHolder.materialCache.has(LINE_MATERIAL)) {\n this._lineMaterial = this._cacheHolder.materialCache.get(\n LINE_MATERIAL,\n ) as LineBasicMaterial;\n } else {\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n });\n this._cacheHolder.materialCache.set(LINE_MATERIAL, this._lineMaterial);\n }\n }\n\n private _init() {\n this._initMaterials();\n\n const maxSize = Math.round(\n Math.max(this._size.y, this._size.x, this._size.z),\n );\n const length = Math.abs(this._dimensioning.to - this._dimensioning.from);\n\n let fontSize = TEXT_SIZE + (maxSize < 4 ? 0 : maxSize * 0.005);\n if (length < 0.3) {\n fontSize *= 0.5 + length;\n }\n\n // Approximate text height for spacing calculations\n // Based on typical font metrics (height is roughly 1.4x the font size)\n const levelSpacing = fontSize * 1.4;\n\n const lineOffset =\n LINE_SPACING + (3 * TEXT_SPACING + levelSpacing) * this._level;\n\n const line = this._axis.getEdge(\n this._dimensioning.from,\n this._dimensioning.to,\n lineOffset,\n );\n\n this._addEdgeSideLines(\n levelSpacing,\n line,\n this._axis.labelDirection.clone(),\n );\n\n const lineGeometry = new BufferGeometry();\n const vertices = [\n line.start.x,\n line.start.y,\n line.start.z,\n line.end.x,\n line.end.y,\n line.end.z,\n ];\n lineGeometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n\n const lineObject = new Line(lineGeometry, this._lineMaterial);\n lineObject.name = 'component dimension line ' + this._dimensioning.axis;\n lineObject.renderOrder = MESH_RENDER_ORDER.DIMENSION_LINE;\n lineObject.layers.set(LAYER.DIMENSIONS);\n\n this._mainLineObject = lineObject;\n\n this.add(lineObject);\n\n const labelText = this._unitFormatter.formatMMValueToUnitString(\n length * 1000,\n );\n this._dimensionInMM = length * 1000;\n\n if (labelText === null) {\n return;\n }\n\n this._textLabel = this.createTextLabel(labelText);\n this.add(this._textLabel);\n }\n\n public setLabelVisible(visible: boolean) {\n if (!this._textLabel) {\n return;\n }\n\n this._textLabel.visible = visible;\n }\n\n public getDimensionInMM(): number {\n return this._dimensionInMM;\n }\n\n private createTextLabel(labelText: string): CSS2DObject {\n const labelHtmlDiv = createDimensioningTextLabelHtmlDiv(\n labelText,\n this._dimensioning.level,\n this._dimensioning.interactionKey,\n this.onEditingFinished,\n );\n const labelObject = new CSS2DObject(labelHtmlDiv);\n labelObject.userData.isLabel = true;\n labelObject.renderOrder = MESH_RENDER_ORDER.DIMENSION_LABEL;\n\n return labelObject;\n }\n\n private onEditingFinished = (interactionKey: string, value: string): void => {\n const parsedValue = this._unitFormatter.parseMMValueFromUnitString(\n value,\n 'length',\n );\n\n if (parsedValue === null) {\n return;\n }\n\n this.editingFinishedCallback(interactionKey, parsedValue);\n };\n\n // Get the world position center of the main dimension line (same logic as getDimensionLineCenter)\n private _getMainLineCenterWorldPosition(): Vector3 | null {\n if (!this._mainLineObject) {\n return null;\n }\n\n this.updateMatrixWorld(true);\n this._mainLineObject.updateMatrixWorld(true);\n\n const positions = this._mainLineObject.geometry.attributes.position.array;\n\n if (positions.length < 6) {\n return null;\n }\n\n const start = new Vector3(positions[0], positions[1], positions[2]);\n const end = new Vector3(positions[3], positions[4], positions[5]);\n\n start.applyMatrix4(this._mainLineObject.matrixWorld);\n end.applyMatrix4(this._mainLineObject.matrixWorld);\n\n return start.clone().add(end).multiplyScalar(0.5);\n }\n\n public initializeTextLabels(): void {\n if (!this._textLabel || this._textLabel.children.length > 0) {\n return;\n }\n\n try {\n this.updateMatrixWorld(true);\n\n const labelWorldPos = this._getMainLineCenterWorldPosition();\n if (labelWorldPos) {\n const labelLocalPos = this.worldToLocal(labelWorldPos.clone());\n this._textLabel.position.copy(labelLocalPos);\n }\n } catch (error) {\n console.warn('Failed to initialize text label for dimension:', error);\n if (this._textLabel) {\n this.remove(this._textLabel);\n }\n }\n }\n\n private _addEdgeSideLines(\n levelSpacing: number,\n line: Line3,\n labelDirection: Vector3,\n ) {\n const sideOffset = -(3 * TEXT_SPACING + levelSpacing) * 0.5;\n const endFrom = line.start.clone();\n const startFrom = line.start\n .clone()\n .add(labelDirection.clone().multiplyScalar(sideOffset));\n const endTo = line.end.clone();\n const startTo = line.end\n .clone()\n .add(labelDirection.clone().multiplyScalar(sideOffset));\n this._addLine(startFrom, endFrom);\n this._addLine(startTo, endTo);\n }\n\n private _addLine(start: Vector3, end: Vector3) {\n const lineGeometry = new BufferGeometry();\n const vertices = [start.x, start.y, start.z, end.x, end.y, end.z];\n lineGeometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(lineGeometry, this._lineMaterial);\n line.renderOrder = MESH_RENDER_ORDER.DIMENSION_LINE;\n line.layers.set(LAYER.DIMENSIONS);\n this.add(line);\n }\n\n public dispose() {\n this.remove(this._textLabel);\n this._mainLineObject = null;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAgB,EACd,GACA,GACA,GACA,GACgB;CAChB,IAAM,IAAe,SAAS,cAAc,MAAM;AA8BlD,QA7BA,EAAa,UAAU,IAAI,kB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WAAW,SAAS,KAAK,EAAc;;WAEvC,GAAO;AAEd,GADA,QAAQ,KAAK,kDAAkD,EAAM,EACjE,KAAK,cACP,KAAK,OAAO,KAAK,WAAW;;;CAKlC,kBACE,GACA,GACA,GACA;EACA,IAAM,IAAa,EAAE,IAAI,IAAe,KAAgB,IAClD,IAAU,EAAK,MAAM,OAAO,EAC5B,IAAY,EAAK,MACpB,OAAO,CACP,IAAI,EAAe,OAAO,CAAC,eAAe,EAAW,CAAC,EACnD,IAAQ,EAAK,IAAI,OAAO,EACxB,IAAU,EAAK,IAClB,OAAO,CACP,IAAI,EAAe,OAAO,CAAC,eAAe,EAAW,CAAC;AAEzD,EADA,KAAK,SAAS,GAAW,EAAQ,EACjC,KAAK,SAAS,GAAS,EAAM;;CAG/B,SAAiB,GAAgB,GAAc;EAC7C,IAAM,IAAe,IAAI,GAAgB,EACnC,IAAW;GAAC,EAAM;GAAG,EAAM;GAAG,EAAM;GAAG,EAAI;GAAG,EAAI;GAAG,EAAI;GAAE;AACjE,IAAa,aACX,YACA,IAAI,EAAgB,IAAI,aAAa,EAAS,EAAE,EAAE,CACnD;EACD,IAAM,IAAO,IAAI,EAAK,GAAc,KAAK,cAAc;AAGvD,EAFA,EAAK,cAAc,EAAkB,gBACrC,EAAK,OAAO,IAAI,EAAM,WAAW,EACjC,KAAK,IAAI,EAAK;;CAGhB,UAAiB;AAEf,EADA,KAAK,OAAO,KAAK,WAAW,EAC5B,KAAK,kBAAkB;;;GApQxB,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,gBAAA,KAAA,EAAA,KAGA,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"component-dimensioning-BaUqwqYJ.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/component-dimensioning-html-util.ts","../../packages/configurator-core/src/utils/component-dimensioning.ts"],"sourcesContent":["export function createDimensioningTextLabelHtmlDiv(\n labelText: string,\n dimensioningLevel: number,\n interactionKey: string | undefined,\n editingFinishedCallback: (interactionKey: string, value: string) => void,\n): HTMLDivElement {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add('dimension-label');\n\n if (dimensioningLevel === 0) {\n labelHtmlDiv.classList.add('dimension-label--primary');\n } else {\n labelHtmlDiv.classList.add('dimension-label--secondary');\n }\n\n if (!interactionKey) {\n labelHtmlDiv.classList.add('dimension-label--disabled');\n } else {\n labelHtmlDiv.onclick = () => {\n labelHtmlDiv.classList.add('dimension-label--editing');\n while (labelHtmlDiv.firstChild) {\n labelHtmlDiv.removeChild(labelHtmlDiv.firstChild);\n }\n const labelHtmlInput = createDimensioningLabelHtmlInput(\n labelText,\n interactionKey,\n editingFinishedCallback,\n );\n labelHtmlDiv.appendChild(labelHtmlInput);\n labelHtmlInput.focus();\n labelHtmlInput.select();\n };\n }\n\n resetChildren(labelHtmlDiv, labelText);\n\n return labelHtmlDiv;\n}\n\nfunction createDimensioningLabelHtmlInput(\n originalValue: string,\n interactionKey: string,\n editingFinishedCallback: (interactionKey: string, value: string) => void,\n): HTMLInputElement {\n const labelHtmlInput = document.createElement('input');\n labelHtmlInput.id = interactionKey;\n labelHtmlInput.type = 'text';\n labelHtmlInput.enterKeyHint = 'done';\n labelHtmlInput.classList.add('dimension-label__input');\n labelHtmlInput.inputMode = 'numeric';\n labelHtmlInput.pattern = '[0-9]*';\n labelHtmlInput.value = originalValue;\n\n function finishEditing(interactionKey: string, valueToSet: string): void {\n // avoid race conditions\n if (labelHtmlInput.id !== interactionKey) {\n return;\n }\n labelHtmlInput.id = '';\n\n const numValue = parseFloat(valueToSet);\n\n if (isNaN(numValue) || numValue <= 0) {\n editingFinishedCallback(interactionKey, originalValue);\n return;\n }\n\n editingFinishedCallback(interactionKey, valueToSet);\n }\n\n labelHtmlInput.onkeydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' || event.key === 'Esc') {\n finishEditing(interactionKey, originalValue);\n } else if (event.key === 'Enter') {\n finishEditing(interactionKey, labelHtmlInput.value);\n }\n };\n\n labelHtmlInput.onblur = () => {\n finishEditing(interactionKey, labelHtmlInput.value);\n };\n\n return labelHtmlInput;\n}\n\nfunction resetChildren(labelHtmlDiv: HTMLDivElement, labelText: string): void {\n while (labelHtmlDiv.firstChild) {\n labelHtmlDiv.removeChild(labelHtmlDiv.firstChild);\n }\n\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.dataset.testId = 'dimension-label-value';\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n}\n","import type CacheHolder from '../../../common-core/src/services/cache-holder';\nimport type UnitFormatter from '../services/unit-formatter';\nimport type { Dimensioning, DimensioningAxis } from '../../../typings/kernel';\n\nimport type { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Object3D,\n Vector3,\n} from 'three';\nimport { kernelDimensioningToThree } from '../../../common-core/src/utils/threejs-utils';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport { DIMENSIONING_GEOMETRY } from './dimensioning-helper';\nimport inject from '../../../common-core/src/di/inject';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\nimport { MESH_RENDER_ORDER } from '../../../common-core/src/webgl/render-order';\nimport { createDimensioningTextLabelHtmlDiv } from './component-dimensioning-html-util';\n\nconst LINE_MATERIAL = 'component_dimensioning_line_material';\nconst LINE_COLOR = 0x373737;\nconst LINE_SPACING = 0.05;\n\nconst TEXT_SPACING = 0.02;\nconst TEXT_SIZE = 0.025;\n\nexport interface DimensioningAndAxis {\n dimensioning: Dimensioning;\n axis?: DimensioningAxis;\n}\n\nclass ComponentDimensioningAxis {\n private _origin: Vector3;\n private readonly _direction: Vector3;\n private readonly _labelDirection: Vector3;\n\n constructor(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n cameraPosition: Vector3,\n ) {\n this._direction =\n ComponentDimensioningAxis._getDirection(dimensioningAndAxis);\n const defaultLabelDirection =\n ComponentDimensioningAxis._getDefaultLabelDirection(\n dimensioningAndAxis,\n this._direction,\n );\n const lookAtOppositeSide = cameraPosition.dot(defaultLabelDirection) >= 0;\n this._labelDirection =\n ComponentDimensioningAxis._calculateActualLabelDirection(\n dimensioningAndAxis,\n lookAtOppositeSide,\n defaultLabelDirection,\n );\n this._origin = ComponentDimensioningAxis._calculateOrigin(\n dimensioningAndAxis,\n boundingBox,\n lookAtOppositeSide,\n );\n }\n\n get direction(): Vector3 {\n return this._direction;\n }\n\n get labelDirection(): Vector3 {\n return this._labelDirection;\n }\n\n getEdge(from: number, to: number, lineOffset: number): Line3 {\n const start = this._origin\n .clone()\n .add(this._direction.clone().multiplyScalar(from))\n .add(this._labelDirection.clone().multiplyScalar(lineOffset));\n const end = this._origin\n .clone()\n .add(this._direction.clone().multiplyScalar(to))\n .add(this._labelDirection.clone().multiplyScalar(lineOffset));\n return new Line3(start, end);\n }\n\n private static _getDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n ): Vector3 {\n if (dimensioningAndAxis.axis) {\n return convertToTHREE(dimensioningAndAxis.axis.direction).normalize();\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(1, 0, 0);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(0, 0, 1);\n }\n return new Vector3(0, 1, 0);\n }\n\n private static _getDefaultLabelDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n direction: Vector3,\n ): Vector3 {\n if (dimensioningAndAxis.axis) {\n const labelDirection = convertToTHREE(\n dimensioningAndAxis.axis.labelDirection,\n );\n const planeNormal = direction.clone().cross(labelDirection);\n return planeNormal.cross(direction).normalize();\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(0, 1, 0);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(-1, 0, 0);\n }\n return new Vector3(-1, 0, 0);\n }\n\n private static _calculateActualLabelDirection(\n dimensioningAndAxis: DimensioningAndAxis,\n lookAtOppositeSide: boolean,\n labelDirection: Vector3,\n ): Vector3 {\n if (lookAtOppositeSide) {\n if (dimensioningAndAxis.axis) {\n if (dimensioningAndAxis.axis.alternativeOrigin) {\n return labelDirection.clone().multiplyScalar(-1);\n }\n } else if (\n dimensioningAndAxis.dimensioning.axis === 'y' ||\n dimensioningAndAxis.dimensioning.axis === 'z'\n ) {\n return labelDirection.clone().multiplyScalar(-1);\n }\n }\n return labelDirection;\n }\n\n private static _calculateOrigin(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n lookAtOppositeSide: boolean,\n ): Vector3 {\n const center = boundingBox.getCenter(new Vector3());\n const size = boundingBox.getSize(new Vector3());\n if (dimensioningAndAxis.axis) {\n return lookAtOppositeSide && dimensioningAndAxis.axis.alternativeOrigin\n ? convertToTHREE(dimensioningAndAxis.axis.alternativeOrigin)\n : convertToTHREE(dimensioningAndAxis.axis.origin);\n } else if (dimensioningAndAxis.dimensioning.axis === 'x') {\n return new Vector3(0, center.y + size.y * 0.5, center.z - size.z * 0.5);\n } else if (dimensioningAndAxis.dimensioning.axis === 'y') {\n return new Vector3(\n center.x + size.x * (lookAtOppositeSide ? 0.5 : -0.5),\n center.y - size.y * 0.5,\n 0,\n );\n }\n return new Vector3(\n center.x + size.x * (lookAtOppositeSide ? 0.5 : -0.5),\n 0,\n center.z - size.z * 0.5,\n );\n }\n}\n\nexport default class ComponentDimensioning extends Object3D {\n @inject\n private _cacheHolder: CacheHolder;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _dimensioning: Dimensioning;\n private _axis: ComponentDimensioningAxis;\n private _size: Vector3;\n private _dimensionInMM: number;\n\n private readonly editingFinishedCallback: (\n interactionKey: string,\n value: number,\n ) => void;\n\n private readonly _level: number;\n private _lineMaterial: LineBasicMaterial;\n\n private _textLabel: CSS2DObject;\n\n private _mainLineObject: Line | null = null;\n\n constructor(\n dimensioningAndAxis: DimensioningAndAxis,\n boundingBox: Box3,\n relativeCameraDirection: Vector3,\n editingFinishedCallback: (interactionKey: string, value: number) => void,\n ) {\n super();\n this.name = DIMENSIONING_GEOMETRY;\n\n this._size = boundingBox.getSize(new Vector3());\n this._dimensioning = kernelDimensioningToThree(\n dimensioningAndAxis.dimensioning,\n );\n this._axis = new ComponentDimensioningAxis(\n dimensioningAndAxis,\n boundingBox,\n relativeCameraDirection,\n );\n this._level = this._dimensioning.maxLevel - this._dimensioning.level;\n\n this.editingFinishedCallback = editingFinishedCallback;\n\n this._init();\n }\n\n clone() {\n console.warn(\n 'Will not clone ComponentDimensioning because this can break the generation of perspective images. ' +\n 'If the ComponentDimensioning is visible during the generation of the perspective image, ' +\n 'three.js tries to clone it but clone does not give any parameters to the constructor and therefore the clone breaks.',\n );\n // Since we do not need to clone ComponentDimensioning, we return undefined\n return undefined as any;\n }\n\n private _initMaterials() {\n if (!this._cacheHolder.materialCache) {\n return;\n }\n\n if (this._cacheHolder.materialCache.has(LINE_MATERIAL)) {\n this._lineMaterial = this._cacheHolder.materialCache.get(\n LINE_MATERIAL,\n ) as LineBasicMaterial;\n } else {\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n });\n this._cacheHolder.materialCache.set(LINE_MATERIAL, this._lineMaterial);\n }\n }\n\n private _init() {\n this._initMaterials();\n\n const maxSize = Math.round(\n Math.max(this._size.y, this._size.x, this._size.z),\n );\n const length = Math.abs(this._dimensioning.to - this._dimensioning.from);\n\n let fontSize = TEXT_SIZE + (maxSize < 4 ? 0 : maxSize * 0.005);\n if (length < 0.3) {\n fontSize *= 0.5 + length;\n }\n\n // Approximate text height for spacing calculations\n // Based on typical font metrics (height is roughly 1.4x the font size)\n const levelSpacing = fontSize * 1.4;\n\n const lineOffset =\n LINE_SPACING + (3 * TEXT_SPACING + levelSpacing) * this._level;\n\n const line = this._axis.getEdge(\n this._dimensioning.from,\n this._dimensioning.to,\n lineOffset,\n );\n\n this._addEdgeSideLines(\n levelSpacing,\n line,\n this._axis.labelDirection.clone(),\n );\n\n const lineGeometry = new BufferGeometry();\n const vertices = [\n line.start.x,\n line.start.y,\n line.start.z,\n line.end.x,\n line.end.y,\n line.end.z,\n ];\n lineGeometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n\n const lineObject = new Line(lineGeometry, this._lineMaterial);\n lineObject.name = 'component dimension line ' + this._dimensioning.axis;\n lineObject.renderOrder = MESH_RENDER_ORDER.DIMENSION_LINE;\n lineObject.layers.set(LAYER.DIMENSIONS);\n\n this._mainLineObject = lineObject;\n\n this.add(lineObject);\n\n const labelText = this._unitFormatter.formatMMValueToUnitString(\n length * 1000,\n );\n this._dimensionInMM = length * 1000;\n\n if (labelText === null) {\n return;\n }\n\n this._textLabel = this.createTextLabel(labelText);\n this.add(this._textLabel);\n }\n\n public setLabelVisible(visible: boolean) {\n if (!this._textLabel) {\n return;\n }\n\n this._textLabel.visible = visible;\n }\n\n public getDimensionInMM(): number {\n return this._dimensionInMM;\n }\n\n private createTextLabel(labelText: string): CSS2DObject {\n const labelHtmlDiv = createDimensioningTextLabelHtmlDiv(\n labelText,\n this._dimensioning.level,\n this._dimensioning.interactionKey,\n this.onEditingFinished,\n );\n const labelObject = new CSS2DObject(labelHtmlDiv);\n labelObject.userData.isLabel = true;\n labelObject.renderOrder = MESH_RENDER_ORDER.DIMENSION_LABEL;\n\n return labelObject;\n }\n\n private onEditingFinished = (interactionKey: string, value: string): void => {\n const parsedValue = this._unitFormatter.parseMMValueFromUnitString(\n value,\n 'length',\n );\n\n if (parsedValue === null) {\n return;\n }\n\n this.editingFinishedCallback(interactionKey, parsedValue);\n };\n\n // Get the world position center of the main dimension line (same logic as getDimensionLineCenter)\n private _getMainLineCenterWorldPosition(): Vector3 | null {\n if (!this._mainLineObject) {\n return null;\n }\n\n this.updateMatrixWorld(true);\n this._mainLineObject.updateMatrixWorld(true);\n\n const positions = this._mainLineObject.geometry.attributes.position.array;\n\n if (positions.length < 6) {\n return null;\n }\n\n const start = new Vector3(positions[0], positions[1], positions[2]);\n const end = new Vector3(positions[3], positions[4], positions[5]);\n\n start.applyMatrix4(this._mainLineObject.matrixWorld);\n end.applyMatrix4(this._mainLineObject.matrixWorld);\n\n return start.clone().add(end).multiplyScalar(0.5);\n }\n\n public initializeTextLabels(): void {\n if (!this._textLabel || this._textLabel.children.length > 0) {\n return;\n }\n\n try {\n this.updateMatrixWorld(true);\n\n const labelWorldPos = this._getMainLineCenterWorldPosition();\n if (labelWorldPos) {\n const labelLocalPos = this.worldToLocal(labelWorldPos.clone());\n this._textLabel.position.copy(labelLocalPos);\n }\n } catch (error) {\n console.warn('Failed to initialize text label for dimension:', error);\n if (this._textLabel) {\n this.remove(this._textLabel);\n }\n }\n }\n\n private _addEdgeSideLines(\n levelSpacing: number,\n line: Line3,\n labelDirection: Vector3,\n ) {\n const sideOffset = -(3 * TEXT_SPACING + levelSpacing) * 0.5;\n const endFrom = line.start.clone();\n const startFrom = line.start\n .clone()\n .add(labelDirection.clone().multiplyScalar(sideOffset));\n const endTo = line.end.clone();\n const startTo = line.end\n .clone()\n .add(labelDirection.clone().multiplyScalar(sideOffset));\n this._addLine(startFrom, endFrom);\n this._addLine(startTo, endTo);\n }\n\n private _addLine(start: Vector3, end: Vector3) {\n const lineGeometry = new BufferGeometry();\n const vertices = [start.x, start.y, start.z, end.x, end.y, end.z];\n lineGeometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(lineGeometry, this._lineMaterial);\n line.renderOrder = MESH_RENDER_ORDER.DIMENSION_LINE;\n line.layers.set(LAYER.DIMENSIONS);\n this.add(line);\n }\n\n public dispose() {\n this.remove(this._textLabel);\n this._mainLineObject = null;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAgB,EACd,GACA,GACA,GACA,GACgB;CAChB,IAAM,IAAe,SAAS,cAAc,MA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n as i, dt as a, f as o, sn as s } from "./three.core-0KaTx8dm.mjs";
3
- import { t as c } from "./layer-DaGoZ5YI.mjs";
3
+ import { t as c } from "./layer-DRMDGxT7.mjs";
4
4
  import { L as l } from "./common-utils-DbL4tku0.mjs";
5
5
  //#region packages/configurator-core/src/utils/component-raycast-helper.ts
6
6
  var u = class {
@@ -93,4 +93,4 @@ var u = class {
93
93
  //#endregion
94
94
  export { u as t };
95
95
 
96
- //# sourceMappingURL=component-raycast-helper-CEAdBcdx.mjs.map
96
+ //# sourceMappingURL=component-raycast-helper-4i8b4E5B.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-raycast-helper-CEAdBcdx.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/component-raycast-helper.ts"],"sourcesContent":["import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport { throttle } from '../../../common-core/src/utils/common-utils';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\nimport { transitionTransparencyOfMaterial } from '../../../common-core/src/utils/threejs-utils';\nimport type { Object3D, PerspectiveCamera } from 'three';\nimport {\n Box3,\n Frustum,\n Matrix4,\n Mesh,\n MeshStandardMaterial,\n Raycaster,\n Vector3,\n} from 'three';\n\nimport type { HighlightHelper } from './highlight-helper';\n\nexport default class ComponentRaycastHelper implements HighlightHelper {\n private _object: Object3D;\n private _camera: PerspectiveCamera;\n private _raycaster: Raycaster;\n\n private _nonTransparentComponent: RoomleComponent | null = null;\n\n constructor() {\n this._raycaster = new Raycaster();\n this._raycaster.near = 0.1;\n this._raycaster.layers.enable(LAYER.OBJECT);\n this._raycaster.layers.enable(LAYER.COMPONENT);\n this._raycaster.layers.enable(LAYER.PREVIEW);\n this._raycaster.layers.enable(LAYER.UI);\n }\n\n public init(object: Object3D, camera: PerspectiveCamera) {\n this._object = object;\n this._camera = camera;\n\n this.checkComponentVisibility = throttle(\n this.checkComponentVisibility,\n 100,\n ).bind(this);\n this.checkPreviewVisibility = throttle(\n this.checkPreviewVisibility,\n 100,\n ).bind(this);\n }\n\n public setCamera(camera: PerspectiveCamera) {\n this._camera = camera;\n }\n\n public setObject(object: Object3D | null) {\n if (object) {\n this._object = object;\n }\n }\n\n public changeMaterialsOnSelect(\n object: Object3D,\n component: RoomleComponent | null,\n selected: boolean = false,\n callback?: () => void,\n ) {\n if (component === this._nonTransparentComponent) {\n return;\n }\n this._nonTransparentComponent = component;\n this._changeMaterialsOnSelect(object, component, selected, callback);\n }\n\n public cancelDocking(object: Object3D, callback?: () => void) {\n this.changeMaterialsOnSelect(object, null, false, callback);\n }\n\n private _changeMaterialsOnSelect(\n object: Object3D,\n component: RoomleComponent | null,\n selected: boolean = false,\n callback?: () => void,\n ) {\n if (object.children.length > 0) {\n for (const child of object.children) {\n const selectChild =\n (component && object.id === component.id) || selected;\n const isComponent = !(child instanceof Mesh);\n if (!child.userData.ignoreComponentRaycast) {\n this._changeMaterialsOnSelect(\n child,\n component,\n selectChild && isComponent ? false : selectChild,\n callback,\n );\n }\n }\n }\n if (component) {\n if (\n object instanceof Mesh &&\n object.material instanceof MeshStandardMaterial &&\n !object.userData.oldMaterial\n ) {\n object.userData.oldMaterial = object.material;\n object.material = object.material.clone();\n if (!selected) {\n transitionTransparencyOfMaterial(object, {\n opacity: 0.2,\n transparent: true,\n }).then(() => {\n callback?.();\n });\n }\n }\n } else if (object.userData.oldMaterial) {\n if (\n object instanceof Mesh &&\n object.material instanceof MeshStandardMaterial\n ) {\n const { opacity, transparent } = object.userData.oldMaterial;\n transitionTransparencyOfMaterial(object, { opacity, transparent }).then(\n () => callback?.(),\n );\n object.userData.oldMaterial = undefined;\n }\n }\n }\n\n public isComponentVisible(component: RoomleComponent): boolean {\n const uuids: string[] = [];\n component.traverse((object) => uuids.push(object.uuid));\n const position = new Box3()\n .setFromObject(component)\n .getCenter(new Vector3());\n const direction = new Vector3()\n .subVectors(position, this._camera.position)\n .normalize();\n this._raycaster.set(this._camera.position, direction);\n this._raycaster.far = this._camera.position.distanceTo(position);\n const visibleIntersections = this._raycaster\n .intersectObjects(this._object.children, true)\n .filter((i) => {\n // do not include invisible materials\n if (!(i.object as any).material.visible) {\n return false;\n }\n // do not include the object itself\n if (uuids.includes(i.object.uuid)) {\n return false;\n }\n // do not include objects which explicitly have the ignoreComponentRaycast flag\n if ((i.object as any).userData.ignoreComponentRaycast) {\n return false;\n }\n return true;\n });\n return visibleIntersections.length === 0;\n }\n\n public checkComponentAndPreviewVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n if (sceneEventHandler.hasSelection()) {\n this.checkComponentVisibility(sceneEventHandler, configuratorViewModel);\n } else if (configuratorViewModel.hasPreviews()) {\n this.checkPreviewVisibility(configuratorViewModel);\n } else {\n this.changeMaterialsOnSelect(this._object, null);\n }\n }\n\n public checkComponentVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n if (!sceneEventHandler.hasSelection()) {\n return;\n }\n const selectedComponents = configuratorViewModel.getComponentsForIds(\n sceneEventHandler.getSelectedRuntimeComponentIds(),\n );\n if (selectedComponents.length > 1) {\n return;\n }\n const selectedComponent = selectedComponents[0];\n if (this.isComponentVisible(selectedComponent)) {\n this.changeMaterialsOnSelect(this._object, null);\n } else {\n this.changeMaterialsOnSelect(this._object, selectedComponent);\n }\n }\n\n public areAllPreviewsVisible(\n configuratorViewModel: ConfiguratorViewModel,\n ): boolean {\n if (!configuratorViewModel.hasPreviews()) {\n return true;\n }\n const previews = configuratorViewModel.getPreviews();\n if (previews.length === 0) {\n return true;\n }\n return previews\n .map((preview) => this.isComponentVisible(preview))\n .reduce(\n (arePreviewsVisible, isPreviewVisible) =>\n arePreviewsVisible && isPreviewVisible,\n );\n }\n\n public areAllComponentsInFrustum(previews: RoomleComponent[]): boolean {\n if (previews.length === 0) {\n return true;\n }\n const frustum = new Frustum();\n const matrix = new Matrix4().multiplyMatrices(\n this._camera.projectionMatrix,\n this._camera.matrixWorldInverse,\n );\n const box3 = new Box3();\n frustum.setFromProjectionMatrix(matrix);\n const isComponentInFrustum = (component: RoomleComponent) => {\n const position = box3.setFromObject(component).getCenter(new Vector3());\n return frustum.containsPoint(position);\n };\n return previews\n .map((preview) => isComponentInFrustum(preview))\n .reduce(\n (arePreviewsVisible, isPreviewVisible) =>\n arePreviewsVisible && isPreviewVisible,\n );\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n if (configuratorViewModel.hasPreviewLines()) {\n return;\n }\n const allPreviewsVisible = this.areAllPreviewsVisible(\n configuratorViewModel,\n );\n if (!allPreviewsVisible) {\n this.changeMaterialsOnSelect(this._object, { id: -1 } as RoomleComponent);\n } else {\n this.changeMaterialsOnSelect(this._object, null);\n }\n }\n\n public isComponentMeasurementLabelOccluded(\n labelWorldPos: Vector3,\n component: RoomleComponent,\n ): boolean {\n const direction = new Vector3()\n .subVectors(labelWorldPos, this._camera.position)\n .normalize();\n const distance = this._camera.position.distanceTo(labelWorldPos);\n\n this._raycaster.set(this._camera.position, direction);\n this._raycaster.far = distance - 0.01;\n\n const intersections = this._raycaster.intersectObject(component, true);\n\n const occludingIntersections = intersections.filter((intersection) => {\n const obj = intersection.object as any;\n\n if (\n obj.type !== 'Mesh' ||\n obj.userData.ignoreComponentRaycast ||\n (obj.material && !obj.material.visible)\n ) {\n return false;\n }\n\n return true;\n });\n\n return occludingIntersections.length > 0;\n }\n\n public checkMultipleLabelOcclusion(\n labelPositions: Array<{ id: string; worldPos: Vector3 }>,\n component: RoomleComponent,\n ): Set<string> {\n const occludedLabelIds = new Set<string>();\n\n labelPositions.forEach(({ id, worldPos }) => {\n if (this.isComponentMeasurementLabelOccluded(worldPos, component)) {\n occludedLabelIds.add(id);\n }\n });\n\n return occludedLabelIds;\n }\n\n public onSelectionChanged(\n _object: Object3D,\n _componentIds: number[],\n _callback?: () => void,\n ) {\n // no-op: standard raycast highlighting reacts to camera movement, not selection\n }\n}\n"],"mappings":";;;;;AAmBA,IAAqB,IAArB,MAAuE;CAOrE,cAAc;AAMZ,kCARyD,MAGzD,KAAK,aAAa,IAAI,GAAW,EACjC,KAAK,WAAW,OAAO,IACvB,KAAK,WAAW,OAAO,OAAO,EAAM,OAAO,EAC3C,KAAK,WAAW,OAAO,OAAO,EAAM,UAAU,EAC9C,KAAK,WAAW,OAAO,OAAO,EAAM,QAAQ,EAC5C,KAAK,WAAW,OAAO,OAAO,EAAM,GAAG;;CAGzC,KAAY,GAAkB,GAA2B;AAQvD,EAPA,KAAK,UAAU,GACf,KAAK,UAAU,GAEf,KAAK,2BAA2B,EAC9B,KAAK,0BACL,IACD,CAAC,KAAK,KAAK,EACZ,KAAK,yBAAyB,EAC5B,KAAK,wBACL,IACD,CAAC,KAAK,KAAK;;CAGd,UAAiB,GAA2B;AAC1C,OAAK,UAAU;;CAGjB,UAAiB,GAAyB;AACxC,EAAI,MACF,KAAK,UAAU;;CAInB,wBACE,GACA,GACA,IAAoB,IACpB,GACA;AACI,QAAc,KAAK,6BAGvB,KAAK,2BAA2B,GAChC,KAAK,yBAAyB,GAAQ,GAAW,GAAU,EAAS;;CAGtE,cAAqB,GAAkB,GAAuB;AAC5D,OAAK,wBAAwB,GAAQ,MAAM,IAAO,EAAS;;CAG7D,yBACE,GACA,GACA,IAAoB,IACpB,GACA;AACA,MAAI,EAAO,SAAS,SAAS,EAC3B,MAAK,IAAM,KAAS,EAAO,UAAU;GACnC,IAAM,IACH,KAAa,EAAO,OAAO,EAAU,MAAO,GACzC,IAAc,EAAE,aAAiB;AACvC,GAAK,EAAM,SAAS,0BAClB,KAAK,yBACH,GACA,GACA,KAAe,IAAc,KAAQ,GACrC,EACD;;AAIP,MAAI,GAEA,aAAkB,KAClB,EAAO,oBAAoB,KAC3B,CAAC,EAAO,SAAS,gBAEjB,EAAO,SAAS,cAAc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B;GACpE,IAAM,IAAM,EAAa;AAUzB,UARA,EACE,EAAI,SAAS,UACb,EAAI,SAAS,0BACZ,EAAI,YAAY,CAAC,EAAI,SAAS;IAMjC,CAE4B,SAAS;;CAGzC,4BACE,GACA,GACa;EACb,IAAM,oBAAmB,IAAI,KAAa;AAQ1C,SANA,EAAe,SAAS,EAAE,OAAI,kBAAe;AAC3C,GAAI,KAAK,oCAAoC,GAAU,EAAU,IAC/D,EAAiB,IAAI,EAAG;IAE1B,EAEK;;CAGT,mBACE,GACA,GACA,GACA"}
1
+ {"version":3,"file":"component-raycast-helper-4i8b4E5B.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/component-raycast-helper.ts"],"sourcesContent":["import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport { throttle } from '../../../common-core/src/utils/common-utils';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\nimport { transitionTransparencyOfMaterial } from '../../../common-core/src/utils/threejs-utils';\nimport type { Object3D, PerspectiveCamera } from 'three';\nimport {\n Box3,\n Frustum,\n Matrix4,\n Mesh,\n MeshStandardMaterial,\n Raycaster,\n Vector3,\n} from 'three';\n\nimport type { HighlightHelper } from './highlight-helper';\n\nexport default class ComponentRaycastHelper implements HighlightHelper {\n private _object: Object3D;\n private _camera: PerspectiveCamera;\n private _raycaster: Raycaster;\n\n private _nonTransparentComponent: RoomleComponent | null = null;\n\n constructor() {\n this._raycaster = new Raycaster();\n this._raycaster.near = 0.1;\n this._raycaster.layers.enable(LAYER.OBJECT);\n this._raycaster.layers.enable(LAYER.COMPONENT);\n this._raycaster.layers.enable(LAYER.PREVIEW);\n this._raycaster.layers.enable(LAYER.UI);\n }\n\n public init(object: Object3D, camera: PerspectiveCamera) {\n this._object = object;\n this._camera = camera;\n\n this.checkComponentVisibility = throttle(\n this.checkComponentVisibility,\n 100,\n ).bind(this);\n this.checkPreviewVisibility = throttle(\n this.checkPreviewVisibility,\n 100,\n ).bind(this);\n }\n\n public setCamera(camera: PerspectiveCamera) {\n this._camera = camera;\n }\n\n public setObject(object: Object3D | null) {\n if (object) {\n this._object = object;\n }\n }\n\n public changeMaterialsOnSelect(\n object: Object3D,\n component: RoomleComponent | null,\n selected: boolean = false,\n callback?: () => void,\n ) {\n if (component === this._nonTransparentComponent) {\n return;\n }\n this._nonTransparentComponent = component;\n this._changeMaterialsOnSelect(object, component, selected, callback);\n }\n\n public cancelDocking(object: Object3D, callback?: () => void) {\n this.changeMaterialsOnSelect(object, null, false, callback);\n }\n\n private _changeMaterialsOnSelect(\n object: Object3D,\n component: RoomleComponent | null,\n selected: boolean = false,\n callback?: () => void,\n ) {\n if (object.children.length > 0) {\n for (const child of object.children) {\n const selectChild =\n (component && object.id === component.id) || selected;\n const isComponent = !(child instanceof Mesh);\n if (!child.userData.ignoreComponentRaycast) {\n this._changeMaterialsOnSelect(\n child,\n component,\n selectChild && isComponent ? false : selectChild,\n callback,\n );\n }\n }\n }\n if (component) {\n if (\n object instanceof Mesh &&\n object.material instanceof MeshStandardMaterial &&\n !object.userData.oldMaterial\n ) {\n object.userData.oldMaterial = object.material;\n object.material = object.material.clone();\n if (!selected) {\n transitionTransparencyOfMaterial(object, {\n opacity: 0.2,\n transparent: true,\n }).then(() => {\n callback?.();\n });\n }\n }\n } else if (object.userData.oldMaterial) {\n if (\n object instanceof Mesh &&\n object.material instanceof MeshStandardMaterial\n ) {\n const { opacity, transparent } = object.userData.oldMaterial;\n transitionTransparencyOfMaterial(object, { opacity, transparent }).then(\n () => callback?.(),\n );\n object.userData.oldMaterial = undefined;\n }\n }\n }\n\n public isComponentVisible(component: RoomleComponent): boolean {\n const uuids: string[] = [];\n component.traverse((object) => uuids.push(object.uuid));\n const position = new Box3()\n .setFromObject(component)\n .getCenter(new Vector3());\n const direction = new Vector3()\n .subVectors(position, this._camera.position)\n .normalize();\n this._raycaster.set(this._camera.position, direction);\n this._raycaster.far = this._camera.position.distanceTo(position);\n const visibleIntersections = this._raycaster\n .intersectObjects(this._object.children, true)\n .filter((i) => {\n // do not include invisible materials\n if (!(i.object as any).material.visible) {\n return false;\n }\n // do not include the object itself\n if (uuids.includes(i.object.uuid)) {\n return false;\n }\n // do not include objects which explicitly have the ignoreComponentRaycast flag\n if ((i.object as any).userData.ignoreComponentRaycast) {\n return false;\n }\n return true;\n });\n return visibleIntersections.length === 0;\n }\n\n public checkComponentAndPreviewVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n if (sceneEventHandler.hasSelection()) {\n this.checkComponentVisibility(sceneEventHandler, configuratorViewModel);\n } else if (configuratorViewModel.hasPreviews()) {\n this.checkPreviewVisibility(configuratorViewModel);\n } else {\n this.changeMaterialsOnSelect(this._object, null);\n }\n }\n\n public checkComponentVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n if (!sceneEventHandler.hasSelection()) {\n return;\n }\n const selectedComponents = configuratorViewModel.getComponentsForIds(\n sceneEventHandler.getSelectedRuntimeComponentIds(),\n );\n if (selectedComponents.length > 1) {\n return;\n }\n const selectedComponent = selectedComponents[0];\n if (this.isComponentVisible(selectedComponent)) {\n this.changeMaterialsOnSelect(this._object, null);\n } else {\n this.changeMaterialsOnSelect(this._object, selectedComponent);\n }\n }\n\n public areAllPreviewsVisible(\n configuratorViewModel: ConfiguratorViewModel,\n ): boolean {\n if (!configuratorViewModel.hasPreviews()) {\n return true;\n }\n const previews = configuratorViewModel.getPreviews();\n if (previews.length === 0) {\n return true;\n }\n return previews\n .map((preview) => this.isComponentVisible(preview))\n .reduce(\n (arePreviewsVisible, isPreviewVisible) =>\n arePreviewsVisible && isPreviewVisible,\n );\n }\n\n public areAllComponentsInFrustum(previews: RoomleComponent[]): boolean {\n if (previews.length === 0) {\n return true;\n }\n const frustum = new Frustum();\n const matrix = new Matrix4().multiplyMatrices(\n this._camera.projectionMatrix,\n this._camera.matrixWorldInverse,\n );\n const box3 = new Box3();\n frustum.setFromProjectionMatrix(matrix);\n const isComponentInFrustum = (component: RoomleComponent) => {\n const position = box3.setFromObject(component).getCenter(new Vector3());\n return frustum.containsPoint(position);\n };\n return previews\n .map((preview) => isComponentInFrustum(preview))\n .reduce(\n (arePreviewsVisible, isPreviewVisible) =>\n arePreviewsVisible && isPreviewVisible,\n );\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n if (configuratorViewModel.hasPreviewLines()) {\n return;\n }\n const allPreviewsVisible = this.areAllPreviewsVisible(\n configuratorViewModel,\n );\n if (!allPreviewsVisible) {\n this.changeMaterialsOnSelect(this._object, { id: -1 } as RoomleComponent);\n } else {\n this.changeMaterialsOnSelect(this._object, null);\n }\n }\n\n public isComponentMeasurementLabelOccluded(\n labelWorldPos: Vector3,\n component: RoomleComponent,\n ): boolean {\n const direction = new Vector3()\n .subVectors(labelWorldPos, this._camera.position)\n .normalize();\n const distance = this._camera.position.distanceTo(labelWorldPos);\n\n this._raycaster.set(this._camera.position, direction);\n this._raycaster.far = distance - 0.01;\n\n const intersections = this._raycaster.intersectObject(component, true);\n\n const occludingIntersections = intersections.filter((intersection) => {\n const obj = intersection.object as any;\n\n if (\n obj.type !== 'Mesh' ||\n obj.userData.ignoreComponentRaycast ||\n (obj.material && !obj.material.visible)\n ) {\n return false;\n }\n\n return true;\n });\n\n return occludingIntersections.length > 0;\n }\n\n public checkMultipleLabelOcclusion(\n labelPositions: Array<{ id: string; worldPos: Vector3 }>,\n component: RoomleComponent,\n ): Set<string> {\n const occludedLabelIds = new Set<string>();\n\n labelPositions.forEach(({ id, worldPos }) => {\n if (this.isComponentMeasurementLabelOccluded(worldPos, component)) {\n occludedLabelIds.add(id);\n }\n });\n\n return occludedLabelIds;\n }\n\n public onSelectionChanged(\n _object: Object3D,\n _componentIds: number[],\n _callback?: () => void,\n ) {\n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