ss-component-new 1.3.474 → 1.3.475

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 (85) hide show
  1. package/dist/{OrbitControls-X8Tx1hPt.js → OrbitControls-CcniPNk7.js} +1 -1
  2. package/dist/{OrbitControls-DvnUitVd.cjs → OrbitControls-kK6BBpL4.cjs} +1 -1
  3. package/dist/{PCDLoader-BG-ZSu84.js → PCDLoader-B0_dKUxm.js} +1 -1
  4. package/dist/{PCDLoader-Dy4BlpG3.cjs → PCDLoader-BhWhU7AF.cjs} +1 -1
  5. package/dist/{animationData-Bln0M7cD.js → animationData-_k7oY6dT.js} +1 -1
  6. package/dist/{animationData-BsfHPO-P.cjs → animationData-u3PDQuOQ.cjs} +1 -1
  7. package/dist/{iconfont-D9hgzLCg.cjs → iconfont-BYcEzhNe.cjs} +1 -1
  8. package/dist/{iconfont-BQBCgO1O.js → iconfont-DiGd__OT.js} +2 -2
  9. package/dist/{index-BTghn1W2.cjs → index-4sRonvwO.cjs} +1 -1
  10. package/dist/{index-BWUv92s4.cjs → index-BER-9cea.cjs} +1 -1
  11. package/dist/{index-BQCj3fMV.js → index-BEmcYHbr.js} +13 -13
  12. package/dist/{index-CD5uCiH9.js → index-BG20WI0G.js} +1 -1
  13. package/dist/{index-BOb1nNwq.js → index-BWlbMCvF.js} +3 -3
  14. package/dist/{index-DlMQigjS.js → index-B_hltucu.js} +1 -1
  15. package/dist/{index-8dhcui8A.js → index-BeRXwYS6.js} +1 -1
  16. package/dist/{index-BQOERy34.cjs → index-BrmJTI0B.cjs} +1 -1
  17. package/dist/{index-BKIacUel.cjs → index-Bu78K7ZG.cjs} +1 -1
  18. package/dist/{index-CNbYtIV_.cjs → index-BvHQ4rgD.cjs} +1 -1
  19. package/dist/{index-Dq4Lwm9O.cjs → index-C-B1N90Y.cjs} +1 -1
  20. package/dist/{index-DJL-eKIo.js → index-C35tMkD-.js} +2 -2
  21. package/dist/{index-sVdFHyjl.cjs → index-C89mMUM5.cjs} +1 -1
  22. package/dist/{index-CHIWRNqT.cjs → index-C8G1ik6O.cjs} +1 -1
  23. package/dist/{index-BWxZZ5t2.js → index-C8howWAV.js} +6 -6
  24. package/dist/{index-BW7PEvq0.js → index-CFp-3Ii5.js} +1 -1
  25. package/dist/{index-BAC9zNh7.js → index-CV1On3aP.js} +3 -3
  26. package/dist/{index-DFfIPpCG.js → index-CZU4FRVk.js} +3 -3
  27. package/dist/{index-D_Xo-WAP.cjs → index-Ca7EraIq.cjs} +1 -1
  28. package/dist/{index-DyeuJeIz.js → index-Cjax9TjT.js} +2 -2
  29. package/dist/{index-Djzfu6It.js → index-CnERmJxh.js} +3 -3
  30. package/dist/{index-CJIlx0kh.cjs → index-CoDkK5hg.cjs} +1 -1
  31. package/dist/{index-DOoRG-By.cjs → index-CsdTTuj7.cjs} +1 -1
  32. package/dist/{index-CmDV_HX-.cjs → index-Cvv5GKOV.cjs} +1 -1
  33. package/dist/{index-TGKm3MXI.js → index-Cx8gP3xA.js} +6 -6
  34. package/dist/{index-0JtF10qC.cjs → index-CxNA05bD.cjs} +1 -1
  35. package/dist/{index-CMiciReg.js → index-D04ebGoA.js} +1 -1
  36. package/dist/{index-FrPdQKQq.js → index-D54GltRD.js} +1 -1
  37. package/dist/{index-B1cEBcBv.cjs → index-D8agmBOg.cjs} +1 -1
  38. package/dist/{index-CZ01Uey-.js → index-DBZg952W.js} +4 -4
  39. package/dist/{index-cAtiRq0m.js → index-DHHOxu2C.js} +2 -2
  40. package/dist/{index-iDpB4RnF.cjs → index-DHotzRf6.cjs} +1 -1
  41. package/dist/{index-C6xyzF3E.cjs → index-DiH9I8Qd.cjs} +1 -1
  42. package/dist/{index-B74gcS36.cjs → index-DmN5XL7c.cjs} +1 -1
  43. package/dist/{index-CyjcMwPq.js → index-DoOEAJe9.js} +1 -1
  44. package/dist/{index-CdNXBIFC.cjs → index-DpDOUFmB.cjs} +1 -1
  45. package/dist/{index-B8MP6uHs.cjs → index-DqcKRmzN.cjs} +1 -1
  46. package/dist/{index-CbjEUSvK.cjs → index-LkiYEgcl.cjs} +1 -1
  47. package/dist/{index-CJfoKnFP.js → index-ThbaNcbe.js} +1 -1
  48. package/dist/{index-CeuUur0J.js → index-_qmANZPg.js} +1 -1
  49. package/dist/{index-BdB_acmm.cjs → index-eGw5gJGa.cjs} +1 -1
  50. package/dist/{index-ChCxwtv1.js → index-oXfFN0Pr.js} +1 -1
  51. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DCLueP3M.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Cws68h8h.cjs} +1 -1
  52. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BRGuwIGi.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-tsnXyC8a.js} +6 -6
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CYXAbj2a.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B3RSoHQA.js} +4379 -4379
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DpGu0pGu.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BkkUVCLE.cjs} +73 -73
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CbAt1Sgy.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-BzTbm05u.js} +3 -3
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CzixMCTz.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-ChLyboIT.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_1_lang-bvR0uxez.js → index.vue_vue_type_style_index_1_lang-Cwuh77RJ.js} +3 -3
  58. package/dist/{index.vue_vue_type_style_index_1_lang-DiCmmZWZ.cjs → index.vue_vue_type_style_index_1_lang-D_Jkk1jj.cjs} +1 -1
  59. package/dist/{main-DBuDKx9k.js → main-CQ5P45HO.js} +2 -2
  60. package/dist/{main-BAdh_eGu.cjs → main-CdLPmV9p.cjs} +1 -1
  61. package/dist/{pointTrack-C3DjtFZp.cjs → pointTrack-BlTNQUei.cjs} +1 -1
  62. package/dist/{pointTrack-DINaUvcX.js → pointTrack-o_VVFlmw.js} +1 -1
  63. package/dist/{robotUtil-BeynP2xM.js → robotUtil-BIMs6Vbb.js} +1 -1
  64. package/dist/{robotUtil-CI-r19FW.cjs → robotUtil-CHCt1RuS.cjs} +1 -1
  65. package/dist/ss-component.cjs +1 -1
  66. package/dist/ss-component.js +9 -9
  67. package/dist/ss-component2.cjs +1 -1
  68. package/dist/ss-component2.js +10 -10
  69. package/dist/{threeModel-CEX82wRN.cjs → threeModel-DP_7xQQL.cjs} +1 -1
  70. package/dist/{threeModel-DT3NAfO0.js → threeModel-OAebCYSS.js} +5 -5
  71. package/dist/{threePreview-D3TXuSzk.cjs → threePreview-BNlZnB3i.cjs} +1 -1
  72. package/dist/{threePreview-BDS4HbKS.js → threePreview-RzBngWrN.js} +3 -3
  73. package/dist/{threeSceneView-Cl6V_agq.cjs → threeSceneView-C1o5iNCO.cjs} +1 -1
  74. package/dist/{threeSceneView-DN0ThqUj.js → threeSceneView-C8vlDAO-.js} +7 -7
  75. package/dist/{threeSceneViewForCPMPIP-Bln3jqsZ.cjs → threeSceneViewForCPMPIP-ByuSeCFK.cjs} +1 -1
  76. package/dist/{threeSceneViewForCPMPIP-6wdyEUgw.js → threeSceneViewForCPMPIP-CdhbgviA.js} +10 -10
  77. package/dist/{threeTrackPathView-C8VR9-qO.cjs → threeTrackPathView-BqI0D7OI.cjs} +1 -1
  78. package/dist/{threeTrackPathView-B1oaH-Qc.js → threeTrackPathView-DyGh44hI.js} +5 -5
  79. package/dist/{threeViewerHost-BaGBR8jd.js → threeViewerHost-CTUpfC_Y.js} +2 -2
  80. package/dist/{threeViewerHost-pVmmGFpg.cjs → threeViewerHost-Czjy_lsO.cjs} +2 -2
  81. package/dist/{urdfTree-BU2M7_8q.cjs → urdfTree-CE1RFgO5.cjs} +1 -1
  82. package/dist/{urdfTree-BhqPlNff.js → urdfTree-Du-nKROV.js} +1 -1
  83. package/dist/{workpieceTreePanel-DiVmUGRy.js → workpieceTreePanel-BCaK6cMT.js} +5 -5
  84. package/dist/{workpieceTreePanel-2XzE7ufi.cjs → workpieceTreePanel-XnZWnUpu.cjs} +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),H=require("./iconfont-D9hgzLCg.cjs"),u=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DpGu0pGu.cjs"),J=require("./index-CEwxrYB-.cjs"),z=require("./PCDLoader-Dy4BlpG3.cjs"),B=require("./svgIcon-BH_8oaav.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class ie extends u.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new de(t)}),this.register(function(t){return new fe(t)}),this.register(function(t){return new Me(t)}),this.register(function(t){return new Le(t)}),this.register(function(t){return new Ae(t)}),this.register(function(t){return new pe(t)}),this.register(function(t){return new me(t)}),this.register(function(t){return new ge(t)}),this.register(function(t){return new Te(t)}),this.register(function(t){return new ue(t)}),this.register(function(t){return new Re(t)}),this.register(function(t){return new he(t)}),this.register(function(t){return new Ee(t)}),this.register(function(t){return new xe(t)}),this.register(function(t){return new ce(t)}),this.register(function(t){return new _e(t)}),this.register(function(t){return new ye(t)})}load(e,t,r,n){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(e);o=u.LoaderUtils.resolveURL(c,this.path)}else o=u.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){n?n(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(c){try{s.parse(c,o,function(d){t(d),s.manager.itemEnd(e)},a)}catch(d){a(d)}},r,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let s;const o={},a={},i=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(i.decode(new Uint8Array(e,0,4))===ne){try{o[L.KHR_BINARY_GLTF]=new Se(e)}catch(l){n&&n(l);return}s=JSON.parse(o[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(i.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Ge(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,o[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],f=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:o[l]=new le;break;case L.KHR_DRACO_MESH_COMPRESSION:o[l]=new we(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:o[l]=new be;break;case L.KHR_MESH_QUANTIZATION:o[l]=new Ne;break;default:f.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(r,n)}parseAsync(e,t){const r=this;return new Promise(function(n,s){r.parse(e,t,n,s)})}}function ae(){let h={};return{get:function(e){return h[e]},add:function(e,t){h[e]=t},remove:function(e){delete h[e]},removeAll:function(){h={}}}}const L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ce{constructor(e){this.parser=e,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){const s=t[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let n=t.cache.get(r);if(n)return n;const s=t.json,i=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const d=new u.Color(16777215);i.color!==void 0&&d.setRGB(i.color[0],i.color[1],i.color[2],u.LinearSRGBColorSpace);const l=i.range!==void 0?i.range:0;switch(i.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,c.angle=i.spot.outerConeAngle,c.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return c.position.set(0,0,0),k(c,i),i.intensity!==void 0&&(c.intensity=i.intensity),c.name=t.createUniqueName(i.name||"light_"+e),n=Promise.resolve(c),t.cache.add(r,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,s=r.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return r._getNodeRef(t.cache,a,i)})}}class le{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(e,t,r){const n=[];e.color=new u.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],u.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(e,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class ue{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class de{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class fe{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class he{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class pe{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new u.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(r.assignTexture(t,"sheenColorMap",o.sheenColorTexture,u.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class me{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(r.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class ge{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(r.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class Te{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class Re{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(r.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&s.push(r.assignTexture(t,"specularColorMap",o.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class xe{constructor(e){this.parser=e,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(r.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class Ee{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(r.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class Me{constructor(e){this.parser=e,this.name=L.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Le{constructor(e){this.parser=e,this.name=L.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let i=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(i=c)}return r.loadTextureImage(e,o.source,i)}}class Ae{constructor(e){this.parser=e,this.name=L.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let i=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(i=c)}return r.loadTextureImage(e,o.source,i)}}class _e{constructor(e){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const i=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,f=new Uint8Array(a,i,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,l,f,n.mode,n.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(d*l);return o.decodeGltfBuffer(new Uint8Array(m),d,l,f,n.mode,n.filter),m})})}else return null}}class ye{constructor(e){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const n=t.meshes[r.mesh];for(const c of n.primitives)if(c.mode!==v.TRIANGLES&&c.mode!==v.TRIANGLE_STRIP&&c.mode!==v.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=r.extensions[this.name].attributes,a=[],i={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(i[c]=d,i[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],f=c[0].count,m=[];for(const T of l){const E=new u.Matrix4,R=new u.Vector3,g=new u.Quaternion,x=new u.Vector3(1,1,1),y=new u.InstancedMesh(T.geometry,T.material,f);for(let M=0;M<f;M++)i.TRANSLATION&&R.fromBufferAttribute(i.TRANSLATION,M),i.ROTATION&&g.fromBufferAttribute(i.ROTATION,M),i.SCALE&&x.fromBufferAttribute(i.SCALE,M),y.setMatrixAt(M,E.compose(R,g,x));for(const M in i)if(M==="_COLOR_0"){const S=i[M];y.instanceColor=new u.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else M!=="TRANSLATION"&&M!=="ROTATION"&&M!=="SCALE"&&T.geometry.setAttribute(M,i[M]);u.Object3D.prototype.copy.call(y,T),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const ne="glTF",U=12,Q={JSON:1313821514,BIN:5130562};class Se{constructor(e){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,U),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ne)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-U,s=new DataView(e,U);let o=0;for(;o<n;){const a=s.getUint32(o,!0);o+=4;const i=s.getUint32(o,!0);if(o+=4,i===Q.JSON){const c=new Uint8Array(e,U+o,a);this.content=r.decode(c)}else if(i===Q.BIN){const c=U+o;this.body=e.slice(c,c+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class we{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,n=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},i={},c={};for(const d in o){const l=$[d]||d.toLowerCase();a[l]=o[d]}for(const d in e.attributes){const l=$[d]||d.toLowerCase();if(o[d]!==void 0){const f=r.accessors[e.attributes[d]],m=G[f.componentType];c[l]=m.name,i[l]=f.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(l,f){n.decodeDracoFile(d,function(m){for(const T in m.attributes){const E=m.attributes[T],R=i[T];R!==void 0&&(E.normalized=R)}l(m)},a,c,u.LinearSRGBColorSpace,f)})})}}class be{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Ne{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class se extends u.Interpolant{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n*3+n;for(let o=0;o!==n;o++)t[o]=r[s+o];return t}interpolate_(e,t,r,n){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,i=a*2,c=a*3,d=n-t,l=(r-t)/d,f=l*l,m=f*l,T=e*c,E=T-c,R=-2*m+3*f,g=m-f,x=1-R,y=g-f+l;for(let M=0;M!==a;M++){const S=o[E+M+a],_=o[E+M+i]*d,w=o[T+M+a],O=o[T+M]*d;s[M]=x*S+y*_+R*w+g*O}return s}}const Ce=new u.Quaternion;class Ie extends se{interpolate_(e,t,r,n){const s=super.interpolate_(e,t,r,n);return Ce.fromArray(s).normalize().toArray(s),s}}const v={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},G={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Z={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},ee={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},D={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Oe={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},q={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ve(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),h.DefaultMaterial}function F(h,e,t){for(const r in t.extensions)h[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function k(h,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(h.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Pe(h,e,t){let r=!1,n=!1,s=!1;for(let c=0,d=e.length;c<d;c++){const l=e[c];if(l.POSITION!==void 0&&(r=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(h);const o=[],a=[],i=[];for(let c=0,d=e.length;c<d;c++){const l=e[c];if(r){const f=l.POSITION!==void 0?t.getDependency("accessor",l.POSITION):h.attributes.position;o.push(f)}if(n){const f=l.NORMAL!==void 0?t.getDependency("accessor",l.NORMAL):h.attributes.normal;a.push(f)}if(s){const f=l.COLOR_0!==void 0?t.getDependency("accessor",l.COLOR_0):h.attributes.color;i.push(f)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i)]).then(function(c){const d=c[0],l=c[1],f=c[2];return r&&(h.morphAttributes.position=d),n&&(h.morphAttributes.normal=l),s&&(h.morphAttributes.color=f),h.morphTargetsRelative=!0,h})}function ke(h,e){if(h.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)h.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(h.morphTargetInfluences.length===t.length){h.morphTargetDictionary={};for(let r=0,n=t.length;r<n;r++)h.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function De(h){let e;const t=h.extensions&&h.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+W(t.attributes):e=h.indices+":"+W(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)e+=":"+W(h.targets[r]);return e}function W(h){let e="";const t=Object.keys(h).sort();for(let r=0,n=t.length;r<n;r++)e+=t[r]+":"+h[t[r]]+";";return e}function Y(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Fe(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":h.search(/\.ktx2($|\?)/i)>0||h.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const He=new u.Matrix4;class Ge{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const i=a.match(/Version\/(\d+)/);n=r&&i?parseInt(i[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&n<17||s&&o<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(o){const a={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:r,userData:{}};return F(s,a,n),k(a,n),Promise.all(r._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=t.length;n<s;n++){const o=t[n].joints;for(let a=0,i=o.length;a<i;a++)e[o[a]].isBone=!0}for(let n=0,s=e.length;n<s;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(r[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const n=r.clone(),s=(o,a)=>{const i=this.associations.get(o);i!=null&&this.associations.set(a,i);for(const[c,d]of o.children.entries())s(d,a.children[c])};return s(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const n=e(t[r]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let n=0;n<t.length;n++){const s=e(t[n]);s&&r.push(s)}return r}getDependency(e,t){const r=e+":"+t;let n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(s,o){return r.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,o){r.load(u.LoaderUtils.resolveURL(t.uri,n.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(r){const n=t.byteLength||0,s=t.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(e){const t=this,r=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=X[n.type],a=G[n.componentType],i=n.normalized===!0,c=new a(n.count*o);return Promise.resolve(new u.BufferAttribute(c,o,i))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],i=X[n.type],c=G[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*i,f=n.byteOffset||0,m=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,T=n.normalized===!0;let E,R;if(m&&m!==l){const g=Math.floor(f/m),x="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+g+":"+n.count;let y=t.cache.get(x);y||(E=new c(a,g*m,n.count*m/d),y=new u.InterleavedBuffer(E,m/d),t.cache.add(x,y)),R=new u.InterleavedBufferAttribute(y,i,f%m/d,T)}else a===null?E=new c(n.count*i):E=new c(a,f,n.count*i),R=new u.BufferAttribute(E,i,T);if(n.sparse!==void 0){const g=X.SCALAR,x=G[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,M=n.sparse.values.byteOffset||0,S=new x(o[1],y,n.sparse.count*g),_=new c(o[2],M,n.sparse.count*i);a!==null&&(R=new u.BufferAttribute(R.array.slice(),R.itemSize,R.normalized)),R.normalized=!1;for(let w=0,O=S.length;w<O;w++){const b=S[w];if(R.setX(b,_[w*i]),i>=2&&R.setY(b,_[w*i+1]),i>=3&&R.setZ(b,_[w*i+2]),i>=4&&R.setW(b,_[w*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}R.normalized=T}return R})}loadTexture(e){const t=this.json,r=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const i=r.manager.getHandler(o.uri);i!==null&&(a=i)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,r){const n=this,s=this.json,o=s.textures[e],a=s.images[t],i=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[i])return this.textureCache[i];const c=this.loadImageSource(t,r).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const f=(s.samplers||{})[o.sampler]||{};return d.magFilter=Z[f.magFilter]||u.LinearFilter,d.minFilter=Z[f.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=ee[f.wrapS]||u.RepeatWrapping,d.wrapT=ee[f.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[i]=c,c}loadImageSource(e,t){const r=this,n=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(l=>l.clone());const o=n.images[e],a=self.URL||self.webkitURL;let i=o.uri||"",c=!1;if(o.bufferView!==void 0)i=r.getDependency("bufferView",o.bufferView).then(function(l){c=!0;const f=new Blob([l],{type:o.mimeType});return i=a.createObjectURL(f),i});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(i).then(function(l){return new Promise(function(f,m){let T=f;t.isImageBitmapLoader===!0&&(T=function(E){const R=new u.Texture(E);R.needsUpdate=!0,f(R)}),t.load(u.LoaderUtils.resolveURL(l,s.path),T,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(i),k(l,o),l.userData.mimeType=o.mimeType||Fe(o.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),l});return this.sourceCache[e]=d,d}assignTexture(e,t,r,n){const s=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(o=o.clone(),o.channel=r.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=s.associations.get(o);o=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,i)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const n=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let i=this.cache.get(a);i||(i=new u.PointsMaterial,u.Material.prototype.copy.call(i,r),i.color.copy(r.color),i.map=r.map,i.sizeAttenuation=!1,this.cache.add(a,i)),r=i}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let i=this.cache.get(a);i||(i=new u.LineBasicMaterial,u.Material.prototype.copy.call(i,r),i.color.copy(r.color),i.map=r.map,this.cache.add(a,i)),r=i}if(n||s||o){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=r.clone(),s&&(i.vertexColors=!0),o&&(i.flatShading=!0),n&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(r))),r=i}e.material=r}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,n=this.extensions,s=r.materials[e];let o;const a={},i=s.extensions||{},c=[];if(i[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];o=l.getMaterialType(),c.push(l.extendParams(a,s,t))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const f=l.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],u.LinearSRGBColorSpace),a.opacity=f[3]}l.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=u.DoubleSide);const d=s.alphaMode||q.OPAQUE;if(d===q.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===q.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==u.MeshBasicMaterial&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&o!==u.MeshBasicMaterial&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==u.MeshBasicMaterial&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new o(a);return s.name&&(l.name=s.name),k(l,s),t.associations.set(l,{materials:e}),s.extensions&&F(n,l,s),l})}createUniqueName(e){const t=u.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(i){return te(i,a,t)})}const o=[];for(let a=0,i=e.length;a<i;a++){const c=e[a],d=De(c),l=n[d];if(l)o.push(l.promise);else{let f;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?f=s(c):f=te(new u.BufferGeometry,c,t),n[d]={primitive:c,promise:f},o.push(f)}}return Promise.all(o)}loadMesh(e){const t=this,r=this.json,n=this.extensions,s=r.meshes[e],o=s.primitives,a=[];for(let i=0,c=o.length;i<c;i++){const d=o[i].material===void 0?ve(this.cache):this.getDependency("material",o[i].material);a.push(d)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(i){const c=i.slice(0,i.length-1),d=i[i.length-1],l=[];for(let m=0,T=d.length;m<T;m++){const E=d[m],R=o[m];let g;const x=c[m];if(R.mode===v.TRIANGLES||R.mode===v.TRIANGLE_STRIP||R.mode===v.TRIANGLE_FAN||R.mode===void 0)g=s.isSkinnedMesh===!0?new u.SkinnedMesh(E,x):new u.Mesh(E,x),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),R.mode===v.TRIANGLE_STRIP?g.geometry=H.toTrianglesDrawMode(g.geometry,u.TriangleStripDrawMode):R.mode===v.TRIANGLE_FAN&&(g.geometry=H.toTrianglesDrawMode(g.geometry,u.TriangleFanDrawMode));else if(R.mode===v.LINES)g=new u.LineSegments(E,x);else if(R.mode===v.LINE_STRIP)g=new u.Line(E,x);else if(R.mode===v.LINE_LOOP)g=new u.LineLoop(E,x);else if(R.mode===v.POINTS)g=new u.Points(E,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(g.geometry.morphAttributes).length>0&&ke(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),k(g,s),R.extensions&&F(n,g,R),t.assignFinalMaterial(g),l.push(g)}for(let m=0,T=l.length;m<T;m++)t.associations.set(l[m],{meshes:e,primitives:m});if(l.length===1)return s.extensions&&F(n,l[0],s),l[0];const f=new u.Group;s.extensions&&F(n,f,s),t.associations.set(f,{meshes:e});for(let m=0,T=l.length;m<T;m++)f.add(l[m]);return f})}loadCamera(e){let t;const r=this.json.cameras[e],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(t=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),k(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let n=0,s=t.joints.length;n<s;n++)r.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){const s=n.pop(),o=n,a=[],i=[];for(let c=0,d=o.length;c<d;c++){const l=o[c];if(l){a.push(l);const f=new u.Matrix4;s!==null&&f.fromArray(s.array,c*16),i.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new u.Skeleton(a,i)})}loadAnimation(e){const t=this.json,r=this,n=t.animations[e],s=n.name?n.name:"animation_"+e,o=[],a=[],i=[],c=[],d=[];for(let l=0,f=n.channels.length;l<f;l++){const m=n.channels[l],T=n.samplers[m.sampler],E=m.target,R=E.node,g=n.parameters!==void 0?n.parameters[T.input]:T.input,x=n.parameters!==void 0?n.parameters[T.output]:T.output;E.node!==void 0&&(o.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",g)),i.push(this.getDependency("accessor",x)),c.push(T),d.push(E))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i),Promise.all(c),Promise.all(d)]).then(function(l){const f=l[0],m=l[1],T=l[2],E=l[3],R=l[4],g=[];for(let x=0,y=f.length;x<y;x++){const M=f[x],S=m[x],_=T[x],w=E[x],O=R[x];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const b=r._createAnimationTracks(M,S,_,w,O);if(b)for(let P=0;P<b.length;P++)g.push(b[P])}return new u.AnimationClip(s,void 0,g)})}createNodeMesh(e){const t=this.json,r=this,n=t.nodes[e];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){const o=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let i=0,c=n.weights.length;i<c;i++)a.morphTargetInfluences[i]=n.weights[i]}),o})}loadNode(e){const t=this.json,r=this,n=t.nodes[e],s=r._loadNodeShallow(e),o=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)o.push(r.getDependency("node",a[c]));const i=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(o),i]).then(function(c){const d=c[0],l=c[1],f=c[2];f!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(f,He)});for(let m=0,T=l.length;m<T;m++)d.add(l[m]);return d})}_loadNodeShallow(e){const t=this.json,r=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?n.createUniqueName(s.name):"",a=[],i=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return i&&a.push(i),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,f=c.length;l<f;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=o),k(d,s),s.extensions&&F(r,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],n=this,s=new u.Group;r.name&&(s.name=n.createUniqueName(r.name)),k(s,r),r.extensions&&F(t,s,r);const o=r.nodes||[],a=[];for(let i=0,c=o.length;i<c;i++)a.push(n.getDependency("node",o[i]));return Promise.all(a).then(function(i){for(let d=0,l=i.length;d<l;d++)s.add(i[d]);const c=d=>{const l=new Map;for(const[f,m]of n.associations)(f instanceof u.Material||f instanceof u.Texture)&&l.set(f,m);return d.traverse(f=>{const m=n.associations.get(f);m!=null&&l.set(f,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(e,t,r,n,s){const o=[],a=e.name?e.name:e.uuid,i=[];D[s.path]===D.weights?e.traverse(function(f){f.morphTargetInfluences&&i.push(f.name?f.name:f.uuid)}):i.push(a);let c;switch(D[s.path]){case D.weights:c=u.NumberKeyframeTrack;break;case D.rotation:c=u.QuaternionKeyframeTrack;break;case D.translation:case D.scale:c=u.VectorKeyframeTrack;break;default:switch(r.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Oe[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(r);for(let f=0,m=i.length;f<m;f++){const T=new c(i[f]+"."+D[s.path],t.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(T),o.push(T)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=Y(t.constructor),n=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)n[s]=t[s]*r;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const n=this instanceof u.QuaternionKeyframeTrack?Ie:se;return new n(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Be(h,e,t){const r=e.attributes,n=new u.Box3;if(r.POSITION!==void 0){const a=t.json.accessors[r.POSITION],i=a.min,c=a.max;if(i!==void 0&&c!==void 0){if(n.set(new u.Vector3(i[0],i[1],i[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=Y(G[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new u.Vector3,i=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const f=t.json.accessors[l.POSITION],m=f.min,T=f.max;if(m!==void 0&&T!==void 0){if(i.setX(Math.max(Math.abs(m[0]),Math.abs(T[0]))),i.setY(Math.max(Math.abs(m[1]),Math.abs(T[1]))),i.setZ(Math.max(Math.abs(m[2]),Math.abs(T[2]))),f.normalized){const E=Y(G[f.componentType]);i.multiplyScalar(E)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;const o=new u.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=o}function te(h,e,t){const r=e.attributes,n=[];function s(o,a){return t.getDependency("accessor",o).then(function(i){h.setAttribute(a,i)})}for(const o in r){const a=$[o]||o.toLowerCase();a in h.attributes||n.push(s(r[o],a))}if(e.indices!==void 0&&!h.index){const o=t.getDependency("accessor",e.indices).then(function(a){h.setIndex(a)});n.push(o)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),k(h,e),Be(h,e,t),Promise.all(n).then(function(){return e.targets!==void 0?Pe(h,e.targets,t):h})}function Ue(){const h=p.ref(!1),e=p.ref(""),t=p.shallowRef([]),r=p.ref(null),n=new z.MTLLoader,s=new z.OBJLoader,o=new z.STLLoader,a=new ie,i=new z.PCDLoader,c=async l=>{var R;if(!l||l.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}h.value=!0,e.value="准备加载...",t.value=[],r.value=null;const f=new Map,m=[];l.forEach(g=>{if(g instanceof File){const x=g.name.toLowerCase();f.set(x,g),x.endsWith(".pcd")&&m.push(g)}});const T=[],E=[];try{if(m.length>0){e.value=`正在加载 ${m.length} 个点云文件...`;const g=await d(m,T);g&&E.push(g)}for(const g of l){const x=g.name||"unknown_file",y=(R=x.split(".").pop())==null?void 0:R.toLowerCase();if(y==="mtl"||y==="pcd")continue;const M=URL.createObjectURL(g);T.push(M);let S=null;const _=w=>{const O=w.lengthComputable?w.loaded/w.total*100:0;e.value=`正在加载 ${x}... ${Math.round(O)}%`};switch(e.value=`正在加载 ${x}... 0%`,y){case"obj":const w=x.replace(/\.obj$/i,".mtl").toLowerCase();if(f.has(w)){const C=f.get(w),j=URL.createObjectURL(C);T.push(j);const V=await n.loadAsync(j);V.preload(),s.setMaterials(V)}else s.setMaterials(null);S=await s.loadAsync(M,_),S&&H.optimizeHardEdgeAndSide(S);break;case"stl":const O=await o.loadAsync(M,_),b=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});S=new u.Mesh(O,b);break;case"gltf":case"glb":S=(await a.loadAsync(M,_)).scene;break;default:console.warn(`不支持的文件类型: .${y}`),e.value=`不支持的文件类型: ${x}`;continue}S&&(S.userData.boundingBox=new u.Box3().setFromObject(S),E.push(S))}t.value=E,e.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),r.value=`加载失败: ${g.message||"未知错误"}`,e.value="加载失败!",t.value=[],g}finally{h.value=!1,T.forEach(g=>URL.revokeObjectURL(g))}},d=async(l,f)=>{if(l.length===0)return null;const m=new u.Group;m.name="PCD Point Clouds";try{for(let E=0;E<l.length;E++){const R=l[E],g=R.name||`point_cloud_${E}.pcd`;e.value=`正在加载点云文件 ${E+1}/${l.length}: ${g}`;try{const x=URL.createObjectURL(R);f.push(x);const y=await new Promise((M,S)=>{i.load(x,_=>{const w=_.geometry.attributes.position,O=_.geometry.attributes.color;if(O&&O.count===w.count)_.userData.color="原始颜色";else{const P=new Float32Array(w.count*3);for(let C=0;C<w.count;C++)P[C*3]=0,P[C*3+1]=0,P[C*3+2]=0;_.geometry.setAttribute("color",new u.BufferAttribute(P,3)),_.userData.color="黑色"}_.material instanceof u.PointsMaterial&&(_.material.vertexColors=!0,_.material.size=.8,_.material.sizeAttenuation=!1),_.name=g,_.userData.originalFile=g,M(_)},void 0,_=>{console.error(`PCD文件加载失败: ${g}`,_),S(_)})});m.add(y)}catch(x){console.error(`加载点云文件失败: ${g}`,x)}}if(m.children.length===0)return console.warn("所有PCD文件都加载失败"),null;const T=new u.Box3().setFromObject(m);return m.userData.boundingBox=T,m}catch(T){throw console.error("PCD文件组加载失败:",T),new Error("无法加载PCD点云文件")}};return{isLoading:h,loadingProgress:e,loadedModels:t,error:r,loadModelsFromBlobs:c}}const je={class:"obj-viewer-container"},Ve={class:"buttonGroup-topLeft"},Ke={class:"buttonGroup-left"},ze={class:"buttonGroup-right"},Xe={class:"left-panel"},qe={class:"panel-header"},We={key:0,class:"clipping-content"},$e={class:"radio-group"},Ye={class:"radio-label"},Je={class:"radio-label"},Qe={class:"radio-label"},Ze={class:"radio-label"},et={key:0,class:"loading-overlay"},tt=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(h){const e=h,t=p.ref(null),r=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:o,initThreeJS:a,handleResize:i,getThreeJSObjects:c,cleanup:d,setModels:l,axesHelperVisible:f,toggleAxesVisibility:m,zoomIn:T,zoomOut:E}=H.useThreeJS(t),{isLoading:R,loadingProgress:g,loadedModels:x,error:y,loadModelsFromBlobs:M}=Ue(),{isAnimating:S,toggleAnimation:_,stopAnimation:w}=H.useAnimation(c,s),{isClipping:O,activeClippingAxis:b,toggleClipping:P,updateClippingPlanes:C}=H.useClipping(c,s),j=()=>{m()};p.watch(()=>e.fileBlobs,N=>{N&&N.length>0&&M(N).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(x,N=>{N&&N.length>0&&l(N)}),p.watch(y,N=>{N&&J.ElMessage.error(`模型加载失败: ${N}`)});const V=N=>{r.value=!0,n.value=N,N==="剖面视图"&&!O.value&&P()};let K=null;return p.onMounted(async()=>{await p.nextTick();try{a(),t.value&&(K=new ResizeObserver(i),K.observe(t.value))}catch(N){console.error("Three.js 初始化失败:",N),J.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",K&&K.disconnect(),S.value&&w(),d()}),(N,A)=>{const re=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",je,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:t,class:"threejs-container"},null,512),p.createElementVNode("div",Ve,[p.createVNode(B.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(o),title:"重置"},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:p.unref(T)},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:p.unref(E)},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(_),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(B.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(f),onClick:j,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Ke,[p.renderSlot(N.$slots,"button-left",{switchRightPanel:V},void 0,!0)]),p.createElementVNode("div",ze,[p.renderSlot(N.$slots,"button-right",{},void 0,!0)]),A[14]||(A[14]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Xe,[p.createElementVNode("div",qe,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[0]||(A[0]=I=>r.value=!1)}," X ")]),p.createVNode(re,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",We,[p.createElementVNode("div",$e,[p.createElementVNode("label",Ye,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[1]||(A[1]=I=>p.isRef(b)?b.value=I:null),onChange:A[2]||(A[2]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[9]||(A[9]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[3]||(A[3]=I=>p.isRef(b)?b.value=I:null),onChange:A[4]||(A[4]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",Qe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[5]||(A[5]=I=>p.isRef(b)?b.value=I:null),onChange:A[6]||(A[6]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Ze,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[7]||(A[7]=I=>p.isRef(b)?b.value=I:null),onChange:A[8]||(A[8]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,r.value]]),p.unref(R)?(p.openBlock(),p.createElementBlock("div",et,[A[13]||(A[13]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(g)),1)])):p.createCommentVNode("",!0)])}}}),nt=oe._export_sfc(tt,[["__scopeId","data-v-53f2a047"]]);exports.default=nt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),H=require("./iconfont-BYcEzhNe.cjs"),u=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BkkUVCLE.cjs"),J=require("./index-CEwxrYB-.cjs"),z=require("./PCDLoader-BhWhU7AF.cjs"),B=require("./svgIcon-BH_8oaav.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class ie extends u.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new de(t)}),this.register(function(t){return new fe(t)}),this.register(function(t){return new Me(t)}),this.register(function(t){return new Le(t)}),this.register(function(t){return new Ae(t)}),this.register(function(t){return new pe(t)}),this.register(function(t){return new me(t)}),this.register(function(t){return new ge(t)}),this.register(function(t){return new Te(t)}),this.register(function(t){return new ue(t)}),this.register(function(t){return new Re(t)}),this.register(function(t){return new he(t)}),this.register(function(t){return new Ee(t)}),this.register(function(t){return new xe(t)}),this.register(function(t){return new ce(t)}),this.register(function(t){return new _e(t)}),this.register(function(t){return new ye(t)})}load(e,t,r,n){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(e);o=u.LoaderUtils.resolveURL(c,this.path)}else o=u.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){n?n(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(c){try{s.parse(c,o,function(d){t(d),s.manager.itemEnd(e)},a)}catch(d){a(d)}},r,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,n){let s;const o={},a={},i=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(i.decode(new Uint8Array(e,0,4))===ne){try{o[L.KHR_BINARY_GLTF]=new Se(e)}catch(l){n&&n(l);return}s=JSON.parse(o[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(i.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Ge(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,o[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],f=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:o[l]=new le;break;case L.KHR_DRACO_MESH_COMPRESSION:o[l]=new we(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:o[l]=new be;break;case L.KHR_MESH_QUANTIZATION:o[l]=new Ne;break;default:f.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(r,n)}parseAsync(e,t){const r=this;return new Promise(function(n,s){r.parse(e,t,n,s)})}}function ae(){let h={};return{get:function(e){return h[e]},add:function(e,t){h[e]=t},remove:function(e){delete h[e]},removeAll:function(){h={}}}}const L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ce{constructor(e){this.parser=e,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,n=t.length;r<n;r++){const s=t[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let n=t.cache.get(r);if(n)return n;const s=t.json,i=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const d=new u.Color(16777215);i.color!==void 0&&d.setRGB(i.color[0],i.color[1],i.color[2],u.LinearSRGBColorSpace);const l=i.range!==void 0?i.range:0;switch(i.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,c.angle=i.spot.outerConeAngle,c.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return c.position.set(0,0,0),k(c,i),i.intensity!==void 0&&(c.intensity=i.intensity),c.name=t.createUniqueName(i.name||"light_"+e),n=Promise.resolve(c),t.cache.add(r,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,s=r.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return r._getNodeRef(t.cache,a,i)})}}class le{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(e,t,r){const n=[];e.color=new u.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],u.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(e,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class ue{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class de{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class fe{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class he{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class pe{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new u.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(r.assignTexture(t,"sheenColorMap",o.sheenColorTexture,u.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class me{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(r.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class ge{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(r.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class Te{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class Re{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(r.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&s.push(r.assignTexture(t,"specularColorMap",o.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class xe{constructor(e){this.parser=e,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(r.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class Ee{constructor(e){this.parser=e,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){const r=this.parser,n=r.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(r.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class Me{constructor(e){this.parser=e,this.name=L.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,n=r.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Le{constructor(e){this.parser=e,this.name=L.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let i=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(i=c)}return r.loadTextureImage(e,o.source,i)}}class Ae{constructor(e){this.parser=e,this.name=L.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,r=this.parser,n=r.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=n.images[o.source];let i=r.textureLoader;if(a.uri){const c=r.options.manager.getHandler(a.uri);c!==null&&(i=c)}return r.loadTextureImage(e,o.source,i)}}class _e{constructor(e){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const i=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,f=new Uint8Array(a,i,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,l,f,n.mode,n.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(d*l);return o.decodeGltfBuffer(new Uint8Array(m),d,l,f,n.mode,n.filter),m})})}else return null}}class ye{constructor(e){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const n=t.meshes[r.mesh];for(const c of n.primitives)if(c.mode!==v.TRIANGLES&&c.mode!==v.TRIANGLE_STRIP&&c.mode!==v.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=r.extensions[this.name].attributes,a=[],i={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(i[c]=d,i[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],f=c[0].count,m=[];for(const T of l){const E=new u.Matrix4,R=new u.Vector3,g=new u.Quaternion,x=new u.Vector3(1,1,1),y=new u.InstancedMesh(T.geometry,T.material,f);for(let M=0;M<f;M++)i.TRANSLATION&&R.fromBufferAttribute(i.TRANSLATION,M),i.ROTATION&&g.fromBufferAttribute(i.ROTATION,M),i.SCALE&&x.fromBufferAttribute(i.SCALE,M),y.setMatrixAt(M,E.compose(R,g,x));for(const M in i)if(M==="_COLOR_0"){const S=i[M];y.instanceColor=new u.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else M!=="TRANSLATION"&&M!=="ROTATION"&&M!=="SCALE"&&T.geometry.setAttribute(M,i[M]);u.Object3D.prototype.copy.call(y,T),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const ne="glTF",U=12,Q={JSON:1313821514,BIN:5130562};class Se{constructor(e){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,U),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ne)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-U,s=new DataView(e,U);let o=0;for(;o<n;){const a=s.getUint32(o,!0);o+=4;const i=s.getUint32(o,!0);if(o+=4,i===Q.JSON){const c=new Uint8Array(e,U+o,a);this.content=r.decode(c)}else if(i===Q.BIN){const c=U+o;this.body=e.slice(c,c+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class we{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,n=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},i={},c={};for(const d in o){const l=$[d]||d.toLowerCase();a[l]=o[d]}for(const d in e.attributes){const l=$[d]||d.toLowerCase();if(o[d]!==void 0){const f=r.accessors[e.attributes[d]],m=G[f.componentType];c[l]=m.name,i[l]=f.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(l,f){n.decodeDracoFile(d,function(m){for(const T in m.attributes){const E=m.attributes[T],R=i[T];R!==void 0&&(E.normalized=R)}l(m)},a,c,u.LinearSRGBColorSpace,f)})})}}class be{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Ne{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class se extends u.Interpolant{constructor(e,t,r,n){super(e,t,r,n)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=e*n*3+n;for(let o=0;o!==n;o++)t[o]=r[s+o];return t}interpolate_(e,t,r,n){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,i=a*2,c=a*3,d=n-t,l=(r-t)/d,f=l*l,m=f*l,T=e*c,E=T-c,R=-2*m+3*f,g=m-f,x=1-R,y=g-f+l;for(let M=0;M!==a;M++){const S=o[E+M+a],_=o[E+M+i]*d,w=o[T+M+a],O=o[T+M]*d;s[M]=x*S+y*_+R*w+g*O}return s}}const Ce=new u.Quaternion;class Ie extends se{interpolate_(e,t,r,n){const s=super.interpolate_(e,t,r,n);return Ce.fromArray(s).normalize().toArray(s),s}}const v={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},G={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Z={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},ee={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},D={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Oe={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},q={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ve(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),h.DefaultMaterial}function F(h,e,t){for(const r in t.extensions)h[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function k(h,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(h.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Pe(h,e,t){let r=!1,n=!1,s=!1;for(let c=0,d=e.length;c<d;c++){const l=e[c];if(l.POSITION!==void 0&&(r=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(h);const o=[],a=[],i=[];for(let c=0,d=e.length;c<d;c++){const l=e[c];if(r){const f=l.POSITION!==void 0?t.getDependency("accessor",l.POSITION):h.attributes.position;o.push(f)}if(n){const f=l.NORMAL!==void 0?t.getDependency("accessor",l.NORMAL):h.attributes.normal;a.push(f)}if(s){const f=l.COLOR_0!==void 0?t.getDependency("accessor",l.COLOR_0):h.attributes.color;i.push(f)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i)]).then(function(c){const d=c[0],l=c[1],f=c[2];return r&&(h.morphAttributes.position=d),n&&(h.morphAttributes.normal=l),s&&(h.morphAttributes.color=f),h.morphTargetsRelative=!0,h})}function ke(h,e){if(h.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)h.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(h.morphTargetInfluences.length===t.length){h.morphTargetDictionary={};for(let r=0,n=t.length;r<n;r++)h.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function De(h){let e;const t=h.extensions&&h.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+W(t.attributes):e=h.indices+":"+W(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)e+=":"+W(h.targets[r]);return e}function W(h){let e="";const t=Object.keys(h).sort();for(let r=0,n=t.length;r<n;r++)e+=t[r]+":"+h[t[r]]+";";return e}function Y(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Fe(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":h.search(/\.ktx2($|\?)/i)>0||h.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const He=new u.Matrix4;class Ge{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const i=a.match(/Version\/(\d+)/);n=r&&i?parseInt(i[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&n<17||s&&o<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(o){const a={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:r,userData:{}};return F(s,a,n),k(a,n),Promise.all(r._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=t.length;n<s;n++){const o=t[n].joints;for(let a=0,i=o.length;a<i;a++)e[o[a]].isBone=!0}for(let n=0,s=e.length;n<s;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(r[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const n=r.clone(),s=(o,a)=>{const i=this.associations.get(o);i!=null&&this.associations.set(a,i);for(const[c,d]of o.children.entries())s(d,a.children[c])};return s(r,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const n=e(t[r]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let n=0;n<t.length;n++){const s=e(t[n]);s&&r.push(s)}return r}getDependency(e,t){const r=e+":"+t;let n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(r,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(s,o){return r.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,o){r.load(u.LoaderUtils.resolveURL(t.uri,n.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(r){const n=t.byteLength||0,s=t.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(e){const t=this,r=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=X[n.type],a=G[n.componentType],i=n.normalized===!0,c=new a(n.count*o);return Promise.resolve(new u.BufferAttribute(c,o,i))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],i=X[n.type],c=G[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*i,f=n.byteOffset||0,m=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,T=n.normalized===!0;let E,R;if(m&&m!==l){const g=Math.floor(f/m),x="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+g+":"+n.count;let y=t.cache.get(x);y||(E=new c(a,g*m,n.count*m/d),y=new u.InterleavedBuffer(E,m/d),t.cache.add(x,y)),R=new u.InterleavedBufferAttribute(y,i,f%m/d,T)}else a===null?E=new c(n.count*i):E=new c(a,f,n.count*i),R=new u.BufferAttribute(E,i,T);if(n.sparse!==void 0){const g=X.SCALAR,x=G[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,M=n.sparse.values.byteOffset||0,S=new x(o[1],y,n.sparse.count*g),_=new c(o[2],M,n.sparse.count*i);a!==null&&(R=new u.BufferAttribute(R.array.slice(),R.itemSize,R.normalized)),R.normalized=!1;for(let w=0,O=S.length;w<O;w++){const b=S[w];if(R.setX(b,_[w*i]),i>=2&&R.setY(b,_[w*i+1]),i>=3&&R.setZ(b,_[w*i+2]),i>=4&&R.setW(b,_[w*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}R.normalized=T}return R})}loadTexture(e){const t=this.json,r=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const i=r.manager.getHandler(o.uri);i!==null&&(a=i)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,r){const n=this,s=this.json,o=s.textures[e],a=s.images[t],i=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[i])return this.textureCache[i];const c=this.loadImageSource(t,r).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const f=(s.samplers||{})[o.sampler]||{};return d.magFilter=Z[f.magFilter]||u.LinearFilter,d.minFilter=Z[f.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=ee[f.wrapS]||u.RepeatWrapping,d.wrapT=ee[f.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[i]=c,c}loadImageSource(e,t){const r=this,n=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(l=>l.clone());const o=n.images[e],a=self.URL||self.webkitURL;let i=o.uri||"",c=!1;if(o.bufferView!==void 0)i=r.getDependency("bufferView",o.bufferView).then(function(l){c=!0;const f=new Blob([l],{type:o.mimeType});return i=a.createObjectURL(f),i});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(i).then(function(l){return new Promise(function(f,m){let T=f;t.isImageBitmapLoader===!0&&(T=function(E){const R=new u.Texture(E);R.needsUpdate=!0,f(R)}),t.load(u.LoaderUtils.resolveURL(l,s.path),T,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(i),k(l,o),l.userData.mimeType=o.mimeType||Fe(o.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),l});return this.sourceCache[e]=d,d}assignTexture(e,t,r,n){const s=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(o=o.clone(),o.channel=r.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=s.associations.get(o);o=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,i)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const n=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let i=this.cache.get(a);i||(i=new u.PointsMaterial,u.Material.prototype.copy.call(i,r),i.color.copy(r.color),i.map=r.map,i.sizeAttenuation=!1,this.cache.add(a,i)),r=i}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let i=this.cache.get(a);i||(i=new u.LineBasicMaterial,u.Material.prototype.copy.call(i,r),i.color.copy(r.color),i.map=r.map,this.cache.add(a,i)),r=i}if(n||s||o){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=r.clone(),s&&(i.vertexColors=!0),o&&(i.flatShading=!0),n&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(r))),r=i}e.material=r}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(e){const t=this,r=this.json,n=this.extensions,s=r.materials[e];let o;const a={},i=s.extensions||{},c=[];if(i[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];o=l.getMaterialType(),c.push(l.extendParams(a,s,t))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const f=l.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],u.LinearSRGBColorSpace),a.opacity=f[3]}l.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=u.DoubleSide);const d=s.alphaMode||q.OPAQUE;if(d===q.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===q.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==u.MeshBasicMaterial&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&o!==u.MeshBasicMaterial&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==u.MeshBasicMaterial&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new o(a);return s.name&&(l.name=s.name),k(l,s),t.associations.set(l,{materials:e}),s.extensions&&F(n,l,s),l})}createUniqueName(e){const t=u.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(i){return te(i,a,t)})}const o=[];for(let a=0,i=e.length;a<i;a++){const c=e[a],d=De(c),l=n[d];if(l)o.push(l.promise);else{let f;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?f=s(c):f=te(new u.BufferGeometry,c,t),n[d]={primitive:c,promise:f},o.push(f)}}return Promise.all(o)}loadMesh(e){const t=this,r=this.json,n=this.extensions,s=r.meshes[e],o=s.primitives,a=[];for(let i=0,c=o.length;i<c;i++){const d=o[i].material===void 0?ve(this.cache):this.getDependency("material",o[i].material);a.push(d)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(i){const c=i.slice(0,i.length-1),d=i[i.length-1],l=[];for(let m=0,T=d.length;m<T;m++){const E=d[m],R=o[m];let g;const x=c[m];if(R.mode===v.TRIANGLES||R.mode===v.TRIANGLE_STRIP||R.mode===v.TRIANGLE_FAN||R.mode===void 0)g=s.isSkinnedMesh===!0?new u.SkinnedMesh(E,x):new u.Mesh(E,x),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),R.mode===v.TRIANGLE_STRIP?g.geometry=H.toTrianglesDrawMode(g.geometry,u.TriangleStripDrawMode):R.mode===v.TRIANGLE_FAN&&(g.geometry=H.toTrianglesDrawMode(g.geometry,u.TriangleFanDrawMode));else if(R.mode===v.LINES)g=new u.LineSegments(E,x);else if(R.mode===v.LINE_STRIP)g=new u.Line(E,x);else if(R.mode===v.LINE_LOOP)g=new u.LineLoop(E,x);else if(R.mode===v.POINTS)g=new u.Points(E,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(g.geometry.morphAttributes).length>0&&ke(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),k(g,s),R.extensions&&F(n,g,R),t.assignFinalMaterial(g),l.push(g)}for(let m=0,T=l.length;m<T;m++)t.associations.set(l[m],{meshes:e,primitives:m});if(l.length===1)return s.extensions&&F(n,l[0],s),l[0];const f=new u.Group;s.extensions&&F(n,f,s),t.associations.set(f,{meshes:e});for(let m=0,T=l.length;m<T;m++)f.add(l[m]);return f})}loadCamera(e){let t;const r=this.json.cameras[e],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(t=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),k(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let n=0,s=t.joints.length;n<s;n++)r.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){const s=n.pop(),o=n,a=[],i=[];for(let c=0,d=o.length;c<d;c++){const l=o[c];if(l){a.push(l);const f=new u.Matrix4;s!==null&&f.fromArray(s.array,c*16),i.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new u.Skeleton(a,i)})}loadAnimation(e){const t=this.json,r=this,n=t.animations[e],s=n.name?n.name:"animation_"+e,o=[],a=[],i=[],c=[],d=[];for(let l=0,f=n.channels.length;l<f;l++){const m=n.channels[l],T=n.samplers[m.sampler],E=m.target,R=E.node,g=n.parameters!==void 0?n.parameters[T.input]:T.input,x=n.parameters!==void 0?n.parameters[T.output]:T.output;E.node!==void 0&&(o.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",g)),i.push(this.getDependency("accessor",x)),c.push(T),d.push(E))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(i),Promise.all(c),Promise.all(d)]).then(function(l){const f=l[0],m=l[1],T=l[2],E=l[3],R=l[4],g=[];for(let x=0,y=f.length;x<y;x++){const M=f[x],S=m[x],_=T[x],w=E[x],O=R[x];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const b=r._createAnimationTracks(M,S,_,w,O);if(b)for(let P=0;P<b.length;P++)g.push(b[P])}return new u.AnimationClip(s,void 0,g)})}createNodeMesh(e){const t=this.json,r=this,n=t.nodes[e];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){const o=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let i=0,c=n.weights.length;i<c;i++)a.morphTargetInfluences[i]=n.weights[i]}),o})}loadNode(e){const t=this.json,r=this,n=t.nodes[e],s=r._loadNodeShallow(e),o=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)o.push(r.getDependency("node",a[c]));const i=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(o),i]).then(function(c){const d=c[0],l=c[1],f=c[2];f!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(f,He)});for(let m=0,T=l.length;m<T;m++)d.add(l[m]);return d})}_loadNodeShallow(e){const t=this.json,r=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?n.createUniqueName(s.name):"",a=[],i=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return i&&a.push(i),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,f=c.length;l<f;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=o),k(d,s),s.extensions&&F(r,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],n=this,s=new u.Group;r.name&&(s.name=n.createUniqueName(r.name)),k(s,r),r.extensions&&F(t,s,r);const o=r.nodes||[],a=[];for(let i=0,c=o.length;i<c;i++)a.push(n.getDependency("node",o[i]));return Promise.all(a).then(function(i){for(let d=0,l=i.length;d<l;d++)s.add(i[d]);const c=d=>{const l=new Map;for(const[f,m]of n.associations)(f instanceof u.Material||f instanceof u.Texture)&&l.set(f,m);return d.traverse(f=>{const m=n.associations.get(f);m!=null&&l.set(f,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(e,t,r,n,s){const o=[],a=e.name?e.name:e.uuid,i=[];D[s.path]===D.weights?e.traverse(function(f){f.morphTargetInfluences&&i.push(f.name?f.name:f.uuid)}):i.push(a);let c;switch(D[s.path]){case D.weights:c=u.NumberKeyframeTrack;break;case D.rotation:c=u.QuaternionKeyframeTrack;break;case D.translation:case D.scale:c=u.VectorKeyframeTrack;break;default:switch(r.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Oe[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(r);for(let f=0,m=i.length;f<m;f++){const T=new c(i[f]+"."+D[s.path],t.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(T),o.push(T)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=Y(t.constructor),n=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)n[s]=t[s]*r;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const n=this instanceof u.QuaternionKeyframeTrack?Ie:se;return new n(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Be(h,e,t){const r=e.attributes,n=new u.Box3;if(r.POSITION!==void 0){const a=t.json.accessors[r.POSITION],i=a.min,c=a.max;if(i!==void 0&&c!==void 0){if(n.set(new u.Vector3(i[0],i[1],i[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=Y(G[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new u.Vector3,i=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const f=t.json.accessors[l.POSITION],m=f.min,T=f.max;if(m!==void 0&&T!==void 0){if(i.setX(Math.max(Math.abs(m[0]),Math.abs(T[0]))),i.setY(Math.max(Math.abs(m[1]),Math.abs(T[1]))),i.setZ(Math.max(Math.abs(m[2]),Math.abs(T[2]))),f.normalized){const E=Y(G[f.componentType]);i.multiplyScalar(E)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;const o=new u.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=o}function te(h,e,t){const r=e.attributes,n=[];function s(o,a){return t.getDependency("accessor",o).then(function(i){h.setAttribute(a,i)})}for(const o in r){const a=$[o]||o.toLowerCase();a in h.attributes||n.push(s(r[o],a))}if(e.indices!==void 0&&!h.index){const o=t.getDependency("accessor",e.indices).then(function(a){h.setIndex(a)});n.push(o)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),k(h,e),Be(h,e,t),Promise.all(n).then(function(){return e.targets!==void 0?Pe(h,e.targets,t):h})}function Ue(){const h=p.ref(!1),e=p.ref(""),t=p.shallowRef([]),r=p.ref(null),n=new z.MTLLoader,s=new z.OBJLoader,o=new z.STLLoader,a=new ie,i=new z.PCDLoader,c=async l=>{var R;if(!l||l.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}h.value=!0,e.value="准备加载...",t.value=[],r.value=null;const f=new Map,m=[];l.forEach(g=>{if(g instanceof File){const x=g.name.toLowerCase();f.set(x,g),x.endsWith(".pcd")&&m.push(g)}});const T=[],E=[];try{if(m.length>0){e.value=`正在加载 ${m.length} 个点云文件...`;const g=await d(m,T);g&&E.push(g)}for(const g of l){const x=g.name||"unknown_file",y=(R=x.split(".").pop())==null?void 0:R.toLowerCase();if(y==="mtl"||y==="pcd")continue;const M=URL.createObjectURL(g);T.push(M);let S=null;const _=w=>{const O=w.lengthComputable?w.loaded/w.total*100:0;e.value=`正在加载 ${x}... ${Math.round(O)}%`};switch(e.value=`正在加载 ${x}... 0%`,y){case"obj":const w=x.replace(/\.obj$/i,".mtl").toLowerCase();if(f.has(w)){const C=f.get(w),j=URL.createObjectURL(C);T.push(j);const V=await n.loadAsync(j);V.preload(),s.setMaterials(V)}else s.setMaterials(null);S=await s.loadAsync(M,_),S&&H.optimizeHardEdgeAndSide(S);break;case"stl":const O=await o.loadAsync(M,_),b=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});S=new u.Mesh(O,b);break;case"gltf":case"glb":S=(await a.loadAsync(M,_)).scene;break;default:console.warn(`不支持的文件类型: .${y}`),e.value=`不支持的文件类型: ${x}`;continue}S&&(S.userData.boundingBox=new u.Box3().setFromObject(S),E.push(S))}t.value=E,e.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),r.value=`加载失败: ${g.message||"未知错误"}`,e.value="加载失败!",t.value=[],g}finally{h.value=!1,T.forEach(g=>URL.revokeObjectURL(g))}},d=async(l,f)=>{if(l.length===0)return null;const m=new u.Group;m.name="PCD Point Clouds";try{for(let E=0;E<l.length;E++){const R=l[E],g=R.name||`point_cloud_${E}.pcd`;e.value=`正在加载点云文件 ${E+1}/${l.length}: ${g}`;try{const x=URL.createObjectURL(R);f.push(x);const y=await new Promise((M,S)=>{i.load(x,_=>{const w=_.geometry.attributes.position,O=_.geometry.attributes.color;if(O&&O.count===w.count)_.userData.color="原始颜色";else{const P=new Float32Array(w.count*3);for(let C=0;C<w.count;C++)P[C*3]=0,P[C*3+1]=0,P[C*3+2]=0;_.geometry.setAttribute("color",new u.BufferAttribute(P,3)),_.userData.color="黑色"}_.material instanceof u.PointsMaterial&&(_.material.vertexColors=!0,_.material.size=.8,_.material.sizeAttenuation=!1),_.name=g,_.userData.originalFile=g,M(_)},void 0,_=>{console.error(`PCD文件加载失败: ${g}`,_),S(_)})});m.add(y)}catch(x){console.error(`加载点云文件失败: ${g}`,x)}}if(m.children.length===0)return console.warn("所有PCD文件都加载失败"),null;const T=new u.Box3().setFromObject(m);return m.userData.boundingBox=T,m}catch(T){throw console.error("PCD文件组加载失败:",T),new Error("无法加载PCD点云文件")}};return{isLoading:h,loadingProgress:e,loadedModels:t,error:r,loadModelsFromBlobs:c}}const je={class:"obj-viewer-container"},Ve={class:"buttonGroup-topLeft"},Ke={class:"buttonGroup-left"},ze={class:"buttonGroup-right"},Xe={class:"left-panel"},qe={class:"panel-header"},We={key:0,class:"clipping-content"},$e={class:"radio-group"},Ye={class:"radio-label"},Je={class:"radio-label"},Qe={class:"radio-label"},Ze={class:"radio-label"},et={key:0,class:"loading-overlay"},tt=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(h){const e=h,t=p.ref(null),r=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:o,initThreeJS:a,handleResize:i,getThreeJSObjects:c,cleanup:d,setModels:l,axesHelperVisible:f,toggleAxesVisibility:m,zoomIn:T,zoomOut:E}=H.useThreeJS(t),{isLoading:R,loadingProgress:g,loadedModels:x,error:y,loadModelsFromBlobs:M}=Ue(),{isAnimating:S,toggleAnimation:_,stopAnimation:w}=H.useAnimation(c,s),{isClipping:O,activeClippingAxis:b,toggleClipping:P,updateClippingPlanes:C}=H.useClipping(c,s),j=()=>{m()};p.watch(()=>e.fileBlobs,N=>{N&&N.length>0&&M(N).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(x,N=>{N&&N.length>0&&l(N)}),p.watch(y,N=>{N&&J.ElMessage.error(`模型加载失败: ${N}`)});const V=N=>{r.value=!0,n.value=N,N==="剖面视图"&&!O.value&&P()};let K=null;return p.onMounted(async()=>{await p.nextTick();try{a(),t.value&&(K=new ResizeObserver(i),K.observe(t.value))}catch(N){console.error("Three.js 初始化失败:",N),J.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",K&&K.disconnect(),S.value&&w(),d()}),(N,A)=>{const re=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",je,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:t,class:"threejs-container"},null,512),p.createElementVNode("div",Ve,[p.createVNode(B.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(o),title:"重置"},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:p.unref(T)},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:p.unref(E)},null,8,["onClick"]),p.createVNode(B.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(_),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(B.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(f),onClick:j,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Ke,[p.renderSlot(N.$slots,"button-left",{switchRightPanel:V},void 0,!0)]),p.createElementVNode("div",ze,[p.renderSlot(N.$slots,"button-right",{},void 0,!0)]),A[14]||(A[14]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Xe,[p.createElementVNode("div",qe,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[0]||(A[0]=I=>r.value=!1)}," X ")]),p.createVNode(re,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",We,[p.createElementVNode("div",$e,[p.createElementVNode("label",Ye,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[1]||(A[1]=I=>p.isRef(b)?b.value=I:null),onChange:A[2]||(A[2]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[9]||(A[9]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[3]||(A[3]=I=>p.isRef(b)?b.value=I:null),onChange:A[4]||(A[4]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",Qe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[5]||(A[5]=I=>p.isRef(b)?b.value=I:null),onChange:A[6]||(A[6]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Ze,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[7]||(A[7]=I=>p.isRef(b)?b.value=I:null),onChange:A[8]||(A[8]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,r.value]]),p.unref(R)?(p.openBlock(),p.createElementBlock("div",et,[A[13]||(A[13]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(g)),1)])):p.createCommentVNode("",!0)])}}}),nt=oe._export_sfc(tt,[["__scopeId","data-v-53f2a047"]]);exports.default=nt;
@@ -1,8 +1,8 @@
1
1
  import { ref as K, shallowRef as Ve, defineComponent as ze, watch as ie, onMounted as Xe, nextTick as qe, onBeforeUnmount as $e, resolveComponent as We, createElementBlock as oe, openBlock as ae, createElementVNode as b, withDirectives as z, createCommentVNode as Te, createVNode as j, unref as S, renderSlot as xe, toDisplayString as Re, withCtx as Ye, isRef as ee, vModelRadio as te, vShow as Je } from "vue";
2
- import { t as Ae, o as Qe, u as Ze, a as et, b as tt } from "./iconfont-BQBCgO1O.js";
3
- import { U as nt, Y as W, Z as Ie, _ as k, $ as Oe, C as G, a0 as F, o as Y, a1 as st, t as rt, D as it, x as re, V as B, a2 as ot, a3 as ve, a4 as at, a5 as Pe, a6 as ct, a7 as lt, a8 as ne, a9 as ut, aa as ke, ab as dt, ac as ft, ad as ht, ae as fe, af as De, ag as he, ah as pt, ai as mt, aj as Fe, ak as ce, al as gt, I as He, v as Tt, am as $, an as xt, J as Rt, ao as At, r as Ue, ap as Et, N as _t, aq as Lt, ar as yt, F as se, P as Mt, y as wt, as as bt, at as St, au as Nt, av as Ct, aw as It, ax as Ge, ay as Ot, az as Ee, aA as _e, aB as Le, aC as ye, aD as Me, aE as vt, aF as Pt, B as pe, aG as kt, aH as Dt, aI as Ft, u as Ht } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CYXAbj2a.js";
2
+ import { t as Ae, o as Qe, u as Ze, a as et, b as tt } from "./iconfont-DiGd__OT.js";
3
+ import { U as nt, Y as W, Z as Ie, _ as k, $ as Oe, C as G, a0 as F, o as Y, a1 as st, t as rt, D as it, x as re, V as B, a2 as ot, a3 as ve, a4 as at, a5 as Pe, a6 as ct, a7 as lt, a8 as ne, a9 as ut, aa as ke, ab as dt, ac as ft, ad as ht, ae as fe, af as De, ag as he, ah as pt, ai as mt, aj as Fe, ak as ce, al as gt, I as He, v as Tt, am as $, an as xt, J as Rt, ao as At, r as Ue, ap as Et, N as _t, aq as Lt, ar as yt, F as se, P as Mt, y as wt, as as bt, at as St, au as Nt, av as Ct, aw as It, ax as Ge, ay as Ot, az as Ee, aA as _e, aB as Le, aC as ye, aD as Me, aE as vt, aF as Pt, B as pe, aG as kt, aH as Dt, aI as Ft, u as Ht } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B3RSoHQA.js";
4
4
  import { E as we } from "./index-CA0SFykF.js";
5
- import { M as Ut, O as Gt, S as jt, P as Bt } from "./PCDLoader-BG-ZSu84.js";
5
+ import { M as Ut, O as Gt, S as jt, P as Bt } from "./PCDLoader-B0_dKUxm.js";
6
6
  import { T as X } from "./svgIcon-OBhwktPM.js";
7
7
  import { _ as Kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  class Vt extends nt {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-2XzE7ufi.cjs"),ue=require("./iconfont-D9hgzLCg.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DpGu0pGu.cjs");require("./index.vue_vue_type_style_index_1_lang-PBh9haH2.cjs");const Q=require("./index-DdIZEUfD.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-DiCmmZWZ.cjs");const Y=require("./robotUtil-CI-r19FW.cjs");require("./index-Ku2f-lW8.cjs");const we=require("./animationData-BsfHPO-P.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-BU2M7_8q.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ie($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),s=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>a.model?Y.getNonFixedJoints(a.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-XnZWnUpu.cjs"),ue=require("./iconfont-BYcEzhNe.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BkkUVCLE.cjs");require("./index.vue_vue_type_style_index_1_lang-PBh9haH2.cjs");const Q=require("./index-DdIZEUfD.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-D_Jkk1jj.cjs");const Y=require("./robotUtil-CHCt1RuS.cjs");require("./index-Ku2f-lW8.cjs");const we=require("./animationData-u3PDQuOQ.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-CE1RFgO5.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ie($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),s=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>a.model?Y.getNonFixedJoints(a.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${$.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),z=()=>c.value.map(l=>({Y:parseFloat(l.Y)||0,B:parseFloat(l.B)||0,C:parseFloat(l.C)||0,R:parseFloat(l.R)||0})),q=()=>{const l=[],t=[];return c.value.forEach(o=>{const{Y1:y,B1:N,C1:E,R1:j,Y2:W,B2:J,C2:re,R2:B}=o;l.push({Y:parseFloat(y)||0,B:parseFloat(N)||0,C:parseFloat(E)||0,R:parseFloat(j)||0}),t.push({Y:parseFloat(W)||0,B:parseFloat(J)||0,C:parseFloat(re)||0,R:parseFloat(B)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},I=(l=0,t=0)=>{if(v.value&&T.value){const o=q();xe(v.value,T.value,o.posPipeYbcr,o.negPipeYbcr,S.value,D.value,l,t,R.value)}else if(v.value){const o=z();Ce(v.value,o,S.value,D.value,l,t)}},U=l=>{if(l<0||l>=c.value.length){console.error(`帧索引 ${l} 超出范围`);return}const t=c.value[l];if(console.log(`应用第 ${l} 帧数据 ${t}`),s.value=l,k.value){const o={};C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value.setJointAngles(o)}I(l,0)},H=async()=>{if(c.value.length===0){A.ElMessage.error("无法播放动画:无数据");return}if(!m.value){m.value=!0,b=!1,c.value.length-1===s.value&&(s.value=0);try{for(let l=s.value+1;l<c.value.length&&!b;l++){s.value=l;const t=c.value[l],o={};k.value&&C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value?await k.value.animateToState(o,i.value,y=>{d.value=(l+y)/c.value.length*100,I(l-1,y)}):(await new Promise(y=>setTimeout(y,i.value)),d.value=(l+1)/c.value.length*100)}b||A.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l),A.ElMessage.error("动画播放出错")}finally{m.value=!1,d.value=0}}},w=()=>{b=!0,m.value=!1,d.value=0,A.ElMessage.info("动画已停止")},te=()=>{s.value=0},G=()=>{if(v.value&&T.value){const l=q();xe(v.value,T.value,l.posPipeYbcr,l.negPipeYbcr,S.value,D.value,-1,0,R.value)}else if(v.value){const l=z();Ce(v.value,l,S.value,D.value,-1,0)}},oe=()=>{k.value&&k.value.resetToZero(),G(),te(),A.ElMessage.success("机器人和管件已重置")},ne=l=>`第 ${l+1} 帧`,de=l=>{m.value&&w(),U(l)},me=()=>{m.value&&w(),!(s.value+1>=c.value.length)&&U(s.value+1)},pe=()=>{m.value&&w(),s.value!==0&&U(s.value-1)},ae=()=>{P.value&&(P.value.visible=!0),v.value&&v.value.parent&&v.value.parent.remove(v.value),P.value=null,v.value=null,T.value=null},ie=l=>l==null?void 0:l.reduce((t,o)=>(t[o]="0",t),{});e.watch($,(l,t)=>{if(JSON.stringify(l)!==JSON.stringify(t))if(l.length>0){const o=ie(l);c.value=[o]}else c.value=[]},{immediate:!0});const se=e.ref(0),ve=l=>{se.value=l},ee=(l,t)=>{if(!l||!t)return;const o=Y.getTargetJoint(l,t),y=Me();y.visible=!1,o==null||o.add(y)},le=l=>{k.value=new O.URDFRobotController(l),L.value=Y.getAllLinkName(l),M.value="Pipe_Joint"},fe=()=>{k.value=null,L.value=[],M.value=null},ge=l=>{le(l),ee(l,M.value),ve(se.value+1),oe()};e.watch(()=>a.model,l=>{if(ae(),l){ge(l);return}fe()},{immediate:!0});const ce=l=>{var o,y;const t=new n.Mesh(l.geometry.clone(),l.material);return t.name="managed_pipe_clone",(y=(o=l==null?void 0:l.parent)==null?void 0:o.add)==null||y.call(o,t),t.position.copy(l.position),t.rotation.copy(l.rotation),t.scale.copy(l.scale),t};e.watch([M,R,S,se],([l,t])=>{if(ae(),a.model&&l){const o=Y.getMeshFromJoint(a.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=ce(o);if(u.value===O.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,u.value===O.robotMode.DOUBLE){const N=ce(o);T.value=N}I(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const he=async()=>{if($.value.length===0){A.ElMessage.warning("没有可导出的表头");return}const l=$.value.join(" ");try{await navigator.clipboard.writeText(l),A.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),A.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},Ve=()=>{if(!r.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as Ee, ref as b, watch as se, shallowRef as ve, computed as _e, onUnmounted as et, resolveComponent as j, createElementBlock as we, openBlock as le, createElementVNode as n, createVNode as o, withCtx as T, createBlock as Ce, createCommentVNode as ye, unref as S, toDisplayString as me, nextTick as Ie, onMounted as We, onBeforeUnmount as Ke, Fragment as tt, renderList as lt, withDirectives as W, vShow as re, renderSlot as De, isRef as Re, vModelRadio as Te } from "vue";
2
- import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-DiVmUGRy.js";
3
- import { u as Qe, a as it, b as rt } from "./iconfont-BQBCgO1O.js";
2
+ import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-BCaK6cMT.js";
3
+ import { u as Qe, a as it, b as rt } from "./iconfont-DiGd__OT.js";
4
4
  import { a9 as ut, c as ct, E, aM as pt, ao as dt } from "./index-CA0SFykF.js";
5
- import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CYXAbj2a.js";
5
+ import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B3RSoHQA.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-B7HH0PCt.js";
7
7
  import { _ as ue, s as Mt } from "./index-DYC-Eh0y.js";
8
8
  import "./index-BHtNKL1L.js";
9
- import "./index.vue_vue_type_style_index_1_lang-bvR0uxez.js";
10
- import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-BeynP2xM.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-Cwuh77RJ.js";
10
+ import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-BIMs6Vbb.js";
11
11
  import "./index-BWB32eon.js";
12
- import { f as Ft, a as zt } from "./animationData-Bln0M7cD.js";
12
+ import { f as Ft, a as zt } from "./animationData-_k7oY6dT.js";
13
13
  import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
- import { U as Yt, J as Bt } from "./urdfTree-BhqPlNff.js";
14
+ import { U as Yt, J as Bt } from "./urdfTree-Du-nKROV.js";
15
15
  import { T as O } from "./svgIcon-OBhwktPM.js";
16
16
  const ae = mt.degToRad, Ge = new ft({
17
17
  // 灰色
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ye=require("./index.vue_vue_type_style_index_1_lang-PBh9haH2.cjs"),R=require("./workpieceTreePanel-2XzE7ufi.cjs"),K=require("./iconfont-D9hgzLCg.cjs"),Q=require("./index-CEwxrYB-.cjs"),de=require("./pointTrack-C3DjtFZp.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=require("./threeViewerHost-pVmmGFpg.cjs"),q=require("./robotUtil-CI-r19FW.cjs"),ne=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DpGu0pGu.cjs"),ce=require("./urdfTree-BU2M7_8q.cjs"),He=require("./index-BQOERy34.cjs"),y=require("./svgIcon-BH_8oaav.cjs"),Ke=require("./PCDLoader-Dy4BlpG3.cjs"),ue=require("./index-BdB_acmm.cjs"),Qe=async v=>await new Ke.OBJLoader().loadAsync(v),et={class:"table-container"},tt=["title"],nt=["title"],at=["title"],ot=["title"],lt=["title"],st=["title"],it=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(v){const s=v,b=e.ref();function p(i){e.nextTick(()=>{var u;const c=s.list.findIndex(N=>N.id===i);c>-1&&((u=b.value)==null||u.scrollToItem(c,"center"))})}return e.watch(()=>s.currentId,p,{immediate:!0}),(i,c)=>(e.openBlock(),e.createElementBlock("div",et,[c[0]||(c[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(de.script$2),{class:"scroller",ref_key:"scrollerRef",ref:b,items:i.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:u,index:N})=>{var m,A,x,S,j,z,h,k,w,D;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:u.id===i.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:N+1},e.toDisplayString(N+1),9,tt),e.createElementVNode("div",{class:"cell",title:(m=u.x)==null?void 0:m.toFixed(5)},e.toDisplayString((A=u.x)==null?void 0:A.toFixed(5)),9,nt),e.createElementVNode("div",{class:"cell",title:(x=u.y)==null?void 0:x.toFixed(5)},e.toDisplayString((S=u.y)==null?void 0:S.toFixed(5)),9,at),e.createElementVNode("div",{class:"cell",title:(j=u.z)==null?void 0:j.toFixed(5)},e.toDisplayString((z=u.z)==null?void 0:z.toFixed(5)),9,ot),e.createElementVNode("div",{class:"cell",title:(h=u.b_axis)==null?void 0:h.toFixed(5)},e.toDisplayString((k=u.b_axis)==null?void 0:k.toFixed(5)),9,lt),e.createElementVNode("div",{class:"cell",title:(w=u.c_axis)==null?void 0:w.toFixed(5)},e.toDisplayString((D=u.c_axis)==null?void 0:D.toFixed(5)),9,st)],2)]}),_:1},8,["items"])]))}}),rt=ae._export_sfc(it,[["__scopeId","data-v-b02c9b80"]]);function ct(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function ut(v){const s=de.getPointGeometry(v);return s&&(s.material.sizeAttenuation=!1),s}async function dt(v){return await ve.downloadFile(v)}async function vt(v){return await ve.readCsv(v)}async function mt(v){const s=await dt(v);return(await vt(s)).map(i=>{const c=ct();return c.x_axis=i.X_Axis,c.y_axis=i.Y_Axis,c.z_axis=i.Z_Axis,c.b_axis=i.B_Axis,c.c_axis=i.C_Axis,c.x=i.X,c.y=i.Y,c.z=i.Z,c})}const ft={class:"panel-content"},pt={class:"animation-controls"},ht={class:"control-row"},gt={class:"control-row"},bt={class:"frame-info"},_t={class:"control-row"},Vt={class:"scroller-row"},yt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(v,{expose:s,emit:b}){const p=v,i=e.computed(()=>(p.animationData||[]).map((a,r)=>({...a,id:r}))),c=e.ref(!1),u=e.ref(0),N=e.ref(100);let m=!1;const A={bladeAxis:"叶片模型位置"},x=e.ref(null),S=o=>{if(o<0||o>=i.value.length)return null;const a=q.getObjectWorldMatrix(p.robot,A.bladeAxis);if(!a)return null;const r=i.value[o];return new ne.Vector3(r.x,r.y,r.z).applyMatrix4(a)},j=(o,a)=>{o&&o.setJointValues(a)},z=(o,a,r,g,E)=>{const I={B_Axis:ne.MathUtils.degToRad(g),C_Axis:ne.MathUtils.degToRad(E),X_Axis:o,Y_Axis:a,Z_Axis:r};j(p.robot,I)},h=()=>{const o=p.scene;if(!o)return;const a=[];o.traverse(r=>{r.name==="TrajectoryPoints"&&a.push(r)}),a.forEach(r=>{o.remove(r),K.disposeObj(r)})},k=o=>{const a=[];for(let r=0;r<=o;r++){const g=S(r);g&&a.push(g.x,g.y,g.z)}return a},w=o=>{const a=ut(o);if(a)return a.name="TrajectoryPoints",x.value=a,a},D=o=>{h();const a=k(o),r=w(a);p.scene&&r&&p.scene.add(r)},J=o=>`第 ${o+1} 帧`,U=o=>{if(o<0||o>=i.value.length){console.error(`帧索引 ${o} 超出范围`);return}const a=i.value[o];u.value=o,z(a.x_axis,a.y_axis,a.z_axis,a.b_axis,a.c_axis);const r=p.scene;r&&r.updateMatrixWorld(!0),D(o)},$=async()=>{if(i.value.length===0){Q.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!c.value){c.value=!0,m=!1,i.value.length-1===u.value&&(u.value=0);try{for(let o=u.value+1;o<i.value.length&&!m;o++)await new Promise(a=>setTimeout(a,N.value)),U(o);m||Q.ElMessage.success("动画播放完成")}catch(o){console.error("动画播放出错:",o)}finally{c.value=!1}}},B=async()=>{c.value&&(m=!0,await new Promise(o=>{const a=e.watch(()=>c.value,r=>{a(),o()})}))},M=async o=>{c.value&&await B(),U(o)},G=async()=>{c.value&&await B(),!(u.value+1>=i.value.length)&&U(u.value+1)},X=async()=>{c.value&&await B(),u.value!==0&&U(u.value-1)},F=()=>{u.value=0},C=async()=>{await B(),h(),F()};return e.onBeforeUnmount(()=>{C()}),s({playAnimation:$,stopAnimation:B,forwardFrame:G,backwardFrame:X,resetAnimationFrame:F,reset:C}),(o,a)=>{const r=e.resolveComponent("el-input-number"),g=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),I=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",pt,[e.createElementVNode("div",ht,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(g,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:N.value,"onUpdate:modelValue":a[0]||(a[0]=O=>N.value=O),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",gt,[a[2]||(a[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",bt,e.toDisplayString(u.value+1)+" / "+e.toDisplayString(i.value.length),1)]),e.createElementVNode("div",_t,[a[3]||(a[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(I,{class:"slider",modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=O=>u.value=O),min:0,max:i.value.length>0?i.value.length-1:0,step:1,"format-tooltip":J,onInput:M,disabled:i.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Vt,[e.createVNode(rt,{class:"scroller",list:i.value,"current-id":u.value},null,8,["list","current-id"])])])])}}}),Nt=ae._export_sfc(yt,[["__scopeId","data-v-228866a6"]]),xt=async v=>{const s=await Qe(v);return s==null||s.traverse(b=>{b.isMesh&&b.geometry.computeVertexNormals()}),s},wt={class:"obj-viewer-container"},Ct={key:0,class:"machine-casing"},kt={class:"buttonGroup-topLeft"},Et={class:"buttonGroup-left"},Pt={class:"buttonGroup-right"},Tt={class:"left-panel"},St={class:"panel-header"},Dt={class:"panel-body"},Bt={key:1,class:"clipping-content"},Mt={class:"radio-group"},At={class:"radio-label"},jt={class:"radio-label"},zt={class:"radio-label"},Ut={class:"radio-label"},$t={class:"right-panel"},Ft={class:"panel-header"},Rt={class:"panel-body"},It={key:1,class:"loading-overlay"},Ot={key:2,class:"brand"},Lt={class:"brand-item"},qt={class:"item-value"},Jt={class:"brand-item"},Gt={class:"item-value"},Xt={class:"brand-item"},Wt={class:"item-value"},Zt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(v){const s=v,b=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),i=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.machine}),c=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.产品型号}),u=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.编号}),N=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.厂家}),m=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.workpieceInfo}),A=e.computed(()=>{var n;return(n=m.value)==null?void 0:n.name}),x=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.knife}),S=e.ref([]),j=async n=>{!n||!n.isExtra||(await z(n),b==null||b(n==null?void 0:n.pageName),p==null||p(!0))},z=ue.debounce(async n=>{await ue.onPageBack();const{mainKey:t,baseMenuPath:l}=n||{};Ye.copyAdd(l,t)},500);e.watch(()=>[c.value,m.value,x.value],()=>{var V,d,ie,re;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};c.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:c.value,label:c.value,baseMenuPath:"设备库/机床"});const l={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};m.value&&l.children.push({isExtra:!0,type:(V=m.value)==null?void 0:V.type,pageName:"工件",mainKey:(d=m.value)==null?void 0:d.name,label:(ie=m.value)==null?void 0:ie.name,baseMenuPath:`工件库/${(re=m.value)==null?void 0:re.type}`});const T={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};x.value&&T.children.push({isExtra:!0,pageName:"刀具",mainKey:x.value,label:x.value,baseMenuPath:"设备库/刀具"}),n.push(t,l,T),S.value=n},{immediate:!0});const h=e.ref(!1),k=e.ref([]),w=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.csvUrl});e.watch(()=>w.value,async()=>{if(console.log("three data",s==null?void 0:s.threeData),console.log("csvUrl",w.value),k.value=[],w.value){h.value=!0;const n=await mt(w.value);k.value=n,h.value=!1}},{immediate:!0});const D={"CJ-001":"CJ001榫头","CJ-002":"CJ002榫头","CJ-003":"CJ003榫头"},J=e.computed(()=>D[A.value]),U=e.computed(()=>{var n;return((n=m.value)==null?void 0:n.type)==="航空发动机叶片"}),$=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.bladeObjUrl}),B=e.ref(R.sceneType.ROBOT),M=e.ref(null),G=e.ref(!1),X=e.ref(""),F=e.ref(!1),C=e.ref(""),o=e.ref(!1),a=e.ref(""),r=e.shallowRef(null),g=e.ref(null),E=e.ref("叶片模型"),I=e.shallowRef(null),O=e.shallowRef(null),W=e.ref(!0),Z=e.shallowRef(null),me=e.computed(()=>!!Z.value),oe=e.shallowRef(null),f=e.ref(),{currentModels:Y,resetView:fe,initThreeJS:pe,handleResize:he,getThreeJSObjects:L,cleanup:ge,setModels:le,axesHelperVisible:be,toggleAxesVisibility:_e,zoomIn:Ve,zoomOut:ye}=K.useThreeJS(M),{loadSceneFromFile:Ne}=R.useUrdfLoader(L,Y,G,X),{isAnimating:se,toggleAnimation:xe,stopAnimation:we}=K.useAnimation(L,Y),{isClipping:Ce,activeClippingAxis:_,toggleClipping:ke,updateClippingPlanes:P}=K.useClipping(L,Y),{initRaycaster:Ee,selectedObject3D:Pe,setSelectedObjVisible:Te,updatePosition:Se,updateRotation:De,dispose:Be}=R.useRaycaster(M,L,Y),Me=()=>{_e()},Ae=e.computed(()=>B.value===R.sceneType.ROBOT),je=n=>{F.value=!0,C.value=n,n==="剖面视图"&&!Ce.value&&ke()},ee=n=>{o.value=!0,a.value=n},ze=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.playAnimation()},Ue=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.stopAnimation()},$e=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.forwardFrame()},Fe=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.backwardFrame()},te=()=>{var n;(n=f==null?void 0:f.value)==null||n.reset()},Re=()=>{te(),fe(),g.value&&g.value.resetToZero()},Ie=n=>{if(!n){Z.value=null,W.value=!1;return}const t=q.getTargetLink(n,"Base1");Z.value=t,W.value=!!(t!=null&&t.visible)},Oe=n=>{W.value=n,Z.value.visible=n},Le=(n,t)=>{if(J.value){const l=q.getTargetLink(n,J.value);l&&(l.visible=t)}},qe=(n,t)=>{const l=Object.values(D);for(let T=0;T<l.length;T++){const V=l[T],d=q.getTargetLink(n,V);d&&(d.visible=t)}},Je=n=>{n&&qe(n,!1)},Ge=(n,t)=>q.getMeshFromLink(n,t),Xe=async n=>{const t=Ge(n,E.value);if(O.value=t,console.log("bladeObjUrl",$.value),U.value&&$.value&&t&&Le(n,!0),t&&t.parent&&$.value){const l=await xt($.value);l.name="blade_clone",t.parent.add(l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),t.visible=!1,I.value=l}else E.value&&console.warn(`在 Blade '${E.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>s.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;Ne(t).then(l=>{r.value=l,Je(l),l&&Xe(l)}).catch(l=>{console.error("加载URDF文件时发生错误:",l),Q.ElMessage.error("加载urdf模型失败"),r.value=null})}else r.value=null},{immediate:!0,deep:!0}),e.watch(r,n=>{te(),n?(le([n]),g.value=new R.URDFRobotController(n)):(le([]),g.value=null),Ie(n),Ee()});let H=null;const We=()=>{pe(),e.nextTick(()=>{M.value&&(H=new ResizeObserver(he),H.observe(M.value))});const n=L();oe.value=n.scene},Ze=()=>{C.value="",a.value="",H&&H.disconnect(),se.value&&we(),te(),ge(),Be()};return e.onMounted(async()=>{await e.nextTick();try{We()}catch(n){console.error("Three.js 初始化失败:",n),Q.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Ze()}),(n,t)=>{const l=e.resolveComponent("el-scrollbar"),T=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",wt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:M,class:"threejs-container"},null,512),[[e.vShow,Ae.value]]),me.value?(e.openBlock(),e.createElementBlock("div",Ct,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(He._sfc_main$1,{value:W.value,onChange:Oe,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",kt,[e.createVNode(y.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Re,title:"重置"}),e.createVNode(y.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(Ve)},null,8,["onClick"]),e.createVNode(y.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(ye)},null,8,["onClick"]),e.createVNode(y.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(xe),title:e.unref(se)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(y.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(be),onClick:Me,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",Et,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:je},void 0,!0)]),e.createElementVNode("div",Pt,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:ee},void 0,!0),e.createVNode(y.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=V=>ee("机床控制")),active:o.value&&a.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(y.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=V=>ee("轨迹路径")),active:o.value&&a.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":h.value}])},[e.createVNode(y.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Fe}),e.createVNode(y.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),e.createVNode(y.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:$e}),e.createVNode(y.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ue})],2),e.withDirectives(e.createElementVNode("div",Tt,[e.createElementVNode("div",St,[e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=V=>F.value=!1)}," X ")]),e.createElementVNode("div",Dt,[e.createVNode(l,{height:"100%"},{default:e.withCtx(()=>{var V;return[C.value==="场景树"?(e.openBlock(),e.createBlock(ce.UrdfTree,{key:0,model:r.value,extraNodes:S.value,onNodeClick:j},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",Mt,[e.createElementVNode("label",At,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(_)?_.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",jt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(_)?_.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",zt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(_)?_.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ut,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(_)?_.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),C.value==="工件树"?(e.openBlock(),e.createBlock(R.WorkpieceTreePanel,{key:2,model:(V=e.unref(Pe))==null?void 0:V.obj,onVisibleChange:e.unref(Te),onUpdatePosition:e.unref(Se),onUpdateRotation:e.unref(De)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,F.value]]),e.withDirectives(e.createElementVNode("div",$t,[e.createElementVNode("div",Ft,[e.createElementVNode("span",null,e.toDisplayString(a.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=V=>o.value=!1)}," X ")]),e.createElementVNode("div",Rt,[e.createVNode(l,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ce.JointPanel,{model:r.value},null,8,["model"]),[[e.vShow,a.value==="机床控制"]]),e.withDirectives(e.createVNode(Nt,{robot:r.value,scene:oe.value,animationData:k.value,ref_key:"bladeTrackPanelRef",ref:f},null,8,["robot","scene","animationData"]),[[e.vShow,a.value==="轨迹路径"&&!h.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:a.value},void 0,!0)]),_:3})])],512),[[e.vShow,o.value]]),G.value?(e.openBlock(),e.createElementBlock("div",It,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(X.value),1)])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",Lt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",qt,e.toDisplayString(N.value),1)]),e.createElementVNode("div",Jt,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",Gt,e.toDisplayString(c.value),1)]),e.createElementVNode("div",Xt,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Wt,e.toDisplayString(u.value),1)])])):e.createCommentVNode("",!0),e.createVNode(T,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),Yt=ae._export_sfc(Zt,[["__scopeId","data-v-cd9c616b"]]);exports.default=Yt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ye=require("./index.vue_vue_type_style_index_1_lang-PBh9haH2.cjs"),R=require("./workpieceTreePanel-XnZWnUpu.cjs"),K=require("./iconfont-BYcEzhNe.cjs"),Q=require("./index-CEwxrYB-.cjs"),de=require("./pointTrack-BlTNQUei.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=require("./threeViewerHost-Czjy_lsO.cjs"),q=require("./robotUtil-CHCt1RuS.cjs"),ne=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BkkUVCLE.cjs"),ce=require("./urdfTree-CE1RFgO5.cjs"),He=require("./index-BrmJTI0B.cjs"),y=require("./svgIcon-BH_8oaav.cjs"),Ke=require("./PCDLoader-BhWhU7AF.cjs"),ue=require("./index-eGw5gJGa.cjs"),Qe=async v=>await new Ke.OBJLoader().loadAsync(v),et={class:"table-container"},tt=["title"],nt=["title"],at=["title"],ot=["title"],lt=["title"],st=["title"],it=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(v){const s=v,b=e.ref();function p(i){e.nextTick(()=>{var u;const c=s.list.findIndex(N=>N.id===i);c>-1&&((u=b.value)==null||u.scrollToItem(c,"center"))})}return e.watch(()=>s.currentId,p,{immediate:!0}),(i,c)=>(e.openBlock(),e.createElementBlock("div",et,[c[0]||(c[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(de.script$2),{class:"scroller",ref_key:"scrollerRef",ref:b,items:i.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:u,index:N})=>{var m,A,x,S,j,z,h,k,w,D;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:u.id===i.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:N+1},e.toDisplayString(N+1),9,tt),e.createElementVNode("div",{class:"cell",title:(m=u.x)==null?void 0:m.toFixed(5)},e.toDisplayString((A=u.x)==null?void 0:A.toFixed(5)),9,nt),e.createElementVNode("div",{class:"cell",title:(x=u.y)==null?void 0:x.toFixed(5)},e.toDisplayString((S=u.y)==null?void 0:S.toFixed(5)),9,at),e.createElementVNode("div",{class:"cell",title:(j=u.z)==null?void 0:j.toFixed(5)},e.toDisplayString((z=u.z)==null?void 0:z.toFixed(5)),9,ot),e.createElementVNode("div",{class:"cell",title:(h=u.b_axis)==null?void 0:h.toFixed(5)},e.toDisplayString((k=u.b_axis)==null?void 0:k.toFixed(5)),9,lt),e.createElementVNode("div",{class:"cell",title:(w=u.c_axis)==null?void 0:w.toFixed(5)},e.toDisplayString((D=u.c_axis)==null?void 0:D.toFixed(5)),9,st)],2)]}),_:1},8,["items"])]))}}),rt=ae._export_sfc(it,[["__scopeId","data-v-b02c9b80"]]);function ct(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function ut(v){const s=de.getPointGeometry(v);return s&&(s.material.sizeAttenuation=!1),s}async function dt(v){return await ve.downloadFile(v)}async function vt(v){return await ve.readCsv(v)}async function mt(v){const s=await dt(v);return(await vt(s)).map(i=>{const c=ct();return c.x_axis=i.X_Axis,c.y_axis=i.Y_Axis,c.z_axis=i.Z_Axis,c.b_axis=i.B_Axis,c.c_axis=i.C_Axis,c.x=i.X,c.y=i.Y,c.z=i.Z,c})}const ft={class:"panel-content"},pt={class:"animation-controls"},ht={class:"control-row"},gt={class:"control-row"},bt={class:"frame-info"},_t={class:"control-row"},Vt={class:"scroller-row"},yt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(v,{expose:s,emit:b}){const p=v,i=e.computed(()=>(p.animationData||[]).map((a,r)=>({...a,id:r}))),c=e.ref(!1),u=e.ref(0),N=e.ref(100);let m=!1;const A={bladeAxis:"叶片模型位置"},x=e.ref(null),S=o=>{if(o<0||o>=i.value.length)return null;const a=q.getObjectWorldMatrix(p.robot,A.bladeAxis);if(!a)return null;const r=i.value[o];return new ne.Vector3(r.x,r.y,r.z).applyMatrix4(a)},j=(o,a)=>{o&&o.setJointValues(a)},z=(o,a,r,g,E)=>{const I={B_Axis:ne.MathUtils.degToRad(g),C_Axis:ne.MathUtils.degToRad(E),X_Axis:o,Y_Axis:a,Z_Axis:r};j(p.robot,I)},h=()=>{const o=p.scene;if(!o)return;const a=[];o.traverse(r=>{r.name==="TrajectoryPoints"&&a.push(r)}),a.forEach(r=>{o.remove(r),K.disposeObj(r)})},k=o=>{const a=[];for(let r=0;r<=o;r++){const g=S(r);g&&a.push(g.x,g.y,g.z)}return a},w=o=>{const a=ut(o);if(a)return a.name="TrajectoryPoints",x.value=a,a},D=o=>{h();const a=k(o),r=w(a);p.scene&&r&&p.scene.add(r)},J=o=>`第 ${o+1} 帧`,U=o=>{if(o<0||o>=i.value.length){console.error(`帧索引 ${o} 超出范围`);return}const a=i.value[o];u.value=o,z(a.x_axis,a.y_axis,a.z_axis,a.b_axis,a.c_axis);const r=p.scene;r&&r.updateMatrixWorld(!0),D(o)},$=async()=>{if(i.value.length===0){Q.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!c.value){c.value=!0,m=!1,i.value.length-1===u.value&&(u.value=0);try{for(let o=u.value+1;o<i.value.length&&!m;o++)await new Promise(a=>setTimeout(a,N.value)),U(o);m||Q.ElMessage.success("动画播放完成")}catch(o){console.error("动画播放出错:",o)}finally{c.value=!1}}},B=async()=>{c.value&&(m=!0,await new Promise(o=>{const a=e.watch(()=>c.value,r=>{a(),o()})}))},M=async o=>{c.value&&await B(),U(o)},G=async()=>{c.value&&await B(),!(u.value+1>=i.value.length)&&U(u.value+1)},X=async()=>{c.value&&await B(),u.value!==0&&U(u.value-1)},F=()=>{u.value=0},C=async()=>{await B(),h(),F()};return e.onBeforeUnmount(()=>{C()}),s({playAnimation:$,stopAnimation:B,forwardFrame:G,backwardFrame:X,resetAnimationFrame:F,reset:C}),(o,a)=>{const r=e.resolveComponent("el-input-number"),g=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),I=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",pt,[e.createElementVNode("div",ht,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(g,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:N.value,"onUpdate:modelValue":a[0]||(a[0]=O=>N.value=O),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",gt,[a[2]||(a[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",bt,e.toDisplayString(u.value+1)+" / "+e.toDisplayString(i.value.length),1)]),e.createElementVNode("div",_t,[a[3]||(a[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(I,{class:"slider",modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=O=>u.value=O),min:0,max:i.value.length>0?i.value.length-1:0,step:1,"format-tooltip":J,onInput:M,disabled:i.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Vt,[e.createVNode(rt,{class:"scroller",list:i.value,"current-id":u.value},null,8,["list","current-id"])])])])}}}),Nt=ae._export_sfc(yt,[["__scopeId","data-v-228866a6"]]),xt=async v=>{const s=await Qe(v);return s==null||s.traverse(b=>{b.isMesh&&b.geometry.computeVertexNormals()}),s},wt={class:"obj-viewer-container"},Ct={key:0,class:"machine-casing"},kt={class:"buttonGroup-topLeft"},Et={class:"buttonGroup-left"},Pt={class:"buttonGroup-right"},Tt={class:"left-panel"},St={class:"panel-header"},Dt={class:"panel-body"},Bt={key:1,class:"clipping-content"},Mt={class:"radio-group"},At={class:"radio-label"},jt={class:"radio-label"},zt={class:"radio-label"},Ut={class:"radio-label"},$t={class:"right-panel"},Ft={class:"panel-header"},Rt={class:"panel-body"},It={key:1,class:"loading-overlay"},Ot={key:2,class:"brand"},Lt={class:"brand-item"},qt={class:"item-value"},Jt={class:"brand-item"},Gt={class:"item-value"},Xt={class:"brand-item"},Wt={class:"item-value"},Zt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(v){const s=v,b=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),i=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.machine}),c=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.产品型号}),u=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.编号}),N=e.computed(()=>{var t;return(t=i==null?void 0:i.value)==null?void 0:t.厂家}),m=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.workpieceInfo}),A=e.computed(()=>{var n;return(n=m.value)==null?void 0:n.name}),x=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.knife}),S=e.ref([]),j=async n=>{!n||!n.isExtra||(await z(n),b==null||b(n==null?void 0:n.pageName),p==null||p(!0))},z=ue.debounce(async n=>{await ue.onPageBack();const{mainKey:t,baseMenuPath:l}=n||{};Ye.copyAdd(l,t)},500);e.watch(()=>[c.value,m.value,x.value],()=>{var V,d,ie,re;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};c.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:c.value,label:c.value,baseMenuPath:"设备库/机床"});const l={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};m.value&&l.children.push({isExtra:!0,type:(V=m.value)==null?void 0:V.type,pageName:"工件",mainKey:(d=m.value)==null?void 0:d.name,label:(ie=m.value)==null?void 0:ie.name,baseMenuPath:`工件库/${(re=m.value)==null?void 0:re.type}`});const T={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};x.value&&T.children.push({isExtra:!0,pageName:"刀具",mainKey:x.value,label:x.value,baseMenuPath:"设备库/刀具"}),n.push(t,l,T),S.value=n},{immediate:!0});const h=e.ref(!1),k=e.ref([]),w=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.csvUrl});e.watch(()=>w.value,async()=>{if(console.log("three data",s==null?void 0:s.threeData),console.log("csvUrl",w.value),k.value=[],w.value){h.value=!0;const n=await mt(w.value);k.value=n,h.value=!1}},{immediate:!0});const D={"CJ-001":"CJ001榫头","CJ-002":"CJ002榫头","CJ-003":"CJ003榫头"},J=e.computed(()=>D[A.value]),U=e.computed(()=>{var n;return((n=m.value)==null?void 0:n.type)==="航空发动机叶片"}),$=e.computed(()=>{var t,l;return(l=(t=s==null?void 0:s.threeData)==null?void 0:t.data)==null?void 0:l.bladeObjUrl}),B=e.ref(R.sceneType.ROBOT),M=e.ref(null),G=e.ref(!1),X=e.ref(""),F=e.ref(!1),C=e.ref(""),o=e.ref(!1),a=e.ref(""),r=e.shallowRef(null),g=e.ref(null),E=e.ref("叶片模型"),I=e.shallowRef(null),O=e.shallowRef(null),W=e.ref(!0),Z=e.shallowRef(null),me=e.computed(()=>!!Z.value),oe=e.shallowRef(null),f=e.ref(),{currentModels:Y,resetView:fe,initThreeJS:pe,handleResize:he,getThreeJSObjects:L,cleanup:ge,setModels:le,axesHelperVisible:be,toggleAxesVisibility:_e,zoomIn:Ve,zoomOut:ye}=K.useThreeJS(M),{loadSceneFromFile:Ne}=R.useUrdfLoader(L,Y,G,X),{isAnimating:se,toggleAnimation:xe,stopAnimation:we}=K.useAnimation(L,Y),{isClipping:Ce,activeClippingAxis:_,toggleClipping:ke,updateClippingPlanes:P}=K.useClipping(L,Y),{initRaycaster:Ee,selectedObject3D:Pe,setSelectedObjVisible:Te,updatePosition:Se,updateRotation:De,dispose:Be}=R.useRaycaster(M,L,Y),Me=()=>{_e()},Ae=e.computed(()=>B.value===R.sceneType.ROBOT),je=n=>{F.value=!0,C.value=n,n==="剖面视图"&&!Ce.value&&ke()},ee=n=>{o.value=!0,a.value=n},ze=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.playAnimation()},Ue=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.stopAnimation()},$e=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.forwardFrame()},Fe=()=>{var n;h.value||(n=f==null?void 0:f.value)==null||n.backwardFrame()},te=()=>{var n;(n=f==null?void 0:f.value)==null||n.reset()},Re=()=>{te(),fe(),g.value&&g.value.resetToZero()},Ie=n=>{if(!n){Z.value=null,W.value=!1;return}const t=q.getTargetLink(n,"Base1");Z.value=t,W.value=!!(t!=null&&t.visible)},Oe=n=>{W.value=n,Z.value.visible=n},Le=(n,t)=>{if(J.value){const l=q.getTargetLink(n,J.value);l&&(l.visible=t)}},qe=(n,t)=>{const l=Object.values(D);for(let T=0;T<l.length;T++){const V=l[T],d=q.getTargetLink(n,V);d&&(d.visible=t)}},Je=n=>{n&&qe(n,!1)},Ge=(n,t)=>q.getMeshFromLink(n,t),Xe=async n=>{const t=Ge(n,E.value);if(O.value=t,console.log("bladeObjUrl",$.value),U.value&&$.value&&t&&Le(n,!0),t&&t.parent&&$.value){const l=await xt($.value);l.name="blade_clone",t.parent.add(l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),t.visible=!1,I.value=l}else E.value&&console.warn(`在 Blade '${E.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>s.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;Ne(t).then(l=>{r.value=l,Je(l),l&&Xe(l)}).catch(l=>{console.error("加载URDF文件时发生错误:",l),Q.ElMessage.error("加载urdf模型失败"),r.value=null})}else r.value=null},{immediate:!0,deep:!0}),e.watch(r,n=>{te(),n?(le([n]),g.value=new R.URDFRobotController(n)):(le([]),g.value=null),Ie(n),Ee()});let H=null;const We=()=>{pe(),e.nextTick(()=>{M.value&&(H=new ResizeObserver(he),H.observe(M.value))});const n=L();oe.value=n.scene},Ze=()=>{C.value="",a.value="",H&&H.disconnect(),se.value&&we(),te(),ge(),Be()};return e.onMounted(async()=>{await e.nextTick();try{We()}catch(n){console.error("Three.js 初始化失败:",n),Q.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Ze()}),(n,t)=>{const l=e.resolveComponent("el-scrollbar"),T=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",wt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:M,class:"threejs-container"},null,512),[[e.vShow,Ae.value]]),me.value?(e.openBlock(),e.createElementBlock("div",Ct,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(He._sfc_main$1,{value:W.value,onChange:Oe,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",kt,[e.createVNode(y.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Re,title:"重置"}),e.createVNode(y.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(Ve)},null,8,["onClick"]),e.createVNode(y.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(ye)},null,8,["onClick"]),e.createVNode(y.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(xe),title:e.unref(se)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(y.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(be),onClick:Me,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",Et,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:je},void 0,!0)]),e.createElementVNode("div",Pt,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:ee},void 0,!0),e.createVNode(y.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=V=>ee("机床控制")),active:o.value&&a.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(y.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=V=>ee("轨迹路径")),active:o.value&&a.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":h.value}])},[e.createVNode(y.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Fe}),e.createVNode(y.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),e.createVNode(y.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:$e}),e.createVNode(y.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ue})],2),e.withDirectives(e.createElementVNode("div",Tt,[e.createElementVNode("div",St,[e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=V=>F.value=!1)}," X ")]),e.createElementVNode("div",Dt,[e.createVNode(l,{height:"100%"},{default:e.withCtx(()=>{var V;return[C.value==="场景树"?(e.openBlock(),e.createBlock(ce.UrdfTree,{key:0,model:r.value,extraNodes:S.value,onNodeClick:j},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",Mt,[e.createElementVNode("label",At,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(_)?_.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",jt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(_)?_.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",zt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(_)?_.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ut,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(_)?_.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(P)&&e.unref(P)(...d))},null,544),[[e.vModelRadio,e.unref(_)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),C.value==="工件树"?(e.openBlock(),e.createBlock(R.WorkpieceTreePanel,{key:2,model:(V=e.unref(Pe))==null?void 0:V.obj,onVisibleChange:e.unref(Te),onUpdatePosition:e.unref(Se),onUpdateRotation:e.unref(De)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,F.value]]),e.withDirectives(e.createElementVNode("div",$t,[e.createElementVNode("div",Ft,[e.createElementVNode("span",null,e.toDisplayString(a.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=V=>o.value=!1)}," X ")]),e.createElementVNode("div",Rt,[e.createVNode(l,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ce.JointPanel,{model:r.value},null,8,["model"]),[[e.vShow,a.value==="机床控制"]]),e.withDirectives(e.createVNode(Nt,{robot:r.value,scene:oe.value,animationData:k.value,ref_key:"bladeTrackPanelRef",ref:f},null,8,["robot","scene","animationData"]),[[e.vShow,a.value==="轨迹路径"&&!h.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:a.value},void 0,!0)]),_:3})])],512),[[e.vShow,o.value]]),G.value?(e.openBlock(),e.createElementBlock("div",It,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(X.value),1)])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",Lt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",qt,e.toDisplayString(N.value),1)]),e.createElementVNode("div",Jt,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",Gt,e.toDisplayString(c.value),1)]),e.createElementVNode("div",Xt,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Wt,e.toDisplayString(u.value),1)])])):e.createCommentVNode("",!0),e.createVNode(T,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),Yt=ae._export_sfc(Zt,[["__scopeId","data-v-cd9c616b"]]);exports.default=Yt;
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as _e, ref as p, watch as K, createElementBlock as R, openBlock as D, createStaticVNode as pt, createVNode as d, unref as v, withCtx as ae, createElementVNode as a, normalizeClass as je, toDisplayString as w, nextTick as he, computed as x, onBeforeUnmount as ze, resolveComponent as Y, inject as Pe, shallowRef as ee, onMounted as ft, withDirectives as N, createCommentVNode as Z, vShow as te, renderSlot as fe, createBlock as Te, isRef as ce, vModelRadio as de } from "vue";
2
2
  import { aD as bt } from "./index.vue_vue_type_style_index_1_lang-B7HH0PCt.js";
3
- import { s as Ae, u as ht, a as _t, U as gt, W as yt } from "./workpieceTreePanel-DiVmUGRy.js";
4
- import { d as xt, u as wt, a as Ct, b as kt } from "./iconfont-BQBCgO1O.js";
3
+ import { s as Ae, u as ht, a as _t, U as gt, W as yt } from "./workpieceTreePanel-BCaK6cMT.js";
4
+ import { d as xt, u as wt, a as Ct, b as kt } from "./iconfont-DiGd__OT.js";
5
5
  import { E as ve } from "./index-CA0SFykF.js";
6
- import { s as Pt, b as Tt } from "./pointTrack-DINaUvcX.js";
6
+ import { s as Pt, b as Tt } from "./pointTrack-o_VVFlmw.js";
7
7
  import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- import { b as At, c as Vt } from "./threeViewerHost-BaGBR8jd.js";
9
- import { d as jt, e as be, f as zt } from "./robotUtil-BeynP2xM.js";
10
- import { V as Nt, y as Ve } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CYXAbj2a.js";
11
- import { U as Dt, J as Ut } from "./urdfTree-BhqPlNff.js";
12
- import { a as $t } from "./index-Djzfu6It.js";
8
+ import { b as At, c as Vt } from "./threeViewerHost-CTUpfC_Y.js";
9
+ import { d as jt, e as be, f as zt } from "./robotUtil-BIMs6Vbb.js";
10
+ import { V as Nt, y as Ve } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B3RSoHQA.js";
11
+ import { U as Dt, J as Ut } from "./urdfTree-Du-nKROV.js";
12
+ import { a as $t } from "./index-CnERmJxh.js";
13
13
  import { T } from "./svgIcon-OBhwktPM.js";
14
- import { O as Ft } from "./PCDLoader-BG-ZSu84.js";
15
- import { K as Mt, j as Bt } from "./index-BWxZZ5t2.js";
14
+ import { O as Ft } from "./PCDLoader-B0_dKUxm.js";
15
+ import { K as Mt, j as Bt } from "./index-C8howWAV.js";
16
16
  const Ot = async (f) => await new Ft().loadAsync(f), St = { class: "table-container" }, Lt = ["title"], Rt = ["title"], It = ["title"], Jt = ["title"], Et = ["title"], Gt = ["title"], Wt = /* @__PURE__ */ _e({
17
17
  __name: "virtualScroller",
18
18
  props: {