ss-component-new 1.2.175 → 1.2.177

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 (88) hide show
  1. package/dist/{MTLLoader-CR-R4D3A.cjs → MTLLoader-45vFx6Ci.cjs} +1 -1
  2. package/dist/{MTLLoader-D05WSq-q.js → MTLLoader-DgByTNTq.js} +1 -1
  3. package/dist/{OrbitControls-DkAdlZPz.cjs → OrbitControls-CV-MrHG5.cjs} +1 -1
  4. package/dist/{OrbitControls-DGyaLqZV.js → OrbitControls-Cv9SGdpv.js} +1 -1
  5. package/dist/{URDFLoader-rXQKxYBd.js → URDFLoader-BY2oim56.js} +2 -2
  6. package/dist/{URDFLoader-x8vUKwPr.cjs → URDFLoader-DwCZd3DT.cjs} +1 -1
  7. package/dist/{animationData-CGKa2au1.js → animationData-B8-fvoQG.js} +1 -1
  8. package/dist/{animationData-DBwtb8zr.cjs → animationData-BKJUksL6.cjs} +1 -1
  9. package/dist/{array-DlS90r5w.js → array-DDU6IBRR.js} +1 -1
  10. package/dist/{array-Dw4Yc0on.cjs → array-iLq62gEW.cjs} +1 -1
  11. package/dist/{iconfont-DTy0GXFn.cjs → iconfont-B1otHnDa.cjs} +1 -1
  12. package/dist/{iconfont-Bh6I7yoc.js → iconfont-CbHnKyhA.js} +2 -2
  13. package/dist/{index-BYrG8OBb.js → index-7YX4_dSG.js} +7 -7
  14. package/dist/{index-CHIienMN.js → index-BEikclM4.js} +5 -5
  15. package/dist/{index-D5Y_Pm_3.cjs → index-BGWmVxWe.cjs} +1 -1
  16. package/dist/{index-CpCjSu_n.js → index-BGy8QZn-.js} +1 -1
  17. package/dist/{index-5MfOfDqd.cjs → index-BJ73Hg5A.cjs} +1 -1
  18. package/dist/{index-BmIdmZp6.cjs → index-Ba45W3Ua.cjs} +12 -12
  19. package/dist/{index-D5LAwrWR.cjs → index-Bc0ovJko.cjs} +1 -1
  20. package/dist/{index-CmNhcax9.cjs → index-Bi8P9IId.cjs} +1 -1
  21. package/dist/{index-D2_BSB58.js → index-BtxgGP4E.js} +4 -4
  22. package/dist/{index-BpbXVqPH.js → index-C1COYIFO.js} +8 -8
  23. package/dist/{index-Bgfn_1PY.cjs → index-CG3YRLNm.cjs} +1 -1
  24. package/dist/{index-BxkOJwR0.js → index-CHSOjR_9.js} +1 -1
  25. package/dist/{index-fveEMEQr.js → index-CJlqtSTk.js} +1 -1
  26. package/dist/{index-DBlrqy2z.js → index-CJxrfrKo.js} +1 -1
  27. package/dist/{index-vUmI_aAz.cjs → index-CMJ0vea6.cjs} +1 -1
  28. package/dist/{index-ruvk89Uz.js → index-CQP2wp7R.js} +3 -3
  29. package/dist/{index-CQfanE9k.cjs → index-CTTqwfEF.cjs} +1 -1
  30. package/dist/{index-C6NYcqQj.cjs → index-CWM4tw3W.cjs} +1 -1
  31. package/dist/{index-D___JfrA.cjs → index-CXpkAw7j.cjs} +1 -1
  32. package/dist/{index-Xz5odwQo.cjs → index-CZ4aOdZv.cjs} +1 -1
  33. package/dist/{index-BKP1yyHm.cjs → index-CZOv_Rpa.cjs} +1 -1
  34. package/dist/{index-DgY30UFg.cjs → index-CbxJuVpo.cjs} +1 -1
  35. package/dist/{index-Cy0TW-Cc.js → index-CqOl875P.js} +1161 -1164
  36. package/dist/{index-tnXXGyGw.js → index-Cs-66QSw.js} +1 -1
  37. package/dist/{index-Czs-ptVO.js → index-Cwk-d3wI.js} +2 -2
  38. package/dist/{index-DUPTbPtM.cjs → index-CxR_MVxT.cjs} +1 -1
  39. package/dist/{index-YWQNDnbh.js → index-D0vkeBo-.js} +1 -1
  40. package/dist/{index-u22RYT6X.js → index-D8BddVAV.js} +16 -16
  41. package/dist/{index-DyNBPmUy.js → index-DFLL9Wee.js} +1 -1
  42. package/dist/{index-A2vAi7vP.cjs → index-DHrJRz4q.cjs} +1 -1
  43. package/dist/{index-CruAXu_m.cjs → index-DJDVTa-T.cjs} +1 -1
  44. package/dist/{index-Bw3_5l5O.js → index-DKRbSiXR.js} +1 -1
  45. package/dist/{index-BQ4uZmL2.cjs → index-DOg3gviX.cjs} +1 -1
  46. package/dist/{index-l9Pk1XBp.cjs → index-DR-dApow.cjs} +1 -1
  47. package/dist/{index-DKca7iRT.cjs → index-DUfSCM58.cjs} +1 -1
  48. package/dist/{index-a4D2ISWg.js → index-D_-bWCdl.js} +2 -2
  49. package/dist/{index-B-gaEXuH.cjs → index-DjGsEnMW.cjs} +1 -1
  50. package/dist/{index-Dy40DEnD.js → index-DrhU4P9y.js} +1 -1
  51. package/dist/{index-ZsNhppF_.js → index-DspBnzO8.js} +1 -1
  52. package/dist/{index-C6oRl7w0.js → index-JdVcYM_c.js} +4 -4
  53. package/dist/{index-XCNh-jZY.js → index-KnWmI9D6.js} +1 -1
  54. package/dist/{index-BqpWqgSt.js → index-jmELRcSf.js} +3 -3
  55. package/dist/{index-e-AcrHyq.cjs → index-rJrZ4Jyu.cjs} +1 -1
  56. package/dist/{index-C9MdLFq4.cjs → index-tAOovNrl.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Ct2nep0f.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-54GoJ76b.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-2AD5eQB1.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D9IgUdvX.js} +7 -7
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs} +1 -1
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-BW1MPKr7.cjs → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-DSEBqd14.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-9_ehDmOC.js → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-gGhupIEq.js} +4 -4
  63. package/dist/{index.vue_vue_type_style_index_1_lang-46IdC_8L.js → index.vue_vue_type_style_index_1_lang-BObmb_2e.js} +3 -3
  64. package/dist/{index.vue_vue_type_style_index_1_lang-CmFbshDy.cjs → index.vue_vue_type_style_index_1_lang-BgpaLloL.cjs} +1 -1
  65. package/dist/{main-DTcn4amP.js → main--vkjmZ5H.js} +3 -3
  66. package/dist/{main-9L2fq1tN.cjs → main-DfsIGI6Q.cjs} +1 -1
  67. package/dist/ss-component.cjs +1 -1
  68. package/dist/ss-component.css +1 -1
  69. package/dist/ss-component.js +9 -9
  70. package/dist/ss-component2.cjs +1 -1
  71. package/dist/ss-component2.js +10 -10
  72. package/dist/{threeModel-oOClIGBp.cjs → threeModel-31Mk02S0.cjs} +1 -1
  73. package/dist/{threeModel-DETrDZhQ.js → threeModel-CPOiuPmf.js} +4 -4
  74. package/dist/{threePreview-BGQ5FlOC.cjs → threePreview-6K0uX_kn.cjs} +1 -1
  75. package/dist/{threePreview-B-2nMWcI.js → threePreview-B2c38aNi.js} +3 -3
  76. package/dist/{threeSceneView-DmtE3lwc.js → threeSceneView-DKe-yheh.js} +8 -8
  77. package/dist/{threeSceneView-CU32CHkR.cjs → threeSceneView-R3C2C5mu.cjs} +1 -1
  78. package/dist/{threeSceneViewForCPMPIP-Cc9J6xz6.js → threeSceneViewForCPMPIP-B8KV3E55.js} +7 -7
  79. package/dist/{threeSceneViewForCPMPIP-CBw9wJUT.cjs → threeSceneViewForCPMPIP-D5GmzScE.cjs} +1 -1
  80. package/dist/{threeTrackPathView-DcR0RXPb.js → threeTrackPathView-AOVKXiLQ.js} +3 -3
  81. package/dist/{threeTrackPathView-Bmtfv7VK.cjs → threeTrackPathView-BYJQxkco.cjs} +1 -1
  82. package/dist/{threeViewerHost-C6gjvpcg.cjs → threeViewerHost-Birr5icJ.cjs} +1 -1
  83. package/dist/{threeViewerHost-DKsihx3G.js → threeViewerHost-D3nc548f.js} +2 -2
  84. package/dist/{urdfTree-D55cXXY_.js → urdfTree-BORFZd89.js} +1 -1
  85. package/dist/{urdfTree-CB9GhNL7.cjs → urdfTree-j7pQuwXM.cjs} +1 -1
  86. package/dist/{workpieceTreePanel-DfC-7RWt.cjs → workpieceTreePanel-C3Ah_exL.cjs} +1 -1
  87. package/dist/{workpieceTreePanel-BnLl9nv-.js → workpieceTreePanel-vnbkBGAm.js} +4 -4
  88. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),f=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs"),W=require("./index-y1mE3_ai.cjs"),B=require("./iconfont-DTy0GXFn.cjs"),U=require("./MTLLoader-CR-R4D3A.cjs"),F=require("./svgIcon-CUM54R6L.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Y(d,t){if(t===f.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),d;if(t===f.TriangleFanDrawMode||t===f.TriangleStripDrawMode){let e=d.getIndex();if(e===null){const r=[],a=d.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);d.setIndex(r),e=d.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),d}const i=e.count-2,n=[];if(t===f.TriangleFanDrawMode)for(let r=1;r<=i;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<i;r++)r%2===0?(n.push(e.getX(r)),n.push(e.getX(r+1)),n.push(e.getX(r+2))):(n.push(e.getX(r+2)),n.push(e.getX(r+1)),n.push(e.getX(r)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=d.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),d}class ae extends f.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new de(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new ye(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=f.LoaderUtils.extractUrlBase(t);r=f.LoaderUtils.resolveURL(c,this.path)}else r=f.LoaderUtils.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},o=new f.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,r,function(u){e(u),s.manager.itemEnd(t)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let s;const r={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===ee){try{r[M.KHR_BINARY_GLTF]=new we(t)}catch(l){n&&n(l);return}s=JSON.parse(r[M.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;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 Be(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const l=s.extensionsUsed[u],h=s.extensionsRequired||[];switch(l){case M.KHR_MATERIALS_UNLIT:r[l]=new ue;break;case M.KHR_DRACO_MESH_COMPRESSION:r[l]=new be(s,this.dracoLoader);break;case M.KHR_TEXTURE_TRANSFORM:r[l]=new Ne;break;case M.KHR_MESH_QUANTIZATION:r[l]=new Ie;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,s){i.parse(t,e,n,s)})}}function ce(){let d={};return{get:function(t){return d[t]},add:function(t,e){d[t]=e},remove:function(t){delete d[t]},removeAll:function(){d={}}}}const M={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 le{constructor(t){this.parser=t,this.name=M.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const s=e[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const u=new f.Color(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],f.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new f.DirectionalLight(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new f.PointLight(u),c.distance=l;break;case"spot":c=new f.SpotLight(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),O(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,s=i.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class ue{constructor(){this.name=M.KHR_MATERIALS_UNLIT}getMaterialType(){return f.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new f.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const r=s.baseColorFactor;t.color.setRGB(r[0],r[1],r[2],f.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,f.SRGBColorSpace))}return Promise.all(n)}}class fe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}}class de{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(e.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new f.Vector2(a,a)}return Promise.all(s)}}class he{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class pe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(e.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(e.iridescenceIOR=r.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class me{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new f.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,f.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class ge{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(e.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&s.push(i.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class Te{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&s.push(i.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),Promise.all(s)}}class Re{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class xe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&s.push(i.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,f.SRGBColorSpace)),Promise.all(s)}}class Ee{constructor(t){this.parser=t,this.name=M.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return e.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&s.push(i.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class Me{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(e.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(e.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&s.push(i.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class _e{constructor(t){this.parser=t,this.name=M.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,r)}}class Le{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Ae{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Se{constructor(t){this.name=M.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.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 o=n.byteOffset||0,c=n.byteLength||0,u=n.count,l=n.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,n.mode,n.filter).then(function(p){return p.buffer}):r.ready.then(function(){const p=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(p),u,l,h,n.mode,n.filter),p})})}else return null}}class ye{constructor(t){this.name=M.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==N.TRIANGLES&&c.mode!==N.TRIANGLE_STRIP&&c.mode!==N.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=i.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,p=[];for(const m of l){const E=new f.Matrix4,T=new f.Vector3,R=new f.Quaternion,_=new f.Vector3(1,1,1),L=new f.InstancedMesh(m.geometry,m.material,h);for(let x=0;x<h;x++)o.TRANSLATION&&T.fromBufferAttribute(o.TRANSLATION,x),o.ROTATION&&R.fromBufferAttribute(o.ROTATION,x),o.SCALE&&_.fromBufferAttribute(o.SCALE,x),L.setMatrixAt(x,E.compose(T,R,_));for(const x in o)if(x==="_COLOR_0"){const S=o[x];L.instanceColor=new f.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&m.geometry.setAttribute(x,o[x]);f.Object3D.prototype.copy.call(L,m),this.parser.assignFinalMaterial(L),p.push(L)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const ee="glTF",H=12,$={JSON:1313821514,BIN:5130562};class we{constructor(t){this.name=M.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,H),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==ee)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-H,s=new DataView(t,H);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const o=s.getUint32(r,!0);if(r+=4,o===$.JSON){const c=new Uint8Array(t,H+r,a);this.content=i.decode(c)}else if(o===$.BIN){const c=H+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class be{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=M.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=X[u]||u.toLowerCase();a[l]=r[u]}for(const u in t.attributes){const l=X[u]||u.toLowerCase();if(r[u]!==void 0){const h=i.accessors[t.attributes[u]],p=D[h.componentType];c[l]=p.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(u){return new Promise(function(l,h){n.decodeDracoFile(u,function(p){for(const m in p.attributes){const E=p.attributes[m],T=o[m];T!==void 0&&(E.normalized=T)}l(p)},a,c,f.LinearSRGBColorSpace,h)})})}}class Ne{constructor(){this.name=M.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Ie{constructor(){this.name=M.KHR_MESH_QUANTIZATION}}class te extends f.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=i[s+r];return e}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=n-e,l=(i-e)/u,h=l*l,p=h*l,m=t*c,E=m-c,T=-2*p+3*h,R=p-h,_=1-T,L=R-h+l;for(let x=0;x!==a;x++){const S=r[E+x+a],b=r[E+x+o]*u,y=r[m+x+a],I=r[m+x]*u;s[x]=_*S+L*b+T*y+R*I}return s}}const Ce=new f.Quaternion;class Oe extends te{interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return Ce.fromArray(s).normalize().toArray(s),s}}const N={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},D={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},J={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},Q={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},j={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={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"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ve={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},K={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ke(d){return d.DefaultMaterial===void 0&&(d.DefaultMaterial=new f.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:f.FrontSide})),d.DefaultMaterial}function P(d,t,e){for(const i in e.extensions)d[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(d,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(d.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Pe(d,t,e){let i=!1,n=!1,s=!1;for(let c=0,u=t.length;c<u;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(d);const r=[],a=[],o=[];for(let c=0,u=t.length;c<u;c++){const l=t[c];if(i){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):d.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):d.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):d.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return i&&(d.morphAttributes.position=u),n&&(d.morphAttributes.normal=l),s&&(d.morphAttributes.color=h),d.morphTargetsRelative=!0,d})}function Fe(d,t){if(d.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)d.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(d.morphTargetInfluences.length===e.length){d.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)d.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function De(d){let t;const e=d.extensions&&d.extensions[M.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+V(e.attributes):t=d.indices+":"+V(d.attributes)+":"+d.mode,d.targets!==void 0)for(let i=0,n=d.targets.length;i<n;i++)t+=":"+V(d.targets[i]);return t}function V(d){let t="";const e=Object.keys(d).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+d[e[i]]+";";return t}function z(d){switch(d){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 He(d){return d.search(/\.jpe?g($|\?)/i)>0||d.search(/^data\:image\/jpeg/)===0?"image/jpeg":d.search(/\.webp($|\?)/i)>0||d.search(/^data\:image\/webp/)===0?"image/webp":d.search(/\.ktx2($|\?)/i)>0||d.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Ge=new f.Matrix4;class Be{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ce,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 i=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&r<98?this.textureLoader=new f.TextureLoader(this.options.manager):this.textureLoader=new f.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new f.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:i,userData:{}};return P(s,a,n),O(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,o=r.length;a<o;a++)t[r[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){const r=t[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(i[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),s=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())s(u,a.children[c])};return s(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&i.push(s)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return i.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[M.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){i.load(f.LoaderUtils.resolveURL(e.uri,n.path),s,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,s=e.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=j[n.type],a=D[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new f.BufferAttribute(c,r,o))}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(r){const a=r[0],o=j[n.type],c=D[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=n.byteOffset||0,p=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0;let E,T;if(p&&p!==l){const R=Math.floor(h/p),_="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+R+":"+n.count;let L=e.cache.get(_);L||(E=new c(a,R*p,n.count*p/u),L=new f.InterleavedBuffer(E,p/u),e.cache.add(_,L)),T=new f.InterleavedBufferAttribute(L,o,h%p/u,m)}else a===null?E=new c(n.count*o):E=new c(a,h,n.count*o),T=new f.BufferAttribute(E,o,m);if(n.sparse!==void 0){const R=j.SCALAR,_=D[n.sparse.indices.componentType],L=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,S=new _(r[1],L,n.sparse.count*R),b=new c(r[2],x,n.sparse.count*o);a!==null&&(T=new f.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let y=0,I=S.length;y<I;y++){const w=S[y];if(T.setX(w,b[y*o]),o>=2&&T.setY(w,b[y*o+1]),o>=3&&T.setZ(w,b[y*o+2]),o>=4&&T.setW(w,b[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=m}return T})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const o=i.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,i){const n=this,s=this.json,r=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return u.magFilter=J[h.magFilter]||f.LinearFilter,u.minFilter=J[h.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=Q[h.wrapS]||f.RepeatWrapping,u.wrapT=Q[h.wrapT]||f.RepeatWrapping,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==f.NearestFilter&&u.minFilter!==f.LinearFilter,n.associations.set(u,{textures:t}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const r=n.images[t],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=i.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,p){let m=h;e.isImageBitmapLoader===!0&&(m=function(E){const T=new f.Texture(E);T.needsUpdate=!0,h(T)}),e.load(f.LoaderUtils.resolveURL(l,s.path),m,void 0,p)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||He(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=u,u}assignTexture(t,e,i,n){const s=this;return this.getDependency("texture",i.index).then(function(r){if(!r)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(r=r.clone(),r.channel=i.texCoord),s.extensions[M.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[M.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=s.associations.get(r);r=s.extensions[M.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,o)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.PointsMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.LineBasicMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||s||r){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),s&&(o.vertexColors=!0),r&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return f.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,n=this.extensions,s=i.materials[t];let r;const a={},o=s.extensions||{},c=[];if(o[M.KHR_MATERIALS_UNLIT]){const l=n[M.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new f.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],f.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,f.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(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=f.DoubleSide);const u=s.alphaMode||K.OPAQUE;if(u===K.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===K.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new f.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==f.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new f.Color().setRGB(l[0],l[1],l[2],f.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==f.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,f.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),O(l,s),e.associations.set(l,{materials:t}),s.extensions&&P(n,l,s),l})}createUniqueName(t){const e=f.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function s(a){return i[M.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return Z(o,a,e)})}const r=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],u=De(c),l=n[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[M.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=Z(new f.BufferGeometry,c,e),n[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,i=this.json,n=this.extensions,s=i.meshes[t],r=s.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?ke(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let p=0,m=u.length;p<m;p++){const E=u[p],T=r[p];let R;const _=c[p];if(T.mode===N.TRIANGLES||T.mode===N.TRIANGLE_STRIP||T.mode===N.TRIANGLE_FAN||T.mode===void 0)R=s.isSkinnedMesh===!0?new f.SkinnedMesh(E,_):new f.Mesh(E,_),R.isSkinnedMesh===!0&&R.normalizeSkinWeights(),T.mode===N.TRIANGLE_STRIP?R.geometry=Y(R.geometry,f.TriangleStripDrawMode):T.mode===N.TRIANGLE_FAN&&(R.geometry=Y(R.geometry,f.TriangleFanDrawMode));else if(T.mode===N.LINES)R=new f.LineSegments(E,_);else if(T.mode===N.LINE_STRIP)R=new f.Line(E,_);else if(T.mode===N.LINE_LOOP)R=new f.LineLoop(E,_);else if(T.mode===N.POINTS)R=new f.Points(E,_);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(R.geometry.morphAttributes).length>0&&Fe(R,s),R.name=e.createUniqueName(s.name||"mesh_"+t),O(R,s),T.extensions&&P(n,R,T),e.assignFinalMaterial(R),l.push(R)}for(let p=0,m=l.length;p<m;p++)e.associations.set(l[p],{meshes:t,primitives:p});if(l.length===1)return s.extensions&&P(n,l[0],s),l[0];const h=new f.Group;s.extensions&&P(n,h,s),e.associations.set(h,{meshes:t});for(let p=0,m=l.length;p<m;p++)h.add(l[p]);return h})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new f.PerspectiveCamera(f.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new f.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),O(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,s=e.joints.length;n<s;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),r=n,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new f.Matrix4;s!==null&&h.fromArray(s.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new f.Skeleton(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=n.channels.length;l<h;l++){const p=n.channels[l],m=n.samplers[p.sampler],E=p.target,T=E.node,R=n.parameters!==void 0?n.parameters[m.input]:m.input,_=n.parameters!==void 0?n.parameters[m.output]:m.output;E.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",R)),o.push(this.getDependency("accessor",_)),c.push(m),u.push(E))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],p=l[1],m=l[2],E=l[3],T=l[4],R=[];for(let _=0,L=h.length;_<L;_++){const x=h[_],S=p[_],b=m[_],y=E[_],I=T[_];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const w=i._createAnimationTracks(x,S,b,y,I);if(w)for(let v=0;v<w.length;v++)R.push(w[v])}return new f.AnimationClip(s,void 0,R)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const r=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),r})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],s=i._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,u=a.length;c<u;c++)r.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(p){p.isSkinnedMesh&&p.bind(h,Ge)});for(let p=0,m=l.length;p<m;p++)u.add(l[p]);return u})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const s=e.nodes[t],r=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),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(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let u;if(s.isBone===!0?u=new f.Bone:c.length>1?u=new f.Group:c.length===1?u=c[0]:u=new f.Object3D,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(s.name&&(u.userData.name=s.name,u.name=r),O(u,s),s.extensions&&P(i,u,s),s.matrix!==void 0){const l=new f.Matrix4;l.fromArray(s.matrix),u.applyMatrix4(l)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);if(!n.associations.has(u))n.associations.set(u,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(u);n.associations.set(u,{...l})}return n.associations.get(u).nodes=t,u}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,s=new f.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&P(e,s,i);const r=i.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(n.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++)s.add(o[u]);const c=u=>{const l=new Map;for(const[h,p]of n.associations)(h instanceof f.Material||h instanceof f.Texture)&&l.set(h,p);return u.traverse(h=>{const p=n.associations.get(h);p!=null&&l.set(h,p)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,i,n,s){const r=[],a=t.name?t.name:t.uuid,o=[];k[s.path]===k.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(k[s.path]){case k.weights:c=f.NumberKeyframeTrack;break;case k.rotation:c=f.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=f.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=f.NumberKeyframeTrack;break;case 2:case 3:default:c=f.VectorKeyframeTrack;break}break}const u=n.interpolation!==void 0?ve[n.interpolation]:f.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,p=o.length;h<p;h++){const m=new c(o[h]+"."+k[s.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),r.push(m)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=z(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof f.QuaternionKeyframeTrack?Oe:te;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Ue(d,t,e){const i=t.attributes,n=new f.Box3;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new f.Vector3(o[0],o[1],o[2]),new f.Vector3(c[0],c[1],c[2])),a.normalized){const u=z(D[a.componentType]);n.min.multiplyScalar(u),n.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new f.Vector3,o=new f.Vector3;for(let c=0,u=s.length;c<u;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],p=h.min,m=h.max;if(p!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(p[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(p[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(p[2]),Math.abs(m[2]))),h.normalized){const E=z(D[h.componentType]);o.multiplyScalar(E)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}d.boundingBox=n;const r=new f.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,d.boundingSphere=r}function Z(d,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){d.setAttribute(a,o)})}for(const r in i){const a=X[r]||r.toLowerCase();a in d.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!d.index){const r=e.getDependency("accessor",t.indices).then(function(a){d.setIndex(a)});n.push(r)}return f.ColorManagement.workingColorSpace!==f.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${f.ColorManagement.workingColorSpace}" not supported.`),O(d,t),Ue(d,t,e),Promise.all(n).then(function(){return t.targets!==void 0?Pe(d,t.targets,e):d})}function je(){const d=g.ref(!1),t=g.ref(""),e=g.shallowRef([]),i=g.ref(null),n=new U.MTLLoader,s=new U.OBJLoader,r=new U.STLLoader,a=new ae;return{isLoading:d,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var p;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}d.value=!0,t.value="准备加载...",e.value=[],i.value=null;const u=new Map;c.forEach(m=>{m instanceof File&&u.set(m.name.toLowerCase(),m)});const l=[],h=[];try{for(const m of c){const E=m.name||"unknown_file",T=(p=E.split(".").pop())==null?void 0:p.toLowerCase();if(T==="mtl")continue;const R=URL.createObjectURL(m);l.push(R);let _=null;const L=x=>{const S=x.lengthComputable?x.loaded/x.total*100:0;t.value=`正在加载 ${E}... ${Math.round(S)}%`};switch(t.value=`正在加载 ${E}... 0%`,T){case"obj":const x=E.replace(/\.obj$/i,".mtl").toLowerCase();if(u.has(x)){const I=u.get(x),w=URL.createObjectURL(I);l.push(w);const v=await n.loadAsync(w);v.preload(),s.setMaterials(v)}else s.setMaterials(null);_=await s.loadAsync(R,L);break;case"stl":const S=await r.loadAsync(R,L),b=new f.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});_=new f.Mesh(S,b);break;case"gltf":case"glb":_=(await a.loadAsync(R,L)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${E}`;continue}_&&(_.userData.boundingBox=new f.Box3().setFromObject(_),h.push(_))}e.value=h,t.value="加载完成!"}catch(m){throw console.error("加载模型时出错:",m),i.value=`加载失败: ${m.message||"未知错误"}`,t.value="加载失败!",e.value=[],m}finally{d.value=!1,l.forEach(m=>URL.revokeObjectURL(m))}}}}function Ke(d,t={}){const e={threeInfo:{},modelLoader:{},animation:{},clipping:{}},i=B.useThreeJS(d);e.threeInfo=i;const{currentModels:n,getThreeJSObjects:s}=i,{useModelLoaderHook:r,useAnimationHook:a,useClippingHook:o}=t;return r&&(e.modelLoader=je()),a&&(e.animation=B.useAnimation(s,n)),o&&(e.clipping=B.useClipping(s,n)),e}const Ve={class:"obj-viewer-container"},Xe={class:"buttonGroup-topLeft"},ze={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},We={class:"left-panel"},Ye={class:"panel-header"},$e={key:0,class:"loading-overlay"},Je=g.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(d){const t=d,e=g.ref(null),i=g.ref(!1),n=g.ref(""),{threeInfo:{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:u,setAndFitModels:l,axesHelperVisible:h,toggleAxesVisibility:p},modelLoader:{isLoading:m,loadingProgress:E,loadedModels:T,error:R,loadModelsFromBlobs:_},animation:{isAnimating:L,toggleAnimation:x,startAnimation:S,stopAnimation:b},clipping:{isClipping:y,activeClippingAxis:I,toggleClipping:w,updateClippingPlanes:v}}=Ke(e,{useModelLoaderHook:!0,useAnimationHook:!0,useClippingHook:!0}),ne=()=>{p()},se=A=>{I.value=A,v()};g.watch(()=>t.fileBlobs,A=>{A&&A.length>0&&_(A).catch(C=>{console.error("加载错误:",C)})},{immediate:!0,deep:!0}),g.watch(T,A=>{A&&A.length>0&&l(A)}),g.watch(R,A=>{A&&W.ElMessage.error(`模型加载失败: ${A}`)});const q=A=>{i.value=!0,n.value=A,A==="剖面视图"&&!y.value&&w()};let G=null;return g.onMounted(async()=>{await g.nextTick();try{a(),e.value&&(G=new ResizeObserver(o),G.observe(e.value))}catch(A){console.error("Three.js 初始化失败:",A),W.ElMessage.error("渲染引擎初始化失败!")}}),g.onBeforeUnmount(()=>{n.value="",G&&G.disconnect(),L.value&&b(),u()}),(A,C)=>{const re=g.resolveComponent("el-scrollbar");return g.openBlock(),g.createElementBlock("div",Ve,[g.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),g.createElementVNode("div",Xe,[g.createVNode(F.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:g.unref(r),title:"重置"},null,8,["onClick"]),g.createVNode(F.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),g.createVNode(F.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),g.createVNode(F.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:g.unref(x),title:g.unref(L)?"停止动画":"动画视图"},null,8,["onClick","title"]),g.createVNode(F.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:g.unref(h),onClick:ne,title:"显隐坐标轴"},null,8,["active"])]),g.createElementVNode("div",ze,[g.renderSlot(A.$slots,"button-left",{switchRightPanel:q},void 0,!0),g.createVNode(F.ThreeSvgIcon,{name:"clipping",size:"24",onClick:C[0]||(C[0]=ie=>q("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),g.createElementVNode("div",qe,[g.renderSlot(A.$slots,"button-right",{},void 0,!0)]),C[3]||(C[3]=g.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),g.withDirectives(g.createElementVNode("div",We,[g.createElementVNode("div",Ye,[g.createElementVNode("span",null,g.toDisplayString(n.value),1),g.createElementVNode("span",{class:"close",onClick:C[1]||(C[1]=ie=>i.value=!1)}," X ")]),g.createVNode(re,{"max-height":"650px"},{default:g.withCtx(()=>[n.value==="剖面视图"?(g.openBlock(),g.createBlock(B.ClippingPanel,{key:0,value:g.unref(I),onChange:se},null,8,["value"])):g.createCommentVNode("",!0)]),_:1})],512),[[g.vShow,i.value]]),g.unref(m)?(g.openBlock(),g.createElementBlock("div",$e,[C[2]||(C[2]=g.createElementVNode("div",{class:"loading-spinner"},null,-1)),g.createElementVNode("p",null,g.toDisplayString(g.unref(E)),1)])):g.createCommentVNode("",!0)])}}}),Qe=oe._export_sfc(Je,[["__scopeId","data-v-2268e4d4"]]);exports.default=Qe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),f=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs"),W=require("./index-y1mE3_ai.cjs"),B=require("./iconfont-B1otHnDa.cjs"),U=require("./MTLLoader-45vFx6Ci.cjs"),F=require("./svgIcon-CUM54R6L.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Y(d,t){if(t===f.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),d;if(t===f.TriangleFanDrawMode||t===f.TriangleStripDrawMode){let e=d.getIndex();if(e===null){const r=[],a=d.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);d.setIndex(r),e=d.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),d}const i=e.count-2,n=[];if(t===f.TriangleFanDrawMode)for(let r=1;r<=i;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<i;r++)r%2===0?(n.push(e.getX(r)),n.push(e.getX(r+1)),n.push(e.getX(r+2))):(n.push(e.getX(r+2)),n.push(e.getX(r+1)),n.push(e.getX(r)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=d.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),d}class ae extends f.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new de(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new ye(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=f.LoaderUtils.extractUrlBase(t);r=f.LoaderUtils.resolveURL(c,this.path)}else r=f.LoaderUtils.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},o=new f.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,r,function(u){e(u),s.manager.itemEnd(t)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let s;const r={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===ee){try{r[M.KHR_BINARY_GLTF]=new we(t)}catch(l){n&&n(l);return}s=JSON.parse(r[M.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;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 Be(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const l=s.extensionsUsed[u],h=s.extensionsRequired||[];switch(l){case M.KHR_MATERIALS_UNLIT:r[l]=new ue;break;case M.KHR_DRACO_MESH_COMPRESSION:r[l]=new be(s,this.dracoLoader);break;case M.KHR_TEXTURE_TRANSFORM:r[l]=new Ne;break;case M.KHR_MESH_QUANTIZATION:r[l]=new Ie;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,s){i.parse(t,e,n,s)})}}function ce(){let d={};return{get:function(t){return d[t]},add:function(t,e){d[t]=e},remove:function(t){delete d[t]},removeAll:function(){d={}}}}const M={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 le{constructor(t){this.parser=t,this.name=M.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const s=e[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const u=new f.Color(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],f.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new f.DirectionalLight(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new f.PointLight(u),c.distance=l;break;case"spot":c=new f.SpotLight(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),O(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,s=i.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class ue{constructor(){this.name=M.KHR_MATERIALS_UNLIT}getMaterialType(){return f.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new f.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const r=s.baseColorFactor;t.color.setRGB(r[0],r[1],r[2],f.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,f.SRGBColorSpace))}return Promise.all(n)}}class fe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}}class de{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(e.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new f.Vector2(a,a)}return Promise.all(s)}}class he{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class pe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(e.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(e.iridescenceIOR=r.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class me{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new f.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,f.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class ge{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(e.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&s.push(i.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class Te{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&s.push(i.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),Promise.all(s)}}class Re{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class xe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&s.push(i.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,f.SRGBColorSpace)),Promise.all(s)}}class Ee{constructor(t){this.parser=t,this.name=M.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return e.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&s.push(i.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class Me{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(e.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(e.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&s.push(i.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class _e{constructor(t){this.parser=t,this.name=M.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,r)}}class Le{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Ae{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Se{constructor(t){this.name=M.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.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 o=n.byteOffset||0,c=n.byteLength||0,u=n.count,l=n.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,n.mode,n.filter).then(function(p){return p.buffer}):r.ready.then(function(){const p=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(p),u,l,h,n.mode,n.filter),p})})}else return null}}class ye{constructor(t){this.name=M.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==N.TRIANGLES&&c.mode!==N.TRIANGLE_STRIP&&c.mode!==N.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=i.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,p=[];for(const m of l){const E=new f.Matrix4,T=new f.Vector3,R=new f.Quaternion,_=new f.Vector3(1,1,1),L=new f.InstancedMesh(m.geometry,m.material,h);for(let x=0;x<h;x++)o.TRANSLATION&&T.fromBufferAttribute(o.TRANSLATION,x),o.ROTATION&&R.fromBufferAttribute(o.ROTATION,x),o.SCALE&&_.fromBufferAttribute(o.SCALE,x),L.setMatrixAt(x,E.compose(T,R,_));for(const x in o)if(x==="_COLOR_0"){const S=o[x];L.instanceColor=new f.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&m.geometry.setAttribute(x,o[x]);f.Object3D.prototype.copy.call(L,m),this.parser.assignFinalMaterial(L),p.push(L)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const ee="glTF",H=12,$={JSON:1313821514,BIN:5130562};class we{constructor(t){this.name=M.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,H),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==ee)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-H,s=new DataView(t,H);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const o=s.getUint32(r,!0);if(r+=4,o===$.JSON){const c=new Uint8Array(t,H+r,a);this.content=i.decode(c)}else if(o===$.BIN){const c=H+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class be{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=M.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=X[u]||u.toLowerCase();a[l]=r[u]}for(const u in t.attributes){const l=X[u]||u.toLowerCase();if(r[u]!==void 0){const h=i.accessors[t.attributes[u]],p=D[h.componentType];c[l]=p.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(u){return new Promise(function(l,h){n.decodeDracoFile(u,function(p){for(const m in p.attributes){const E=p.attributes[m],T=o[m];T!==void 0&&(E.normalized=T)}l(p)},a,c,f.LinearSRGBColorSpace,h)})})}}class Ne{constructor(){this.name=M.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Ie{constructor(){this.name=M.KHR_MESH_QUANTIZATION}}class te extends f.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=i[s+r];return e}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=n-e,l=(i-e)/u,h=l*l,p=h*l,m=t*c,E=m-c,T=-2*p+3*h,R=p-h,_=1-T,L=R-h+l;for(let x=0;x!==a;x++){const S=r[E+x+a],b=r[E+x+o]*u,y=r[m+x+a],I=r[m+x]*u;s[x]=_*S+L*b+T*y+R*I}return s}}const Ce=new f.Quaternion;class Oe extends te{interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return Ce.fromArray(s).normalize().toArray(s),s}}const N={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},D={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},J={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},Q={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},j={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={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"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ve={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},K={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ke(d){return d.DefaultMaterial===void 0&&(d.DefaultMaterial=new f.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:f.FrontSide})),d.DefaultMaterial}function P(d,t,e){for(const i in e.extensions)d[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(d,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(d.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Pe(d,t,e){let i=!1,n=!1,s=!1;for(let c=0,u=t.length;c<u;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(d);const r=[],a=[],o=[];for(let c=0,u=t.length;c<u;c++){const l=t[c];if(i){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):d.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):d.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):d.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return i&&(d.morphAttributes.position=u),n&&(d.morphAttributes.normal=l),s&&(d.morphAttributes.color=h),d.morphTargetsRelative=!0,d})}function Fe(d,t){if(d.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)d.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(d.morphTargetInfluences.length===e.length){d.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)d.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function De(d){let t;const e=d.extensions&&d.extensions[M.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+V(e.attributes):t=d.indices+":"+V(d.attributes)+":"+d.mode,d.targets!==void 0)for(let i=0,n=d.targets.length;i<n;i++)t+=":"+V(d.targets[i]);return t}function V(d){let t="";const e=Object.keys(d).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+d[e[i]]+";";return t}function z(d){switch(d){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 He(d){return d.search(/\.jpe?g($|\?)/i)>0||d.search(/^data\:image\/jpeg/)===0?"image/jpeg":d.search(/\.webp($|\?)/i)>0||d.search(/^data\:image\/webp/)===0?"image/webp":d.search(/\.ktx2($|\?)/i)>0||d.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Ge=new f.Matrix4;class Be{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ce,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 i=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&r<98?this.textureLoader=new f.TextureLoader(this.options.manager):this.textureLoader=new f.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new f.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:i,userData:{}};return P(s,a,n),O(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,o=r.length;a<o;a++)t[r[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){const r=t[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(i[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),s=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())s(u,a.children[c])};return s(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&i.push(s)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return i.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[M.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){i.load(f.LoaderUtils.resolveURL(e.uri,n.path),s,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,s=e.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=j[n.type],a=D[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new f.BufferAttribute(c,r,o))}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(r){const a=r[0],o=j[n.type],c=D[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=n.byteOffset||0,p=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0;let E,T;if(p&&p!==l){const R=Math.floor(h/p),_="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+R+":"+n.count;let L=e.cache.get(_);L||(E=new c(a,R*p,n.count*p/u),L=new f.InterleavedBuffer(E,p/u),e.cache.add(_,L)),T=new f.InterleavedBufferAttribute(L,o,h%p/u,m)}else a===null?E=new c(n.count*o):E=new c(a,h,n.count*o),T=new f.BufferAttribute(E,o,m);if(n.sparse!==void 0){const R=j.SCALAR,_=D[n.sparse.indices.componentType],L=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,S=new _(r[1],L,n.sparse.count*R),b=new c(r[2],x,n.sparse.count*o);a!==null&&(T=new f.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let y=0,I=S.length;y<I;y++){const w=S[y];if(T.setX(w,b[y*o]),o>=2&&T.setY(w,b[y*o+1]),o>=3&&T.setZ(w,b[y*o+2]),o>=4&&T.setW(w,b[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=m}return T})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const o=i.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,i){const n=this,s=this.json,r=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return u.magFilter=J[h.magFilter]||f.LinearFilter,u.minFilter=J[h.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=Q[h.wrapS]||f.RepeatWrapping,u.wrapT=Q[h.wrapT]||f.RepeatWrapping,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==f.NearestFilter&&u.minFilter!==f.LinearFilter,n.associations.set(u,{textures:t}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const r=n.images[t],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=i.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,p){let m=h;e.isImageBitmapLoader===!0&&(m=function(E){const T=new f.Texture(E);T.needsUpdate=!0,h(T)}),e.load(f.LoaderUtils.resolveURL(l,s.path),m,void 0,p)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||He(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=u,u}assignTexture(t,e,i,n){const s=this;return this.getDependency("texture",i.index).then(function(r){if(!r)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(r=r.clone(),r.channel=i.texCoord),s.extensions[M.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[M.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=s.associations.get(r);r=s.extensions[M.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,o)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.PointsMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.LineBasicMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||s||r){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),s&&(o.vertexColors=!0),r&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return f.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,n=this.extensions,s=i.materials[t];let r;const a={},o=s.extensions||{},c=[];if(o[M.KHR_MATERIALS_UNLIT]){const l=n[M.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new f.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],f.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,f.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(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=f.DoubleSide);const u=s.alphaMode||K.OPAQUE;if(u===K.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===K.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new f.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==f.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new f.Color().setRGB(l[0],l[1],l[2],f.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==f.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,f.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),O(l,s),e.associations.set(l,{materials:t}),s.extensions&&P(n,l,s),l})}createUniqueName(t){const e=f.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function s(a){return i[M.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return Z(o,a,e)})}const r=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],u=De(c),l=n[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[M.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=Z(new f.BufferGeometry,c,e),n[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,i=this.json,n=this.extensions,s=i.meshes[t],r=s.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?ke(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let p=0,m=u.length;p<m;p++){const E=u[p],T=r[p];let R;const _=c[p];if(T.mode===N.TRIANGLES||T.mode===N.TRIANGLE_STRIP||T.mode===N.TRIANGLE_FAN||T.mode===void 0)R=s.isSkinnedMesh===!0?new f.SkinnedMesh(E,_):new f.Mesh(E,_),R.isSkinnedMesh===!0&&R.normalizeSkinWeights(),T.mode===N.TRIANGLE_STRIP?R.geometry=Y(R.geometry,f.TriangleStripDrawMode):T.mode===N.TRIANGLE_FAN&&(R.geometry=Y(R.geometry,f.TriangleFanDrawMode));else if(T.mode===N.LINES)R=new f.LineSegments(E,_);else if(T.mode===N.LINE_STRIP)R=new f.Line(E,_);else if(T.mode===N.LINE_LOOP)R=new f.LineLoop(E,_);else if(T.mode===N.POINTS)R=new f.Points(E,_);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(R.geometry.morphAttributes).length>0&&Fe(R,s),R.name=e.createUniqueName(s.name||"mesh_"+t),O(R,s),T.extensions&&P(n,R,T),e.assignFinalMaterial(R),l.push(R)}for(let p=0,m=l.length;p<m;p++)e.associations.set(l[p],{meshes:t,primitives:p});if(l.length===1)return s.extensions&&P(n,l[0],s),l[0];const h=new f.Group;s.extensions&&P(n,h,s),e.associations.set(h,{meshes:t});for(let p=0,m=l.length;p<m;p++)h.add(l[p]);return h})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new f.PerspectiveCamera(f.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new f.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),O(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,s=e.joints.length;n<s;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),r=n,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new f.Matrix4;s!==null&&h.fromArray(s.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new f.Skeleton(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=n.channels.length;l<h;l++){const p=n.channels[l],m=n.samplers[p.sampler],E=p.target,T=E.node,R=n.parameters!==void 0?n.parameters[m.input]:m.input,_=n.parameters!==void 0?n.parameters[m.output]:m.output;E.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",R)),o.push(this.getDependency("accessor",_)),c.push(m),u.push(E))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],p=l[1],m=l[2],E=l[3],T=l[4],R=[];for(let _=0,L=h.length;_<L;_++){const x=h[_],S=p[_],b=m[_],y=E[_],I=T[_];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const w=i._createAnimationTracks(x,S,b,y,I);if(w)for(let v=0;v<w.length;v++)R.push(w[v])}return new f.AnimationClip(s,void 0,R)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const r=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),r})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],s=i._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,u=a.length;c<u;c++)r.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(p){p.isSkinnedMesh&&p.bind(h,Ge)});for(let p=0,m=l.length;p<m;p++)u.add(l[p]);return u})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const s=e.nodes[t],r=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),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(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let u;if(s.isBone===!0?u=new f.Bone:c.length>1?u=new f.Group:c.length===1?u=c[0]:u=new f.Object3D,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(s.name&&(u.userData.name=s.name,u.name=r),O(u,s),s.extensions&&P(i,u,s),s.matrix!==void 0){const l=new f.Matrix4;l.fromArray(s.matrix),u.applyMatrix4(l)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);if(!n.associations.has(u))n.associations.set(u,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(u);n.associations.set(u,{...l})}return n.associations.get(u).nodes=t,u}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,s=new f.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&P(e,s,i);const r=i.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(n.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++)s.add(o[u]);const c=u=>{const l=new Map;for(const[h,p]of n.associations)(h instanceof f.Material||h instanceof f.Texture)&&l.set(h,p);return u.traverse(h=>{const p=n.associations.get(h);p!=null&&l.set(h,p)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,i,n,s){const r=[],a=t.name?t.name:t.uuid,o=[];k[s.path]===k.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(k[s.path]){case k.weights:c=f.NumberKeyframeTrack;break;case k.rotation:c=f.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=f.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=f.NumberKeyframeTrack;break;case 2:case 3:default:c=f.VectorKeyframeTrack;break}break}const u=n.interpolation!==void 0?ve[n.interpolation]:f.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,p=o.length;h<p;h++){const m=new c(o[h]+"."+k[s.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),r.push(m)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=z(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof f.QuaternionKeyframeTrack?Oe:te;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Ue(d,t,e){const i=t.attributes,n=new f.Box3;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new f.Vector3(o[0],o[1],o[2]),new f.Vector3(c[0],c[1],c[2])),a.normalized){const u=z(D[a.componentType]);n.min.multiplyScalar(u),n.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new f.Vector3,o=new f.Vector3;for(let c=0,u=s.length;c<u;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],p=h.min,m=h.max;if(p!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(p[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(p[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(p[2]),Math.abs(m[2]))),h.normalized){const E=z(D[h.componentType]);o.multiplyScalar(E)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}d.boundingBox=n;const r=new f.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,d.boundingSphere=r}function Z(d,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){d.setAttribute(a,o)})}for(const r in i){const a=X[r]||r.toLowerCase();a in d.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!d.index){const r=e.getDependency("accessor",t.indices).then(function(a){d.setIndex(a)});n.push(r)}return f.ColorManagement.workingColorSpace!==f.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${f.ColorManagement.workingColorSpace}" not supported.`),O(d,t),Ue(d,t,e),Promise.all(n).then(function(){return t.targets!==void 0?Pe(d,t.targets,e):d})}function je(){const d=g.ref(!1),t=g.ref(""),e=g.shallowRef([]),i=g.ref(null),n=new U.MTLLoader,s=new U.OBJLoader,r=new U.STLLoader,a=new ae;return{isLoading:d,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var p;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}d.value=!0,t.value="准备加载...",e.value=[],i.value=null;const u=new Map;c.forEach(m=>{m instanceof File&&u.set(m.name.toLowerCase(),m)});const l=[],h=[];try{for(const m of c){const E=m.name||"unknown_file",T=(p=E.split(".").pop())==null?void 0:p.toLowerCase();if(T==="mtl")continue;const R=URL.createObjectURL(m);l.push(R);let _=null;const L=x=>{const S=x.lengthComputable?x.loaded/x.total*100:0;t.value=`正在加载 ${E}... ${Math.round(S)}%`};switch(t.value=`正在加载 ${E}... 0%`,T){case"obj":const x=E.replace(/\.obj$/i,".mtl").toLowerCase();if(u.has(x)){const I=u.get(x),w=URL.createObjectURL(I);l.push(w);const v=await n.loadAsync(w);v.preload(),s.setMaterials(v)}else s.setMaterials(null);_=await s.loadAsync(R,L);break;case"stl":const S=await r.loadAsync(R,L),b=new f.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});_=new f.Mesh(S,b);break;case"gltf":case"glb":_=(await a.loadAsync(R,L)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${E}`;continue}_&&(_.userData.boundingBox=new f.Box3().setFromObject(_),h.push(_))}e.value=h,t.value="加载完成!"}catch(m){throw console.error("加载模型时出错:",m),i.value=`加载失败: ${m.message||"未知错误"}`,t.value="加载失败!",e.value=[],m}finally{d.value=!1,l.forEach(m=>URL.revokeObjectURL(m))}}}}function Ke(d,t={}){const e={threeInfo:{},modelLoader:{},animation:{},clipping:{}},i=B.useThreeJS(d);e.threeInfo=i;const{currentModels:n,getThreeJSObjects:s}=i,{useModelLoaderHook:r,useAnimationHook:a,useClippingHook:o}=t;return r&&(e.modelLoader=je()),a&&(e.animation=B.useAnimation(s,n)),o&&(e.clipping=B.useClipping(s,n)),e}const Ve={class:"obj-viewer-container"},Xe={class:"buttonGroup-topLeft"},ze={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},We={class:"left-panel"},Ye={class:"panel-header"},$e={key:0,class:"loading-overlay"},Je=g.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(d){const t=d,e=g.ref(null),i=g.ref(!1),n=g.ref(""),{threeInfo:{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:u,setAndFitModels:l,axesHelperVisible:h,toggleAxesVisibility:p},modelLoader:{isLoading:m,loadingProgress:E,loadedModels:T,error:R,loadModelsFromBlobs:_},animation:{isAnimating:L,toggleAnimation:x,startAnimation:S,stopAnimation:b},clipping:{isClipping:y,activeClippingAxis:I,toggleClipping:w,updateClippingPlanes:v}}=Ke(e,{useModelLoaderHook:!0,useAnimationHook:!0,useClippingHook:!0}),ne=()=>{p()},se=A=>{I.value=A,v()};g.watch(()=>t.fileBlobs,A=>{A&&A.length>0&&_(A).catch(C=>{console.error("加载错误:",C)})},{immediate:!0,deep:!0}),g.watch(T,A=>{A&&A.length>0&&l(A)}),g.watch(R,A=>{A&&W.ElMessage.error(`模型加载失败: ${A}`)});const q=A=>{i.value=!0,n.value=A,A==="剖面视图"&&!y.value&&w()};let G=null;return g.onMounted(async()=>{await g.nextTick();try{a(),e.value&&(G=new ResizeObserver(o),G.observe(e.value))}catch(A){console.error("Three.js 初始化失败:",A),W.ElMessage.error("渲染引擎初始化失败!")}}),g.onBeforeUnmount(()=>{n.value="",G&&G.disconnect(),L.value&&b(),u()}),(A,C)=>{const re=g.resolveComponent("el-scrollbar");return g.openBlock(),g.createElementBlock("div",Ve,[g.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),g.createElementVNode("div",Xe,[g.createVNode(F.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:g.unref(r),title:"重置"},null,8,["onClick"]),g.createVNode(F.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),g.createVNode(F.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),g.createVNode(F.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:g.unref(x),title:g.unref(L)?"停止动画":"动画视图"},null,8,["onClick","title"]),g.createVNode(F.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:g.unref(h),onClick:ne,title:"显隐坐标轴"},null,8,["active"])]),g.createElementVNode("div",ze,[g.renderSlot(A.$slots,"button-left",{switchRightPanel:q},void 0,!0),g.createVNode(F.ThreeSvgIcon,{name:"clipping",size:"24",onClick:C[0]||(C[0]=ie=>q("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),g.createElementVNode("div",qe,[g.renderSlot(A.$slots,"button-right",{},void 0,!0)]),C[3]||(C[3]=g.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),g.withDirectives(g.createElementVNode("div",We,[g.createElementVNode("div",Ye,[g.createElementVNode("span",null,g.toDisplayString(n.value),1),g.createElementVNode("span",{class:"close",onClick:C[1]||(C[1]=ie=>i.value=!1)}," X ")]),g.createVNode(re,{"max-height":"650px"},{default:g.withCtx(()=>[n.value==="剖面视图"?(g.openBlock(),g.createBlock(B.ClippingPanel,{key:0,value:g.unref(I),onChange:se},null,8,["value"])):g.createCommentVNode("",!0)]),_:1})],512),[[g.vShow,i.value]]),g.unref(m)?(g.openBlock(),g.createElementBlock("div",$e,[C[2]||(C[2]=g.createElementVNode("div",{class:"loading-spinner"},null,-1)),g.createElementVNode("p",null,g.toDisplayString(g.unref(E)),1)])):g.createCommentVNode("",!0)])}}}),Qe=oe._export_sfc(Je,[["__scopeId","data-v-2268e4d4"]]);exports.default=Qe;
@@ -1,8 +1,8 @@
1
1
  import { ref as B, shallowRef as Be, defineComponent as Ke, watch as $, onMounted as Ve, nextTick as Xe, onBeforeUnmount as ze, resolveComponent as qe, createElementBlock as ue, openBlock as J, createElementVNode as S, withDirectives as We, createCommentVNode as fe, createVNode as F, unref as D, renderSlot as de, toDisplayString as he, withCtx as Ye, createBlock as $e, vShow as Je } from "vue";
2
- import { bk as Qe, bl as re, bm as Me, b9 as Ze, bn as z, ba as we, bo as C, bp as ye, ae as G, bq as v, aj as q, br as et, at as tt, ar as nt, ay as Y, ab as j, bs as st, bt as Se, bu as rt, bv as Ne, bw as it, bx as ot, bg as Q, by as at, bz as Ie, bA as ct, bB as lt, bC as ut, bD as ie, bE as Ce, bF as oe, bG as ft, bH as dt, bd as ht, bI as Z, bh as pt, aZ as Oe, av as mt, bJ as X, bK as gt, a$ as Tt, bL as xt, ap as ve, bM as Rt, b1 as bt, bN as Et, be as _t, aY as ee, af as At, az as Lt, bO as Mt, bP as wt, bQ as yt, bR as St, bS as Nt, bT as ke, bU as It, bV as pe, bW as me, bX as ge, bY as Te, bZ as xe, bj as Ct, b_ as Ot, ac as Pe, b$ as vt, au as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
2
+ import { bk as Qe, bl as re, bm as Me, b9 as Ze, bn as z, ba as we, bo as C, bp as ye, ae as G, bq as v, aj as q, br as et, at as tt, ar as nt, ay as Y, ab as j, bs as st, bt as Se, bu as rt, bv as Ne, bw as it, bx as ot, bg as Q, by as at, bz as Ie, bA as ct, bB as lt, bC as ut, bD as ie, bE as Ce, bF as oe, bG as ft, bH as dt, bd as ht, bI as Z, bh as pt, aZ as Oe, av as mt, bJ as X, bK as gt, a$ as Tt, bL as xt, ap as ve, bM as Rt, b1 as bt, bN as Et, be as _t, aY as ee, af as At, az as Lt, bO as Mt, bP as wt, bQ as yt, bR as St, bS as Nt, bT as ke, bU as It, bV as pe, bW as me, bX as ge, bY as Te, bZ as xe, bj as Ct, b_ as Ot, ac as Pe, b$ as vt, au as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
3
3
  import { E as Re } from "./index-KFoWHXov.js";
4
- import { u as Pt, a as Ft, b as Dt, C as Ht } from "./iconfont-Bh6I7yoc.js";
5
- import { M as Gt, O as Ut, S as jt } from "./MTLLoader-D05WSq-q.js";
4
+ import { u as Pt, a as Ft, b as Dt, C as Ht } from "./iconfont-CbHnKyhA.js";
5
+ import { M as Gt, O as Ut, S as jt } from "./MTLLoader-DgByTNTq.js";
6
6
  import { T as U } from "./svgIcon-D-_fXUBL.js";
7
7
  import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  function be(f, t) {
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as Le, ref as h, watch as ae, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as U, createElementBlock as De, openBlock as Q, createElementVNode as u, createVNode as l, withCtx as M, createBlock as ye, createCommentVNode as ke, unref as X, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as He, renderList as qe, nextTick as Ke, withDirectives as pe, vShow as de, renderSlot as Me } from "vue";
2
- import { r as Te, s as Ye } from "./threeViewerHost-DKsihx3G.js";
3
- import { u as Je, a as Qe, b as et, C as tt } from "./iconfont-Bh6I7yoc.js";
4
- import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-BnLl9nv-.js";
2
+ import { r as Te, s as Ye } from "./threeViewerHost-D3nc548f.js";
3
+ import { u as Je, a as Qe, b as et, C as tt } from "./iconfont-CbHnKyhA.js";
4
+ import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-vnbkBGAm.js";
5
5
  import { ah as st, c as it, E as j, aW as rt, aw as ct } from "./index-KFoWHXov.js";
6
- import { aA as Ve, aB as xe, ab as V, ay as H, az as ut, aY as pt, ap as Se, aZ as dt, a_ as mt, a$ as vt, b0 as ft, b1 as gt, b2 as ht, b3 as bt, b4 as yt, av as _t, b5 as Be, b6 as wt, b7 as Ct, b8 as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
6
+ import { aA as Ve, aB as xe, ab as V, ay as H, az as ut, aY as pt, ap as Se, aZ as dt, a_ as mt, a$ as vt, b0 as ft, b1 as gt, b2 as ht, b3 as bt, b4 as yt, av as _t, b5 as Be, b6 as wt, b7 as Ct, b8 as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
7
7
  import "./index-BHtNKL1L.js";
8
8
  import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
9
- import "./index.vue_vue_type_style_index_1_lang-46IdC_8L.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-BObmb_2e.js";
10
10
  import "./index-BIiBz_NW.js";
11
11
  import "./index-Dh_LOm8w.js";
12
- import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-CGKa2au1.js";
13
- import { g as Tt, a as Dt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-D55cXXY_.js";
12
+ import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-B8-fvoQG.js";
13
+ import { g as Tt, a as Dt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-BORFZd89.js";
14
14
  import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
- import { s as Ft } from "./index-BxkOJwR0.js";
15
+ import { s as Ft } from "./index-CHSOjR_9.js";
16
16
  import { T as Y } from "./svgIcon-D-_fXUBL.js";
17
17
  const I = 1e-3, oe = ut.degToRad, je = new dt({
18
18
  // 灰色
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-C6gjvpcg.cjs"),pe=require("./iconfont-DTy0GXFn.cjs"),ve=require("./workpieceTreePanel-DfC-7RWt.cjs"),R=require("./index-y1mE3_ai.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index.vue_vue_type_style_index_1_lang-CmFbshDy.cjs");require("./index-Xb_d3z-H.cjs");require("./index-C5woD5Cw.cjs");const fe=require("./animationData-DBwtb8zr.cjs"),ie=require("./urdfTree-CB9GhNL7.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Me=require("./index-CQfanE9k.cjs"),B=require("./svgIcon-CUM54R6L.cjs"),G=.001,W=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Te(V=.005,v=64){const p=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(p,v,V,16,!1),m=ye;return new n.Mesh(a,m)}const xe=V=>V.reduce((v,p)=>{let a=0;const m=p.Y??0,b=p.C??0,s=p.R??0;return m>0&&(a+=m),b>0&&s>0&&(a+=s*W(b)),v+a},0),ke=V=>{const v=[],p=V.Y??0,a=V.B??0,m=V.C??0,b=V.R??0,s={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(!p&&!m)return v;if(v.push(s.pos.clone()),a!==0){const g=new n.Matrix4().makeRotationAxis(s.localY,W(a));s.localX.applyMatrix4(g),s.localZ.applyMatrix4(g)}if(p>0&&(s.pos.add(s.localY.clone().multiplyScalar(p*G)),v.push(s.pos.clone())),m>0&&b>0){const g=W(m),f=b*G,w=s.pos.clone().add(s.localX.clone().multiplyScalar(-f)),r=Math.max(16,Math.ceil(m/5));for(let y=1;y<=r;y++){const d=g*y/r,_=new n.Matrix4().makeRotationAxis(s.localZ,d),u=s.localX.clone().multiplyScalar(f).applyMatrix4(_),k=w.clone().add(u);v.push(k)}}return v};function Ee(V,v){const p=new n.Group;p.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 m=0,b=1;for(let s=0;s<V.length;s++){const g=V[s],f=g.Y??0,w=g.B??0,r=g.C??0,y=g.R??0;if(w!==0){const d=new n.Matrix4().makeRotationAxis(a.localY,W(w));a.localX.applyMatrix4(d),a.localZ.applyMatrix4(d)}if(f>0){const d=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(f*G));const _=a.pos.clone(),c=Pe(d,_,v*G);c.userData={segmentType:"straight",segmentIndex:m,frameIndex:s,length:f,frame:{Y:f,B:w,C:r,R:y}},c.name=`直段_${m}`,p.add(c);const u=d.clone();Se(p,b,u,v*G),m++}if(r>0&&y>0){const d=W(r),_=y*G,c=[];c.push(a.pos.clone());const u=a.pos.clone().add(a.localX.clone().multiplyScalar(-_)),k=Math.max(16,Math.ceil(r/5));for(let h=1;h<=k;h++){const M=d*h/k,A=new n.Matrix4().makeRotationAxis(a.localZ,M),L=a.localX.clone().multiplyScalar(_).applyMatrix4(A),q=u.clone().add(L);c.push(q)}const E=De(c,v*G);E.userData={segmentType:"bend",segmentIndex:m,frameIndex:s,angle:r,radius:y,centerPoint:u.toArray(),frame:{Y:f,B:w,C:r,R:y}},E.name=`弯段_${m}`,p.add(E),Math.floor(c.length/2),c[0],a.pos=c[c.length-1].clone();const S=new n.Matrix4().makeRotationAxis(a.localZ,d);a.localY.applyMatrix4(S),a.localX.applyMatrix4(S),m++,b++}}return p}function Se(V,v,p,a){const m=new n.Vector3(0,a*2,a*5),b=p.clone().add(m),s=[p,b],g=new n.BufferGeometry().setFromPoints(s),f=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),w=new n.Line(g,f);w.computeLineDistances(),V.add(w);const r=document.createElement("canvas"),y=r.getContext("2d");r.width=128,r.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(v.toString(),64,64);const d=new n.CanvasTexture(r),_=new n.SpriteMaterial({map:d,transparent:!0,depthTest:!1,depthWrite:!1}),c=new n.Sprite(_),u=a*3;c.scale.set(u,u,1),c.position.copy(b),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Pe(V,v,p){const a=new n.LineCurve3(V,v),m=new n.TubeGeometry(a,2,p,18,!1);return new n.Mesh(m,ye)}function De(V,v){const p=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(p,Math.max(16,V.length*2),v,18,!1);return new n.Mesh(a,ye)}function _e(V,v,p,a,m,b=0){let s=v.slice(0,m+1);const g=v[m+1];if(g&&b>0){const c={...g,B:(g.B??0)*b,C:(g.C??0)*b};s.push(c)}const f=xe(s),w=Math.max(0,p-f),r=[];r.push(new n.Vector3(0,0,0));const y=new n.Vector3(0,w*G,0);w>0&&r.push(y);let d={pos:y.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const _=[];for(let c=s.length-1;c>=0;c--){const u=s[c],k=ke(u);if(k.length>0){const E=k.map(A=>{const $=A.clone(),L=new n.Matrix4;return L.makeBasis(d.localX,d.localY,d.localZ),$.applyMatrix4(L),$.add(d.pos)});_.push(E);const S=E[E.length-1];d.pos=S.clone();const h=u.B??0,M=u.C??0;if(h!==0){const A=new n.Matrix4().makeRotationAxis(d.localY,W(h));d.localX.applyMatrix4(A),d.localZ.applyMatrix4(A)}if(M>0){const A=W(M),$=new n.Matrix4().makeRotationAxis(d.localZ,A);d.localY.applyMatrix4($),d.localX.applyMatrix4($)}}}for(const c of _)c.length>1&&r.push(...c.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const c=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,r.length*4),a*G,18,!1);V.geometry.dispose(),V.geometry=u}catch(c){console.error("管件更新失败",c)}}function Ce(V,v,p,a=0){let m=V.slice(0,p+1);const b=V[p+1];if(b&&a>0){const d={...b,B:(b.B??0)*a,C:(b.C??0)*a};m.push(d)}const s=xe(m),g=Math.max(0,v-s),f=[];f.push(new n.Vector3(0,0,0));const w=new n.Vector3(0,g*G,0);g>0&&f.push(w);let r={pos:w.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const y=[];for(let d=m.length-1;d>=0;d--){const _=m[d],c=ke(_);if(c.length>0){const u=c.map(h=>{const M=h.clone(),A=new n.Matrix4;return A.makeBasis(r.localX,r.localY,r.localZ),M.applyMatrix4(A),M.add(r.pos)});y.push(u);const k=u[u.length-1];r.pos=k.clone();const E=_.B??0,S=_.C??0;if(E!==0){const h=new n.Matrix4().makeRotationAxis(r.localY,W(E));r.localX.applyMatrix4(h),r.localZ.applyMatrix4(h)}if(S>0){const h=W(S),M=new n.Matrix4().makeRotationAxis(r.localZ,h);r.localY.applyMatrix4(M),r.localX.applyMatrix4(M)}}}for(const d of y)d.length>1&&f.push(...d.slice(1));return f.length<2&&f.push(new n.Vector3(0,.001,0)),f}function Ne(V,v,p,a,m,b,s,g=0,f=0){const w=m-f,r=Ce(a,w,s,g);let d=Ce(p,f,s,g);d.forEach(c=>c.y=-c.y),d.reverse();const _=[...d,...r];try{const c=new n.CatmullRomCurve3(_,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,_.length*4),b*G,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=u}catch(c){console.error("管件更新失败",c)}}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:{}},setup(V,{expose:v}){const p=V,a=e.ref(),m=e.ref();e.watch(()=>p.threeData,t=>{const l=t==null?void 0:t.data;m.value=l==null?void 0:l.type},{immediate:!0});const b=async()=>{let t={};m.value===ne.robotMode.SINGLE&&(t=await fe.fetchSingleRobotAnimationData()),m.value===ne.robotMode.DOUBLE&&(t=await fe.fetchDoubleRobotAnimationData());const{initialPipeLength:l=0,pipeRadius:o=0,clampLength:i=0,animationData:x}=t;S.value=l,h.value=o,M.value=i,a.value=x;const N=R.cloneDeep(a.value),J=re(Y.value),X=(N==null?void 0:N["输出(动画数据)"])||[];s.value=X.length?X:[J]},s=e.ref([]),g=e.ref(!1),f=e.ref(""),w=e.ref(!1),r=e.ref(0),y=e.ref(0),d=e.ref(1e3);let _=!1;const c=e.ref(null),u=e.shallowRef(null),k=e.shallowRef(null),E=e.shallowRef(null),S=e.ref(0),h=e.ref(12.5),M=e.ref(30),A=e.ref([]),$=e.ref(null),L=e.computed(()=>p.model?ie.getNonFixedJoints(p.model).map(o=>o.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-Birr5icJ.cjs"),pe=require("./iconfont-B1otHnDa.cjs"),ve=require("./workpieceTreePanel-C3Ah_exL.cjs"),R=require("./index-y1mE3_ai.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index.vue_vue_type_style_index_1_lang-BgpaLloL.cjs");require("./index-Xb_d3z-H.cjs");require("./index-C5woD5Cw.cjs");const fe=require("./animationData-BKJUksL6.cjs"),ie=require("./urdfTree-j7pQuwXM.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Me=require("./index-CTTqwfEF.cjs"),B=require("./svgIcon-CUM54R6L.cjs"),G=.001,W=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Te(V=.005,v=64){const p=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(p,v,V,16,!1),m=ye;return new n.Mesh(a,m)}const xe=V=>V.reduce((v,p)=>{let a=0;const m=p.Y??0,b=p.C??0,s=p.R??0;return m>0&&(a+=m),b>0&&s>0&&(a+=s*W(b)),v+a},0),ke=V=>{const v=[],p=V.Y??0,a=V.B??0,m=V.C??0,b=V.R??0,s={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(!p&&!m)return v;if(v.push(s.pos.clone()),a!==0){const g=new n.Matrix4().makeRotationAxis(s.localY,W(a));s.localX.applyMatrix4(g),s.localZ.applyMatrix4(g)}if(p>0&&(s.pos.add(s.localY.clone().multiplyScalar(p*G)),v.push(s.pos.clone())),m>0&&b>0){const g=W(m),f=b*G,w=s.pos.clone().add(s.localX.clone().multiplyScalar(-f)),r=Math.max(16,Math.ceil(m/5));for(let y=1;y<=r;y++){const d=g*y/r,_=new n.Matrix4().makeRotationAxis(s.localZ,d),u=s.localX.clone().multiplyScalar(f).applyMatrix4(_),k=w.clone().add(u);v.push(k)}}return v};function Ee(V,v){const p=new n.Group;p.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 m=0,b=1;for(let s=0;s<V.length;s++){const g=V[s],f=g.Y??0,w=g.B??0,r=g.C??0,y=g.R??0;if(w!==0){const d=new n.Matrix4().makeRotationAxis(a.localY,W(w));a.localX.applyMatrix4(d),a.localZ.applyMatrix4(d)}if(f>0){const d=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(f*G));const _=a.pos.clone(),c=Pe(d,_,v*G);c.userData={segmentType:"straight",segmentIndex:m,frameIndex:s,length:f,frame:{Y:f,B:w,C:r,R:y}},c.name=`直段_${m}`,p.add(c);const u=d.clone();Se(p,b,u,v*G),m++}if(r>0&&y>0){const d=W(r),_=y*G,c=[];c.push(a.pos.clone());const u=a.pos.clone().add(a.localX.clone().multiplyScalar(-_)),k=Math.max(16,Math.ceil(r/5));for(let h=1;h<=k;h++){const M=d*h/k,A=new n.Matrix4().makeRotationAxis(a.localZ,M),L=a.localX.clone().multiplyScalar(_).applyMatrix4(A),q=u.clone().add(L);c.push(q)}const E=De(c,v*G);E.userData={segmentType:"bend",segmentIndex:m,frameIndex:s,angle:r,radius:y,centerPoint:u.toArray(),frame:{Y:f,B:w,C:r,R:y}},E.name=`弯段_${m}`,p.add(E),Math.floor(c.length/2),c[0],a.pos=c[c.length-1].clone();const S=new n.Matrix4().makeRotationAxis(a.localZ,d);a.localY.applyMatrix4(S),a.localX.applyMatrix4(S),m++,b++}}return p}function Se(V,v,p,a){const m=new n.Vector3(0,a*2,a*5),b=p.clone().add(m),s=[p,b],g=new n.BufferGeometry().setFromPoints(s),f=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),w=new n.Line(g,f);w.computeLineDistances(),V.add(w);const r=document.createElement("canvas"),y=r.getContext("2d");r.width=128,r.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(v.toString(),64,64);const d=new n.CanvasTexture(r),_=new n.SpriteMaterial({map:d,transparent:!0,depthTest:!1,depthWrite:!1}),c=new n.Sprite(_),u=a*3;c.scale.set(u,u,1),c.position.copy(b),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Pe(V,v,p){const a=new n.LineCurve3(V,v),m=new n.TubeGeometry(a,2,p,18,!1);return new n.Mesh(m,ye)}function De(V,v){const p=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(p,Math.max(16,V.length*2),v,18,!1);return new n.Mesh(a,ye)}function _e(V,v,p,a,m,b=0){let s=v.slice(0,m+1);const g=v[m+1];if(g&&b>0){const c={...g,B:(g.B??0)*b,C:(g.C??0)*b};s.push(c)}const f=xe(s),w=Math.max(0,p-f),r=[];r.push(new n.Vector3(0,0,0));const y=new n.Vector3(0,w*G,0);w>0&&r.push(y);let d={pos:y.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const _=[];for(let c=s.length-1;c>=0;c--){const u=s[c],k=ke(u);if(k.length>0){const E=k.map(A=>{const $=A.clone(),L=new n.Matrix4;return L.makeBasis(d.localX,d.localY,d.localZ),$.applyMatrix4(L),$.add(d.pos)});_.push(E);const S=E[E.length-1];d.pos=S.clone();const h=u.B??0,M=u.C??0;if(h!==0){const A=new n.Matrix4().makeRotationAxis(d.localY,W(h));d.localX.applyMatrix4(A),d.localZ.applyMatrix4(A)}if(M>0){const A=W(M),$=new n.Matrix4().makeRotationAxis(d.localZ,A);d.localY.applyMatrix4($),d.localX.applyMatrix4($)}}}for(const c of _)c.length>1&&r.push(...c.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const c=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,r.length*4),a*G,18,!1);V.geometry.dispose(),V.geometry=u}catch(c){console.error("管件更新失败",c)}}function Ce(V,v,p,a=0){let m=V.slice(0,p+1);const b=V[p+1];if(b&&a>0){const d={...b,B:(b.B??0)*a,C:(b.C??0)*a};m.push(d)}const s=xe(m),g=Math.max(0,v-s),f=[];f.push(new n.Vector3(0,0,0));const w=new n.Vector3(0,g*G,0);g>0&&f.push(w);let r={pos:w.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const y=[];for(let d=m.length-1;d>=0;d--){const _=m[d],c=ke(_);if(c.length>0){const u=c.map(h=>{const M=h.clone(),A=new n.Matrix4;return A.makeBasis(r.localX,r.localY,r.localZ),M.applyMatrix4(A),M.add(r.pos)});y.push(u);const k=u[u.length-1];r.pos=k.clone();const E=_.B??0,S=_.C??0;if(E!==0){const h=new n.Matrix4().makeRotationAxis(r.localY,W(E));r.localX.applyMatrix4(h),r.localZ.applyMatrix4(h)}if(S>0){const h=W(S),M=new n.Matrix4().makeRotationAxis(r.localZ,h);r.localY.applyMatrix4(M),r.localX.applyMatrix4(M)}}}for(const d of y)d.length>1&&f.push(...d.slice(1));return f.length<2&&f.push(new n.Vector3(0,.001,0)),f}function Ne(V,v,p,a,m,b,s,g=0,f=0){const w=m-f,r=Ce(a,w,s,g);let d=Ce(p,f,s,g);d.forEach(c=>c.y=-c.y),d.reverse();const _=[...d,...r];try{const c=new n.CatmullRomCurve3(_,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,_.length*4),b*G,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=u}catch(c){console.error("管件更新失败",c)}}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:{}},setup(V,{expose:v}){const p=V,a=e.ref(),m=e.ref();e.watch(()=>p.threeData,t=>{const l=t==null?void 0:t.data;m.value=l==null?void 0:l.type},{immediate:!0});const b=async()=>{let t={};m.value===ne.robotMode.SINGLE&&(t=await fe.fetchSingleRobotAnimationData()),m.value===ne.robotMode.DOUBLE&&(t=await fe.fetchDoubleRobotAnimationData());const{initialPipeLength:l=0,pipeRadius:o=0,clampLength:i=0,animationData:x}=t;S.value=l,h.value=o,M.value=i,a.value=x;const N=R.cloneDeep(a.value),J=re(Y.value),X=(N==null?void 0:N["输出(动画数据)"])||[];s.value=X.length?X:[J]},s=e.ref([]),g=e.ref(!1),f=e.ref(""),w=e.ref(!1),r=e.ref(0),y=e.ref(0),d=e.ref(1e3);let _=!1;const c=e.ref(null),u=e.shallowRef(null),k=e.shallowRef(null),E=e.shallowRef(null),S=e.ref(0),h=e.ref(12.5),M=e.ref(30),A=e.ref([]),$=e.ref(null),L=e.computed(()=>p.model?ie.getNonFixedJoints(p.model).map(o=>o.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${Y.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),ae=()=>s.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),K=()=>{const t=[],l=[];return s.value.forEach(o=>{const{Y1:i,B1:x,C1:N,R1:J,Y2:X,B2:oe,C2:de,R2:D}=o;t.push({Y:parseFloat(i)||0,B:parseFloat(x)||0,C:parseFloat(N)||0,R:parseFloat(J)||0}),l.push({Y:parseFloat(X)||0,B:parseFloat(oe)||0,C:parseFloat(de)||0,R:parseFloat(D)||0})}),{posPipeYbcr:t,negPipeYbcr:l}},T=(t=0,l=0)=>{if(u.value&&k.value){const o=K();Ne(u.value,k.value,o.posPipeYbcr,o.negPipeYbcr,S.value,h.value,t,l,M.value)}else if(u.value){const o=ae();_e(u.value,o,S.value,h.value,t,l)}},C=t=>{if(t<0||t>=s.value.length){console.error(`帧索引 ${t} 超出范围`);return}const l=s.value[t];if(console.log(`应用第 ${t} 帧数据 ${l}`),r.value=t,c.value){const o={};L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value.setJointAngles(o)}T(t,0)},U=async()=>{if(s.value.length===0){R.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,s.value.length-1===r.value&&(r.value=0);try{for(let t=r.value+1;t<s.value.length&&!_;t++){r.value=t;const l=s.value[t],o={};c.value&&L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value?await c.value.animateToState(o,d.value,i=>{y.value=(t+i)/s.value.length*100,T(t-1,i)}):(await new Promise(i=>setTimeout(i,d.value)),y.value=(t+1)/s.value.length*100)}_||R.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),R.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,R.ElMessage.info("动画已停止")},I=()=>{r.value=0},z=()=>{if(u.value&&k.value){const t=K();Ne(u.value,k.value,t.posPipeYbcr,t.negPipeYbcr,S.value,h.value,-1,0,M.value)}else if(u.value){const t=ae();_e(u.value,t,S.value,h.value,-1,0)}},Z=()=>{c.value&&c.value.resetToZero(),z(),I(),R.ElMessage.success("机器人和管件已重置")},O=t=>`第 ${t+1} 帧`,j=t=>{w.value&&F(),C(t)},Q=()=>{w.value&&F(),!(r.value+1>=s.value.length)&&C(r.value+1)},P=()=>{w.value&&F(),r.value!==0&&C(r.value-1)},H=()=>{E.value&&(E.value.visible=!0),u.value&&u.value.parent&&u.value.parent.remove(u.value),E.value=null,u.value=null,k.value=null},re=t=>t==null?void 0:t.reduce((l,o)=>(l[o]="0",l),{});e.watch(Y,(t,l)=>{if(JSON.stringify(t)!==JSON.stringify(l))if(t.length>0){const o=re(t);s.value=[o]}else s.value=[]},{immediate:!0});const ee=e.ref(0),ue=t=>{ee.value=t},he=(t,l)=>{if(!t||!l)return;const o=ie.getTargetJoint(t,l),i=Te();i.visible=!1,o==null||o.add(i)},ge=t=>{c.value=new ve.URDFRobotController(t),A.value=ie.getAllLinkName(t),$.value="Pipe_Joint"},te=()=>{c.value=null,A.value=[],$.value=null},se=t=>{ge(t),he(t,$.value),ue(ee.value+1),Z()};e.watch(()=>p.model,t=>{if(H(),t){se(t);return}te()},{immediate:!0});const me=t=>{var o,i;const l=new n.Mesh(t.geometry.clone(),t.material);return l.name="managed_pipe_clone",(i=(o=t==null?void 0:t.parent)==null?void 0:o.add)==null||i.call(o,l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),l};e.watch([$,M,S,ee],([t,l])=>{if(H(),p.model&&t){const o=ie.getMeshFromJoint(p.model,t);if(console.log(o,"meshToReplace"),o&&o.parent){E.value=o,o.visible=!1;const i=me(o);if(m.value===ne.robotMode.SINGLE&&(i.position.y-=l*.001),u.value=i,m.value===ne.robotMode.DOUBLE){const x=me(o);k.value=x}T(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const Ve=async()=>{if(Y.value.length===0){R.ElMessage.warning("没有可导出的表头");return}const t=Y.value.join(" ");try{await navigator.clipboard.writeText(t),R.ElMessage.success("表头已成功复制到剪贴板!")}catch(l){console.error("复制失败:",l),R.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!f.value.trim()){R.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as ge, ref as r, computed as k, watch as X, onUnmounted as De, resolveComponent as G, createElementBlock as x, openBlock as g, createElementVNode as n, createCommentVNode as U, createVNode as s, toDisplayString as L, Fragment as Be, renderList as Je, withCtx as le, shallowRef as te, onMounted as Me, nextTick as me, onBeforeUnmount as Ee, withDirectives as I, vShow as W, unref as z, renderSlot as ve, createBlock as de } from "vue";
2
- import { s as pe } from "./threeViewerHost-DKsihx3G.js";
3
- import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-Bh6I7yoc.js";
4
- import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-BnLl9nv-.js";
2
+ import { s as pe } from "./threeViewerHost-D3nc548f.js";
3
+ import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-CbHnKyhA.js";
4
+ import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-vnbkBGAm.js";
5
5
  import { c as Ke, E as _ } from "./index-KFoWHXov.js";
6
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
6
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
7
7
  import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
8
- import { g as Qe, b as et, U as tt, J as lt, d as nt } from "./urdfTree-D55cXXY_.js";
8
+ import { g as Qe, b as et, U as tt, J as lt, d as nt } from "./urdfTree-BORFZd89.js";
9
9
  import { _ as he } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  import { T as y } from "./svgIcon-D-_fXUBL.js";
11
- import { i as at } from "./animationData-CGKa2au1.js";
12
- import { O as ot } from "./MTLLoader-D05WSq-q.js";
11
+ import { i as at } from "./animationData-B8-fvoQG.js";
12
+ import { O as ot } from "./MTLLoader-DgByTNTq.js";
13
13
  const st = { class: "panel-content" }, it = {
14
14
  key: 0,
15
15
  class: "animation-controls"
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-C6gjvpcg.cjs"),q=require("./iconfont-DTy0GXFn.cjs"),J=require("./workpieceTreePanel-DfC-7RWt.cjs"),f=require("./index-y1mE3_ai.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-CB9GhNL7.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./svgIcon-CUM54R6L.cjs"),Ce=require("./animationData-DBwtb8zr.cjs"),_e=require("./MTLLoader-CR-R4D3A.cjs"),we={class:"panel-content"},Se={key:0,class:"animation-controls"},Pe={class:"control-row"},Te={class:"control-row"},Be={class:"frame-info"},xe={class:"control-row"},ze={key:1,class:"empty-state"},De={class:"dialog-footer"},Le=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),g=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-Birr5icJ.cjs"),q=require("./iconfont-B1otHnDa.cjs"),J=require("./workpieceTreePanel-C3Ah_exL.cjs"),f=require("./index-y1mE3_ai.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-j7pQuwXM.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./svgIcon-CUM54R6L.cjs"),Ce=require("./animationData-BKJUksL6.cjs"),_e=require("./MTLLoader-45vFx6Ci.cjs"),we={class:"panel-content"},Se={key:0,class:"animation-controls"},Pe={class:"control-row"},Te={class:"control-row"},Be={class:"frame-info"},xe={class:"control-row"},ze={key:1,class:"empty-state"},De={class:"dialog-footer"},Le=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),g=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${S.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),M=e.computed(()=>s.value[g.value]||{});e.watch(()=>y.model,o=>{o?(u.value=new J.URDFRobotController(o),V.value=U.getAllLinkName(o),g.value=0):(u.value=null,V.value=[])},{immediate:!0});const D=o=>{if(o<0||o>=s.value.length){console.error(`帧索引 ${o} 超出范围`);return}const n=s.value[o];if(u.value){const p={};N.value.forEach(k=>{const r=parseFloat(n[k]);isNaN(r)||(p[k]=r)}),u.value.setJointAngles(p)}g.value=o,w.value=s.value.length>1?o/(s.value.length-1)*100:100},L=async o=>{try{for(let n=g.value;n<s.value.length;n++){if(o!==c)return;const p=s.value[n],k={};if(u.value)N.value.forEach(r=>{const d=parseFloat(p[r]);isNaN(d)||(k[r]=d)}),await u.value.animateToState(k,b.value,r=>{o===c&&(w.value=(n+r)/s.value.length*100)});else{if(await new Promise(r=>setTimeout(r,b.value)),o!==c)return;w.value=(n+1)/s.value.length*100}g.value=n}o===c&&(f.ElMessage.success("动画播放完成"),i.value="stopped",w.value=100)}catch(n){console.error("动画播放出错:",n),f.ElMessage.error("动画播放出错"),i.value="stopped"}},B=()=>{if(s.value.length===0){f.ElMessage.error("无动画数据");return}i.value==="stopped"&&(g.value=0,D(0)),i.value="playing",c++,L(c),f.ElMessage.info("动画播放中")},$=()=>{i.value==="playing"&&(c++,i.value="paused",f.ElMessage.info("动画已暂停"))},R=()=>{c++,i.value="stopped",g.value=0,w.value=0,D(0),f.ElMessage.info("动画已停止并重置")},G=()=>{i.value==="playing"?$():B()},x=o=>{c++,i.value="paused",D(o)},X=()=>{if(!T.value.trim()){f.ElMessage.warning("导入内容不能为空");return}const o=T.value.trim().split(`
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as ce, computed as U, ref as w, resolveComponent as E, createElementBlock as ee, openBlock as X, createElementVNode as d, createVNode as p, withCtx as I, toDisplayString as j, shallowRef as Z, watch as Ee, onMounted as Xe, onBeforeUnmount as je, withDirectives as D, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as N, nextTick as Ye } from "vue";
2
- import { u as Ze, a as De, b as Ne, C as Be, f as Ie, d as re } from "./iconfont-Bh6I7yoc.js";
3
- import { ae as O, ap as Oe, c0 as Ge, aZ as qe, ab as te, a$ as ue, bb as fe, bh as Ke, b1 as We, bg as Je, bd as Re, be as He, az as Qe, c1 as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
2
+ import { u as Ze, a as De, b as Ne, C as Be, f as Ie, d as re } from "./iconfont-CbHnKyhA.js";
3
+ import { ae as O, ap as Oe, c0 as Ge, aZ as qe, ab as te, a$ as ue, bb as fe, bh as Ke, b1 as We, bg as Je, bd as Re, be as He, az as Qe, c1 as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
4
4
  import { E as B } from "./index-KFoWHXov.js";
5
- import { U as et, J as tt } from "./urdfTree-D55cXXY_.js";
5
+ import { U as et, J as tt } from "./urdfTree-BORFZd89.js";
6
6
  import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { T as b } from "./svgIcon-D-_fXUBL.js";
8
8
  import { i as nt } from "./isString-BcJYo5aE.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-DTy0GXFn.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs"),I=require("./index-y1mE3_ai.cjs"),K=require("./urdfTree-CB9GhNL7.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CUM54R6L.cjs"),ge=require("./isString-MUYgjroV.cjs");function ye(t=.5,o=4){const r=new p.Mesh(new p.ConeGeometry(t,o,32),new p.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),s=r.geometry.parameters.height;return r.geometry.translate(0,-s/2,0),r.rotation.set(-90,0,0,"XYZ"),r}function Ce(t,o){t.position.copy(o)}function we(t,o,r=new p.Color(16711680)){const s=new p.Vector3;o.getWorldPosition(s);const a=t.geometry.attributes.position,n=t.geometry.attributes.color,l=new p.Color(55551);let c=1/0,f=-1;for(let u=0;u<a.count;u++){const v=new p.Vector3().fromBufferAttribute(a,u).distanceTo(s);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)l.toArray(n.array,u*3);if(f!==-1){const u=r.toArray(),m=f*3+2;for(let v=0;v<m;v=v+3)n.array[v]=u[0],n.array[v+1]=u[1],n.array[v+2]=u[2]}n.needsUpdate=!0}function S(t,o,r,s=new p.Color(16711680)){Ce(t,o),we(r,t,s)}const ke={class:"panel-content"},_e={class:"animation-controls"},Ve={class:"control-row"},be={class:"control-row"},Ne={class:"frame-info"},Te={class:"control-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(t,{expose:o,emit:r}){const s=t,a=e.computed(()=>s.vectors),n=e.ref(!1),l=e.ref(0),c=e.ref(100);let f=!1;const u=g=>`第 ${g+1} 帧`,m=g=>{if(g<0||g>=a.value.length){console.error(`帧索引 ${g} 超出范围`);return}const y=a.value[g];l.value=g,S(s.knife,y,s.cloud)},v=async()=>{if(a.value.length===0){I.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,a.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<a.value.length&&!f;g++)await new Promise(y=>setTimeout(y,c.value)),m(g);f||I.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,I.ElMessage.info("动画已停止")},N=g=>{n.value&&C(),m(g)},_=()=>{n.value&&C(),!(l.value+1>=a.value.length)&&m(l.value+1)},V=()=>{n.value&&C(),l.value!==0&&m(l.value-1)},h=()=>{l.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:_,backwardFrame:V,resetAnimationFrame:h,reset:async()=>{await C(),h()}}),(g,y)=>{const L=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),$=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",Ve,[e.createVNode(D,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(B,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(L,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=z=>c.value=z),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",be,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode($,{modelValue:l.value,"onUpdate:modelValue":y[1]||(y[1]=z=>l.value=z),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),xe=R._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function ze(t){const o=[];return t.forEach(r=>{const[s,a,n]=r.trim().split(/\s+/);o.push(+s,+a,+n)}),o}function U(t,o,r){switch(t){case"X":o.x=+r||0;break;case"Y":o.y=+r||0;break;case"Z":o.z=+r||0;break}}function Ae(t){const o=[],r=["X","Y","Z"];return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=r.find(v=>v===u);if(m){l&&U(l,a,c),c="",l=m;continue}c=c+u}U(l,a,c),o.push(a.x,a.y,a.z)}),o}const Pe=t=>t==null?void 0:t.filter(r=>r.includes("=")),Me=t=>t.replace(/,/g,""),Fe=t=>t==null?void 0:t.map(r=>Me(r)),Ie=t=>{const o=Pe(t);return Fe(o)};function Ue(t){const o=Ie(t),r=[];return o.forEach(s=>{var v,C,N,_,V,h;let[a,n,l,c]=s.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),l=(C=l==null?void 0:l.trim)==null?void 0:C.call(l),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(_=n==null?void 0:n.split)==null?void 0:_.call(n,"="),[,u]=(V=l==null?void 0:l.split)==null?void 0:V.call(l,"="),[,m]=(h=c==null?void 0:c.split)==null?void 0:h.call(c,"=");r.push(+f,+u,+m)}),r}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function $e(t){return Le(t)||Be(t)||De(t)}function je(t){const o=[],r=new Set(["X","Y","Z"]);return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f];if(u==="T")break;const m=r.has(u)?u:null,v=$e(u);if(m||!v){l&&U(l,a,c),l=m,c="";continue}c=c+u}l&&U(l,a,c),o.push(a.x,a.y,a.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var a,n;const o=(a=t==null?void 0:t.trim())==null?void 0:a.split(/\r?\n/);if(qe(t))return Ue(o);const r=o==null?void 0:o[0],s=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\s+/);if((s==null?void 0:s.length)>=3)return ze(o);if((s==null?void 0:s.length)===1)return Ae(o)}async function Ye(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Ze(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Oe(t){let o=t.trim().split(/\r?\n/);return o=o.filter(s=>{const a=s.startsWith("X")||s.startsWith("Y")||s.startsWith("Z"),n=s.startsWith("G")&&(s.includes("X")||s.includes("Y")||s.includes("Z")),l=s.startsWith("N")&&(s.includes("X")||s.includes("Y")||s.includes("Z"));return a||n||l}),je(o)}async function Ge(t,o){const{isCyd:r,isUv:s,isCpt:a,isNc:n}=o;return s?Xe(t):r?Ze(t):a?Ye(t):n?Oe(t):[]}function Ke(t){const o=[];for(let r=0;r<t.length;r+=3)o.push(new p.Vector3(t[r],t[r+1],t[r+2]));return o}function Re(t){const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new p.LineBasicMaterial({color:55551,linewidth:3});return new p.Line(o,r)}function Se(t,o){if(!o||o.length<3)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=Re(o);return l.name="轨迹路径",r.add(l),l}function We(t,o,r,s=4,a=50){let n=1/0,l=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let h=0;h<t.length;h+=3){const A=t[h],g=t[h+1],y=t[h+2];n=Math.min(n,A),l=Math.max(l,A),c=Math.min(c,g),f=Math.max(f,g),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((l-n)**2+(f-c)**2+(m-u)**2)*.05,N=p.MathUtils.degToRad(o.fov),_=2*Math.tan(N/2)*a,V=C/_*r.domElement.height*(s/4);return Math.min(.4,V)}function He(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)r[n]=0,r[n+1]=.847,r[n+2]=1;o.setAttribute("color",new p.BufferAttribute(r,3));const s=new p.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),a=new p.Points(o,s);return s.needsUpdate=!0,a}function Je(t,o){if(!o)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=He(o);if(!l)return;l.name="轨迹路径",r.add(l);const c=We(o,s,a,.1,50);return l.material.size=c,l}const Qe={class:"obj-viewer-container"},et={class:"buttonGroup-topLeft"},tt={class:"buttonGroup-left"},nt={class:"buttonGroup-right"},ot={class:"buttonGroup-bottom"},rt={class:"left-panel"},lt={class:"panel-header"},st={class:"panel-body"},it={class:"right-panel"},at={class:"panel-header"},ct={class:"panel-body"},ut={key:0,class:"loading-overlay"},dt=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(t){const o=t,r=e.ref(null),s=e.ref(!1),a=e.ref(""),n=e.ref(),l=e.ref(!1),c=e.ref(""),f=e.ref(!1),u=e.ref(""),m=e.shallowRef(null),v=e.shallowRef(null),{currentModels:C,resetView:N,initThreeJS:_,handleResize:V,getThreeJSObjects:h,cleanup:A,setModels:g,setAndFitModels:y,axesHelperVisible:L,toggleAxesVisibility:B,zoomIn:D,zoomOut:$}=x.useThreeJS(r),{isAnimating:z,toggleAnimation:W,startAnimation:vt,stopAnimation:H}=x.useAnimation(h,C),{isClipping:J,activeClippingAxis:Y,toggleClipping:Q,updateClippingPlanes:ee}=x.useClipping(h,C),te=()=>{B()},ne=i=>{Y.value=i,ee()},j=i=>{l.value=!0,c.value=i,i==="剖面视图"&&!J.value&&Q()},q=i=>{f.value=!0,u.value=i},X=e.ref([]),P=e.ref([]),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),re=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),le=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCpt}),T=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isNc}),Z=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let k=e.shallowRef(),E=e.shallowRef();const se=()=>{const{scene:i}=h();k.value&&i&&(x.disposeObj(k.value,i),k.value=null)},ie=()=>{const{scene:i}=h();E.value&&i&&(x.disposeObj(E.value,i),E.value=null)},O=()=>{se(),ie()},ae=async i=>{const d=URL.createObjectURL(i),M=await p.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(M)){X.value=await Ge(M,o.trackFileType)||[];const b=X.value;oe.value&&(k.value=Se(h,b)),(re.value||le.value||T.value)&&(k.value=Je(h,b))}},ce=async()=>{var i,d;E.value=ye(),P.value=Ke(X.value),P.value&&P.value.length&&(S(E.value,P.value[0],k.value,new p.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},G=async i=>{O(),await ae(i),k.value&&x.frameCameraToObject3D(h,k.value),T.value&&ce()};e.watch(()=>Z.value,async i=>{i&&await G(i)},{immediate:!0,deep:!0});const ue=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await G(Z.value)},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},me=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},pe=()=>{_(),e.nextTick(()=>{r.value&&(F=new ResizeObserver(V),F.observe(r.value))});const i=h();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},he=()=>{F&&F.disconnect(),z.value&&H(),O(),A()};let F=null;return e.onMounted(async()=>{try{pe()}catch(i){console.error("Three.js 初始化失败:",i),I.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{he()}),(i,d)=>{const M=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ue,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref($)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(W),title:e.unref(z)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"button-left",{switchRightPanel:j},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:d[0]||(d[0]=b=>j("场景树")),active:l.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=b=>j("剖面视图")),active:l.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=b=>q("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=b=>q("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:me}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:fe})]),e.withDirectives(e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(c.value),1),e.createElementVNode("span",{class:"close",onClick:d[4]||(d[4]=b=>l.value=!1)}," X ")]),e.createElementVNode("div",st,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(K.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(x.ClippingPanel,{key:1,value:e.unref(Y),onChange:ne},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,l.value]]),e.withDirectives(e.createElementVNode("div",it,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=b=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(K.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(k),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ut,[d[6]||(d[6]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0)])}}}),ft=R._export_sfc(dt,[["__scopeId","data-v-7178b621"]]);exports.default=ft;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-B1otHnDa.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs"),I=require("./index-y1mE3_ai.cjs"),K=require("./urdfTree-j7pQuwXM.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CUM54R6L.cjs"),ge=require("./isString-MUYgjroV.cjs");function ye(t=.5,o=4){const r=new p.Mesh(new p.ConeGeometry(t,o,32),new p.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),s=r.geometry.parameters.height;return r.geometry.translate(0,-s/2,0),r.rotation.set(-90,0,0,"XYZ"),r}function Ce(t,o){t.position.copy(o)}function we(t,o,r=new p.Color(16711680)){const s=new p.Vector3;o.getWorldPosition(s);const a=t.geometry.attributes.position,n=t.geometry.attributes.color,l=new p.Color(55551);let c=1/0,f=-1;for(let u=0;u<a.count;u++){const v=new p.Vector3().fromBufferAttribute(a,u).distanceTo(s);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)l.toArray(n.array,u*3);if(f!==-1){const u=r.toArray(),m=f*3+2;for(let v=0;v<m;v=v+3)n.array[v]=u[0],n.array[v+1]=u[1],n.array[v+2]=u[2]}n.needsUpdate=!0}function S(t,o,r,s=new p.Color(16711680)){Ce(t,o),we(r,t,s)}const ke={class:"panel-content"},_e={class:"animation-controls"},Ve={class:"control-row"},be={class:"control-row"},Ne={class:"frame-info"},Te={class:"control-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(t,{expose:o,emit:r}){const s=t,a=e.computed(()=>s.vectors),n=e.ref(!1),l=e.ref(0),c=e.ref(100);let f=!1;const u=g=>`第 ${g+1} 帧`,m=g=>{if(g<0||g>=a.value.length){console.error(`帧索引 ${g} 超出范围`);return}const y=a.value[g];l.value=g,S(s.knife,y,s.cloud)},v=async()=>{if(a.value.length===0){I.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,a.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<a.value.length&&!f;g++)await new Promise(y=>setTimeout(y,c.value)),m(g);f||I.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,I.ElMessage.info("动画已停止")},N=g=>{n.value&&C(),m(g)},_=()=>{n.value&&C(),!(l.value+1>=a.value.length)&&m(l.value+1)},V=()=>{n.value&&C(),l.value!==0&&m(l.value-1)},h=()=>{l.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:_,backwardFrame:V,resetAnimationFrame:h,reset:async()=>{await C(),h()}}),(g,y)=>{const L=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),$=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",Ve,[e.createVNode(D,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(B,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(L,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=z=>c.value=z),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",be,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode($,{modelValue:l.value,"onUpdate:modelValue":y[1]||(y[1]=z=>l.value=z),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),xe=R._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function ze(t){const o=[];return t.forEach(r=>{const[s,a,n]=r.trim().split(/\s+/);o.push(+s,+a,+n)}),o}function U(t,o,r){switch(t){case"X":o.x=+r||0;break;case"Y":o.y=+r||0;break;case"Z":o.z=+r||0;break}}function Ae(t){const o=[],r=["X","Y","Z"];return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=r.find(v=>v===u);if(m){l&&U(l,a,c),c="",l=m;continue}c=c+u}U(l,a,c),o.push(a.x,a.y,a.z)}),o}const Pe=t=>t==null?void 0:t.filter(r=>r.includes("=")),Me=t=>t.replace(/,/g,""),Fe=t=>t==null?void 0:t.map(r=>Me(r)),Ie=t=>{const o=Pe(t);return Fe(o)};function Ue(t){const o=Ie(t),r=[];return o.forEach(s=>{var v,C,N,_,V,h;let[a,n,l,c]=s.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),l=(C=l==null?void 0:l.trim)==null?void 0:C.call(l),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(_=n==null?void 0:n.split)==null?void 0:_.call(n,"="),[,u]=(V=l==null?void 0:l.split)==null?void 0:V.call(l,"="),[,m]=(h=c==null?void 0:c.split)==null?void 0:h.call(c,"=");r.push(+f,+u,+m)}),r}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function $e(t){return Le(t)||Be(t)||De(t)}function je(t){const o=[],r=new Set(["X","Y","Z"]);return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f];if(u==="T")break;const m=r.has(u)?u:null,v=$e(u);if(m||!v){l&&U(l,a,c),l=m,c="";continue}c=c+u}l&&U(l,a,c),o.push(a.x,a.y,a.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var a,n;const o=(a=t==null?void 0:t.trim())==null?void 0:a.split(/\r?\n/);if(qe(t))return Ue(o);const r=o==null?void 0:o[0],s=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\s+/);if((s==null?void 0:s.length)>=3)return ze(o);if((s==null?void 0:s.length)===1)return Ae(o)}async function Ye(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Ze(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Oe(t){let o=t.trim().split(/\r?\n/);return o=o.filter(s=>{const a=s.startsWith("X")||s.startsWith("Y")||s.startsWith("Z"),n=s.startsWith("G")&&(s.includes("X")||s.includes("Y")||s.includes("Z")),l=s.startsWith("N")&&(s.includes("X")||s.includes("Y")||s.includes("Z"));return a||n||l}),je(o)}async function Ge(t,o){const{isCyd:r,isUv:s,isCpt:a,isNc:n}=o;return s?Xe(t):r?Ze(t):a?Ye(t):n?Oe(t):[]}function Ke(t){const o=[];for(let r=0;r<t.length;r+=3)o.push(new p.Vector3(t[r],t[r+1],t[r+2]));return o}function Re(t){const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new p.LineBasicMaterial({color:55551,linewidth:3});return new p.Line(o,r)}function Se(t,o){if(!o||o.length<3)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=Re(o);return l.name="轨迹路径",r.add(l),l}function We(t,o,r,s=4,a=50){let n=1/0,l=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let h=0;h<t.length;h+=3){const A=t[h],g=t[h+1],y=t[h+2];n=Math.min(n,A),l=Math.max(l,A),c=Math.min(c,g),f=Math.max(f,g),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((l-n)**2+(f-c)**2+(m-u)**2)*.05,N=p.MathUtils.degToRad(o.fov),_=2*Math.tan(N/2)*a,V=C/_*r.domElement.height*(s/4);return Math.min(.4,V)}function He(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)r[n]=0,r[n+1]=.847,r[n+2]=1;o.setAttribute("color",new p.BufferAttribute(r,3));const s=new p.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),a=new p.Points(o,s);return s.needsUpdate=!0,a}function Je(t,o){if(!o)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=He(o);if(!l)return;l.name="轨迹路径",r.add(l);const c=We(o,s,a,.1,50);return l.material.size=c,l}const Qe={class:"obj-viewer-container"},et={class:"buttonGroup-topLeft"},tt={class:"buttonGroup-left"},nt={class:"buttonGroup-right"},ot={class:"buttonGroup-bottom"},rt={class:"left-panel"},lt={class:"panel-header"},st={class:"panel-body"},it={class:"right-panel"},at={class:"panel-header"},ct={class:"panel-body"},ut={key:0,class:"loading-overlay"},dt=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(t){const o=t,r=e.ref(null),s=e.ref(!1),a=e.ref(""),n=e.ref(),l=e.ref(!1),c=e.ref(""),f=e.ref(!1),u=e.ref(""),m=e.shallowRef(null),v=e.shallowRef(null),{currentModels:C,resetView:N,initThreeJS:_,handleResize:V,getThreeJSObjects:h,cleanup:A,setModels:g,setAndFitModels:y,axesHelperVisible:L,toggleAxesVisibility:B,zoomIn:D,zoomOut:$}=x.useThreeJS(r),{isAnimating:z,toggleAnimation:W,startAnimation:vt,stopAnimation:H}=x.useAnimation(h,C),{isClipping:J,activeClippingAxis:Y,toggleClipping:Q,updateClippingPlanes:ee}=x.useClipping(h,C),te=()=>{B()},ne=i=>{Y.value=i,ee()},j=i=>{l.value=!0,c.value=i,i==="剖面视图"&&!J.value&&Q()},q=i=>{f.value=!0,u.value=i},X=e.ref([]),P=e.ref([]),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),re=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),le=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCpt}),T=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isNc}),Z=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let k=e.shallowRef(),E=e.shallowRef();const se=()=>{const{scene:i}=h();k.value&&i&&(x.disposeObj(k.value,i),k.value=null)},ie=()=>{const{scene:i}=h();E.value&&i&&(x.disposeObj(E.value,i),E.value=null)},O=()=>{se(),ie()},ae=async i=>{const d=URL.createObjectURL(i),M=await p.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(M)){X.value=await Ge(M,o.trackFileType)||[];const b=X.value;oe.value&&(k.value=Se(h,b)),(re.value||le.value||T.value)&&(k.value=Je(h,b))}},ce=async()=>{var i,d;E.value=ye(),P.value=Ke(X.value),P.value&&P.value.length&&(S(E.value,P.value[0],k.value,new p.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},G=async i=>{O(),await ae(i),k.value&&x.frameCameraToObject3D(h,k.value),T.value&&ce()};e.watch(()=>Z.value,async i=>{i&&await G(i)},{immediate:!0,deep:!0});const ue=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await G(Z.value)},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},me=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},pe=()=>{_(),e.nextTick(()=>{r.value&&(F=new ResizeObserver(V),F.observe(r.value))});const i=h();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},he=()=>{F&&F.disconnect(),z.value&&H(),O(),A()};let F=null;return e.onMounted(async()=>{try{pe()}catch(i){console.error("Three.js 初始化失败:",i),I.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{he()}),(i,d)=>{const M=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ue,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref($)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(W),title:e.unref(z)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"button-left",{switchRightPanel:j},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:d[0]||(d[0]=b=>j("场景树")),active:l.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=b=>j("剖面视图")),active:l.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=b=>q("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=b=>q("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:me}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:fe})]),e.withDirectives(e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(c.value),1),e.createElementVNode("span",{class:"close",onClick:d[4]||(d[4]=b=>l.value=!1)}," X ")]),e.createElementVNode("div",st,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(K.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(x.ClippingPanel,{key:1,value:e.unref(Y),onChange:ne},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,l.value]]),e.withDirectives(e.createElementVNode("div",it,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=b=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(K.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(k),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ut,[d[6]||(d[6]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0)])}}}),ft=R._export_sfc(dt,[["__scopeId","data-v-7178b621"]]);exports.default=ft;
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),h=require("./index-y1mE3_ai.cjs"),b=require("./index-C5woD5Cw.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B_P-I7Kf.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={SINGLE:"单机",DOUBLE:"双机"},N={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},I=h.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function O(){const v=b.useMenuState(h.pinia),{platform:g}=h.storeToRefs(v),P=I(h.pinia),c=["uv","cyd","nc"],d=["urdf"],r=["obj","stl"],T=[...c,...d,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),m=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},p=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},u=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1,isNc:!1};const o=l(t),a=c==null?void 0:c.find(k=>k===o);return{isCpt:a==="cpt",isCyd:a==="cyd",isUv:a==="uv",isNc:a==="nc"}},_=t=>{if(!t)return!1;const o=l(t);return d==null?void 0:d.includes(o)},B=t=>C()&&m(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:p,isThreeFile:m,isUseBackdrop:B,initTrackFileType:u,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let a=0;a<t.length;a++){const w=t[a],k=n(w);o.push(k)}return o}}}const V={class:"three-platform mv-inline"},A={class:"top-menu"},M={key:4,class:"loading"},H=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-CU32CHkR.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-BGQ5FlOC.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-Bmtfv7VK.cjs"))),d=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-CBw9wJUT.cjs"))),r=v,T=b.useMenuState(h.pinia),{platName:f}=h.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=O(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),m=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),p=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return i.ROBOT_SCENE;case"track":return i.TRACK_PATH;case"cpmpip":return i.CPMPIP_SCENE;case"preview":return i.PREVIEW}return(f==null?void 0:f.value)===S.platNameConstants.CPMPIP&&y(m.value)?i.CPMPIP_SCENE:(f==null?void 0:f.value)===S.platNameConstants.ROBOT&&y(m.value)?i.ROBOT_SCENE:C(m.value)&&E.value?i.TRACK_PATH:i.PREVIEW}),u=e.ref([]),_=e.ref(!1);async function B(n){if(!n||!n.length){u.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));u.value=s}catch(s){console.error("文件下载时发生错误:",s),u.value=[]}finally{_.value=!1}}return e.watch(()=>l.value,async n=>{await B(n||[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",A,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),p.value===e.unref(i).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):p.value===e.unref(i).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileBlobs:u.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData","trackFileType"])):p.value===e.unref(i).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(d),{key:2,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):p.value===e.unref(i).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,fileBlobs:u.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",M," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),D=F._export_sfc(H,[["__scopeId","data-v-9798f55b"]]),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=D;exports.robotMode=R;exports.sceneType=N;exports.threeViewerHost=$;exports.useThreeState=I;exports.useThreeSystem=O;
1
+ "use strict";const e=require("vue"),h=require("./index-y1mE3_ai.cjs"),b=require("./index-C5woD5Cw.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B7Adlltj.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={SINGLE:"单机",DOUBLE:"双机"},N={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},I=h.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function O(){const v=b.useMenuState(h.pinia),{platform:g}=h.storeToRefs(v),P=I(h.pinia),c=["uv","cyd","nc"],d=["urdf"],r=["obj","stl"],T=[...c,...d,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),m=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},p=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},u=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1,isNc:!1};const o=l(t),a=c==null?void 0:c.find(k=>k===o);return{isCpt:a==="cpt",isCyd:a==="cyd",isUv:a==="uv",isNc:a==="nc"}},_=t=>{if(!t)return!1;const o=l(t);return d==null?void 0:d.includes(o)},B=t=>C()&&m(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:p,isThreeFile:m,isUseBackdrop:B,initTrackFileType:u,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let a=0;a<t.length;a++){const w=t[a],k=n(w);o.push(k)}return o}}}const V={class:"three-platform mv-inline"},A={class:"top-menu"},M={key:4,class:"loading"},H=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-R3C2C5mu.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-6K0uX_kn.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-BYJQxkco.cjs"))),d=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-D5GmzScE.cjs"))),r=v,T=b.useMenuState(h.pinia),{platName:f}=h.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=O(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),m=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),p=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return i.ROBOT_SCENE;case"track":return i.TRACK_PATH;case"cpmpip":return i.CPMPIP_SCENE;case"preview":return i.PREVIEW}return(f==null?void 0:f.value)===S.platNameConstants.CPMPIP&&y(m.value)?i.CPMPIP_SCENE:(f==null?void 0:f.value)===S.platNameConstants.ROBOT&&y(m.value)?i.ROBOT_SCENE:C(m.value)&&E.value?i.TRACK_PATH:i.PREVIEW}),u=e.ref([]),_=e.ref(!1);async function B(n){if(!n||!n.length){u.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));u.value=s}catch(s){console.error("文件下载时发生错误:",s),u.value=[]}finally{_.value=!1}}return e.watch(()=>l.value,async n=>{await B(n||[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",A,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),p.value===e.unref(i).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):p.value===e.unref(i).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileBlobs:u.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData","trackFileType"])):p.value===e.unref(i).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(d),{key:2,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):p.value===e.unref(i).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,fileBlobs:u.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",M," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),D=F._export_sfc(H,[["__scopeId","data-v-9798f55b"]]),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=D;exports.robotMode=R;exports.sceneType=N;exports.threeViewerHost=$;exports.useThreeState=I;exports.useThreeSystem=O;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as U, defineAsyncComponent as b, computed as I, ref as R, watch as H, createElementBlock as N, openBlock as T, createElementVNode as W, createBlock as B, createCommentVNode as V, renderSlot as u, unref as m, withCtx as d } from "vue";
2
2
  import { bS as K, p as D, s as A } from "./index-KFoWHXov.js";
3
3
  import { u as $ } from "./index-Dh_LOm8w.js";
4
- import { c as j, aW as M, aX as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
4
+ import { c as j, aW as M, aX as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
5
5
  import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const se = {
7
7
  SINGLE: "单机",
@@ -113,7 +113,7 @@ const Y = { class: "three-platform mv-inline" }, q = { class: "top-menu" }, J =
113
113
  height: { default: "100%" }
114
114
  },
115
115
  setup(E) {
116
- const O = b(() => import("./threeSceneView-DmtE3lwc.js")), y = b(() => import("./threePreview-B-2nMWcI.js")), i = b(() => import("./threeTrackPathView-DcR0RXPb.js")), p = b(() => import("./threeSceneViewForCPMPIP-Cc9J6xz6.js")), n = E, P = $(D), { platName: f } = A(P), { isUrdf: _, isTrackPathFile: g } = X(), c = I(() => {
116
+ const O = b(() => import("./threeSceneView-DKe-yheh.js")), y = b(() => import("./threePreview-B2c38aNi.js")), i = b(() => import("./threeTrackPathView-AOVKXiLQ.js")), p = b(() => import("./threeSceneViewForCPMPIP-B8KV3E55.js")), n = E, P = $(D), { platName: f } = A(P), { isUrdf: _, isTrackPathFile: g } = X(), c = I(() => {
117
117
  var t;
118
118
  return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
119
119
  const { url: e } = s;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as I, ref as F, watch as M, onMounted as C, onUnmounted as E, createElementBlock as m, openBlock as f, Fragment as P, renderList as T, createElementVNode as c, createCommentVNode as U, toDisplayString as h, computed as L, resolveComponent as S, createVNode as A } from "vue";
2
- import { ap as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DeWDRnK-.js";
2
+ import { ap as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DoTLasl4.js";
3
3
  import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const D = (i, a) => {
5
5
  if (!a)