ss-component-new 1.2.89 → 1.2.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{MTLLoader-D80GV1WB.cjs → MTLLoader-B7nny5Fq.cjs} +1 -1
  2. package/dist/{MTLLoader-B5xRp-vz.js → MTLLoader-BFJXexXd.js} +1 -1
  3. package/dist/{OrbitControls-Dh9PyFO4.js → OrbitControls-C9jawbH9.js} +1 -1
  4. package/dist/{OrbitControls-CqIpswqa.cjs → OrbitControls-xaR75UGu.cjs} +1 -1
  5. package/dist/{animationData-BceOYz3t.cjs → animationData-CBP3-eEz.cjs} +1 -1
  6. package/dist/{animationData-cz9yaraV.js → animationData-CgRkXv4t.js} +1 -1
  7. package/dist/{iconfont-0T5xTLj8.cjs → iconfont-CP5tSbKZ.cjs} +1 -1
  8. package/dist/{iconfont-DN8mra_i.js → iconfont-CjxxsF1M.js} +2 -2
  9. package/dist/{index-gEhfvrw9.js → index-1K0-Lril.js} +3 -3
  10. package/dist/{index-DnWV9aik.js → index-4C4_axeD.js} +1 -1
  11. package/dist/{index-KosCsYsR.cjs → index-5IXozXfb.cjs} +1 -1
  12. package/dist/{index-CvNF7UrX.cjs → index-7Birt--o.cjs} +1 -1
  13. package/dist/{index-CrJ-2GSh.cjs → index-7slO1Rxz.cjs} +1 -1
  14. package/dist/{index-DHSqydCb.js → index-8zvR_tOe.js} +1 -1
  15. package/dist/{index-CZQcTyH7.cjs → index-B2gEqMwz.cjs} +1 -1
  16. package/dist/{index-fbsH9PEh.js → index-B8bmwRCI.js} +1 -1
  17. package/dist/{index-7pAPxJKA.js → index-BAhJFVq5.js} +2 -2
  18. package/dist/{index-CZLI4UKD.js → index-BEvmMS0i.js} +1 -1
  19. package/dist/{index-BBedBiu1.js → index-BMP_6QMQ.js} +4 -4
  20. package/dist/{index-CZ6HZJE2.js → index-BQ2epFRD.js} +1 -1
  21. package/dist/{index-DGA9Umxw.cjs → index-BXnPM7aS.cjs} +1 -1
  22. package/dist/{index-_NRJBGmA.js → index-B_PGXhqu.js} +1 -1
  23. package/dist/{index-DwP4dBya.js → index-Bb1-JDSj.js} +2 -2
  24. package/dist/{index-BeEVAZ15.cjs → index-BekTYc0y.cjs} +1 -1
  25. package/dist/{index-BdwtuRne.cjs → index-BlCQ16SZ.cjs} +1 -1
  26. package/dist/{index-Cui0eEum.cjs → index-BtAr_AHh.cjs} +1 -1
  27. package/dist/{index-XAGbFQyj.cjs → index-BuBu-8ML.cjs} +1 -1
  28. package/dist/{index-CF3EDmxa.js → index-C-L7sbsd.js} +421 -418
  29. package/dist/{index-pPR2Vmk4.js → index-C3T-KdRt.js} +1 -1
  30. package/dist/{index-D4L62Ng5.cjs → index-C8yBntW8.cjs} +1 -1
  31. package/dist/{index-Ckha_JO6.js → index-CETcLmm9.js} +3 -3
  32. package/dist/{index-m_VPPkQD.cjs → index-CP7aP3gS.cjs} +1 -1
  33. package/dist/{index-kJYCjFRC.cjs → index-CUEf5Kz5.cjs} +1 -1
  34. package/dist/{index-VAIyDbcT.js → index-D9EZRG95.js} +1 -1
  35. package/dist/{index-DLF-rZp-.js → index-DFI9yzK6.js} +13 -13
  36. package/dist/{index-Cx6WbHc4.cjs → index-DG16Kf33.cjs} +1 -1
  37. package/dist/{index-TvxCcWL3.cjs → index-DUVWJUDm.cjs} +1 -1
  38. package/dist/{index-Go9mCE8z.cjs → index-DYPr6Y5L.cjs} +1 -1
  39. package/dist/{index-Do55CjH4.cjs → index-Dp0Qfw7S.cjs} +1 -1
  40. package/dist/{index-CewrcECw.js → index-Dp6H2nKE.js} +1 -1
  41. package/dist/{index-DmWD_94x.cjs → index-DqVT7oIp.cjs} +1 -1
  42. package/dist/{index-DlmzYZjv.js → index-DvGuZe_T.js} +3 -3
  43. package/dist/{index-C3TG-567.js → index-Ebo1c622.js} +1 -1
  44. package/dist/{index-BBcGTAcF.js → index-Vsjvei0H.js} +2 -2
  45. package/dist/{index-Cx0e9wI7.cjs → index-aQEd-0P6.cjs} +1 -1
  46. package/dist/{index-BMd3PTaa.cjs → index-aSIQAW_v.cjs} +1 -1
  47. package/dist/{index-HaBsmo21.js → index-dDyNP3sZ.js} +6 -6
  48. package/dist/{index-BIFWKFgy.cjs → index-ihwK0f5N.cjs} +1 -1
  49. package/dist/{index-Bs_LoZjG.js → index-q5RVI5cd.js} +3 -3
  50. package/dist/{index-BMsn8UNC.cjs → index-vOASo2vq.cjs} +1 -1
  51. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Dsh8O5SA.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CFsZEbkA.js} +6 -6
  52. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D33Zn0tl.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DecIEtG7.cjs} +1 -1
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs} +58 -58
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DKwIZnH1.js} +1647 -1642
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-axNB8U_I.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-B10uDdFf.js} +3 -3
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BrA_L4QZ.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-BX54cUHO.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_1_lang-BLhks2a1.js → index.vue_vue_type_style_index_1_lang-B-okL2FZ.js} +3 -3
  58. package/dist/{index.vue_vue_type_style_index_1_lang-DmKFKo03.cjs → index.vue_vue_type_style_index_1_lang-CTa9TwBd.cjs} +1 -1
  59. package/dist/{main-CtXTseBB.cjs → main-Cwa67iI0.cjs} +1 -1
  60. package/dist/{main-uXXF2UAJ.js → main-t0azuc9l.js} +2 -2
  61. package/dist/obj/model.mtl +42 -0
  62. package/dist/obj/model.obj +26110 -0
  63. package/dist/ss-component.cjs +1 -1
  64. package/dist/ss-component.js +9 -9
  65. package/dist/ss-component2.cjs +1 -1
  66. package/dist/ss-component2.js +10 -10
  67. package/dist/{threeModel-OGJISKHI.cjs → threeModel-BsTUf7j3.cjs} +1 -1
  68. package/dist/{threeModel-CzOa_LSd.js → threeModel-Byx2BFHA.js} +4 -4
  69. package/dist/{threePreview-Dmaba2U-.js → threePreview-B9a62AVY.js} +3 -3
  70. package/dist/{threePreview-B9kbeN1y.cjs → threePreview-DGcEWlwZ.cjs} +1 -1
  71. package/dist/{threeSceneView-Fsu73EkI.cjs → threeSceneView-BYc0Z0CJ.cjs} +1 -1
  72. package/dist/{threeSceneView-Ct0gR37j.js → threeSceneView-C59wI_1_.js} +6 -6
  73. package/dist/{threeSceneViewForCPMPIP-DgzzW1p5.js → threeSceneViewForCPMPIP-BslGbi80.js} +7 -7
  74. package/dist/{threeSceneViewForCPMPIP-BEKYa0p7.cjs → threeSceneViewForCPMPIP-kGIus7ge.cjs} +1 -1
  75. package/dist/{threeTrackPathView-lhebTqR7.cjs → threeTrackPathView-C5outYjx.cjs} +2 -2
  76. package/dist/{threeTrackPathView-DejvRIf1.js → threeTrackPathView-CNiRDEIa.js} +7 -5
  77. package/dist/{threeViewerHost-BZOpA6mF.js → threeViewerHost-C2iVAVlI.js} +2 -2
  78. package/dist/{threeViewerHost-cIBL_Tao.cjs → threeViewerHost-D3ZmD_As.cjs} +2 -2
  79. package/dist/{urdfTree-CWwnorES.cjs → urdfTree-DEo6cc0y.cjs} +1 -1
  80. package/dist/{urdfTree-DIyCunQo.js → urdfTree-D_oX4idQ.js} +1 -1
  81. package/dist/{workpieceTreePanel-UKomlBEL.js → workpieceTreePanel--92uvFwB.js} +5 -5
  82. package/dist/{workpieceTreePanel-CTj1J8en.cjs → workpieceTreePanel-C0Lq3HIU.cjs} +1 -1
  83. package/package.json +1 -1
  84. package/public/obj/model.mtl +42 -0
  85. package/public/obj/model.obj +26110 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),B=require("./iconfont-0T5xTLj8.cjs"),d=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs"),W=require("./index-C8qRkCgn.cjs"),U=require("./MTLLoader-D80GV1WB.cjs"),D=require("./svgIcon-CUM54R6L.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Y(f,t){if(t===d.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===d.TriangleFanDrawMode||t===d.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const i=e.count-2,n=[];if(t===d.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=f.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),f}class re extends d.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new le(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Ae(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=d.LoaderUtils.extractUrlBase(t);r=d.LoaderUtils.resolveURL(c,this.path)}else r=d.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 d.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 _e(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 De(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 ae;break;case M.KHR_DRACO_MESH_COMPRESSION:r[l]=new Se(s,this.dracoLoader);break;case M.KHR_TEXTURE_TRANSFORM:r[l]=new ye;break;case M.KHR_MESH_QUANTIZATION:r[l]=new we;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 ie(){let f={};return{get:function(t){return f[t]},add:function(t,e){f[t]=e},remove:function(t){delete f[t]},removeAll:function(){f={}}}}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 oe{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 d.Color(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],d.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new d.DirectionalLight(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new d.PointLight(u),c.distance=l;break;case"spot":c=new d.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 ae{constructor(){this.name=M.KHR_MATERIALS_UNLIT}getMaterialType(){return d.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new d.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],d.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,d.SRGBColorSpace))}return Promise.all(n)}}class ce{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 le{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:d.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 d.Vector2(a,a)}return Promise.all(s)}}class ue{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:d.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 de{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:d.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 fe{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:d.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 d.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],d.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,d.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class he{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:d.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 pe{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:d.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 d.Color().setRGB(a[0],a[1],a[2],d.LinearSRGBColorSpace),Promise.all(s)}}class me{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:d.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 ge{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:d.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 d.Color().setRGB(a[0],a[1],a[2],d.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,d.SRGBColorSpace)),Promise.all(s)}}class Te{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:d.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 Re{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:d.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 xe{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 Ee{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 Me{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 Le{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(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(m),u,l,h,n.mode,n.filter),m})})}else return null}}class Ae{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!==I.TRIANGLES&&c.mode!==I.TRIANGLE_STRIP&&c.mode!==I.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,m=[];for(const g of l){const E=new d.Matrix4,T=new d.Vector3,R=new d.Quaternion,L=new d.Vector3(1,1,1),S=new d.InstancedMesh(g.geometry,g.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&&L.fromBufferAttribute(o.SCALE,x),S.setMatrixAt(x,E.compose(T,R,L));for(const x in o)if(x==="_COLOR_0"){const N=o[x];S.instanceColor=new d.InstancedBufferAttribute(N.array,N.itemSize,N.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,o[x]);d.Object3D.prototype.copy.call(S,g),this.parser.assignFinalMaterial(S),m.push(S)}return u.isGroup?(u.clear(),u.add(...m),u):m[0]}))}}const ee="glTF",G=12,$={JSON:1313821514,BIN:5130562};class _e{constructor(t){this.name=M.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,G),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-G,s=new DataView(t,G);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,G+r,a);this.content=i.decode(c)}else if(o===$.BIN){const c=G+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Se{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]],m=H[h.componentType];c[l]=m.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(u){return new Promise(function(l,h){n.decodeDracoFile(u,function(m){for(const g in m.attributes){const E=m.attributes[g],T=o[g];T!==void 0&&(E.normalized=T)}l(m)},a,c,d.LinearSRGBColorSpace,h)})})}}class ye{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 we{constructor(){this.name=M.KHR_MESH_QUANTIZATION}}class te extends d.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,m=h*l,g=t*c,E=g-c,T=-2*m+3*h,R=m-h,L=1-T,S=R-h+l;for(let x=0;x!==a;x++){const N=r[E+x+a],C=r[E+x+o]*u,_=r[g+x+a],v=r[g+x]*u;s[x]=L*N+S*C+T*_+R*v}return s}}const be=new d.Quaternion;class Ne extends te{interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return be.fromArray(s).normalize().toArray(s),s}}const I={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},J={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Q={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},V={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"},Ce={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},j={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Ie(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new d.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:d.FrontSide})),f.DefaultMaterial}function F(f,t,e){for(const i in e.extensions)f[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(f,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(f.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ve(f,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(f);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):f.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.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&&(f.morphAttributes.position=u),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function Oe(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)f.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)f.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Pe(f){let t;const e=f.extensions&&f.extensions[M.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+K(e.attributes):t=f.indices+":"+K(f.attributes)+":"+f.mode,f.targets!==void 0)for(let i=0,n=f.targets.length;i<n;i++)t+=":"+K(f.targets[i]);return t}function K(f){let t="";const e=Object.keys(f).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+f[e[i]]+";";return t}function z(f){switch(f){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 ke(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Fe=new d.Matrix4;class De{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ie,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 d.TextureLoader(this.options.manager):this.textureLoader=new d.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new d.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 F(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(d.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=V[n.type],a=H[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new d.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=V[n.type],c=H[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=n.byteOffset||0,m=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,g=n.normalized===!0;let E,T;if(m&&m!==l){const R=Math.floor(h/m),L="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+R+":"+n.count;let S=e.cache.get(L);S||(E=new c(a,R*m,n.count*m/u),S=new d.InterleavedBuffer(E,m/u),e.cache.add(L,S)),T=new d.InterleavedBufferAttribute(S,o,h%m/u,g)}else a===null?E=new c(n.count*o):E=new c(a,h,n.count*o),T=new d.BufferAttribute(E,o,g);if(n.sparse!==void 0){const R=V.SCALAR,L=H[n.sparse.indices.componentType],S=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,N=new L(r[1],S,n.sparse.count*R),C=new c(r[2],x,n.sparse.count*o);a!==null&&(T=new d.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let _=0,v=N.length;_<v;_++){const y=N[_];if(T.setX(y,C[_*o]),o>=2&&T.setY(y,C[_*o+1]),o>=3&&T.setZ(y,C[_*o+2]),o>=4&&T.setW(y,C[_*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=g}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]||d.LinearFilter,u.minFilter=J[h.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=Q[h.wrapS]||d.RepeatWrapping,u.wrapT=Q[h.wrapT]||d.RepeatWrapping,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==d.NearestFilter&&u.minFilter!==d.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,m){let g=h;e.isImageBitmapLoader===!0&&(g=function(E){const T=new d.Texture(E);T.needsUpdate=!0,h(T)}),e.load(d.LoaderUtils.resolveURL(l,s.path),g,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||ke(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 d.PointsMaterial,d.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 d.LineBasicMaterial,d.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 d.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 d.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],d.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,d.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=d.DoubleSide);const u=s.alphaMode||j.OPAQUE;if(u===j.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===j.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==d.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new d.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==d.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==d.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new d.Color().setRGB(l[0],l[1],l[2],d.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==d.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,d.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&&F(n,l,s),l})}createUniqueName(t){const e=d.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=Pe(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 d.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?Ie(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 m=0,g=u.length;m<g;m++){const E=u[m],T=r[m];let R;const L=c[m];if(T.mode===I.TRIANGLES||T.mode===I.TRIANGLE_STRIP||T.mode===I.TRIANGLE_FAN||T.mode===void 0)R=s.isSkinnedMesh===!0?new d.SkinnedMesh(E,L):new d.Mesh(E,L),R.isSkinnedMesh===!0&&R.normalizeSkinWeights(),T.mode===I.TRIANGLE_STRIP?R.geometry=Y(R.geometry,d.TriangleStripDrawMode):T.mode===I.TRIANGLE_FAN&&(R.geometry=Y(R.geometry,d.TriangleFanDrawMode));else if(T.mode===I.LINES)R=new d.LineSegments(E,L);else if(T.mode===I.LINE_STRIP)R=new d.Line(E,L);else if(T.mode===I.LINE_LOOP)R=new d.LineLoop(E,L);else if(T.mode===I.POINTS)R=new d.Points(E,L);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(R.geometry.morphAttributes).length>0&&Oe(R,s),R.name=e.createUniqueName(s.name||"mesh_"+t),O(R,s),T.extensions&&F(n,R,T),e.assignFinalMaterial(R),l.push(R)}for(let m=0,g=l.length;m<g;m++)e.associations.set(l[m],{meshes:t,primitives:m});if(l.length===1)return s.extensions&&F(n,l[0],s),l[0];const h=new d.Group;s.extensions&&F(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,g=l.length;m<g;m++)h.add(l[m]);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 d.PerspectiveCamera(d.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new d.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 d.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 d.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 m=n.channels[l],g=n.samplers[m.sampler],E=m.target,T=E.node,R=n.parameters!==void 0?n.parameters[g.input]:g.input,L=n.parameters!==void 0?n.parameters[g.output]:g.output;E.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",R)),o.push(this.getDependency("accessor",L)),c.push(g),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],m=l[1],g=l[2],E=l[3],T=l[4],R=[];for(let L=0,S=h.length;L<S;L++){const x=h[L],N=m[L],C=g[L],_=E[L],v=T[L];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const y=i._createAnimationTracks(x,N,C,_,v);if(y)for(let P=0;P<y.length;P++)R.push(y[P])}return new d.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(m){m.isSkinnedMesh&&m.bind(h,Fe)});for(let m=0,g=l.length;m<g;m++)u.add(l[m]);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 d.Bone:c.length>1?u=new d.Group:c.length===1?u=c[0]:u=new d.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&&F(i,u,s),s.matrix!==void 0){const l=new d.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 d.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&F(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,m]of n.associations)(h instanceof d.Material||h instanceof d.Texture)&&l.set(h,m);return u.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),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=d.NumberKeyframeTrack;break;case k.rotation:c=d.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=d.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=d.NumberKeyframeTrack;break;case 2:case 3:default:c=d.VectorKeyframeTrack;break}break}const u=n.interpolation!==void 0?Ce[n.interpolation]:d.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,m=o.length;h<m;h++){const g=new c(o[h]+"."+k[s.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}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 d.QuaternionKeyframeTrack?Ne:te;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function He(f,t,e){const i=t.attributes,n=new d.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 d.Vector3(o[0],o[1],o[2]),new d.Vector3(c[0],c[1],c[2])),a.normalized){const u=z(H[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 d.Vector3,o=new d.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],m=h.min,g=h.max;if(m!==void 0&&g!==void 0){if(o.setX(Math.max(Math.abs(m[0]),Math.abs(g[0]))),o.setY(Math.max(Math.abs(m[1]),Math.abs(g[1]))),o.setZ(Math.max(Math.abs(m[2]),Math.abs(g[2]))),h.normalized){const E=z(H[h.componentType]);o.multiplyScalar(E)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new d.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function Z(f,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in i){const a=X[r]||r.toLowerCase();a in f.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!f.index){const r=e.getDependency("accessor",t.indices).then(function(a){f.setIndex(a)});n.push(r)}return d.ColorManagement.workingColorSpace!==d.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${d.ColorManagement.workingColorSpace}" not supported.`),O(f,t),He(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?ve(f,t.targets,e):f})}function Ge(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),i=p.ref(null),n=new U.MTLLoader,s=new U.OBJLoader,r=new U.STLLoader,a=new re;return{isLoading:f,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var m;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],i.value=null;const u=new Map;c.forEach(g=>{g instanceof File&&u.set(g.name.toLowerCase(),g)});const l=[],h=[];try{for(const g of c){const E=g.name||"unknown_file",T=(m=E.split(".").pop())==null?void 0:m.toLowerCase();if(T==="mtl")continue;const R=URL.createObjectURL(g);l.push(R);let L=null;const S=x=>{const N=x.lengthComputable?x.loaded/x.total*100:0;t.value=`正在加载 ${E}... ${Math.round(N)}%`};switch(t.value=`正在加载 ${E}... 0%`,T){case"obj":const x=E.replace(/\.obj$/i,".mtl").toLowerCase();if(u.has(x)){const v=u.get(x),y=URL.createObjectURL(v);l.push(y);const P=await n.loadAsync(y);P.preload(),s.setMaterials(P)}else s.setMaterials(null);L=await s.loadAsync(R,S);break;case"stl":const N=await r.loadAsync(R,S),C=new d.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});L=new d.Mesh(N,C);break;case"gltf":case"glb":L=(await a.loadAsync(R,S)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${E}`;continue}L&&(L.userData.boundingBox=new d.Box3().setFromObject(L),h.push(L))}e.value=h,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),i.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,l.forEach(g=>URL.revokeObjectURL(g))}}}}const Be={class:"obj-viewer-container"},Ue={class:"buttonGroup-topLeft"},Ve={class:"buttonGroup-left"},je={class:"buttonGroup-right"},Ke={class:"left-panel"},Xe={class:"panel-header"},ze={key:0,class:"clipping-content"},qe={class:"radio-group"},We={class:"radio-label"},Ye={class:"radio-label"},$e={class:"radio-label"},Je={class:"radio-label"},Qe={key:0,class:"loading-overlay"},Ze=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),i=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:u,setModels:l,axesHelperVisible:h,toggleAxesVisibility:m}=B.useThreeJS(e),{isLoading:g,loadingProgress:E,loadedModels:T,error:R,loadModelsFromBlobs:L}=Ge(),{isAnimating:S,toggleAnimation:x,stopAnimation:N}=B.useAnimation(c,s),{isClipping:C,activeClippingAxis:_,toggleClipping:v,updateClippingPlanes:y}=B.useClipping(c,s),P=()=>{m()};p.watch(()=>t.fileBlobs,w=>{w&&w.length>0&&L(w).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(T,w=>{w&&w.length>0&&l(w)}),p.watch(R,w=>{w&&W.ElMessage.error(`模型加载失败: ${w}`)});const q=w=>{i.value=!0,n.value=w,w==="剖面视图"&&!C.value&&v()};return p.onMounted(async()=>{await p.nextTick();try{a(),window.addEventListener("resize",o)}catch(w){console.error("Three.js 初始化失败:",w),W.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",window.removeEventListener("resize",o),S.value&&N(),u()}),(w,A)=>{const ne=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",Be,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),A[15]||(A[15]=p.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),p.createElementVNode("div",Ue,[p.createVNode(D.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(D.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),p.createVNode(D.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),p.createVNode(D.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(x),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(D.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(h),onClick:P,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Ve,[p.renderSlot(w.$slots,"button-left",{switchRightPanel:q},void 0,!0),p.createVNode(D.ThreeSvgIcon,{name:"clipping",size:"24",onClick:A[0]||(A[0]=b=>q("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),p.createElementVNode("div",je,[p.renderSlot(w.$slots,"button-right",{},void 0,!0)]),A[16]||(A[16]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Ke,[p.createElementVNode("div",Xe,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[1]||(A[1]=b=>i.value=!1)}," X ")]),p.createVNode(ne,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",ze,[p.createElementVNode("div",qe,[p.createElementVNode("label",We,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[2]||(A[2]=b=>p.isRef(_)?_.value=b:null),onChange:A[3]||(A[3]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ye,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[4]||(A[4]=b=>p.isRef(_)?_.value=b:null),onChange:A[5]||(A[5]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",$e,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[6]||(A[6]=b=>p.isRef(_)?_.value=b:null),onChange:A[7]||(A[7]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[8]||(A[8]=b=>p.isRef(_)?_.value=b:null),onChange:A[9]||(A[9]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[13]||(A[13]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,i.value]]),p.unref(g)?(p.openBlock(),p.createElementBlock("div",Qe,[A[14]||(A[14]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(E)),1)])):p.createCommentVNode("",!0)])}}}),et=se._export_sfc(Ze,[["__scopeId","data-v-0b2f8148"]]);exports.default=et;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),B=require("./iconfont-CP5tSbKZ.cjs"),d=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs"),W=require("./index-C8qRkCgn.cjs"),U=require("./MTLLoader-B7nny5Fq.cjs"),D=require("./svgIcon-CUM54R6L.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Y(f,t){if(t===d.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===d.TriangleFanDrawMode||t===d.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const i=e.count-2,n=[];if(t===d.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=f.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),f}class re extends d.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new le(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Ae(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=d.LoaderUtils.extractUrlBase(t);r=d.LoaderUtils.resolveURL(c,this.path)}else r=d.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 d.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 _e(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 De(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 ae;break;case M.KHR_DRACO_MESH_COMPRESSION:r[l]=new Se(s,this.dracoLoader);break;case M.KHR_TEXTURE_TRANSFORM:r[l]=new ye;break;case M.KHR_MESH_QUANTIZATION:r[l]=new we;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 ie(){let f={};return{get:function(t){return f[t]},add:function(t,e){f[t]=e},remove:function(t){delete f[t]},removeAll:function(){f={}}}}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 oe{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 d.Color(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],d.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new d.DirectionalLight(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new d.PointLight(u),c.distance=l;break;case"spot":c=new d.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 ae{constructor(){this.name=M.KHR_MATERIALS_UNLIT}getMaterialType(){return d.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new d.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],d.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,d.SRGBColorSpace))}return Promise.all(n)}}class ce{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 le{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:d.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 d.Vector2(a,a)}return Promise.all(s)}}class ue{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:d.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 de{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:d.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 fe{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:d.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 d.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],d.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,d.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class he{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:d.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 pe{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:d.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 d.Color().setRGB(a[0],a[1],a[2],d.LinearSRGBColorSpace),Promise.all(s)}}class me{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:d.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 ge{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:d.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 d.Color().setRGB(a[0],a[1],a[2],d.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,d.SRGBColorSpace)),Promise.all(s)}}class Te{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:d.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 Re{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:d.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 xe{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 Ee{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 Me{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 Le{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(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(m),u,l,h,n.mode,n.filter),m})})}else return null}}class Ae{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!==I.TRIANGLES&&c.mode!==I.TRIANGLE_STRIP&&c.mode!==I.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,m=[];for(const g of l){const E=new d.Matrix4,T=new d.Vector3,R=new d.Quaternion,L=new d.Vector3(1,1,1),S=new d.InstancedMesh(g.geometry,g.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&&L.fromBufferAttribute(o.SCALE,x),S.setMatrixAt(x,E.compose(T,R,L));for(const x in o)if(x==="_COLOR_0"){const N=o[x];S.instanceColor=new d.InstancedBufferAttribute(N.array,N.itemSize,N.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,o[x]);d.Object3D.prototype.copy.call(S,g),this.parser.assignFinalMaterial(S),m.push(S)}return u.isGroup?(u.clear(),u.add(...m),u):m[0]}))}}const ee="glTF",G=12,$={JSON:1313821514,BIN:5130562};class _e{constructor(t){this.name=M.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,G),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-G,s=new DataView(t,G);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,G+r,a);this.content=i.decode(c)}else if(o===$.BIN){const c=G+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Se{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]],m=H[h.componentType];c[l]=m.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(u){return new Promise(function(l,h){n.decodeDracoFile(u,function(m){for(const g in m.attributes){const E=m.attributes[g],T=o[g];T!==void 0&&(E.normalized=T)}l(m)},a,c,d.LinearSRGBColorSpace,h)})})}}class ye{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 we{constructor(){this.name=M.KHR_MESH_QUANTIZATION}}class te extends d.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,m=h*l,g=t*c,E=g-c,T=-2*m+3*h,R=m-h,L=1-T,S=R-h+l;for(let x=0;x!==a;x++){const N=r[E+x+a],C=r[E+x+o]*u,_=r[g+x+a],v=r[g+x]*u;s[x]=L*N+S*C+T*_+R*v}return s}}const be=new d.Quaternion;class Ne extends te{interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return be.fromArray(s).normalize().toArray(s),s}}const I={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},J={9728:d.NearestFilter,9729:d.LinearFilter,9984:d.NearestMipmapNearestFilter,9985:d.LinearMipmapNearestFilter,9986:d.NearestMipmapLinearFilter,9987:d.LinearMipmapLinearFilter},Q={33071:d.ClampToEdgeWrapping,33648:d.MirroredRepeatWrapping,10497:d.RepeatWrapping},V={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"},Ce={CUBICSPLINE:void 0,LINEAR:d.InterpolateLinear,STEP:d.InterpolateDiscrete},j={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Ie(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new d.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:d.FrontSide})),f.DefaultMaterial}function F(f,t,e){for(const i in e.extensions)f[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(f,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(f.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ve(f,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(f);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):f.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.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&&(f.morphAttributes.position=u),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function Oe(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)f.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)f.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Pe(f){let t;const e=f.extensions&&f.extensions[M.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+K(e.attributes):t=f.indices+":"+K(f.attributes)+":"+f.mode,f.targets!==void 0)for(let i=0,n=f.targets.length;i<n;i++)t+=":"+K(f.targets[i]);return t}function K(f){let t="";const e=Object.keys(f).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+f[e[i]]+";";return t}function z(f){switch(f){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 ke(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Fe=new d.Matrix4;class De{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ie,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 d.TextureLoader(this.options.manager):this.textureLoader=new d.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new d.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 F(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(d.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=V[n.type],a=H[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new d.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=V[n.type],c=H[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=n.byteOffset||0,m=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,g=n.normalized===!0;let E,T;if(m&&m!==l){const R=Math.floor(h/m),L="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+R+":"+n.count;let S=e.cache.get(L);S||(E=new c(a,R*m,n.count*m/u),S=new d.InterleavedBuffer(E,m/u),e.cache.add(L,S)),T=new d.InterleavedBufferAttribute(S,o,h%m/u,g)}else a===null?E=new c(n.count*o):E=new c(a,h,n.count*o),T=new d.BufferAttribute(E,o,g);if(n.sparse!==void 0){const R=V.SCALAR,L=H[n.sparse.indices.componentType],S=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,N=new L(r[1],S,n.sparse.count*R),C=new c(r[2],x,n.sparse.count*o);a!==null&&(T=new d.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let _=0,v=N.length;_<v;_++){const y=N[_];if(T.setX(y,C[_*o]),o>=2&&T.setY(y,C[_*o+1]),o>=3&&T.setZ(y,C[_*o+2]),o>=4&&T.setW(y,C[_*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=g}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]||d.LinearFilter,u.minFilter=J[h.minFilter]||d.LinearMipmapLinearFilter,u.wrapS=Q[h.wrapS]||d.RepeatWrapping,u.wrapT=Q[h.wrapT]||d.RepeatWrapping,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==d.NearestFilter&&u.minFilter!==d.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,m){let g=h;e.isImageBitmapLoader===!0&&(g=function(E){const T=new d.Texture(E);T.needsUpdate=!0,h(T)}),e.load(d.LoaderUtils.resolveURL(l,s.path),g,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||ke(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 d.PointsMaterial,d.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 d.LineBasicMaterial,d.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 d.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 d.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],d.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,d.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=d.DoubleSide);const u=s.alphaMode||j.OPAQUE;if(u===j.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===j.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==d.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new d.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==d.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==d.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new d.Color().setRGB(l[0],l[1],l[2],d.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==d.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,d.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&&F(n,l,s),l})}createUniqueName(t){const e=d.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=Pe(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 d.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?Ie(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 m=0,g=u.length;m<g;m++){const E=u[m],T=r[m];let R;const L=c[m];if(T.mode===I.TRIANGLES||T.mode===I.TRIANGLE_STRIP||T.mode===I.TRIANGLE_FAN||T.mode===void 0)R=s.isSkinnedMesh===!0?new d.SkinnedMesh(E,L):new d.Mesh(E,L),R.isSkinnedMesh===!0&&R.normalizeSkinWeights(),T.mode===I.TRIANGLE_STRIP?R.geometry=Y(R.geometry,d.TriangleStripDrawMode):T.mode===I.TRIANGLE_FAN&&(R.geometry=Y(R.geometry,d.TriangleFanDrawMode));else if(T.mode===I.LINES)R=new d.LineSegments(E,L);else if(T.mode===I.LINE_STRIP)R=new d.Line(E,L);else if(T.mode===I.LINE_LOOP)R=new d.LineLoop(E,L);else if(T.mode===I.POINTS)R=new d.Points(E,L);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(R.geometry.morphAttributes).length>0&&Oe(R,s),R.name=e.createUniqueName(s.name||"mesh_"+t),O(R,s),T.extensions&&F(n,R,T),e.assignFinalMaterial(R),l.push(R)}for(let m=0,g=l.length;m<g;m++)e.associations.set(l[m],{meshes:t,primitives:m});if(l.length===1)return s.extensions&&F(n,l[0],s),l[0];const h=new d.Group;s.extensions&&F(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,g=l.length;m<g;m++)h.add(l[m]);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 d.PerspectiveCamera(d.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new d.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 d.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 d.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 m=n.channels[l],g=n.samplers[m.sampler],E=m.target,T=E.node,R=n.parameters!==void 0?n.parameters[g.input]:g.input,L=n.parameters!==void 0?n.parameters[g.output]:g.output;E.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",R)),o.push(this.getDependency("accessor",L)),c.push(g),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],m=l[1],g=l[2],E=l[3],T=l[4],R=[];for(let L=0,S=h.length;L<S;L++){const x=h[L],N=m[L],C=g[L],_=E[L],v=T[L];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const y=i._createAnimationTracks(x,N,C,_,v);if(y)for(let P=0;P<y.length;P++)R.push(y[P])}return new d.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(m){m.isSkinnedMesh&&m.bind(h,Fe)});for(let m=0,g=l.length;m<g;m++)u.add(l[m]);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 d.Bone:c.length>1?u=new d.Group:c.length===1?u=c[0]:u=new d.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&&F(i,u,s),s.matrix!==void 0){const l=new d.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 d.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&F(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,m]of n.associations)(h instanceof d.Material||h instanceof d.Texture)&&l.set(h,m);return u.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),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=d.NumberKeyframeTrack;break;case k.rotation:c=d.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=d.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=d.NumberKeyframeTrack;break;case 2:case 3:default:c=d.VectorKeyframeTrack;break}break}const u=n.interpolation!==void 0?Ce[n.interpolation]:d.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,m=o.length;h<m;h++){const g=new c(o[h]+"."+k[s.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}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 d.QuaternionKeyframeTrack?Ne:te;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function He(f,t,e){const i=t.attributes,n=new d.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 d.Vector3(o[0],o[1],o[2]),new d.Vector3(c[0],c[1],c[2])),a.normalized){const u=z(H[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 d.Vector3,o=new d.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],m=h.min,g=h.max;if(m!==void 0&&g!==void 0){if(o.setX(Math.max(Math.abs(m[0]),Math.abs(g[0]))),o.setY(Math.max(Math.abs(m[1]),Math.abs(g[1]))),o.setZ(Math.max(Math.abs(m[2]),Math.abs(g[2]))),h.normalized){const E=z(H[h.componentType]);o.multiplyScalar(E)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new d.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function Z(f,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in i){const a=X[r]||r.toLowerCase();a in f.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!f.index){const r=e.getDependency("accessor",t.indices).then(function(a){f.setIndex(a)});n.push(r)}return d.ColorManagement.workingColorSpace!==d.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${d.ColorManagement.workingColorSpace}" not supported.`),O(f,t),He(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?ve(f,t.targets,e):f})}function Ge(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),i=p.ref(null),n=new U.MTLLoader,s=new U.OBJLoader,r=new U.STLLoader,a=new re;return{isLoading:f,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var m;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],i.value=null;const u=new Map;c.forEach(g=>{g instanceof File&&u.set(g.name.toLowerCase(),g)});const l=[],h=[];try{for(const g of c){const E=g.name||"unknown_file",T=(m=E.split(".").pop())==null?void 0:m.toLowerCase();if(T==="mtl")continue;const R=URL.createObjectURL(g);l.push(R);let L=null;const S=x=>{const N=x.lengthComputable?x.loaded/x.total*100:0;t.value=`正在加载 ${E}... ${Math.round(N)}%`};switch(t.value=`正在加载 ${E}... 0%`,T){case"obj":const x=E.replace(/\.obj$/i,".mtl").toLowerCase();if(u.has(x)){const v=u.get(x),y=URL.createObjectURL(v);l.push(y);const P=await n.loadAsync(y);P.preload(),s.setMaterials(P)}else s.setMaterials(null);L=await s.loadAsync(R,S);break;case"stl":const N=await r.loadAsync(R,S),C=new d.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});L=new d.Mesh(N,C);break;case"gltf":case"glb":L=(await a.loadAsync(R,S)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${E}`;continue}L&&(L.userData.boundingBox=new d.Box3().setFromObject(L),h.push(L))}e.value=h,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),i.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,l.forEach(g=>URL.revokeObjectURL(g))}}}}const Be={class:"obj-viewer-container"},Ue={class:"buttonGroup-topLeft"},Ve={class:"buttonGroup-left"},je={class:"buttonGroup-right"},Ke={class:"left-panel"},Xe={class:"panel-header"},ze={key:0,class:"clipping-content"},qe={class:"radio-group"},We={class:"radio-label"},Ye={class:"radio-label"},$e={class:"radio-label"},Je={class:"radio-label"},Qe={key:0,class:"loading-overlay"},Ze=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),i=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:u,setModels:l,axesHelperVisible:h,toggleAxesVisibility:m}=B.useThreeJS(e),{isLoading:g,loadingProgress:E,loadedModels:T,error:R,loadModelsFromBlobs:L}=Ge(),{isAnimating:S,toggleAnimation:x,stopAnimation:N}=B.useAnimation(c,s),{isClipping:C,activeClippingAxis:_,toggleClipping:v,updateClippingPlanes:y}=B.useClipping(c,s),P=()=>{m()};p.watch(()=>t.fileBlobs,w=>{w&&w.length>0&&L(w).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(T,w=>{w&&w.length>0&&l(w)}),p.watch(R,w=>{w&&W.ElMessage.error(`模型加载失败: ${w}`)});const q=w=>{i.value=!0,n.value=w,w==="剖面视图"&&!C.value&&v()};return p.onMounted(async()=>{await p.nextTick();try{a(),window.addEventListener("resize",o)}catch(w){console.error("Three.js 初始化失败:",w),W.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",window.removeEventListener("resize",o),S.value&&N(),u()}),(w,A)=>{const ne=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",Be,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),A[15]||(A[15]=p.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),p.createElementVNode("div",Ue,[p.createVNode(D.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(D.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),p.createVNode(D.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),p.createVNode(D.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(x),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(D.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(h),onClick:P,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Ve,[p.renderSlot(w.$slots,"button-left",{switchRightPanel:q},void 0,!0),p.createVNode(D.ThreeSvgIcon,{name:"clipping",size:"24",onClick:A[0]||(A[0]=b=>q("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),p.createElementVNode("div",je,[p.renderSlot(w.$slots,"button-right",{},void 0,!0)]),A[16]||(A[16]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Ke,[p.createElementVNode("div",Xe,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[1]||(A[1]=b=>i.value=!1)}," X ")]),p.createVNode(ne,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",ze,[p.createElementVNode("div",qe,[p.createElementVNode("label",We,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[2]||(A[2]=b=>p.isRef(_)?_.value=b:null),onChange:A[3]||(A[3]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ye,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[4]||(A[4]=b=>p.isRef(_)?_.value=b:null),onChange:A[5]||(A[5]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",$e,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[6]||(A[6]=b=>p.isRef(_)?_.value=b:null),onChange:A[7]||(A[7]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[8]||(A[8]=b=>p.isRef(_)?_.value=b:null),onChange:A[9]||(A[9]=(...b)=>p.unref(y)&&p.unref(y)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),A[13]||(A[13]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,i.value]]),p.unref(g)?(p.openBlock(),p.createElementBlock("div",Qe,[A[14]||(A[14]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(E)),1)])):p.createCommentVNode("",!0)])}}}),et=se._export_sfc(Ze,[["__scopeId","data-v-0b2f8148"]]);exports.default=et;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("./workpieceTreePanel-CTj1J8en.cjs"),pe=require("./iconfont-0T5xTLj8.cjs"),$=require("./index-C8qRkCgn.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs");require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-D_6peWlG.cjs");require("./index.vue_vue_type_style_index_1_lang-DmKFKo03.cjs");require("./index-D4EyLxA0.cjs");const Ce=require("./animationData-BceOYz3t.cjs"),ne=require("./urdfTree-CWwnorES.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-DrslFFRT.cjs"),M=require("./svgIcon-CUM54R6L.cjs"),Z=.001,H=s.MathUtils.degToRad,Ne=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Me(V=.005,m=64){const f=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(f,m,V,16,!1),g=Ne;return new s.Mesh(n,g)}const ke=V=>V.reduce((m,f)=>{let n=0;const g=f.Y??0,h=f.C??0,c=f.R??0;return g>0&&(n+=g),h>0&&c>0&&(n+=c*H(h)),m+n},0),Te=V=>{const m=[],f=V.Y??0,n=V.B??0,g=V.C??0,h=V.R??0,c={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!f&&!g)return m;if(m.push(c.pos.clone()),n!==0){const C=new s.Matrix4().makeRotationAxis(c.localY,H(n));c.localX.applyMatrix4(C),c.localZ.applyMatrix4(C)}if(f>0&&(c.pos.add(c.localY.clone().multiplyScalar(f*Z)),m.push(c.pos.clone())),g>0&&h>0){const C=H(g),u=h*Z,_=c.pos.clone().add(c.localX.clone().multiplyScalar(-u)),r=Math.max(16,Math.ceil(g/5));for(let p=1;p<=r;p++){const a=C*p/r,d=new s.Matrix4().makeRotationAxis(c.localZ,a),b=c.localX.clone().multiplyScalar(u).applyMatrix4(d),E=_.clone().add(b);m.push(E)}}return m};function Se(V,m){const f=new s.Group;f.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let g=0,h=1;for(let c=0;c<V.length;c++){const C=V[c],u=C.Y??0,_=C.B??0,r=C.C??0,p=C.R??0;if(_!==0){const a=new s.Matrix4().makeRotationAxis(n.localY,H(_));n.localX.applyMatrix4(a),n.localZ.applyMatrix4(a)}if(u>0){const a=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(u*Z));const d=n.pos.clone(),i=Pe(a,d,m*Z);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:c,length:u,frame:{Y:u,B:_,C:r,R:p}},i.name=`直段_${g}`,f.add(i);const b=a.clone();De(f,h,b,m*Z),g++}if(r>0&&p>0){const a=H(r),d=p*Z,i=[];i.push(n.pos.clone());const b=n.pos.clone().add(n.localX.clone().multiplyScalar(-d)),E=Math.max(16,Math.ceil(r/5));for(let P=1;P<=E;P++){const D=a*P/E,T=new s.Matrix4().makeRotationAxis(n.localZ,D),k=n.localX.clone().multiplyScalar(d).applyMatrix4(T),w=b.clone().add(k);i.push(w)}const v=Re(i,m*Z);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:c,angle:r,radius:p,centerPoint:b.toArray(),frame:{Y:u,B:_,C:r,R:p}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],n.pos=i[i.length-1].clone();const S=new s.Matrix4().makeRotationAxis(n.localZ,a);n.localY.applyMatrix4(S),n.localX.applyMatrix4(S),g++,h++}}return f}function De(V,m,f,n){const g=new s.Vector3(0,n*2,n*5),h=f.clone().add(g),c=[f,h],C=new s.BufferGeometry().setFromPoints(c),u=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),_=new s.Line(C,u);_.computeLineDistances(),V.add(_);const r=document.createElement("canvas"),p=r.getContext("2d");r.width=128,r.height=128,p.clearRect(0,0,128,128),p.fillStyle="#FF0000",p.font="bold 80px Arial",p.textAlign="center",p.textBaseline="middle",p.fillText(m.toString(),64,64);const a=new s.CanvasTexture(r),d=new s.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),i=new s.Sprite(d),b=n*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${m}`,i.userData={labelNumber:m},V.add(i)}function Pe(V,m,f){const n=new s.LineCurve3(V,m),g=new s.TubeGeometry(n,2,f,18,!1);return new s.Mesh(g,Ne)}function Re(V,m){const f=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(f,Math.max(16,V.length*2),m,18,!1);return new s.Mesh(n,Ne)}function _e(V,m,f,n,g,h=0){let c=m.slice(0,g+1);const C=m[g+1];if(C&&h>0){const i={...C,B:(C.B??0)*h,C:(C.C??0)*h};c.push(i)}const u=ke(c),_=Math.max(0,f-u),r=[];r.push(new s.Vector3(0,0,0));const p=new s.Vector3(0,_*Z,0);_>0&&r.push(p);let a={pos:p.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const d=[];for(let i=c.length-1;i>=0;i--){const b=c[i],E=Te(b);if(E.length>0){const v=E.map(T=>{const R=T.clone(),k=new s.Matrix4;return k.makeBasis(a.localX,a.localY,a.localZ),R.applyMatrix4(k),R.add(a.pos)});d.push(v);const S=v[v.length-1];a.pos=S.clone();const P=b.B??0,D=b.C??0;if(P!==0){const T=new s.Matrix4().makeRotationAxis(a.localY,H(P));a.localX.applyMatrix4(T),a.localZ.applyMatrix4(T)}if(D>0){const T=H(D),R=new s.Matrix4().makeRotationAxis(a.localZ,T);a.localY.applyMatrix4(R),a.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new s.Vector3(0,.001,0));try{const i=new s.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,r.length*4),n*Z,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function xe(V,m,f,n=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&n>0){const a={...h,B:(h.B??0)*n,C:(h.C??0)*n};g.push(a)}const c=ke(g),C=Math.max(0,m-c),u=[];u.push(new s.Vector3(0,0,0));const _=new s.Vector3(0,C*Z,0);C>0&&u.push(_);let r={pos:_.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const p=[];for(let a=g.length-1;a>=0;a--){const d=g[a],i=Te(d);if(i.length>0){const b=i.map(P=>{const D=P.clone(),T=new s.Matrix4;return T.makeBasis(r.localX,r.localY,r.localZ),D.applyMatrix4(T),D.add(r.pos)});p.push(b);const E=b[b.length-1];r.pos=E.clone();const v=d.B??0,S=d.C??0;if(v!==0){const P=new s.Matrix4().makeRotationAxis(r.localY,H(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(S>0){const P=H(S),D=new s.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(D),r.localX.applyMatrix4(D)}}}for(const a of p)a.length>1&&u.push(...a.slice(1));return u.length<2&&u.push(new s.Vector3(0,.001,0)),u}function Ee(V,m,f,n,g,h,c,C=0,u=0){const _=g-u,r=xe(n,_,c,C);let a=xe(f,u,c,C);a.forEach(i=>i.y=-i.y),a.reverse();const d=[...a,...r];try{const i=new s.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,d.length*4),h*Z,18,!1);m.geometry.dispose(),V.geometry.dispose(),m.parent&&m.parent.remove(m),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Be={class:"panel-content"},ze={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ie={class:"progress-bar"},Ue={class:"dialog-footer"},je=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:m,emit:f}){const n=V,g=f,h=e.ref(),c=e.ref();e.watch(()=>n.threeData,l=>{const t=l==null?void 0:l.data;c.value=t==null?void 0:t.type},{immediate:!0});const C=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};c.value===X.robotMode.SINGLE&&(t=await Ce.fetchSingleRobotAnimationData()),c.value===X.robotMode.DOUBLE&&(t=await Ce.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:x}=t;D.value=o,T.value=y,R.value=N,h.value=x;const O=$.cloneDeep(h.value),K=ce(F.value),q=(O==null?void 0:O["输出(动画数据)"])||[];u.value=q.length?q:[K]},u=e.ref([]),_=e.ref(!1),r=e.ref(""),p=e.ref(!1),a=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const E=e.ref(null),v=e.shallowRef(null),S=e.shallowRef(null),P=e.shallowRef(null),D=e.ref(0),T=e.ref(12.5),R=e.ref(30),k=e.ref([]),w=e.ref(null),I=e.computed(()=>n.model?ne.getNonFixedJoints(n.model).map(o=>o.name):[]),G=e.ref(["Y","B","C","R"]),F=e.computed(()=>[...I.value,...G.value]),Y=e.computed(()=>F.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("./workpieceTreePanel-C0Lq3HIU.cjs"),pe=require("./iconfont-CP5tSbKZ.cjs"),$=require("./index-C8qRkCgn.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs");require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-D_6peWlG.cjs");require("./index.vue_vue_type_style_index_1_lang-CTa9TwBd.cjs");require("./index-D4EyLxA0.cjs");const Ce=require("./animationData-CBP3-eEz.cjs"),ne=require("./urdfTree-DEo6cc0y.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-DrslFFRT.cjs"),M=require("./svgIcon-CUM54R6L.cjs"),Z=.001,H=s.MathUtils.degToRad,Ne=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Me(V=.005,m=64){const f=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(f,m,V,16,!1),g=Ne;return new s.Mesh(n,g)}const ke=V=>V.reduce((m,f)=>{let n=0;const g=f.Y??0,h=f.C??0,c=f.R??0;return g>0&&(n+=g),h>0&&c>0&&(n+=c*H(h)),m+n},0),Te=V=>{const m=[],f=V.Y??0,n=V.B??0,g=V.C??0,h=V.R??0,c={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!f&&!g)return m;if(m.push(c.pos.clone()),n!==0){const C=new s.Matrix4().makeRotationAxis(c.localY,H(n));c.localX.applyMatrix4(C),c.localZ.applyMatrix4(C)}if(f>0&&(c.pos.add(c.localY.clone().multiplyScalar(f*Z)),m.push(c.pos.clone())),g>0&&h>0){const C=H(g),u=h*Z,_=c.pos.clone().add(c.localX.clone().multiplyScalar(-u)),r=Math.max(16,Math.ceil(g/5));for(let p=1;p<=r;p++){const a=C*p/r,d=new s.Matrix4().makeRotationAxis(c.localZ,a),b=c.localX.clone().multiplyScalar(u).applyMatrix4(d),E=_.clone().add(b);m.push(E)}}return m};function Se(V,m){const f=new s.Group;f.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let g=0,h=1;for(let c=0;c<V.length;c++){const C=V[c],u=C.Y??0,_=C.B??0,r=C.C??0,p=C.R??0;if(_!==0){const a=new s.Matrix4().makeRotationAxis(n.localY,H(_));n.localX.applyMatrix4(a),n.localZ.applyMatrix4(a)}if(u>0){const a=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(u*Z));const d=n.pos.clone(),i=Pe(a,d,m*Z);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:c,length:u,frame:{Y:u,B:_,C:r,R:p}},i.name=`直段_${g}`,f.add(i);const b=a.clone();De(f,h,b,m*Z),g++}if(r>0&&p>0){const a=H(r),d=p*Z,i=[];i.push(n.pos.clone());const b=n.pos.clone().add(n.localX.clone().multiplyScalar(-d)),E=Math.max(16,Math.ceil(r/5));for(let P=1;P<=E;P++){const D=a*P/E,T=new s.Matrix4().makeRotationAxis(n.localZ,D),k=n.localX.clone().multiplyScalar(d).applyMatrix4(T),w=b.clone().add(k);i.push(w)}const v=Re(i,m*Z);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:c,angle:r,radius:p,centerPoint:b.toArray(),frame:{Y:u,B:_,C:r,R:p}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],n.pos=i[i.length-1].clone();const S=new s.Matrix4().makeRotationAxis(n.localZ,a);n.localY.applyMatrix4(S),n.localX.applyMatrix4(S),g++,h++}}return f}function De(V,m,f,n){const g=new s.Vector3(0,n*2,n*5),h=f.clone().add(g),c=[f,h],C=new s.BufferGeometry().setFromPoints(c),u=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),_=new s.Line(C,u);_.computeLineDistances(),V.add(_);const r=document.createElement("canvas"),p=r.getContext("2d");r.width=128,r.height=128,p.clearRect(0,0,128,128),p.fillStyle="#FF0000",p.font="bold 80px Arial",p.textAlign="center",p.textBaseline="middle",p.fillText(m.toString(),64,64);const a=new s.CanvasTexture(r),d=new s.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),i=new s.Sprite(d),b=n*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${m}`,i.userData={labelNumber:m},V.add(i)}function Pe(V,m,f){const n=new s.LineCurve3(V,m),g=new s.TubeGeometry(n,2,f,18,!1);return new s.Mesh(g,Ne)}function Re(V,m){const f=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(f,Math.max(16,V.length*2),m,18,!1);return new s.Mesh(n,Ne)}function _e(V,m,f,n,g,h=0){let c=m.slice(0,g+1);const C=m[g+1];if(C&&h>0){const i={...C,B:(C.B??0)*h,C:(C.C??0)*h};c.push(i)}const u=ke(c),_=Math.max(0,f-u),r=[];r.push(new s.Vector3(0,0,0));const p=new s.Vector3(0,_*Z,0);_>0&&r.push(p);let a={pos:p.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const d=[];for(let i=c.length-1;i>=0;i--){const b=c[i],E=Te(b);if(E.length>0){const v=E.map(T=>{const R=T.clone(),k=new s.Matrix4;return k.makeBasis(a.localX,a.localY,a.localZ),R.applyMatrix4(k),R.add(a.pos)});d.push(v);const S=v[v.length-1];a.pos=S.clone();const P=b.B??0,D=b.C??0;if(P!==0){const T=new s.Matrix4().makeRotationAxis(a.localY,H(P));a.localX.applyMatrix4(T),a.localZ.applyMatrix4(T)}if(D>0){const T=H(D),R=new s.Matrix4().makeRotationAxis(a.localZ,T);a.localY.applyMatrix4(R),a.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new s.Vector3(0,.001,0));try{const i=new s.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,r.length*4),n*Z,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function xe(V,m,f,n=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&n>0){const a={...h,B:(h.B??0)*n,C:(h.C??0)*n};g.push(a)}const c=ke(g),C=Math.max(0,m-c),u=[];u.push(new s.Vector3(0,0,0));const _=new s.Vector3(0,C*Z,0);C>0&&u.push(_);let r={pos:_.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const p=[];for(let a=g.length-1;a>=0;a--){const d=g[a],i=Te(d);if(i.length>0){const b=i.map(P=>{const D=P.clone(),T=new s.Matrix4;return T.makeBasis(r.localX,r.localY,r.localZ),D.applyMatrix4(T),D.add(r.pos)});p.push(b);const E=b[b.length-1];r.pos=E.clone();const v=d.B??0,S=d.C??0;if(v!==0){const P=new s.Matrix4().makeRotationAxis(r.localY,H(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(S>0){const P=H(S),D=new s.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(D),r.localX.applyMatrix4(D)}}}for(const a of p)a.length>1&&u.push(...a.slice(1));return u.length<2&&u.push(new s.Vector3(0,.001,0)),u}function Ee(V,m,f,n,g,h,c,C=0,u=0){const _=g-u,r=xe(n,_,c,C);let a=xe(f,u,c,C);a.forEach(i=>i.y=-i.y),a.reverse();const d=[...a,...r];try{const i=new s.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,d.length*4),h*Z,18,!1);m.geometry.dispose(),V.geometry.dispose(),m.parent&&m.parent.remove(m),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Be={class:"panel-content"},ze={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ie={class:"progress-bar"},Ue={class:"dialog-footer"},je=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:m,emit:f}){const n=V,g=f,h=e.ref(),c=e.ref();e.watch(()=>n.threeData,l=>{const t=l==null?void 0:l.data;c.value=t==null?void 0:t.type},{immediate:!0});const C=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};c.value===X.robotMode.SINGLE&&(t=await Ce.fetchSingleRobotAnimationData()),c.value===X.robotMode.DOUBLE&&(t=await Ce.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:x}=t;D.value=o,T.value=y,R.value=N,h.value=x;const O=$.cloneDeep(h.value),K=ce(F.value),q=(O==null?void 0:O["输出(动画数据)"])||[];u.value=q.length?q:[K]},u=e.ref([]),_=e.ref(!1),r=e.ref(""),p=e.ref(!1),a=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const E=e.ref(null),v=e.shallowRef(null),S=e.shallowRef(null),P=e.shallowRef(null),D=e.ref(0),T=e.ref(12.5),R=e.ref(30),k=e.ref([]),w=e.ref(null),I=e.computed(()=>n.model?ne.getNonFixedJoints(n.model).map(o=>o.name):[]),G=e.ref(["Y","B","C","R"]),F=e.computed(()=>[...I.value,...G.value]),Y=e.computed(()=>F.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${F.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),J=()=>u.value.map(l=>({Y:parseFloat(l.Y)||0,B:parseFloat(l.B)||0,C:parseFloat(l.C)||0,R:parseFloat(l.R)||0})),U=()=>{const l=[],t=[];return u.value.forEach(o=>{const{Y1:y,B1:N,C1:x,R1:O,Y2:K,B2:q,C2:ie,R2:A}=o;l.push({Y:parseFloat(y)||0,B:parseFloat(N)||0,C:parseFloat(x)||0,R:parseFloat(O)||0}),t.push({Y:parseFloat(K)||0,B:parseFloat(q)||0,C:parseFloat(ie)||0,R:parseFloat(A)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},L=(l=0,t=0)=>{if(v.value&&S.value){const o=U();Ee(v.value,S.value,o.posPipeYbcr,o.negPipeYbcr,D.value,T.value,l,t,R.value)}else if(v.value){const o=J();_e(v.value,o,D.value,T.value,l,t)}},W=l=>{if(l<0||l>=u.value.length){console.error(`帧索引 ${l} 超出范围`);return}const t=u.value[l];if(console.log(`应用第 ${l} 帧数据 ${t}`),a.value=l,E.value){const o={};I.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),E.value.setJointAngles(o)}L(l,0)},B=async()=>{if(u.value.length===0){$.ElMessage.error("无法播放动画:无数据");return}if(!p.value){p.value=!0,b=!1,u.value.length-1===a.value&&(a.value=0);try{for(let l=a.value+1;l<u.value.length&&!b;l++){a.value=l;const t=u.value[l],o={};E.value&&I.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),E.value?await E.value.animateToState(o,i.value,y=>{d.value=(l+y)/u.value.length*100,L(l-1,y)}):(await new Promise(y=>setTimeout(y,i.value)),d.value=(l+1)/u.value.length*100)}b||$.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l),$.ElMessage.error("动画播放出错")}finally{p.value=!1,d.value=0}}},z=()=>{b=!0,p.value=!1,d.value=0,$.ElMessage.info("动画已停止")},ae=()=>{a.value=0},j=()=>{if(v.value&&S.value){const l=U();Ee(v.value,S.value,l.posPipeYbcr,l.negPipeYbcr,D.value,T.value,-1,0,R.value)}else if(v.value){const l=J();_e(v.value,l,D.value,T.value,-1,0)}},oe=()=>{E.value&&E.value.resetToZero(),j(),ae(),$.ElMessage.success("机器人和管件已重置")},me=l=>`第 ${l+1} 帧`,ve=l=>{p.value&&z(),W(l)},fe=()=>{p.value&&z(),!(a.value+1>=u.value.length)&&W(a.value+1)},ge=()=>{p.value&&z(),a.value!==0&&W(a.value-1)},se=()=>{P.value&&(P.value.visible=!0),v.value&&v.value.parent&&v.value.parent.remove(v.value),P.value=null,v.value=null,S.value=null},ce=l=>l==null?void 0:l.reduce((t,o)=>(t[o]="0",t),{});e.watch(F,(l,t)=>{if(JSON.stringify(l)!==JSON.stringify(t))if(l.length>0){const o=ce(l);u.value=[o]}else u.value=[]},{immediate:!0});const re=e.ref(0),he=l=>{re.value=l},ue=(l,t)=>{if(!l||!t)return;const o=ne.getTargetJoint(l,t),y=Me();y.visible=!1,o==null||o.add(y)},te=l=>{E.value=new X.URDFRobotController(l),k.value=ne.getAllLinkName(l),w.value="Pipe_Joint"},le=()=>{E.value=null,k.value=[],w.value=null},Ve=l=>{te(l),ue(l,w.value),he(re.value+1),oe()};e.watch(()=>n.model,l=>{if(se(),l){Ve(l);return}le()},{immediate:!0});const de=l=>{var o,y;const t=new s.Mesh(l.geometry.clone(),l.material);return t.name="managed_pipe_clone",(y=(o=l==null?void 0:l.parent)==null?void 0:o.add)==null||y.call(o,t),t.position.copy(l.position),t.rotation.copy(l.rotation),t.scale.copy(l.scale),t};e.watch([w,R,D,re],([l,t])=>{if(se(),n.model&&l){const o=ne.getMeshFromJoint(n.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=de(o);if(c.value===X.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,c.value===X.robotMode.DOUBLE){const N=de(o);S.value=N}L(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const be=async()=>{if(F.value.length===0){$.ElMessage.warning("没有可导出的表头");return}const l=F.value.join(" ");try{await navigator.clipboard.writeText(l),$.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),$.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},ye=()=>{if(!r.value.trim()){$.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Oe, ref as h, watch as se, shallowRef as ve, computed as we, onUnmounted as Qe, resolveComponent as O, createElementBlock as _e, openBlock as te, createElementVNode as n, createVNode as o, withCtx as T, createBlock as Ce, createCommentVNode as ye, unref as M, toDisplayString as me, onMounted as We, onBeforeUnmount as Ie, Fragment as et, renderList as tt, nextTick as lt, withDirectives as q, vShow as re, renderSlot as de, isRef as Te, vModelRadio as Re } from "vue";
2
- import { r as Ve, U as ot, s as je, u as nt, a as at, W as st } from "./workpieceTreePanel-UKomlBEL.js";
3
- import { u as Ke, a as it, b as rt } from "./iconfont-DN8mra_i.js";
2
+ import { r as Ve, U as ot, s as je, u as nt, a as at, W as st } from "./workpieceTreePanel--92uvFwB.js";
3
+ import { u as Ke, a as it, b as rt } from "./iconfont-CjxxsF1M.js";
4
4
  import { ag as ut, c as ct, E as X, aW as pt, aw as dt } from "./index-BUYYl2Pc.js";
5
- import { t as Me, T as ke, V as F, r as Q, s as mt, u as vt, k as Se, v as ft, L as gt, w as ht, x as bt, y as yt, z as wt, F as _t, I as Ct, p as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
5
+ import { t as Me, T as ke, V as F, r as Q, s as mt, u as vt, k as Se, v as ft, L as gt, w as ht, x as bt, y as yt, z as wt, F as _t, I as Ct, p as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DKwIZnH1.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-kYz8t0xw.js";
7
7
  import "./index-BHtNKL1L.js";
8
8
  import { _ as ue, s as Pt } from "./index-DkEISMpK.js";
9
- import "./index.vue_vue_type_style_index_1_lang-BLhks2a1.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-B-okL2FZ.js";
10
10
  import "./index-C7Ks0zLC.js";
11
- import { f as xt, a as Dt } from "./animationData-cz9yaraV.js";
12
- import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-DIyCunQo.js";
11
+ import { f as xt, a as Dt } from "./animationData-CgRkXv4t.js";
12
+ import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-D_oX4idQ.js";
13
13
  import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  import { g as zt, a as Ee, d as $t, c as Ft, e as Yt, b as Lt } from "./dataUtil-BS-wt9Xk.js";
15
15
  import { T as A } from "./svgIcon-D-_fXUBL.js";
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as _e, ref as u, computed as w, watch as W, onUnmounted as Ye, resolveComponent as Y, createElementBlock as A, openBlock as U, createElementVNode as l, createCommentVNode as M, createVNode as i, toDisplayString as $, Fragment as Ze, renderList as qe, withCtx as ne, inject as ke, shallowRef as ue, onMounted as Qe, nextTick as et, onBeforeUnmount as tt, withDirectives as T, vShow as H, renderSlot as K, unref as v, createBlock as Pe, isRef as re, vModelRadio as de } from "vue";
2
2
  import { aw as lt } from "./index.vue_vue_type_style_index_1_lang-kYz8t0xw.js";
3
- import { U as at, s as we, u as nt, a as ot, W as st } from "./workpieceTreePanel-UKomlBEL.js";
4
- import { u as it, a as ut, b as rt } from "./iconfont-DN8mra_i.js";
3
+ import { U as at, s as we, u as nt, a as ot, W as st } from "./workpieceTreePanel--92uvFwB.js";
4
+ import { u as it, a as ut, b as rt } from "./iconfont-CjxxsF1M.js";
5
5
  import { c as dt, E as P } from "./index-BUYYl2Pc.js";
6
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
6
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DKwIZnH1.js";
7
7
  import { _ as me } from "./index-DkEISMpK.js";
8
- import { g as vt, b as ct, U as pt, J as mt, d as ft } from "./urdfTree-DIyCunQo.js";
8
+ import { g as vt, b as ct, U as pt, J as mt, d as ft } from "./urdfTree-D_oX4idQ.js";
9
9
  import { _ as xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  import { T as k } from "./svgIcon-D-_fXUBL.js";
11
- import { i as bt } from "./animationData-cz9yaraV.js";
12
- import { O as gt } from "./MTLLoader-B5xRp-vz.js";
13
- import { L as ht, j as yt } from "./index-CF3EDmxa.js";
11
+ import { i as bt } from "./animationData-CgRkXv4t.js";
12
+ import { O as gt } from "./MTLLoader-BFJXexXd.js";
13
+ import { L as ht, j as yt } from "./index-C-L7sbsd.js";
14
14
  const kt = { class: "panel-content" }, Pt = { class: "action-bar" }, wt = {
15
15
  key: 0,
16
16
  class: "animation-controls"
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Be=require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs"),U=require("./workpieceTreePanel-CTj1J8en.cjs"),Q=require("./iconfont-0T5xTLj8.cjs"),f=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs");const ee=require("./index-D_6peWlG.cjs"),G=require("./urdfTree-CWwnorES.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),N=require("./svgIcon-CUM54R6L.cjs"),$e=require("./animationData-BceOYz3t.cjs"),ze=require("./MTLLoader-D80GV1WB.cjs"),se=require("./index-Cui0eEum.cjs"),Le={class:"panel-content"},Re={class:"action-bar"},Ue={key:0,class:"animation-controls"},je={class:"control-row"},Ae={class:"control-row"},Ie={class:"frame-info"},Oe={class:"control-row"},Fe={key:1,class:"empty-state"},qe={class:"dialog-footer"},Je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(T,{expose:j}){const w=T,o=e.ref([]),C=e.ref(!1),_=e.ref(""),i=e.ref("stopped"),d=e.ref(0),D=e.ref(0),L=e.ref(10),g=e.ref(null);let m=0;const A=e.ref([]),I=e.computed(()=>w.model?G.getNonFixedJoints(w.model).map(r=>r.name):[]),M=e.computed(()=>[...I.value]),H=e.computed(()=>M.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Be=require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs"),U=require("./workpieceTreePanel-C0Lq3HIU.cjs"),Q=require("./iconfont-CP5tSbKZ.cjs"),f=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs");const ee=require("./index-D_6peWlG.cjs"),G=require("./urdfTree-DEo6cc0y.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),N=require("./svgIcon-CUM54R6L.cjs"),$e=require("./animationData-CBP3-eEz.cjs"),ze=require("./MTLLoader-B7nny5Fq.cjs"),se=require("./index-BtAr_AHh.cjs"),Le={class:"panel-content"},Re={class:"action-bar"},Ue={key:0,class:"animation-controls"},je={class:"control-row"},Ae={class:"control-row"},Ie={class:"frame-info"},Oe={class:"control-row"},Fe={key:1,class:"empty-state"},qe={class:"dialog-footer"},Je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(T,{expose:j}){const w=T,o=e.ref([]),C=e.ref(!1),_=e.ref(""),i=e.ref("stopped"),d=e.ref(0),D=e.ref(0),L=e.ref(10),g=e.ref(null);let m=0;const A=e.ref([]),I=e.computed(()=>w.model?G.getNonFixedJoints(w.model).map(r=>r.name):[]),M=e.computed(()=>[...I.value]),H=e.computed(()=>M.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${M.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),B=e.computed(()=>o.value[d.value]||{});e.watch(()=>w.model,s=>{s?(g.value=new U.URDFRobotController(s),A.value=G.getAllLinkName(s),d.value=0):(g.value=null,A.value=[])},{immediate:!0});const $=s=>{if(s<0||s>=o.value.length){console.error(`帧索引 ${s} 超出范围`);return}const n=o.value[s];if(g.value){const r={};I.value.forEach(b=>{const v=parseFloat(n[b]);isNaN(v)||(r[b]=v)}),g.value.setJointAngles(r)}d.value=s,D.value=o.value.length>1?s/(o.value.length-1)*100:100},W=async s=>{try{for(let n=d.value;n<o.value.length;n++){if(s!==m)return;const r=o.value[n],b={};if(g.value)I.value.forEach(v=>{const p=parseFloat(r[v]);isNaN(p)||(b[v]=p)}),await g.value.animateToState(b,L.value,v=>{s===m&&(D.value=(n+v)/o.value.length*100)});else{if(await new Promise(v=>setTimeout(v,L.value)),s!==m)return;D.value=(n+1)/o.value.length*100}d.value=n}s===m&&(f.ElMessage.success("动画播放完成"),i.value="stopped",D.value=100)}catch(n){console.error("动画播放出错:",n),f.ElMessage.error("动画播放出错"),i.value="stopped"}},R=()=>{if(o.value.length===0){f.ElMessage.error("无动画数据");return}i.value==="stopped"&&(d.value=0,$(0)),i.value="playing",m++,W(m),f.ElMessage.info("动画播放中")},O=()=>{i.value==="playing"&&(m++,i.value="paused",f.ElMessage.info("动画已暂停"))},F=()=>{m++,i.value="stopped",d.value=0,D.value=0,$(0),f.ElMessage.info("动画已停止并重置")},P=()=>{i.value==="playing"?O():R()},y=s=>{m++,i.value="paused",$(s)},z=()=>{if(!_.value.trim()){f.ElMessage.warning("导入内容不能为空");return}const s=_.value.trim().split(`
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-0T5xTLj8.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs"),Be=require("./threeViewerHost-cIBL_Tao.cjs"),G=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-CWwnorES.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function Ie(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),Ie(i,r,o)}const De={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const x=n.value[g];l.value=g,de(o.knife,x,o.cloud)},m=async()=>{if(n.value.length===0){G.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(x=>setTimeout(x,a.value)),h(g);p||G.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),G.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,G.ElMessage.info("动画已停止")},C=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,x)=>{const E=t.resolveComponent("el-input-number"),V=t.resolveComponent("el-form-item"),N=t.resolveComponent("el-form"),Z=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",De,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(N,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(V,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[x[2]||(x[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[x[3]||(x[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(Z,{modelValue:l.value,"onUpdate:modelValue":x[1]||(x[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:C,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,q=new c.Vector3;class fe extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)q.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(q)),q.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(q));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-CP5tSbKZ.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cwx8FIbY.cjs"),Be=require("./threeViewerHost-D3ZmD_As.cjs"),G=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-DEo6cc0y.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function Ie(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),Ie(i,r,o)}const De={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const x=n.value[g];l.value=g,de(o.knife,x,o.cloud)},m=async()=>{if(n.value.length===0){G.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(x=>setTimeout(x,a.value)),h(g);p||G.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),G.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,G.ElMessage.info("动画已停止")},C=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,x)=>{const E=t.resolveComponent("el-input-number"),V=t.resolveComponent("el-form-item"),N=t.resolveComponent("el-form"),Z=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",De,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(N,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(V,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[x[2]||(x[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[x[3]||(x[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(Z,{modelValue:l.value,"onUpdate:modelValue":x[1]||(x[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:C,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,q=new c.Vector3;class fe extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)q.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(q)),q.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(q));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
2
2
  #include <common>
3
3
  #include <color_pars_vertex>
4
4
  #include <fog_pars_vertex>
@@ -367,4 +367,4 @@
367
367
  #include <premultiplied_alpha_fragment>
368
368
 
369
369
  }
370
- `};class te extends c.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const J=new c.Vector4,se=new c.Vector3,ae=new c.Vector3,b=new c.Vector4,S=new c.Vector4,T=new c.Vector4,Q=new c.Vector3,ee=new c.Matrix4,_=new c.Line3,le=new c.Vector3,$=new c.Box3,X=new c.Sphere,U=new c.Vector4;let M,D;function ce(r,e,i){return U.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),U.multiplyScalar(1/U.w),U.x=D/i.width,U.y=D/i.height,U.applyMatrix4(r.projectionMatrixInverse),U.multiplyScalar(1/U.w),Math.abs(Math.max(U.x,U.y))}function qe(r,e){const i=r.matrixWorld,o=r.geometry,n=o.attributes.instanceStart,s=o.attributes.instanceEnd,l=Math.min(o.instanceCount,n.count);for(let a=0,p=l;a<p;a++){_.start.fromBufferAttribute(n,a),_.end.fromBufferAttribute(s,a),_.applyMatrix4(i);const f=new c.Vector3,h=new c.Vector3;M.distanceSqToSegment(_.start,_.end,h,f),h.distanceTo(f)<D*.5&&e.push({point:h,pointOnLine:f,distance:M.origin.distanceTo(h),object:r,face:null,faceIndex:a,uv:null,uv1:null})}}function $e(r,e,i){const o=e.projectionMatrix,s=r.material.resolution,l=r.matrixWorld,a=r.geometry,p=a.attributes.instanceStart,f=a.attributes.instanceEnd,h=Math.min(a.instanceCount,p.count),m=-e.near;M.at(1,T),T.w=1,T.applyMatrix4(e.matrixWorldInverse),T.applyMatrix4(o),T.multiplyScalar(1/T.w),T.x*=s.x/2,T.y*=s.y/2,T.z=0,Q.copy(T),ee.multiplyMatrices(e.matrixWorldInverse,l);for(let v=0,C=h;v<C;v++){if(b.fromBufferAttribute(p,v),S.fromBufferAttribute(f,v),b.w=1,S.w=1,b.applyMatrix4(ee),S.applyMatrix4(ee),b.z>m&&S.z>m)continue;if(b.z>m){const V=b.z-S.z,N=(b.z-m)/V;b.lerp(S,N)}else if(S.z>m){const V=S.z-b.z,N=(S.z-m)/V;S.lerp(b,N)}b.applyMatrix4(o),S.applyMatrix4(o),b.multiplyScalar(1/b.w),S.multiplyScalar(1/S.w),b.x*=s.x/2,b.y*=s.y/2,S.x*=s.x/2,S.y*=s.y/2,_.start.copy(b),_.start.z=0,_.end.copy(S),_.end.z=0;const A=_.closestPointToPointParameter(Q,!0);_.at(A,le);const g=c.MathUtils.lerp(b.z,S.z,A),x=g>=-1&&g<=1,E=Q.distanceTo(le)<D*.5;if(x&&E){_.start.fromBufferAttribute(p,v),_.end.fromBufferAttribute(f,v),_.start.applyMatrix4(l),_.end.applyMatrix4(l);const V=new c.Vector3,N=new c.Vector3;M.distanceSqToSegment(_.start,_.end,N,V),i.push({point:N,pointOnLine:V,distance:M.origin.distanceTo(N),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}class Xe extends c.Mesh{constructor(e=new fe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,i=e.attributes.instanceStart,o=e.attributes.instanceEnd,n=new Float32Array(2*i.count);for(let l=0,a=0,p=i.count;l<p;l++,a+=2)se.fromBufferAttribute(i,l),ae.fromBufferAttribute(o,l),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+se.distanceTo(ae);const s=new c.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(s,1,1)),this}raycast(e,i){const o=this.material.worldUnits,n=e.camera;n===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;M=e.ray;const l=this.matrixWorld,a=this.geometry,p=this.material;D=p.linewidth+s,a.boundingSphere===null&&a.computeBoundingSphere(),X.copy(a.boundingSphere).applyMatrix4(l);let f;if(o)f=D*.5;else{const m=Math.max(n.near,X.distanceToPoint(M.origin));f=ce(n,m,p.resolution)}if(X.radius+=f,M.intersectsSphere(X)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),$.copy(a.boundingBox).applyMatrix4(l);let h;if(o)h=D*.5;else{const m=Math.max(n.near,$.distanceToPoint(M.origin));h=ce(n,m,p.resolution)}$.expandByScalar(h),M.intersectsBox($)!==!1&&(o?qe(this,i):$e(this,n,i))}onBeforeRender(e){const i=this.material.uniforms;i&&i.resolution&&(e.getViewport(J),this.material.uniforms.resolution.value.set(J.z,J.w))}}class me extends fe{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setPositions(o),this}setColors(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setColors(o),this}setFromPoints(e){const i=e.length-1,o=new Float32Array(6*i);for(let n=0;n<i;n++)o[6*n]=e[n].x,o[6*n+1]=e[n].y,o[6*n+2]=e[n].z||0,o[6*n+3]=e[n+1].x,o[6*n+4]=e[n+1].y,o[6*n+5]=e[n+1].z||0;return super.setPositions(o),this}fromLine(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}}class Ye extends Xe{constructor(e=new me,i=new te({color:Math.random()*16777215})){super(e,i),this.isLine2=!0,this.type="Line2"}}function Ze(r){const e=[];return r.forEach(i=>{const[o,n,s]=i.trim().split(/\s+/);e.push(+o,+n,+s)}),e}function Y(r,e,i){switch(r){case"X":e.x=+i||0;break;case"Y":e.y=+i||0;break;case"Z":e.z=+i||0;break}}function Ke(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&Y(l,n,a),a="",l=h;continue}a=a+f}Y(l,n,a),e.push(n.x,n.y,n.z)}),e}const Je=r=>r==null?void 0:r.filter(i=>i.includes("=")),Qe=r=>r.replace(/,/g,""),et=r=>r==null?void 0:r.map(i=>Qe(i)),tt=r=>{const e=Je(r);return et(e)};function nt(r){const e=tt(r),i=[];return e.forEach(o=>{var m,v,C,B,A,g;let[n,s,l,a]=o.trim().split(/\s+/);s=(m=s==null?void 0:s.trim)==null?void 0:m.call(s),l=(v=l==null?void 0:l.trim)==null?void 0:v.call(l),a=(C=a==null?void 0:a.trim)==null?void 0:C.call(a);const[,p]=(B=s==null?void 0:s.split)==null?void 0:B.call(s,"="),[,f]=(A=l==null?void 0:l.split)==null?void 0:A.call(l,"="),[,h]=(g=a==null?void 0:a.split)==null?void 0:g.call(a,"=");i.push(+p,+f,+h)}),i}function it(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&Y(l,n,a),a="",l=h;continue}a=a+f}Y(l,n,a),e.push(n.x,n.y,n.z)}),e}function ot(r){return r==null?void 0:r.includes("=")}async function rt(r){var n,s;const e=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\r?\n/);if(ot(r))return nt(e);const i=e==null?void 0:e[0],o=(s=i==null?void 0:i.trim())==null?void 0:s.split(/\s+/);if((o==null?void 0:o.length)>=3)return Ze(e);if((o==null?void 0:o.length)===1)return Ke(e)}async function st(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function at(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function lt(r){let e=r.trim().split(/\r?\n/);return e=e.filter(o=>o.startsWith("X")),e=e.map(o=>{const s=o.indexOf("A");return o.slice(0,s)}),it(e)}async function ct(r,e){const{isCyd:i,isUv:o,isCpt:n,isNc:s}=e;return o?rt(r):i?at(r):n?st(r):s?lt(r):[]}function ut(r){const e=[];for(let i=0;i<r.length;i+=3)e.push(new c.Vector3(r[i],r[i+1],r[i+2]));return e}function dt(r,e){if(!e||e.length<3)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=[];for(let v=0;v<e.length;v+=3)l.push(new c.Vector3(e[v],e[v+1],e[v+2]));const p=new c.CatmullRomCurve3(l,!1,"catmullrom",.5).getPoints(150).flatMap(v=>[v.x,v.y,v.z]),f=new me;f.setPositions(p);const h=new te({color:55551,linewidth:3,resolution:new c.Vector2(window.innerWidth,window.innerHeight)}),m=new Ye(f,h);return m.name="轨迹路径",i.add(m),m}function ft(r,e,i,o=4,n=50){let s=1/0,l=-1/0,a=1/0,p=-1/0,f=1/0,h=-1/0;for(let g=0;g<r.length;g+=3){const x=r[g],E=r[g+1],V=r[g+2];s=Math.min(s,x),l=Math.max(l,x),a=Math.min(a,E),p=Math.max(p,E),f=Math.min(f,V),h=Math.max(h,V)}const v=Math.sqrt((l-s)**2+(p-a)**2+(h-f)**2)*.05,C=c.MathUtils.degToRad(e.fov),B=2*Math.tan(C/2)*n,A=v/B*i.domElement.height*(o/4);return Math.max(1,A)}function mt(r){if(r.length%3!==0)return console.error("points array length is not a multiple of 3:",r),null;const e=new c.BufferGeometry;e.setAttribute("position",new c.Float32BufferAttribute(r,3));const i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3)i[s]=0,i[s+1]=.847,i[s+2]=1;e.setAttribute("color",new c.BufferAttribute(i,3));const o=new c.PointsMaterial({vertexColors:!0,size:1,sizeAttenuation:!1}),n=new c.Points(e,o);return o.needsUpdate=!0,n}function pt(r,e){if(!e)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=mt(e);l.name="轨迹路径",i.add(l);const a=ft(e,o,n,.5,50);return l.material.size=a,l}const ht={class:"obj-viewer-container"},vt={class:"buttonGroup-top"},gt={class:"buttonGroup-topLeft"},yt={class:"buttonGroup-left"},wt={class:"buttonGroup-right"},xt={class:"buttonGroup-bottom"},bt={class:"left-panel"},St={class:"panel-header"},_t={class:"panel-body"},Et={key:1,class:"clipping-content"},Ct={class:"radio-group"},Vt={class:"radio-label"},zt={class:"radio-label"},Nt={class:"radio-label"},At={class:"radio-label"},Tt={class:"right-panel"},Ut={class:"panel-header"},Mt={class:"panel-body"},Bt={key:0,class:"loading-overlay"},Lt=t.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(r,{emit:e}){const i=e,o=r,n=t.ref(null),s=t.ref(!1),l=t.ref(""),a=t.ref(),p=t.ref(!1),f=t.ref(""),h=t.ref(!1),m=t.ref(""),v=t.shallowRef(null),C=t.shallowRef(null),{currentModels:B,resetView:A,initThreeJS:g,handleResize:x,getThreeJSObjects:E,cleanup:V,axesHelperVisible:N,toggleAxesVisibility:Z}=O.useThreeJS(n),{isAnimating:F,toggleAnimation:pe,stopAnimation:he}=O.useAnimation(E,B),{isClipping:ve,activeClippingAxis:z,toggleClipping:ge,updateClippingPlanes:L}=O.useClipping(E,B),ye=()=>{Z()},j=d=>{p.value=!0,f.value=d,d==="剖面视图"&&!ve.value&&ge()},H=d=>{h.value=!0,m.value=d,d==="动画仿真"&&i("getAnimationData")},K=t.ref([]),R=t.ref([]),we=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isUv}),xe=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCyd}),be=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCpt}),P=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isNc}),Se=t.computed(()=>{const d=o.fileBlobs||[];return d==null?void 0:d[0]});let k=t.shallowRef(),I=t.shallowRef();const _e=()=>{const{scene:d}=E();k.value&&d&&(O.disposeObj(k.value,d),k.value=null)},Ee=()=>{const{scene:d}=E();I.value&&d&&(O.disposeObj(I.value,d),I.value=null)},ne=()=>{_e(),Ee()},Ce=async d=>{const u=URL.createObjectURL(d),W=await Be.readFileText(u);if(URL.revokeObjectURL(u),Le.isString(W)){const y=await ct(W,o.trackFileType)||[];K.value=y;const ie=K.value;we.value&&(k.value=dt(E,ie)),(xe.value||be.value||P.value)&&(k.value=pt(E,ie)),O.frameCameraToMesh(E,k.value)}},Ve=()=>{var d,u;I.value=ke(),R.value=ut(K.value),R.value&&R.value.length&&(de(I.value,R.value[0],k.value,new c.Color(16711680)),(u=(d=C.value)==null?void 0:d.add)==null||u.call(d,I.value))};t.watch(()=>Se.value,async d=>{d&&(ne(),await Ce(d),P.value&&Ve())},{immediate:!0,deep:!0});const ze=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.playAnimation())},Ne=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.stopAnimation())},Ae=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.forwardFrame())},Te=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.backwardFrame())},Ue=()=>{g(),window.addEventListener("resize",x);const d=E();C.value=d.scene,C.value&&(C.value.name="CPMPIP")},Me=()=>{window.removeEventListener("resize",x),F.value&&he(),ne(),V()};return t.onMounted(async()=>{try{Ue()}catch(d){console.error("Three.js 初始化失败:",d),G.ElMessage.error("渲染引擎初始化失败!")}}),t.onBeforeUnmount(()=>{Me()}),(d,u)=>{const W=t.resolveComponent("el-scrollbar");return t.openBlock(),t.createElementBlock("div",ht,[t.createElementVNode("div",{ref_key:"threejsContainer",ref:n,class:"threejs-container"},null,512),t.createElementVNode("div",vt,[t.createVNode(w.ThreeSvgIcon,{name:"guanjianjiexi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"gongyishengcheng",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"buchangshezhi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"shuchujiagongchengxu",size:"34"})]),t.createElementVNode("div",gt,[t.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:t.unref(A),title:"重置"},null,8,["onClick"]),t.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),t.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),t.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:t.unref(pe),title:t.unref(F)?"停止动画":"动画视图"},null,8,["onClick","title"]),t.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:t.unref(N),onClick:ye,title:"显隐坐标轴"},null,8,["active"])]),t.createElementVNode("div",yt,[t.renderSlot(d.$slots,"button-left",{switchRightPanel:j},void 0,!0),t.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:u[0]||(u[0]=y=>j("场景树")),active:p.value&&f.value==="场景树",title:"场景树"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:u[1]||(u[1]=y=>j("剖面视图")),active:p.value&&f.value==="剖面视图",title:"剖面视图"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:u[2]||(u[2]=y=>j("场景树3"))}),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:u[3]||(u[3]=y=>j("场景4"))})]),t.createElementVNode("div",wt,[t.renderSlot(d.$slots,"button-right",{switchRightPanel:H},void 0,!0),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),t.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:u[4]||(u[4]=y=>H("关节控制")),active:h.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:u[5]||(u[5]=y=>H("动画仿真")),active:h.value&&m.value==="动画仿真"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:u[6]||(u[6]=y=>H("urdf动画")),active:h.value&&m.value==="urdf动画"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),t.createElementVNode("div",xt,[t.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Te}),t.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),t.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Ae}),t.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ne})]),t.withDirectives(t.createElementVNode("div",bt,[t.createElementVNode("div",St,[t.createElementVNode("span",null,t.toDisplayString(f.value),1),t.createElementVNode("span",{class:"close",onClick:u[7]||(u[7]=y=>p.value=!1)}," X ")]),t.createElementVNode("div",_t,[t.createVNode(W,{height:"100%"},{default:t.withCtx(()=>[f.value==="场景树"?(t.openBlock(),t.createBlock(oe.UrdfTree,{key:0,model:v.value},null,8,["model"])):t.createCommentVNode("",!0),f.value==="剖面视图"?(t.openBlock(),t.createElementBlock("div",Et,[t.createElementVNode("div",Ct,[t.createElementVNode("label",Vt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":u[8]||(u[8]=y=>t.isRef(z)?z.value=y:null),onChange:u[9]||(u[9]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[17]||(u[17]=t.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),t.createElementVNode("label",zt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":u[10]||(u[10]=y=>t.isRef(z)?z.value=y:null),onChange:u[11]||(u[11]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[18]||(u[18]=t.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),t.createElementVNode("label",Nt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":u[12]||(u[12]=y=>t.isRef(z)?z.value=y:null),onChange:u[13]||(u[13]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[19]||(u[19]=t.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),t.createElementVNode("label",At,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":u[14]||(u[14]=y=>t.isRef(z)?z.value=y:null),onChange:u[15]||(u[15]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[20]||(u[20]=t.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):t.createCommentVNode("",!0)]),_:1})])],512),[[t.vShow,p.value]]),t.withDirectives(t.createElementVNode("div",Tt,[t.createElementVNode("div",Ut,[t.createElementVNode("span",null,t.toDisplayString(m.value),1),t.createElementVNode("span",{class:"close",onClick:u[16]||(u[16]=y=>h.value=!1)}," X ")]),t.createElementVNode("div",Mt,[t.createVNode(W,{height:"100%"},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(oe.JointPanel,{model:v.value},null,8,["model"]),[[t.vShow,m.value==="关节控制"]]),t.withDirectives(t.createVNode(He,{ref_key:"animationPanelRef",ref:a,cloud:t.unref(k),knife:t.unref(I),vectors:R.value},null,8,["cloud","knife","vectors"]),[[t.vShow,m.value==="动画仿真"&&P.value]])]),_:1})])],512),[[t.vShow,h.value]]),s.value?(t.openBlock(),t.createElementBlock("div",Bt,[u[21]||(u[21]=t.createElementVNode("div",{class:"loading-spinner"},null,-1)),t.createElementVNode("p",null,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)])}}}),kt=ue._export_sfc(Lt,[["__scopeId","data-v-e8652636"]]);exports.default=kt;
370
+ `};class te extends c.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const J=new c.Vector4,se=new c.Vector3,ae=new c.Vector3,b=new c.Vector4,S=new c.Vector4,T=new c.Vector4,Q=new c.Vector3,ee=new c.Matrix4,_=new c.Line3,le=new c.Vector3,$=new c.Box3,X=new c.Sphere,U=new c.Vector4;let M,D;function ce(r,e,i){return U.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),U.multiplyScalar(1/U.w),U.x=D/i.width,U.y=D/i.height,U.applyMatrix4(r.projectionMatrixInverse),U.multiplyScalar(1/U.w),Math.abs(Math.max(U.x,U.y))}function qe(r,e){const i=r.matrixWorld,o=r.geometry,n=o.attributes.instanceStart,s=o.attributes.instanceEnd,l=Math.min(o.instanceCount,n.count);for(let a=0,p=l;a<p;a++){_.start.fromBufferAttribute(n,a),_.end.fromBufferAttribute(s,a),_.applyMatrix4(i);const f=new c.Vector3,h=new c.Vector3;M.distanceSqToSegment(_.start,_.end,h,f),h.distanceTo(f)<D*.5&&e.push({point:h,pointOnLine:f,distance:M.origin.distanceTo(h),object:r,face:null,faceIndex:a,uv:null,uv1:null})}}function $e(r,e,i){const o=e.projectionMatrix,s=r.material.resolution,l=r.matrixWorld,a=r.geometry,p=a.attributes.instanceStart,f=a.attributes.instanceEnd,h=Math.min(a.instanceCount,p.count),m=-e.near;M.at(1,T),T.w=1,T.applyMatrix4(e.matrixWorldInverse),T.applyMatrix4(o),T.multiplyScalar(1/T.w),T.x*=s.x/2,T.y*=s.y/2,T.z=0,Q.copy(T),ee.multiplyMatrices(e.matrixWorldInverse,l);for(let v=0,C=h;v<C;v++){if(b.fromBufferAttribute(p,v),S.fromBufferAttribute(f,v),b.w=1,S.w=1,b.applyMatrix4(ee),S.applyMatrix4(ee),b.z>m&&S.z>m)continue;if(b.z>m){const V=b.z-S.z,N=(b.z-m)/V;b.lerp(S,N)}else if(S.z>m){const V=S.z-b.z,N=(S.z-m)/V;S.lerp(b,N)}b.applyMatrix4(o),S.applyMatrix4(o),b.multiplyScalar(1/b.w),S.multiplyScalar(1/S.w),b.x*=s.x/2,b.y*=s.y/2,S.x*=s.x/2,S.y*=s.y/2,_.start.copy(b),_.start.z=0,_.end.copy(S),_.end.z=0;const A=_.closestPointToPointParameter(Q,!0);_.at(A,le);const g=c.MathUtils.lerp(b.z,S.z,A),x=g>=-1&&g<=1,E=Q.distanceTo(le)<D*.5;if(x&&E){_.start.fromBufferAttribute(p,v),_.end.fromBufferAttribute(f,v),_.start.applyMatrix4(l),_.end.applyMatrix4(l);const V=new c.Vector3,N=new c.Vector3;M.distanceSqToSegment(_.start,_.end,N,V),i.push({point:N,pointOnLine:V,distance:M.origin.distanceTo(N),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}class Xe extends c.Mesh{constructor(e=new fe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,i=e.attributes.instanceStart,o=e.attributes.instanceEnd,n=new Float32Array(2*i.count);for(let l=0,a=0,p=i.count;l<p;l++,a+=2)se.fromBufferAttribute(i,l),ae.fromBufferAttribute(o,l),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+se.distanceTo(ae);const s=new c.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(s,1,1)),this}raycast(e,i){const o=this.material.worldUnits,n=e.camera;n===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;M=e.ray;const l=this.matrixWorld,a=this.geometry,p=this.material;D=p.linewidth+s,a.boundingSphere===null&&a.computeBoundingSphere(),X.copy(a.boundingSphere).applyMatrix4(l);let f;if(o)f=D*.5;else{const m=Math.max(n.near,X.distanceToPoint(M.origin));f=ce(n,m,p.resolution)}if(X.radius+=f,M.intersectsSphere(X)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),$.copy(a.boundingBox).applyMatrix4(l);let h;if(o)h=D*.5;else{const m=Math.max(n.near,$.distanceToPoint(M.origin));h=ce(n,m,p.resolution)}$.expandByScalar(h),M.intersectsBox($)!==!1&&(o?qe(this,i):$e(this,n,i))}onBeforeRender(e){const i=this.material.uniforms;i&&i.resolution&&(e.getViewport(J),this.material.uniforms.resolution.value.set(J.z,J.w))}}class me extends fe{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setPositions(o),this}setColors(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setColors(o),this}setFromPoints(e){const i=e.length-1,o=new Float32Array(6*i);for(let n=0;n<i;n++)o[6*n]=e[n].x,o[6*n+1]=e[n].y,o[6*n+2]=e[n].z||0,o[6*n+3]=e[n+1].x,o[6*n+4]=e[n+1].y,o[6*n+5]=e[n+1].z||0;return super.setPositions(o),this}fromLine(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}}class Ye extends Xe{constructor(e=new me,i=new te({color:Math.random()*16777215})){super(e,i),this.isLine2=!0,this.type="Line2"}}function Ze(r){const e=[];return r.forEach(i=>{const[o,n,s]=i.trim().split(/\s+/);e.push(+o,+n,+s)}),e}function Y(r,e,i){switch(r){case"X":e.x=+i||0;break;case"Y":e.y=+i||0;break;case"Z":e.z=+i||0;break}}function Ke(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&Y(l,n,a),a="",l=h;continue}a=a+f}Y(l,n,a),e.push(n.x,n.y,n.z)}),e}const Je=r=>r==null?void 0:r.filter(i=>i.includes("=")),Qe=r=>r.replace(/,/g,""),et=r=>r==null?void 0:r.map(i=>Qe(i)),tt=r=>{const e=Je(r);return et(e)};function nt(r){const e=tt(r),i=[];return e.forEach(o=>{var m,v,C,B,A,g;let[n,s,l,a]=o.trim().split(/\s+/);s=(m=s==null?void 0:s.trim)==null?void 0:m.call(s),l=(v=l==null?void 0:l.trim)==null?void 0:v.call(l),a=(C=a==null?void 0:a.trim)==null?void 0:C.call(a);const[,p]=(B=s==null?void 0:s.split)==null?void 0:B.call(s,"="),[,f]=(A=l==null?void 0:l.split)==null?void 0:A.call(l,"="),[,h]=(g=a==null?void 0:a.split)==null?void 0:g.call(a,"=");i.push(+p,+f,+h)}),i}function it(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&Y(l,n,a),a="",l=h;continue}a=a+f}Y(l,n,a),e.push(n.x,n.y,n.z)}),e}function ot(r){return r==null?void 0:r.includes("=")}async function rt(r){var n,s;const e=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\r?\n/);if(ot(r))return nt(e);const i=e==null?void 0:e[0],o=(s=i==null?void 0:i.trim())==null?void 0:s.split(/\s+/);if((o==null?void 0:o.length)>=3)return Ze(e);if((o==null?void 0:o.length)===1)return Ke(e)}async function st(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function at(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function lt(r){let e=r.trim().split(/\r?\n/);return e=e.filter(o=>o.startsWith("X")),e=e.map(o=>{const s=o.indexOf("A");return o.slice(0,s)}),it(e)}async function ct(r,e){const{isCyd:i,isUv:o,isCpt:n,isNc:s}=e;return o?rt(r):i?at(r):n?st(r):s?lt(r):[]}function ut(r){const e=[];for(let i=0;i<r.length;i+=3)e.push(new c.Vector3(r[i],r[i+1],r[i+2]));return e}function dt(r,e){if(!e||e.length<3)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=[];for(let v=0;v<e.length;v+=3)l.push(new c.Vector3(e[v],e[v+1],e[v+2]));const p=new c.CatmullRomCurve3(l,!1,"catmullrom",.5).getPoints(150).flatMap(v=>[v.x,v.y,v.z]),f=new me;f.setPositions(p);const h=new te({color:55551,linewidth:3,resolution:new c.Vector2(window.innerWidth,window.innerHeight)}),m=new Ye(f,h);return m.name="轨迹路径",i.add(m),m}function ft(r,e,i,o=4,n=50){let s=1/0,l=-1/0,a=1/0,p=-1/0,f=1/0,h=-1/0;for(let g=0;g<r.length;g+=3){const x=r[g],E=r[g+1],V=r[g+2];s=Math.min(s,x),l=Math.max(l,x),a=Math.min(a,E),p=Math.max(p,E),f=Math.min(f,V),h=Math.max(h,V)}const v=Math.sqrt((l-s)**2+(p-a)**2+(h-f)**2)*.05,C=c.MathUtils.degToRad(e.fov),B=2*Math.tan(C/2)*n,A=v/B*i.domElement.height*(o/4);return Math.max(1,A)}function mt(r){if(r.length%3!==0)return console.error("points array length is not a multiple of 3:",r),null;const e=new c.BufferGeometry;e.setAttribute("position",new c.Float32BufferAttribute(r,3));const i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3)i[s]=0,i[s+1]=.847,i[s+2]=1;e.setAttribute("color",new c.BufferAttribute(i,3));const o=new c.PointsMaterial({vertexColors:!0,size:1,sizeAttenuation:!1}),n=new c.Points(e,o);return o.needsUpdate=!0,n}function pt(r,e){if(!e)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=mt(e);if(!l)return;l.name="轨迹路径",i.add(l);const a=ft(e,o,n,.4,50);return l.material.size=a,l}const ht={class:"obj-viewer-container"},vt={class:"buttonGroup-top"},gt={class:"buttonGroup-topLeft"},yt={class:"buttonGroup-left"},wt={class:"buttonGroup-right"},xt={class:"buttonGroup-bottom"},bt={class:"left-panel"},St={class:"panel-header"},_t={class:"panel-body"},Et={key:1,class:"clipping-content"},Ct={class:"radio-group"},Vt={class:"radio-label"},zt={class:"radio-label"},Nt={class:"radio-label"},At={class:"radio-label"},Tt={class:"right-panel"},Ut={class:"panel-header"},Mt={class:"panel-body"},Bt={key:0,class:"loading-overlay"},Lt=t.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(r,{emit:e}){const i=e,o=r,n=t.ref(null),s=t.ref(!1),l=t.ref(""),a=t.ref(),p=t.ref(!1),f=t.ref(""),h=t.ref(!1),m=t.ref(""),v=t.shallowRef(null),C=t.shallowRef(null),{currentModels:B,resetView:A,initThreeJS:g,handleResize:x,getThreeJSObjects:E,cleanup:V,axesHelperVisible:N,toggleAxesVisibility:Z}=O.useThreeJS(n),{isAnimating:F,toggleAnimation:pe,stopAnimation:he}=O.useAnimation(E,B),{isClipping:ve,activeClippingAxis:z,toggleClipping:ge,updateClippingPlanes:L}=O.useClipping(E,B),ye=()=>{Z()},j=d=>{p.value=!0,f.value=d,d==="剖面视图"&&!ve.value&&ge()},H=d=>{h.value=!0,m.value=d,d==="动画仿真"&&i("getAnimationData")},K=t.ref([]),R=t.ref([]),we=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isUv}),xe=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCyd}),be=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCpt}),P=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isNc}),Se=t.computed(()=>{const d=o.fileBlobs||[];return d==null?void 0:d[0]});let k=t.shallowRef(),I=t.shallowRef();const _e=()=>{const{scene:d}=E();k.value&&d&&(O.disposeObj(k.value,d),k.value=null)},Ee=()=>{const{scene:d}=E();I.value&&d&&(O.disposeObj(I.value,d),I.value=null)},ne=()=>{_e(),Ee()},Ce=async d=>{const u=URL.createObjectURL(d),W=await Be.readFileText(u);if(URL.revokeObjectURL(u),Le.isString(W)){const y=await ct(W,o.trackFileType)||[];K.value=y;const ie=K.value;we.value&&(k.value=dt(E,ie)),(xe.value||be.value||P.value)&&(k.value=pt(E,ie)),O.frameCameraToMesh(E,k.value)}},Ve=()=>{var d,u;I.value=ke(),R.value=ut(K.value),R.value&&R.value.length&&(de(I.value,R.value[0],k.value,new c.Color(16711680)),(u=(d=C.value)==null?void 0:d.add)==null||u.call(d,I.value))};t.watch(()=>Se.value,async d=>{d&&(ne(),await Ce(d),P.value&&Ve())},{immediate:!0,deep:!0});const ze=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.playAnimation())},Ne=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.stopAnimation())},Ae=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.forwardFrame())},Te=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.backwardFrame())},Ue=()=>{g(),window.addEventListener("resize",x);const d=E();C.value=d.scene,C.value&&(C.value.name="CPMPIP")},Me=()=>{window.removeEventListener("resize",x),F.value&&he(),ne(),V()};return t.onMounted(async()=>{try{Ue()}catch(d){console.error("Three.js 初始化失败:",d),G.ElMessage.error("渲染引擎初始化失败!")}}),t.onBeforeUnmount(()=>{Me()}),(d,u)=>{const W=t.resolveComponent("el-scrollbar");return t.openBlock(),t.createElementBlock("div",ht,[t.createElementVNode("div",{ref_key:"threejsContainer",ref:n,class:"threejs-container"},null,512),t.createElementVNode("div",vt,[t.createVNode(w.ThreeSvgIcon,{name:"guanjianjiexi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"gongyishengcheng",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"buchangshezhi",size:"34"}),t.createVNode(w.ThreeSvgIcon,{name:"shuchujiagongchengxu",size:"34"})]),t.createElementVNode("div",gt,[t.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:t.unref(A),title:"重置"},null,8,["onClick"]),t.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),t.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),t.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:t.unref(pe),title:t.unref(F)?"停止动画":"动画视图"},null,8,["onClick","title"]),t.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:t.unref(N),onClick:ye,title:"显隐坐标轴"},null,8,["active"])]),t.createElementVNode("div",yt,[t.renderSlot(d.$slots,"button-left",{switchRightPanel:j},void 0,!0),t.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:u[0]||(u[0]=y=>j("场景树")),active:p.value&&f.value==="场景树",title:"场景树"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:u[1]||(u[1]=y=>j("剖面视图")),active:p.value&&f.value==="剖面视图",title:"剖面视图"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:u[2]||(u[2]=y=>j("场景树3"))}),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:u[3]||(u[3]=y=>j("场景4"))})]),t.createElementVNode("div",wt,[t.renderSlot(d.$slots,"button-right",{switchRightPanel:H},void 0,!0),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),t.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:u[4]||(u[4]=y=>H("关节控制")),active:h.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:u[5]||(u[5]=y=>H("动画仿真")),active:h.value&&m.value==="动画仿真"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:u[6]||(u[6]=y=>H("urdf动画")),active:h.value&&m.value==="urdf动画"},null,8,["active"]),t.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),t.createElementVNode("div",xt,[t.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Te}),t.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),t.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Ae}),t.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ne})]),t.withDirectives(t.createElementVNode("div",bt,[t.createElementVNode("div",St,[t.createElementVNode("span",null,t.toDisplayString(f.value),1),t.createElementVNode("span",{class:"close",onClick:u[7]||(u[7]=y=>p.value=!1)}," X ")]),t.createElementVNode("div",_t,[t.createVNode(W,{height:"100%"},{default:t.withCtx(()=>[f.value==="场景树"?(t.openBlock(),t.createBlock(oe.UrdfTree,{key:0,model:v.value},null,8,["model"])):t.createCommentVNode("",!0),f.value==="剖面视图"?(t.openBlock(),t.createElementBlock("div",Et,[t.createElementVNode("div",Ct,[t.createElementVNode("label",Vt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":u[8]||(u[8]=y=>t.isRef(z)?z.value=y:null),onChange:u[9]||(u[9]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[17]||(u[17]=t.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),t.createElementVNode("label",zt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":u[10]||(u[10]=y=>t.isRef(z)?z.value=y:null),onChange:u[11]||(u[11]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[18]||(u[18]=t.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),t.createElementVNode("label",Nt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":u[12]||(u[12]=y=>t.isRef(z)?z.value=y:null),onChange:u[13]||(u[13]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[19]||(u[19]=t.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),t.createElementVNode("label",At,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":u[14]||(u[14]=y=>t.isRef(z)?z.value=y:null),onChange:u[15]||(u[15]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[20]||(u[20]=t.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):t.createCommentVNode("",!0)]),_:1})])],512),[[t.vShow,p.value]]),t.withDirectives(t.createElementVNode("div",Tt,[t.createElementVNode("div",Ut,[t.createElementVNode("span",null,t.toDisplayString(m.value),1),t.createElementVNode("span",{class:"close",onClick:u[16]||(u[16]=y=>h.value=!1)}," X ")]),t.createElementVNode("div",Mt,[t.createVNode(W,{height:"100%"},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(oe.JointPanel,{model:v.value},null,8,["model"]),[[t.vShow,m.value==="关节控制"]]),t.withDirectives(t.createVNode(He,{ref_key:"animationPanelRef",ref:a,cloud:t.unref(k),knife:t.unref(I),vectors:R.value},null,8,["cloud","knife","vectors"]),[[t.vShow,m.value==="动画仿真"&&P.value]])]),_:1})])],512),[[t.vShow,h.value]]),s.value?(t.openBlock(),t.createElementBlock("div",Bt,[u[21]||(u[21]=t.createElementVNode("div",{class:"loading-spinner"},null,-1)),t.createElementVNode("p",null,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)])}}}),kt=ue._export_sfc(Lt,[["__scopeId","data-v-e8652636"]]);exports.default=kt;
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as Pe, computed as R, ref as E, resolveComponent as Y, createElementBlock as le, openBlock as Z, createElementVNode as m, createVNode as h, withCtx as de, toDisplayString as J, shallowRef as te, watch as lt, onMounted as ct, onBeforeUnmount as ut, withDirectives as I, createCommentVNode as ve, unref as b, renderSlot as Ae, createBlock as dt, isRef as ne, vModelRadio as ie, vShow as oe } from "vue";
2
- import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-DN8mra_i.js";
3
- import { C as fe, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as ce, aL as Fe, Y as Oe, aM as ue, aN as Q, aO as bt, r as _t, s as je, t as St, w as zt, a5 as Ct, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
4
- import { r as Et } from "./threeViewerHost-BZOpA6mF.js";
2
+ import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-CjxxsF1M.js";
3
+ import { C as fe, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as ce, aL as Fe, Y as Oe, aM as ue, aN as Q, aO as bt, r as _t, s as je, t as St, w as zt, a5 as Ct, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DKwIZnH1.js";
4
+ import { r as Et } from "./threeViewerHost-C2iVAVlI.js";
5
5
  import { E as K } from "./index-BUYYl2Pc.js";
6
- import { U as Mt, J as Lt } from "./urdfTree-DIyCunQo.js";
6
+ import { U as Mt, J as Lt } from "./urdfTree-D_oX4idQ.js";
7
7
  import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  import { T as w } from "./svgIcon-D-_fXUBL.js";
9
9
  import { i as kt } from "./isString-BATKat46.js";
@@ -1154,8 +1154,10 @@ function fn(o, e) {
1154
1154
  if (!n || !i || !t || !s)
1155
1155
  return;
1156
1156
  const r = dn(e);
1157
+ if (!r)
1158
+ return;
1157
1159
  r.name = "轨迹路径", n.add(r);
1158
- const a = un(e, i, t, 0.5, 50);
1160
+ const a = un(e, i, t, 0.4, 50);
1159
1161
  return r.material.size = a, r;
1160
1162
  }
1161
1163
  const pn = { class: "obj-viewer-container" }, mn = { class: "buttonGroup-top" }, hn = { class: "buttonGroup-topLeft" }, vn = { class: "buttonGroup-left" }, gn = { class: "buttonGroup-right" }, yn = { class: "buttonGroup-bottom" }, wn = { class: "left-panel" }, xn = { class: "panel-header" }, bn = { class: "panel-body" }, _n = {