ss-component-new 1.2.294 → 1.2.296
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OBJLoader-CB9WJT82.cjs → OBJLoader-8gDmNV2i.cjs} +1 -1
- package/dist/{OBJLoader-BNv6XCtP.js → OBJLoader-Ck9W3Ir7.js} +1 -1
- package/dist/{OrbitControls-Csw6mD-P.js → OrbitControls-BIGKrhyi.js} +1 -1
- package/dist/{OrbitControls-R243A2UI.cjs → OrbitControls-BWF5w18E.cjs} +1 -1
- package/dist/{PCDLoader-cSzkUgjw.js → PCDLoader-CkJ5aJWh.js} +1 -1
- package/dist/{PCDLoader-BsFAYeJ2.cjs → PCDLoader-D-K96lwY.cjs} +1 -1
- package/dist/{animationData-BNWYvI2q.js → animationData-BlzkiZT-.js} +1 -1
- package/dist/{animationData-j8m9iee2.cjs → animationData-Dzb7SwCQ.cjs} +1 -1
- package/dist/{iconfont-CGucCJqY.js → iconfont-B8t8JT6z.js} +2 -2
- package/dist/{iconfont-BELvOiht.cjs → iconfont-Btynh8XG.cjs} +1 -1
- package/dist/{index-CHxAiQtk.js → index-0uGvrFMJ.js} +3 -3
- package/dist/{index-SnOaE90Y.js → index-8iIO_ocM.js} +3 -3
- package/dist/{index-Cvo0V0hW.cjs → index-B-SQuycq.cjs} +1 -1
- package/dist/{index-DBYidyLi.js → index-B-qFtrGT.js} +1 -1
- package/dist/{index-gW_IQxDq.cjs → index-B2nCv699.cjs} +1 -1
- package/dist/{index-w2CRXMRQ.js → index-B7DZXq3g.js} +6 -6
- package/dist/{index-79I_iorC.js → index-B8yivODj.js} +1 -1
- package/dist/{index-CZm0g4PU.js → index-BVXIOYWQ.js} +9 -7
- package/dist/{index-DQqCL4ju.cjs → index-B_qXEQkF.cjs} +1 -1
- package/dist/{index-Cuz9ELzW.js → index-Bgw0FBZB.js} +1 -1
- package/dist/{index-C0igWyW4.js → index-BsQ-qwMF.js} +13 -13
- package/dist/{index-71M6SFRc.js → index-BtwkxysC.js} +1 -1
- package/dist/{index-CmRzCos6.js → index-Bu1pHSKB.js} +843 -823
- package/dist/index-BwavyD4W.cjs +1 -0
- package/dist/{index-DKofIQfe.js → index-CIZi1SsV.js} +1 -1
- package/dist/{index-B0OE5_Ny.js → index-CJ-zljKi.js} +1 -1
- package/dist/{index-BkSFOSV8.cjs → index-CQn_Bk7v.cjs} +1 -1
- package/dist/{index-_yqtp0Dh.cjs → index-CSrPyW_f.cjs} +1 -1
- package/dist/{index-CZSaHDnf.js → index-CYPJ4mm3.js} +1 -1
- package/dist/{index-ByJJvmV6.js → index-CtbAPra-.js} +3 -3
- package/dist/{index-IClu4Xf8.cjs → index-D0jGNd-H.cjs} +1 -1
- package/dist/{index-9Nz7Dg2Z.js → index-D6bXtF73.js} +1 -1
- package/dist/{index-BC4uFre2.cjs → index-D9i7wZaC.cjs} +1 -1
- package/dist/{index-gHB9TMLI.cjs → index-DGVafVuW.cjs} +1 -1
- package/dist/{index-C5SNPyky.cjs → index-DKCWuetb.cjs} +1 -1
- package/dist/{index-LT5l3lP1.cjs → index-DO9bzS7t.cjs} +1 -1
- package/dist/{index-DU8A2Rcx.js → index-DOsxjhUA.js} +2 -2
- package/dist/{index-CkSlNi8L.js → index-DQTWAF7D.js} +2 -2
- package/dist/{index-BD9p0Xlt.js → index-DT0pnWzT.js} +2 -2
- package/dist/{index-D12kMfBu.cjs → index-DTjWhnIF.cjs} +1 -1
- package/dist/{index-C98tDP8u.cjs → index-DjaN4VhG.cjs} +1 -1
- package/dist/index-DvfqgYXo.cjs +1 -0
- package/dist/{index-DL8dLTof.cjs → index-DyDrPMvD.cjs} +1 -1
- package/dist/{index-_2EYJgni.cjs → index-K4Aol2cP.cjs} +1 -1
- package/dist/{index-CmcomRyN.js → index-_kvrccCu.js} +1 -1
- package/dist/{index-CvykFWHw.cjs → index-_wyT2-AA.cjs} +1 -1
- package/dist/{index-Dq3HNSET.js → index-dTA9hAgr.js} +3261 -3248
- package/dist/{index-CGoPD35H.cjs → index-hBEZJTBK.cjs} +1 -1
- package/dist/{index-DsOj_EOL.cjs → index-hKbFMqEu.cjs} +12 -12
- package/dist/{index-C4efuh6q.cjs → index-hORaVIHc.cjs} +1 -1
- package/dist/{index-D5O3A6Fx.js → index-jfKxOdn1.js} +1 -1
- package/dist/{index-xpsuJRYD.cjs → index-l7UB2yUy.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BqQN_vwd.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BNPzwHXs.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B_3YixjC.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CNiwHtU5.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs} +59 -59
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js} +1643 -1648
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DRUxrXlC.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-BOzovrSr.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Dg0WsT5i.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-BuwJQ9eE.js} +19 -19
- package/dist/{index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs → index.vue_vue_type_style_index_1_lang-CDoOP6Aw.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang--VeL916J.js → index.vue_vue_type_style_index_1_lang-ZmTqB1dO.js} +4 -4
- package/dist/{main-Dx_m6QdJ.cjs → main-CBor783N.cjs} +1 -1
- package/dist/{main-BKAAdzBm.js → main-Yx9pP1an.js} +2 -2
- package/dist/{pointTrack-05CcPzgf.cjs → pointTrack-BkpbGc8n.cjs} +1 -1
- package/dist/{pointTrack-BRZj2fRP.js → pointTrack-CMyadDzE.js} +2 -2
- package/dist/{robotUtil-DGZFmHa1.js → robotUtil-BAK-GNOJ.js} +1 -1
- package/dist/{robotUtil-_esgRFP3.cjs → robotUtil-BtBh1-GY.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +31 -31
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-euHdSZWK.cjs → threeModel-C0vGemcj.cjs} +1 -1
- package/dist/{threeModel-WVUvmnEU.js → threeModel-C44vcdqj.js} +5 -5
- package/dist/{threePreview-BvzwkKZR.js → threePreview-CKjG0F-q.js} +4 -4
- package/dist/{threePreview-B3amehMf.cjs → threePreview-PffN5Aiq.cjs} +1 -1
- package/dist/{threeSceneView-BV580zYO.js → threeSceneView-4FffGfEx.js} +7 -7
- package/dist/{threeSceneView-BYYPjbrf.cjs → threeSceneView-BI__dTV5.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BcL1uoBQ.js → threeSceneViewForCPMPIP-Bo1U2avY.js} +9 -9
- package/dist/{threeSceneViewForCPMPIP-CSKEFRk_.cjs → threeSceneViewForCPMPIP-DZddF3u8.cjs} +1 -1
- package/dist/{threeTrackPathView-BpunMIGZ.js → threeTrackPathView-DzU4AIwq.js} +5 -5
- package/dist/{threeTrackPathView-CGEH2zTP.cjs → threeTrackPathView-oMFtTDLX.cjs} +1 -1
- package/dist/{threeViewerHost-BPu_LZha.cjs → threeViewerHost-BcIsHd7R.cjs} +2 -2
- package/dist/{threeViewerHost-CiYZBM4H.js → threeViewerHost-DUzh9-TD.js} +2 -2
- package/dist/{urdfTree-CoHIn4kK.js → urdfTree-BVGBRI7Z.js} +1 -1
- package/dist/{urdfTree-BjckM2-i.cjs → urdfTree-C_RPoplj.cjs} +1 -1
- package/dist/{workpieceTreePanel-CbsK-tey.cjs → workpieceTreePanel-B1eC1Q8u.cjs} +1 -1
- package/dist/{workpieceTreePanel-CtLKTnWz.js → workpieceTreePanel-_Vo2EKuP.js} +6 -6
- package/package.json +1 -1
- package/dist/index-CslSvatz.cjs +0 -1
- package/dist/index-IvJ1OjwT.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),K=require("./iconfont-BELvOiht.cjs"),u=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),J=require("./index-CEwxrYB-.cjs"),ie=require("./OBJLoader-CB9WJT82.cjs"),z=require("./PCDLoader-BsFAYeJ2.cjs"),H=require("./svgIcon-BH_8oaav.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Q(f,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let i=0;i<a.count;i++)r.push(i);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const o=e.count-2,n=[];if(t===u.TriangleFanDrawMode)for(let r=1;r<=o;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<o;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!==o&&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 ce extends u.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new he(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new we(e)})}load(t,e,o,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(t);r=u.LoaderUtils.resolveURL(c,this.path)}else r=u.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)},i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,function(c){try{s.parse(c,r,function(d){e(d),s.manager.itemEnd(t)},a)}catch(d){a(d)}},o,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,o,n){let s;const r={},a={},i=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(i.decode(new Uint8Array(t,0,4))===se){try{r[L.KHR_BINARY_GLTF]=new be(t)}catch(l){n&&n(l);return}s=JSON.parse(r[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(i.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 Ue(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 d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],h=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:r[l]=new de;break;case L.KHR_DRACO_MESH_COMPRESSION:r[l]=new Ne(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:r[l]=new Ce;break;case L.KHR_MESH_QUANTIZATION:r[l]=new Ie;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(o,n)}parseAsync(t,e){const o=this;return new Promise(function(n,s){o.parse(t,e,n,s)})}}function le(){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 L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ue{constructor(t){this.parser=t,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let o=0,n=e.length;o<n;o++){const s=e[o];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,o="light:"+t;let n=e.cache.get(o);if(n)return n;const s=e.json,i=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const d=new u.Color(16777215);i.color!==void 0&&d.setRGB(i.color[0],i.color[1],i.color[2],u.LinearSRGBColorSpace);const l=i.range!==void 0?i.range:0;switch(i.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,c.angle=i.spot.outerConeAngle,c.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return c.position.set(0,0,0),D(c,i),i.intensity!==void 0&&(c.intensity=i.intensity),c.name=e.createUniqueName(i.name||"light_"+t),n=Promise.resolve(c),e.cache.add(o,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,o=this.parser,s=o.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return o._getNodeRef(e.cache,a,i)})}}class de{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(t,e,o){const n=[];t.color=new u.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],u.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(o.assignTexture(t,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class fe{constructor(t){this.parser=t,this.name=L.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 he{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(o.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(o.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class pe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.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 me{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.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(o.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class ge{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new u.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],u.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(o.assignTexture(e,"sheenColorMap",r.sheenColorTexture,u.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(o.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class Te{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class Re{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class xe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IOR}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.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 Ee{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(o.assignTexture(e,"specularColorMap",r.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class Me{constructor(t){this.parser=t,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class Le{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class Ae{constructor(t){this.parser=t,this.name=L.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,o=e.json,n=o.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(o.extensionsRequired&&o.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 _e{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,o=this.parser,n=o.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return o.loadTextureImage(t,r.source,i)}}class ye{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,o=this.parser,n=o.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return o.loadTextureImage(t,r.source,i)}}class Se{constructor(t){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,o=e.bufferViews[t];if(o.extensions&&o.extensions[this.name]){const n=o.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 i=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,h=new Uint8Array(a,i,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(d,l,h,n.mode,n.filter).then(function(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(d*l);return r.decodeGltfBuffer(new Uint8Array(m),d,l,h,n.mode,n.filter),m})})}else return null}}class we{constructor(t){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,o=e.nodes[t];if(!o.extensions||!o.extensions[this.name]||o.mesh===void 0)return null;const n=e.meshes[o.mesh];for(const c of n.primitives)if(c.mode!==v.TRIANGLES&&c.mode!==v.TRIANGLE_STRIP&&c.mode!==v.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=o.extensions[this.name].attributes,a=[],i={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(d=>(i[c]=d,i[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const T of l){const E=new u.Matrix4,R=new u.Vector3,g=new u.Quaternion,x=new u.Vector3(1,1,1),y=new u.InstancedMesh(T.geometry,T.material,h);for(let M=0;M<h;M++)i.TRANSLATION&&R.fromBufferAttribute(i.TRANSLATION,M),i.ROTATION&&g.fromBufferAttribute(i.ROTATION,M),i.SCALE&&x.fromBufferAttribute(i.SCALE,M),y.setMatrixAt(M,E.compose(R,g,x));for(const M in i)if(M==="_COLOR_0"){const S=i[M];y.instanceColor=new u.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else M!=="TRANSLATION"&&M!=="ROTATION"&&M!=="SCALE"&&T.geometry.setAttribute(M,i[M]);u.Object3D.prototype.copy.call(y,T),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const se="glTF",B=12,Z={JSON:1313821514,BIN:5130562};class be{constructor(t){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,B),o=new TextDecoder;if(this.header={magic:o.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==se)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-B,s=new DataView(t,B);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const i=s.getUint32(r,!0);if(r+=4,i===Z.JSON){const c=new Uint8Array(t,B+r,a);this.content=o.decode(c)}else if(i===Z.BIN){const c=B+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Ne{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const o=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},i={},c={};for(const d in r){const l=$[d]||d.toLowerCase();a[l]=r[d]}for(const d in t.attributes){const l=$[d]||d.toLowerCase();if(r[d]!==void 0){const h=o.accessors[t.attributes[d]],m=G[h.componentType];c[l]=m.name,i[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(d){return new Promise(function(l,h){n.decodeDracoFile(d,function(m){for(const T in m.attributes){const E=m.attributes[T],R=i[T];R!==void 0&&(E.normalized=R)}l(m)},a,c,u.LinearSRGBColorSpace,h)})})}}class Ce{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Ie{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class re extends u.Interpolant{constructor(t,e,o,n){super(t,e,o,n)}copySampleValue_(t){const e=this.resultBuffer,o=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=o[s+r];return e}interpolate_(t,e,o,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,i=a*2,c=a*3,d=n-e,l=(o-e)/d,h=l*l,m=h*l,T=t*c,E=T-c,R=-2*m+3*h,g=m-h,x=1-R,y=g-h+l;for(let M=0;M!==a;M++){const S=r[E+M+a],_=r[E+M+i]*d,w=r[T+M+a],O=r[T+M]*d;s[M]=x*S+y*_+R*w+g*O}return s}}const Oe=new u.Quaternion;class ve extends re{interpolate_(t,e,o,n){const s=super.interpolate_(t,e,o,n);return Oe.fromArray(s).normalize().toArray(s),s}}const v={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},G={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ee={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},te={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Pe={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},q={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function De(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),f.DefaultMaterial}function F(f,t,e){for(const o in e.extensions)f[o]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[o]=e.extensions[o])}function D(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 ke(f,t,e){let o=!1,n=!1,s=!1;for(let c=0,d=t.length;c<d;c++){const l=t[c];if(l.POSITION!==void 0&&(o=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),o&&n&&s)break}if(!o&&!n&&!s)return Promise.resolve(f);const r=[],a=[],i=[];for(let c=0,d=t.length;c<d;c++){const l=t[c];if(o){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;i.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(i)]).then(function(c){const d=c[0],l=c[1],h=c[2];return o&&(f.morphAttributes.position=d),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function Fe(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,o=t.weights.length;e<o;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 o=0,n=e.length;o<n;o++)f.morphTargetDictionary[e[o]]=o}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ge(f){let t;const e=f.extensions&&f.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+W(e.attributes):t=f.indices+":"+W(f.attributes)+":"+f.mode,f.targets!==void 0)for(let o=0,n=f.targets.length;o<n;o++)t+=":"+W(f.targets[o]);return t}function W(f){let t="";const e=Object.keys(f).sort();for(let o=0,n=e.length;o<n;o++)t+=e[o]+":"+f[e[o]]+";";return t}function Y(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 He(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 Be=new u.Matrix4;class Ue{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new le,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 o=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;o=/^((?!chrome|android).)*safari/i.test(a)===!0;const i=a.match(/Version\/(\d+)/);n=o&&i?parseInt(i[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||o&&n<17||s&&r<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const o=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([o.getDependencies("scene"),o.getDependencies("animation"),o.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:o,userData:{}};return F(s,a,n),D(a,n),Promise.all(o._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],o=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,i=r.length;a<i;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&&(o[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,o){if(t.refs[e]<=1)return o;const n=o.clone(),s=(r,a)=>{const i=this.associations.get(r);i!=null&&this.associations.set(a,i);for(const[c,d]of r.children.entries())s(d,a.children[c])};return s(o,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let o=0;o<e.length;o++){const n=t(e[o]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const o=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&o.push(s)}return o}getDependency(t,e){const o=t+":"+e;let n=this.cache.get(o);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(o,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const o=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return o.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],o=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[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){o.load(u.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(o){const n=e.byteLength||0,s=e.byteOffset||0;return o.slice(s,s+n)})}loadAccessor(t){const e=this,o=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=X[n.type],a=G[n.componentType],i=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new u.BufferAttribute(c,r,i))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(r){const a=r[0],i=X[n.type],c=G[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*i,h=n.byteOffset||0,m=n.bufferView!==void 0?o.bufferViews[n.bufferView].byteStride:void 0,T=n.normalized===!0;let E,R;if(m&&m!==l){const g=Math.floor(h/m),x="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+g+":"+n.count;let y=e.cache.get(x);y||(E=new c(a,g*m,n.count*m/d),y=new u.InterleavedBuffer(E,m/d),e.cache.add(x,y)),R=new u.InterleavedBufferAttribute(y,i,h%m/d,T)}else a===null?E=new c(n.count*i):E=new c(a,h,n.count*i),R=new u.BufferAttribute(E,i,T);if(n.sparse!==void 0){const g=X.SCALAR,x=G[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,M=n.sparse.values.byteOffset||0,S=new x(r[1],y,n.sparse.count*g),_=new c(r[2],M,n.sparse.count*i);a!==null&&(R=new u.BufferAttribute(R.array.slice(),R.itemSize,R.normalized)),R.normalized=!1;for(let w=0,O=S.length;w<O;w++){const b=S[w];if(R.setX(b,_[w*i]),i>=2&&R.setY(b,_[w*i+1]),i>=3&&R.setZ(b,_[w*i+2]),i>=4&&R.setW(b,_[w*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}R.normalized=T}return R})}loadTexture(t){const e=this.json,o=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const i=o.manager.getHandler(r.uri);i!==null&&(a=i)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,o){const n=this,s=this.json,r=s.textures[t],a=s.images[e],i=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[i])return this.textureCache[i];const c=this.loadImageSource(e,o).then(function(d){d.flipY=!1,d.name=r.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return d.magFilter=ee[h.magFilter]||u.LinearFilter,d.minFilter=ee[h.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=te[h.wrapS]||u.RepeatWrapping,d.wrapT=te[h.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:t}),d}).catch(function(){return null});return this.textureCache[i]=c,c}loadImageSource(t,e){const o=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 i=r.uri||"",c=!1;if(r.bufferView!==void 0)i=o.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return i=a.createObjectURL(h),i});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const d=Promise.resolve(i).then(function(l){return new Promise(function(h,m){let T=h;e.isImageBitmapLoader===!0&&(T=function(E){const R=new u.Texture(E);R.needsUpdate=!0,h(R)}),e.load(u.LoaderUtils.resolveURL(l,s.path),T,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(i),D(l,r),l.userData.mimeType=r.mimeType||He(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),l});return this.sourceCache[t]=d,d}assignTexture(t,e,o,n){const s=this;return this.getDependency("texture",o.index).then(function(r){if(!r)return null;if(o.texCoord!==void 0&&o.texCoord>0&&(r=r.clone(),r.channel=o.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=o.extensions!==void 0?o.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=s.associations.get(r);r=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,i)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let o=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:"+o.uuid;let i=this.cache.get(a);i||(i=new u.PointsMaterial,u.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,i.sizeAttenuation=!1,this.cache.add(a,i)),o=i}else if(t.isLine){const a="LineBasicMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new u.LineBasicMaterial,u.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,this.cache.add(a,i)),o=i}if(n||s||r){let a="ClonedMaterial:"+o.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=o.clone(),s&&(i.vertexColors=!0),r&&(i.flatShading=!0),n&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(o))),o=i}t.material=o}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(t){const e=this,o=this.json,n=this.extensions,s=o.materials[t];let r;const a={},i=s.extensions||{},c=[];if(i[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],u.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(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=u.DoubleSide);const d=s.alphaMode||q.OPAQUE;if(d===q.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===q.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==u.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),D(l,s),e.associations.set(l,{materials:t}),s.extensions&&F(n,l,s),l})}createUniqueName(t){const e=u.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,o=this.extensions,n=this.primitiveCache;function s(a){return o[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(i){return ne(i,a,e)})}const r=[];for(let a=0,i=t.length;a<i;a++){const c=t[a],d=Ge(c),l=n[d];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=ne(new u.BufferGeometry,c,e),n[d]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,o=this.json,n=this.extensions,s=o.meshes[t],r=s.primitives,a=[];for(let i=0,c=r.length;i<c;i++){const d=r[i].material===void 0?De(this.cache):this.getDependency("material",r[i].material);a.push(d)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(i){const c=i.slice(0,i.length-1),d=i[i.length-1],l=[];for(let m=0,T=d.length;m<T;m++){const E=d[m],R=r[m];let g;const x=c[m];if(R.mode===v.TRIANGLES||R.mode===v.TRIANGLE_STRIP||R.mode===v.TRIANGLE_FAN||R.mode===void 0)g=s.isSkinnedMesh===!0?new u.SkinnedMesh(E,x):new u.Mesh(E,x),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),R.mode===v.TRIANGLE_STRIP?g.geometry=Q(g.geometry,u.TriangleStripDrawMode):R.mode===v.TRIANGLE_FAN&&(g.geometry=Q(g.geometry,u.TriangleFanDrawMode));else if(R.mode===v.LINES)g=new u.LineSegments(E,x);else if(R.mode===v.LINE_STRIP)g=new u.Line(E,x);else if(R.mode===v.LINE_LOOP)g=new u.LineLoop(E,x);else if(R.mode===v.POINTS)g=new u.Points(E,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(g.geometry.morphAttributes).length>0&&Fe(g,s),g.name=e.createUniqueName(s.name||"mesh_"+t),D(g,s),R.extensions&&F(n,g,R),e.assignFinalMaterial(g),l.push(g)}for(let m=0,T=l.length;m<T;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 u.Group;s.extensions&&F(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,T=l.length;m<T;m++)h.add(l[m]);return h})}loadCamera(t){let e;const o=this.json.cameras[t],n=o[o.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return o.type==="perspective"?e=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):o.type==="orthographic"&&(e=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),o.name&&(e.name=this.createUniqueName(o.name)),D(e,o),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],o=[];for(let n=0,s=e.joints.length;n<s;n++)o.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?o.push(this.getDependency("accessor",e.inverseBindMatrices)):o.push(null),Promise.all(o).then(function(n){const s=n.pop(),r=n,a=[],i=[];for(let c=0,d=r.length;c<d;c++){const l=r[c];if(l){a.push(l);const h=new u.Matrix4;s!==null&&h.fromArray(s.array,c*16),i.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new u.Skeleton(a,i)})}loadAnimation(t){const e=this.json,o=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],i=[],c=[],d=[];for(let l=0,h=n.channels.length;l<h;l++){const m=n.channels[l],T=n.samplers[m.sampler],E=m.target,R=E.node,g=n.parameters!==void 0?n.parameters[T.input]:T.input,x=n.parameters!==void 0?n.parameters[T.output]:T.output;E.node!==void 0&&(r.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",g)),i.push(this.getDependency("accessor",x)),c.push(T),d.push(E))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(i),Promise.all(c),Promise.all(d)]).then(function(l){const h=l[0],m=l[1],T=l[2],E=l[3],R=l[4],g=[];for(let x=0,y=h.length;x<y;x++){const M=h[x],S=m[x],_=T[x],w=E[x],O=R[x];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const b=o._createAnimationTracks(M,S,_,w,O);if(b)for(let P=0;P<b.length;P++)g.push(b[P])}return new u.AnimationClip(s,void 0,g)})}createNodeMesh(t){const e=this.json,o=this,n=e.nodes[t];return n.mesh===void 0?null:o.getDependency("mesh",n.mesh).then(function(s){const r=o._getNodeRef(o.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let i=0,c=n.weights.length;i<c;i++)a.morphTargetInfluences[i]=n.weights[i]}),r})}loadNode(t){const e=this.json,o=this,n=e.nodes[t],s=o._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)r.push(o.getDependency("node",a[c]));const i=n.skin===void 0?Promise.resolve(null):o.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),i]).then(function(c){const d=c[0],l=c[1],h=c[2];h!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(h,Be)});for(let m=0,T=l.length;m<T;m++)d.add(l[m]);return d})}_loadNodeShallow(t){const e=this.json,o=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=[],i=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return i&&a.push(i),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,h=c.length;l<h;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=r),D(d,s),s.extensions&&F(o,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=t,d}),this.nodeCache[t]}loadScene(t){const e=this.extensions,o=this.json.scenes[t],n=this,s=new u.Group;o.name&&(s.name=n.createUniqueName(o.name)),D(s,o),o.extensions&&F(e,s,o);const r=o.nodes||[],a=[];for(let i=0,c=r.length;i<c;i++)a.push(n.getDependency("node",r[i]));return Promise.all(a).then(function(i){for(let d=0,l=i.length;d<l;d++)s.add(i[d]);const c=d=>{const l=new Map;for(const[h,m]of n.associations)(h instanceof u.Material||h instanceof u.Texture)&&l.set(h,m);return d.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,o,n,s){const r=[],a=t.name?t.name:t.uuid,i=[];k[s.path]===k.weights?t.traverse(function(h){h.morphTargetInfluences&&i.push(h.name?h.name:h.uuid)}):i.push(a);let c;switch(k[s.path]){case k.weights:c=u.NumberKeyframeTrack;break;case k.rotation:c=u.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=u.VectorKeyframeTrack;break;default:switch(o.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Pe[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(o);for(let h=0,m=i.length;h<m;h++){const T=new c(i[h]+"."+k[s.path],e.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(T),r.push(T)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const o=Y(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*o;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(o){const n=this instanceof u.QuaternionKeyframeTrack?ve:re;return new n(this.times,this.values,this.getValueSize()/3,o)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function je(f,t,e){const o=t.attributes,n=new u.Box3;if(o.POSITION!==void 0){const a=e.json.accessors[o.POSITION],i=a.min,c=a.max;if(i!==void 0&&c!==void 0){if(n.set(new u.Vector3(i[0],i[1],i[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=Y(G[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new u.Vector3,i=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],m=h.min,T=h.max;if(m!==void 0&&T!==void 0){if(i.setX(Math.max(Math.abs(m[0]),Math.abs(T[0]))),i.setY(Math.max(Math.abs(m[1]),Math.abs(T[1]))),i.setZ(Math.max(Math.abs(m[2]),Math.abs(T[2]))),h.normalized){const E=Y(G[h.componentType]);i.multiplyScalar(E)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new u.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function ne(f,t,e){const o=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(i){f.setAttribute(a,i)})}for(const r in o){const a=$[r]||r.toLowerCase();a in f.attributes||n.push(s(o[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 u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in o&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),D(f,t),je(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?ke(f,t.targets,e):f})}function Ve(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),o=p.ref(null),n=new z.MTLLoader,s=new ie.OBJLoader,r=new z.STLLoader,a=new ce,i=new z.PCDLoader,c=async l=>{var R;if(!l||l.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],o.value=null;const h=new Map,m=[];l.forEach(g=>{if(g instanceof File){const x=g.name.toLowerCase();h.set(x,g),x.endsWith(".pcd")&&m.push(g)}});const T=[],E=[];try{if(m.length>0){t.value=`正在加载 ${m.length} 个点云文件...`;const g=await d(m,T);g&&E.push(g)}for(const g of l){const x=g.name||"unknown_file",y=(R=x.split(".").pop())==null?void 0:R.toLowerCase();if(y==="mtl"||y==="pcd")continue;const M=URL.createObjectURL(g);T.push(M);let S=null;const _=w=>{const O=w.lengthComputable?w.loaded/w.total*100:0;t.value=`正在加载 ${x}... ${Math.round(O)}%`};switch(t.value=`正在加载 ${x}... 0%`,y){case"obj":const w=x.replace(/\.obj$/i,".mtl").toLowerCase();if(h.has(w)){const C=h.get(w),U=URL.createObjectURL(C);T.push(U);const j=await n.loadAsync(U);j.preload(),s.setMaterials(j)}else s.setMaterials(null);S=await s.loadAsync(M,_),S&&K.computeVertexNormals(S);break;case"stl":const O=await r.loadAsync(M,_),b=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});S=new u.Mesh(O,b);break;case"gltf":case"glb":S=(await a.loadAsync(M,_)).scene;break;default:console.warn(`不支持的文件类型: .${y}`),t.value=`不支持的文件类型: ${x}`;continue}S&&(S.userData.boundingBox=new u.Box3().setFromObject(S),E.push(S))}e.value=E,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),o.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,T.forEach(g=>URL.revokeObjectURL(g))}},d=async(l,h)=>{if(l.length===0)return null;const m=new u.Group;m.name="PCD Point Clouds";try{for(let E=0;E<l.length;E++){const R=l[E],g=R.name||`point_cloud_${E}.pcd`;t.value=`正在加载点云文件 ${E+1}/${l.length}: ${g}`;try{const x=URL.createObjectURL(R);h.push(x);const y=await new Promise((M,S)=>{i.load(x,_=>{const w=_.geometry.attributes.position,O=_.geometry.attributes.color;if(O&&O.count===w.count)_.userData.color="原始颜色";else{const P=new Float32Array(w.count*3);for(let C=0;C<w.count;C++)P[C*3]=0,P[C*3+1]=0,P[C*3+2]=0;_.geometry.setAttribute("color",new u.BufferAttribute(P,3)),_.userData.color="黑色"}_.material instanceof u.PointsMaterial&&(_.material.vertexColors=!0,_.material.size=.8,_.material.sizeAttenuation=!1),_.name=g,_.userData.originalFile=g,M(_)},void 0,_=>{console.error(`PCD文件加载失败: ${g}`,_),S(_)})});m.add(y)}catch(x){console.error(`加载点云文件失败: ${g}`,x)}}if(m.children.length===0)return console.warn("所有PCD文件都加载失败"),null;const T=new u.Box3().setFromObject(m);return m.userData.boundingBox=T,m}catch(T){throw console.error("PCD文件组加载失败:",T),new Error("无法加载PCD点云文件")}};return{isLoading:f,loadingProgress:t,loadedModels:e,error:o,loadModelsFromBlobs:c}}const Ke={class:"obj-viewer-container"},ze={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},We={class:"left-panel"},$e={class:"panel-header"},Ye={key:0,class:"clipping-content"},Je={class:"radio-group"},Qe={class:"radio-label"},Ze={class:"radio-label"},et={class:"radio-label"},tt={class:"radio-label"},nt={key:0,class:"loading-overlay"},st=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),o=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:i,getThreeJSObjects:c,cleanup:d,setModels:l,axesHelperVisible:h,toggleAxesVisibility:m,zoomIn:T,zoomOut:E}=K.useThreeJS(e),{isLoading:R,loadingProgress:g,loadedModels:x,error:y,loadModelsFromBlobs:M}=Ve(),{isAnimating:S,toggleAnimation:_,stopAnimation:w}=K.useAnimation(c,s),{isClipping:O,activeClippingAxis:b,toggleClipping:P,updateClippingPlanes:C}=K.useClipping(c,s),U=()=>{m()};p.watch(()=>t.fileBlobs,N=>{N&&N.length>0&&M(N).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(x,N=>{N&&N.length>0&&l(N)}),p.watch(y,N=>{N&&J.ElMessage.error(`模型加载失败: ${N}`)});const j=N=>{o.value=!0,n.value=N,N==="剖面视图"&&!O.value&&P()};let V=null;return p.onMounted(async()=>{await p.nextTick();try{a(),e.value&&(V=new ResizeObserver(i),V.observe(e.value))}catch(N){console.error("Three.js 初始化失败:",N),J.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",V&&V.disconnect(),S.value&&w(),d()}),(N,A)=>{const oe=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",Ke,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),p.createElementVNode("div",ze,[p.createVNode(H.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:p.unref(T)},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:p.unref(E)},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(_),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(H.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(h),onClick:U,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Xe,[p.renderSlot(N.$slots,"button-left",{switchRightPanel:j},void 0,!0)]),p.createElementVNode("div",qe,[p.renderSlot(N.$slots,"button-right",{},void 0,!0)]),A[14]||(A[14]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",We,[p.createElementVNode("div",$e,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[0]||(A[0]=I=>o.value=!1)}," X ")]),p.createVNode(oe,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",Ye,[p.createElementVNode("div",Je,[p.createElementVNode("label",Qe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[1]||(A[1]=I=>p.isRef(b)?b.value=I:null),onChange:A[2]||(A[2]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[9]||(A[9]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ze,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[3]||(A[3]=I=>p.isRef(b)?b.value=I:null),onChange:A[4]||(A[4]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",et,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[5]||(A[5]=I=>p.isRef(b)?b.value=I:null),onChange:A[6]||(A[6]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",tt,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[7]||(A[7]=I=>p.isRef(b)?b.value=I:null),onChange:A[8]||(A[8]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,o.value]]),p.unref(R)?(p.openBlock(),p.createElementBlock("div",nt,[A[13]||(A[13]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(g)),1)])):p.createCommentVNode("",!0)])}}}),rt=ae._export_sfc(st,[["__scopeId","data-v-53f2a047"]]);exports.default=rt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),K=require("./iconfont-Btynh8XG.cjs"),u=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs"),J=require("./index-CEwxrYB-.cjs"),ie=require("./OBJLoader-8gDmNV2i.cjs"),z=require("./PCDLoader-D-K96lwY.cjs"),H=require("./svgIcon-BH_8oaav.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function Q(f,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let i=0;i<a.count;i++)r.push(i);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const o=e.count-2,n=[];if(t===u.TriangleFanDrawMode)for(let r=1;r<=o;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<o;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!==o&&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 ce extends u.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new he(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new we(e)})}load(t,e,o,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(t);r=u.LoaderUtils.resolveURL(c,this.path)}else r=u.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)},i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,function(c){try{s.parse(c,r,function(d){e(d),s.manager.itemEnd(t)},a)}catch(d){a(d)}},o,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,o,n){let s;const r={},a={},i=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(i.decode(new Uint8Array(t,0,4))===se){try{r[L.KHR_BINARY_GLTF]=new be(t)}catch(l){n&&n(l);return}s=JSON.parse(r[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(i.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 Ue(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 d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],h=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:r[l]=new de;break;case L.KHR_DRACO_MESH_COMPRESSION:r[l]=new Ne(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:r[l]=new Ce;break;case L.KHR_MESH_QUANTIZATION:r[l]=new Ie;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(o,n)}parseAsync(t,e){const o=this;return new Promise(function(n,s){o.parse(t,e,n,s)})}}function le(){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 L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ue{constructor(t){this.parser=t,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let o=0,n=e.length;o<n;o++){const s=e[o];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,o="light:"+t;let n=e.cache.get(o);if(n)return n;const s=e.json,i=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const d=new u.Color(16777215);i.color!==void 0&&d.setRGB(i.color[0],i.color[1],i.color[2],u.LinearSRGBColorSpace);const l=i.range!==void 0?i.range:0;switch(i.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,c.angle=i.spot.outerConeAngle,c.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return c.position.set(0,0,0),D(c,i),i.intensity!==void 0&&(c.intensity=i.intensity),c.name=e.createUniqueName(i.name||"light_"+t),n=Promise.resolve(c),e.cache.add(o,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,o=this.parser,s=o.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return o._getNodeRef(e.cache,a,i)})}}class de{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(t,e,o){const n=[];t.color=new u.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],u.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(o.assignTexture(t,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class fe{constructor(t){this.parser=t,this.name=L.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 he{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(o.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(o.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class pe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.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 me{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.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(o.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class ge{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new u.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],u.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(o.assignTexture(e,"sheenColorMap",r.sheenColorTexture,u.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(o.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class Te{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class Re{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class xe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IOR}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.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 Ee{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(o.assignTexture(e,"specularColorMap",r.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class Me{constructor(t){this.parser=t,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class Le{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const o=this.parser.json.materials[t];return!o.extensions||!o.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const o=this.parser,n=o.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(o.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class Ae{constructor(t){this.parser=t,this.name=L.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,o=e.json,n=o.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(o.extensionsRequired&&o.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 _e{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,o=this.parser,n=o.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return o.loadTextureImage(t,r.source,i)}}class ye{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,o=this.parser,n=o.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return o.loadTextureImage(t,r.source,i)}}class Se{constructor(t){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,o=e.bufferViews[t];if(o.extensions&&o.extensions[this.name]){const n=o.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 i=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,h=new Uint8Array(a,i,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(d,l,h,n.mode,n.filter).then(function(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(d*l);return r.decodeGltfBuffer(new Uint8Array(m),d,l,h,n.mode,n.filter),m})})}else return null}}class we{constructor(t){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,o=e.nodes[t];if(!o.extensions||!o.extensions[this.name]||o.mesh===void 0)return null;const n=e.meshes[o.mesh];for(const c of n.primitives)if(c.mode!==v.TRIANGLES&&c.mode!==v.TRIANGLE_STRIP&&c.mode!==v.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=o.extensions[this.name].attributes,a=[],i={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(d=>(i[c]=d,i[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const T of l){const E=new u.Matrix4,R=new u.Vector3,g=new u.Quaternion,x=new u.Vector3(1,1,1),y=new u.InstancedMesh(T.geometry,T.material,h);for(let M=0;M<h;M++)i.TRANSLATION&&R.fromBufferAttribute(i.TRANSLATION,M),i.ROTATION&&g.fromBufferAttribute(i.ROTATION,M),i.SCALE&&x.fromBufferAttribute(i.SCALE,M),y.setMatrixAt(M,E.compose(R,g,x));for(const M in i)if(M==="_COLOR_0"){const S=i[M];y.instanceColor=new u.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else M!=="TRANSLATION"&&M!=="ROTATION"&&M!=="SCALE"&&T.geometry.setAttribute(M,i[M]);u.Object3D.prototype.copy.call(y,T),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const se="glTF",B=12,Z={JSON:1313821514,BIN:5130562};class be{constructor(t){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,B),o=new TextDecoder;if(this.header={magic:o.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==se)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-B,s=new DataView(t,B);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const i=s.getUint32(r,!0);if(r+=4,i===Z.JSON){const c=new Uint8Array(t,B+r,a);this.content=o.decode(c)}else if(i===Z.BIN){const c=B+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Ne{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const o=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},i={},c={};for(const d in r){const l=$[d]||d.toLowerCase();a[l]=r[d]}for(const d in t.attributes){const l=$[d]||d.toLowerCase();if(r[d]!==void 0){const h=o.accessors[t.attributes[d]],m=G[h.componentType];c[l]=m.name,i[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(d){return new Promise(function(l,h){n.decodeDracoFile(d,function(m){for(const T in m.attributes){const E=m.attributes[T],R=i[T];R!==void 0&&(E.normalized=R)}l(m)},a,c,u.LinearSRGBColorSpace,h)})})}}class Ce{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Ie{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class re extends u.Interpolant{constructor(t,e,o,n){super(t,e,o,n)}copySampleValue_(t){const e=this.resultBuffer,o=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=o[s+r];return e}interpolate_(t,e,o,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,i=a*2,c=a*3,d=n-e,l=(o-e)/d,h=l*l,m=h*l,T=t*c,E=T-c,R=-2*m+3*h,g=m-h,x=1-R,y=g-h+l;for(let M=0;M!==a;M++){const S=r[E+M+a],_=r[E+M+i]*d,w=r[T+M+a],O=r[T+M]*d;s[M]=x*S+y*_+R*w+g*O}return s}}const Oe=new u.Quaternion;class ve extends re{interpolate_(t,e,o,n){const s=super.interpolate_(t,e,o,n);return Oe.fromArray(s).normalize().toArray(s),s}}const v={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},G={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ee={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},te={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},X={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Pe={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},q={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function De(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),f.DefaultMaterial}function F(f,t,e){for(const o in e.extensions)f[o]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[o]=e.extensions[o])}function D(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 ke(f,t,e){let o=!1,n=!1,s=!1;for(let c=0,d=t.length;c<d;c++){const l=t[c];if(l.POSITION!==void 0&&(o=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),o&&n&&s)break}if(!o&&!n&&!s)return Promise.resolve(f);const r=[],a=[],i=[];for(let c=0,d=t.length;c<d;c++){const l=t[c];if(o){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;i.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(i)]).then(function(c){const d=c[0],l=c[1],h=c[2];return o&&(f.morphAttributes.position=d),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function Fe(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,o=t.weights.length;e<o;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 o=0,n=e.length;o<n;o++)f.morphTargetDictionary[e[o]]=o}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ge(f){let t;const e=f.extensions&&f.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+W(e.attributes):t=f.indices+":"+W(f.attributes)+":"+f.mode,f.targets!==void 0)for(let o=0,n=f.targets.length;o<n;o++)t+=":"+W(f.targets[o]);return t}function W(f){let t="";const e=Object.keys(f).sort();for(let o=0,n=e.length;o<n;o++)t+=e[o]+":"+f[e[o]]+";";return t}function Y(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 He(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 Be=new u.Matrix4;class Ue{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new le,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 o=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;o=/^((?!chrome|android).)*safari/i.test(a)===!0;const i=a.match(/Version\/(\d+)/);n=o&&i?parseInt(i[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||o&&n<17||s&&r<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const o=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([o.getDependencies("scene"),o.getDependencies("animation"),o.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:o,userData:{}};return F(s,a,n),D(a,n),Promise.all(o._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],o=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,i=r.length;a<i;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&&(o[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,o){if(t.refs[e]<=1)return o;const n=o.clone(),s=(r,a)=>{const i=this.associations.get(r);i!=null&&this.associations.set(a,i);for(const[c,d]of r.children.entries())s(d,a.children[c])};return s(o,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let o=0;o<e.length;o++){const n=t(e[o]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const o=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&o.push(s)}return o}getDependency(t,e){const o=t+":"+e;let n=this.cache.get(o);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(o,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const o=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return o.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],o=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[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){o.load(u.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(o){const n=e.byteLength||0,s=e.byteOffset||0;return o.slice(s,s+n)})}loadAccessor(t){const e=this,o=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=X[n.type],a=G[n.componentType],i=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new u.BufferAttribute(c,r,i))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(r){const a=r[0],i=X[n.type],c=G[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*i,h=n.byteOffset||0,m=n.bufferView!==void 0?o.bufferViews[n.bufferView].byteStride:void 0,T=n.normalized===!0;let E,R;if(m&&m!==l){const g=Math.floor(h/m),x="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+g+":"+n.count;let y=e.cache.get(x);y||(E=new c(a,g*m,n.count*m/d),y=new u.InterleavedBuffer(E,m/d),e.cache.add(x,y)),R=new u.InterleavedBufferAttribute(y,i,h%m/d,T)}else a===null?E=new c(n.count*i):E=new c(a,h,n.count*i),R=new u.BufferAttribute(E,i,T);if(n.sparse!==void 0){const g=X.SCALAR,x=G[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,M=n.sparse.values.byteOffset||0,S=new x(r[1],y,n.sparse.count*g),_=new c(r[2],M,n.sparse.count*i);a!==null&&(R=new u.BufferAttribute(R.array.slice(),R.itemSize,R.normalized)),R.normalized=!1;for(let w=0,O=S.length;w<O;w++){const b=S[w];if(R.setX(b,_[w*i]),i>=2&&R.setY(b,_[w*i+1]),i>=3&&R.setZ(b,_[w*i+2]),i>=4&&R.setW(b,_[w*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}R.normalized=T}return R})}loadTexture(t){const e=this.json,o=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const i=o.manager.getHandler(r.uri);i!==null&&(a=i)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,o){const n=this,s=this.json,r=s.textures[t],a=s.images[e],i=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[i])return this.textureCache[i];const c=this.loadImageSource(e,o).then(function(d){d.flipY=!1,d.name=r.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return d.magFilter=ee[h.magFilter]||u.LinearFilter,d.minFilter=ee[h.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=te[h.wrapS]||u.RepeatWrapping,d.wrapT=te[h.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:t}),d}).catch(function(){return null});return this.textureCache[i]=c,c}loadImageSource(t,e){const o=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 i=r.uri||"",c=!1;if(r.bufferView!==void 0)i=o.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return i=a.createObjectURL(h),i});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const d=Promise.resolve(i).then(function(l){return new Promise(function(h,m){let T=h;e.isImageBitmapLoader===!0&&(T=function(E){const R=new u.Texture(E);R.needsUpdate=!0,h(R)}),e.load(u.LoaderUtils.resolveURL(l,s.path),T,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(i),D(l,r),l.userData.mimeType=r.mimeType||He(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),l});return this.sourceCache[t]=d,d}assignTexture(t,e,o,n){const s=this;return this.getDependency("texture",o.index).then(function(r){if(!r)return null;if(o.texCoord!==void 0&&o.texCoord>0&&(r=r.clone(),r.channel=o.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=o.extensions!==void 0?o.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=s.associations.get(r);r=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,i)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let o=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:"+o.uuid;let i=this.cache.get(a);i||(i=new u.PointsMaterial,u.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,i.sizeAttenuation=!1,this.cache.add(a,i)),o=i}else if(t.isLine){const a="LineBasicMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new u.LineBasicMaterial,u.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,this.cache.add(a,i)),o=i}if(n||s||r){let a="ClonedMaterial:"+o.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=o.clone(),s&&(i.vertexColors=!0),r&&(i.flatShading=!0),n&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(o))),o=i}t.material=o}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(t){const e=this,o=this.json,n=this.extensions,s=o.materials[t];let r;const a={},i=s.extensions||{},c=[];if(i[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],u.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(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=u.DoubleSide);const d=s.alphaMode||q.OPAQUE;if(d===q.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===q.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==u.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),D(l,s),e.associations.set(l,{materials:t}),s.extensions&&F(n,l,s),l})}createUniqueName(t){const e=u.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,o=this.extensions,n=this.primitiveCache;function s(a){return o[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(i){return ne(i,a,e)})}const r=[];for(let a=0,i=t.length;a<i;a++){const c=t[a],d=Ge(c),l=n[d];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=ne(new u.BufferGeometry,c,e),n[d]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,o=this.json,n=this.extensions,s=o.meshes[t],r=s.primitives,a=[];for(let i=0,c=r.length;i<c;i++){const d=r[i].material===void 0?De(this.cache):this.getDependency("material",r[i].material);a.push(d)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(i){const c=i.slice(0,i.length-1),d=i[i.length-1],l=[];for(let m=0,T=d.length;m<T;m++){const E=d[m],R=r[m];let g;const x=c[m];if(R.mode===v.TRIANGLES||R.mode===v.TRIANGLE_STRIP||R.mode===v.TRIANGLE_FAN||R.mode===void 0)g=s.isSkinnedMesh===!0?new u.SkinnedMesh(E,x):new u.Mesh(E,x),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),R.mode===v.TRIANGLE_STRIP?g.geometry=Q(g.geometry,u.TriangleStripDrawMode):R.mode===v.TRIANGLE_FAN&&(g.geometry=Q(g.geometry,u.TriangleFanDrawMode));else if(R.mode===v.LINES)g=new u.LineSegments(E,x);else if(R.mode===v.LINE_STRIP)g=new u.Line(E,x);else if(R.mode===v.LINE_LOOP)g=new u.LineLoop(E,x);else if(R.mode===v.POINTS)g=new u.Points(E,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(g.geometry.morphAttributes).length>0&&Fe(g,s),g.name=e.createUniqueName(s.name||"mesh_"+t),D(g,s),R.extensions&&F(n,g,R),e.assignFinalMaterial(g),l.push(g)}for(let m=0,T=l.length;m<T;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 u.Group;s.extensions&&F(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,T=l.length;m<T;m++)h.add(l[m]);return h})}loadCamera(t){let e;const o=this.json.cameras[t],n=o[o.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return o.type==="perspective"?e=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):o.type==="orthographic"&&(e=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),o.name&&(e.name=this.createUniqueName(o.name)),D(e,o),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],o=[];for(let n=0,s=e.joints.length;n<s;n++)o.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?o.push(this.getDependency("accessor",e.inverseBindMatrices)):o.push(null),Promise.all(o).then(function(n){const s=n.pop(),r=n,a=[],i=[];for(let c=0,d=r.length;c<d;c++){const l=r[c];if(l){a.push(l);const h=new u.Matrix4;s!==null&&h.fromArray(s.array,c*16),i.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new u.Skeleton(a,i)})}loadAnimation(t){const e=this.json,o=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],i=[],c=[],d=[];for(let l=0,h=n.channels.length;l<h;l++){const m=n.channels[l],T=n.samplers[m.sampler],E=m.target,R=E.node,g=n.parameters!==void 0?n.parameters[T.input]:T.input,x=n.parameters!==void 0?n.parameters[T.output]:T.output;E.node!==void 0&&(r.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",g)),i.push(this.getDependency("accessor",x)),c.push(T),d.push(E))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(i),Promise.all(c),Promise.all(d)]).then(function(l){const h=l[0],m=l[1],T=l[2],E=l[3],R=l[4],g=[];for(let x=0,y=h.length;x<y;x++){const M=h[x],S=m[x],_=T[x],w=E[x],O=R[x];if(M===void 0)continue;M.updateMatrix&&M.updateMatrix();const b=o._createAnimationTracks(M,S,_,w,O);if(b)for(let P=0;P<b.length;P++)g.push(b[P])}return new u.AnimationClip(s,void 0,g)})}createNodeMesh(t){const e=this.json,o=this,n=e.nodes[t];return n.mesh===void 0?null:o.getDependency("mesh",n.mesh).then(function(s){const r=o._getNodeRef(o.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let i=0,c=n.weights.length;i<c;i++)a.morphTargetInfluences[i]=n.weights[i]}),r})}loadNode(t){const e=this.json,o=this,n=e.nodes[t],s=o._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)r.push(o.getDependency("node",a[c]));const i=n.skin===void 0?Promise.resolve(null):o.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),i]).then(function(c){const d=c[0],l=c[1],h=c[2];h!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(h,Be)});for(let m=0,T=l.length;m<T;m++)d.add(l[m]);return d})}_loadNodeShallow(t){const e=this.json,o=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=[],i=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return i&&a.push(i),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,h=c.length;l<h;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=r),D(d,s),s.extensions&&F(o,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=t,d}),this.nodeCache[t]}loadScene(t){const e=this.extensions,o=this.json.scenes[t],n=this,s=new u.Group;o.name&&(s.name=n.createUniqueName(o.name)),D(s,o),o.extensions&&F(e,s,o);const r=o.nodes||[],a=[];for(let i=0,c=r.length;i<c;i++)a.push(n.getDependency("node",r[i]));return Promise.all(a).then(function(i){for(let d=0,l=i.length;d<l;d++)s.add(i[d]);const c=d=>{const l=new Map;for(const[h,m]of n.associations)(h instanceof u.Material||h instanceof u.Texture)&&l.set(h,m);return d.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,o,n,s){const r=[],a=t.name?t.name:t.uuid,i=[];k[s.path]===k.weights?t.traverse(function(h){h.morphTargetInfluences&&i.push(h.name?h.name:h.uuid)}):i.push(a);let c;switch(k[s.path]){case k.weights:c=u.NumberKeyframeTrack;break;case k.rotation:c=u.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=u.VectorKeyframeTrack;break;default:switch(o.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Pe[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(o);for(let h=0,m=i.length;h<m;h++){const T=new c(i[h]+"."+k[s.path],e.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(T),r.push(T)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const o=Y(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*o;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(o){const n=this instanceof u.QuaternionKeyframeTrack?ve:re;return new n(this.times,this.values,this.getValueSize()/3,o)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function je(f,t,e){const o=t.attributes,n=new u.Box3;if(o.POSITION!==void 0){const a=e.json.accessors[o.POSITION],i=a.min,c=a.max;if(i!==void 0&&c!==void 0){if(n.set(new u.Vector3(i[0],i[1],i[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=Y(G[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new u.Vector3,i=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],m=h.min,T=h.max;if(m!==void 0&&T!==void 0){if(i.setX(Math.max(Math.abs(m[0]),Math.abs(T[0]))),i.setY(Math.max(Math.abs(m[1]),Math.abs(T[1]))),i.setZ(Math.max(Math.abs(m[2]),Math.abs(T[2]))),h.normalized){const E=Y(G[h.componentType]);i.multiplyScalar(E)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new u.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function ne(f,t,e){const o=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(i){f.setAttribute(a,i)})}for(const r in o){const a=$[r]||r.toLowerCase();a in f.attributes||n.push(s(o[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 u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in o&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),D(f,t),je(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?ke(f,t.targets,e):f})}function Ve(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),o=p.ref(null),n=new z.MTLLoader,s=new ie.OBJLoader,r=new z.STLLoader,a=new ce,i=new z.PCDLoader,c=async l=>{var R;if(!l||l.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],o.value=null;const h=new Map,m=[];l.forEach(g=>{if(g instanceof File){const x=g.name.toLowerCase();h.set(x,g),x.endsWith(".pcd")&&m.push(g)}});const T=[],E=[];try{if(m.length>0){t.value=`正在加载 ${m.length} 个点云文件...`;const g=await d(m,T);g&&E.push(g)}for(const g of l){const x=g.name||"unknown_file",y=(R=x.split(".").pop())==null?void 0:R.toLowerCase();if(y==="mtl"||y==="pcd")continue;const M=URL.createObjectURL(g);T.push(M);let S=null;const _=w=>{const O=w.lengthComputable?w.loaded/w.total*100:0;t.value=`正在加载 ${x}... ${Math.round(O)}%`};switch(t.value=`正在加载 ${x}... 0%`,y){case"obj":const w=x.replace(/\.obj$/i,".mtl").toLowerCase();if(h.has(w)){const C=h.get(w),U=URL.createObjectURL(C);T.push(U);const j=await n.loadAsync(U);j.preload(),s.setMaterials(j)}else s.setMaterials(null);S=await s.loadAsync(M,_),S&&K.computeVertexNormals(S);break;case"stl":const O=await r.loadAsync(M,_),b=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});S=new u.Mesh(O,b);break;case"gltf":case"glb":S=(await a.loadAsync(M,_)).scene;break;default:console.warn(`不支持的文件类型: .${y}`),t.value=`不支持的文件类型: ${x}`;continue}S&&(S.userData.boundingBox=new u.Box3().setFromObject(S),E.push(S))}e.value=E,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),o.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,T.forEach(g=>URL.revokeObjectURL(g))}},d=async(l,h)=>{if(l.length===0)return null;const m=new u.Group;m.name="PCD Point Clouds";try{for(let E=0;E<l.length;E++){const R=l[E],g=R.name||`point_cloud_${E}.pcd`;t.value=`正在加载点云文件 ${E+1}/${l.length}: ${g}`;try{const x=URL.createObjectURL(R);h.push(x);const y=await new Promise((M,S)=>{i.load(x,_=>{const w=_.geometry.attributes.position,O=_.geometry.attributes.color;if(O&&O.count===w.count)_.userData.color="原始颜色";else{const P=new Float32Array(w.count*3);for(let C=0;C<w.count;C++)P[C*3]=0,P[C*3+1]=0,P[C*3+2]=0;_.geometry.setAttribute("color",new u.BufferAttribute(P,3)),_.userData.color="黑色"}_.material instanceof u.PointsMaterial&&(_.material.vertexColors=!0,_.material.size=.8,_.material.sizeAttenuation=!1),_.name=g,_.userData.originalFile=g,M(_)},void 0,_=>{console.error(`PCD文件加载失败: ${g}`,_),S(_)})});m.add(y)}catch(x){console.error(`加载点云文件失败: ${g}`,x)}}if(m.children.length===0)return console.warn("所有PCD文件都加载失败"),null;const T=new u.Box3().setFromObject(m);return m.userData.boundingBox=T,m}catch(T){throw console.error("PCD文件组加载失败:",T),new Error("无法加载PCD点云文件")}};return{isLoading:f,loadingProgress:t,loadedModels:e,error:o,loadModelsFromBlobs:c}}const Ke={class:"obj-viewer-container"},ze={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},qe={class:"buttonGroup-right"},We={class:"left-panel"},$e={class:"panel-header"},Ye={key:0,class:"clipping-content"},Je={class:"radio-group"},Qe={class:"radio-label"},Ze={class:"radio-label"},et={class:"radio-label"},tt={class:"radio-label"},nt={key:0,class:"loading-overlay"},st=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),o=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:i,getThreeJSObjects:c,cleanup:d,setModels:l,axesHelperVisible:h,toggleAxesVisibility:m,zoomIn:T,zoomOut:E}=K.useThreeJS(e),{isLoading:R,loadingProgress:g,loadedModels:x,error:y,loadModelsFromBlobs:M}=Ve(),{isAnimating:S,toggleAnimation:_,stopAnimation:w}=K.useAnimation(c,s),{isClipping:O,activeClippingAxis:b,toggleClipping:P,updateClippingPlanes:C}=K.useClipping(c,s),U=()=>{m()};p.watch(()=>t.fileBlobs,N=>{N&&N.length>0&&M(N).catch(A=>{console.error("加载错误:",A)})},{immediate:!0,deep:!0}),p.watch(x,N=>{N&&N.length>0&&l(N)}),p.watch(y,N=>{N&&J.ElMessage.error(`模型加载失败: ${N}`)});const j=N=>{o.value=!0,n.value=N,N==="剖面视图"&&!O.value&&P()};let V=null;return p.onMounted(async()=>{await p.nextTick();try{a(),e.value&&(V=new ResizeObserver(i),V.observe(e.value))}catch(N){console.error("Three.js 初始化失败:",N),J.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",V&&V.disconnect(),S.value&&w(),d()}),(N,A)=>{const oe=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",Ke,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),p.createElementVNode("div",ze,[p.createVNode(H.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:p.unref(T)},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:p.unref(E)},null,8,["onClick"]),p.createVNode(H.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:p.unref(_),title:p.unref(S)?"停止动画":"动画视图"},null,8,["onClick","title"]),p.createVNode(H.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:p.unref(h),onClick:U,title:"显隐坐标轴"},null,8,["active"])]),p.createElementVNode("div",Xe,[p.renderSlot(N.$slots,"button-left",{switchRightPanel:j},void 0,!0)]),p.createElementVNode("div",qe,[p.renderSlot(N.$slots,"button-right",{},void 0,!0)]),A[14]||(A[14]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",We,[p.createElementVNode("div",$e,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:A[0]||(A[0]=I=>o.value=!1)}," X ")]),p.createVNode(oe,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",Ye,[p.createElementVNode("div",Je,[p.createElementVNode("label",Qe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":A[1]||(A[1]=I=>p.isRef(b)?b.value=I:null),onChange:A[2]||(A[2]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[9]||(A[9]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ze,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":A[3]||(A[3]=I=>p.isRef(b)?b.value=I:null),onChange:A[4]||(A[4]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[10]||(A[10]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",et,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":A[5]||(A[5]=I=>p.isRef(b)?b.value=I:null),onChange:A[6]||(A[6]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[11]||(A[11]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",tt,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":A[7]||(A[7]=I=>p.isRef(b)?b.value=I:null),onChange:A[8]||(A[8]=(...I)=>p.unref(C)&&p.unref(C)(...I))},null,544),[[p.vModelRadio,p.unref(b)]]),A[12]||(A[12]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,o.value]]),p.unref(R)?(p.openBlock(),p.createElementBlock("div",nt,[A[13]||(A[13]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(g)),1)])):p.createCommentVNode("",!0)])}}}),rt=ae._export_sfc(st,[["__scopeId","data-v-53f2a047"]]);exports.default=rt;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as Ee, ref as b, watch as se, shallowRef as ve, computed as _e, onUnmounted as et, resolveComponent as j, createElementBlock as we, openBlock as le, createElementVNode as n, createVNode as o, withCtx as T, createBlock as Ce, createCommentVNode as ye, unref as S, toDisplayString as me, nextTick as Ie, onMounted as We, onBeforeUnmount as Ke, Fragment as tt, renderList as lt, withDirectives as W, vShow as re, renderSlot as De, isRef as Re, vModelRadio as Te } from "vue";
|
|
2
|
-
import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-
|
|
3
|
-
import { u as Qe, a as it, b as rt } from "./iconfont-
|
|
2
|
+
import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-_Vo2EKuP.js";
|
|
3
|
+
import { u as Qe, a as it, b as rt } from "./iconfont-B8t8JT6z.js";
|
|
4
4
|
import { a9 as ut, c as ct, E, aM as pt, ao as dt } from "./index-CA0SFykF.js";
|
|
5
|
-
import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
5
|
+
import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
6
6
|
import "./index.vue_vue_type_style_index_1_lang-BKgS2iFu.js";
|
|
7
7
|
import { _ as ue, s as Mt } from "./index-CM4PTcFN.js";
|
|
8
8
|
import "./index-BHtNKL1L.js";
|
|
9
|
-
import "./index.vue_vue_type_style_index_1_lang
|
|
10
|
-
import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-
|
|
9
|
+
import "./index.vue_vue_type_style_index_1_lang-ZmTqB1dO.js";
|
|
10
|
+
import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-BAK-GNOJ.js";
|
|
11
11
|
import "./index-CTZaaoq9.js";
|
|
12
|
-
import { f as Ft, a as zt } from "./animationData-
|
|
12
|
+
import { f as Ft, a as zt } from "./animationData-BlzkiZT-.js";
|
|
13
13
|
import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
import { U as Yt, J as Bt } from "./urdfTree-
|
|
14
|
+
import { U as Yt, J as Bt } from "./urdfTree-BVGBRI7Z.js";
|
|
15
15
|
import { T as O } from "./svgIcon-OBhwktPM.js";
|
|
16
16
|
const ae = mt.degToRad, Ge = new ft({
|
|
17
17
|
// 灰色
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-B1eC1Q8u.cjs"),ue=require("./iconfont-Btynh8XG.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs");require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs");const Q=require("./index-Dmi6R0kU.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-CDoOP6Aw.cjs");const Y=require("./robotUtil-BtBh1-GY.cjs");require("./index-DrVAEV9j.cjs");const we=require("./animationData-Dzb7SwCQ.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-C_RPoplj.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ie($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),s=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>a.model?Y.getNonFixedJoints(a.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${$.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),z=()=>c.value.map(l=>({Y:parseFloat(l.Y)||0,B:parseFloat(l.B)||0,C:parseFloat(l.C)||0,R:parseFloat(l.R)||0})),q=()=>{const l=[],t=[];return c.value.forEach(o=>{const{Y1:y,B1:N,C1:E,R1:j,Y2:W,B2:J,C2:re,R2:B}=o;l.push({Y:parseFloat(y)||0,B:parseFloat(N)||0,C:parseFloat(E)||0,R:parseFloat(j)||0}),t.push({Y:parseFloat(W)||0,B:parseFloat(J)||0,C:parseFloat(re)||0,R:parseFloat(B)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},I=(l=0,t=0)=>{if(v.value&&T.value){const o=q();xe(v.value,T.value,o.posPipeYbcr,o.negPipeYbcr,S.value,D.value,l,t,R.value)}else if(v.value){const o=z();Ce(v.value,o,S.value,D.value,l,t)}},U=l=>{if(l<0||l>=c.value.length){console.error(`帧索引 ${l} 超出范围`);return}const t=c.value[l];if(console.log(`应用第 ${l} 帧数据 ${t}`),s.value=l,k.value){const o={};C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value.setJointAngles(o)}I(l,0)},H=async()=>{if(c.value.length===0){A.ElMessage.error("无法播放动画:无数据");return}if(!m.value){m.value=!0,b=!1,c.value.length-1===s.value&&(s.value=0);try{for(let l=s.value+1;l<c.value.length&&!b;l++){s.value=l;const t=c.value[l],o={};k.value&&C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value?await k.value.animateToState(o,i.value,y=>{d.value=(l+y)/c.value.length*100,I(l-1,y)}):(await new Promise(y=>setTimeout(y,i.value)),d.value=(l+1)/c.value.length*100)}b||A.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l),A.ElMessage.error("动画播放出错")}finally{m.value=!1,d.value=0}}},w=()=>{b=!0,m.value=!1,d.value=0,A.ElMessage.info("动画已停止")},te=()=>{s.value=0},G=()=>{if(v.value&&T.value){const l=q();xe(v.value,T.value,l.posPipeYbcr,l.negPipeYbcr,S.value,D.value,-1,0,R.value)}else if(v.value){const l=z();Ce(v.value,l,S.value,D.value,-1,0)}},oe=()=>{k.value&&k.value.resetToZero(),G(),te(),A.ElMessage.success("机器人和管件已重置")},ne=l=>`第 ${l+1} 帧`,de=l=>{m.value&&w(),U(l)},me=()=>{m.value&&w(),!(s.value+1>=c.value.length)&&U(s.value+1)},pe=()=>{m.value&&w(),s.value!==0&&U(s.value-1)},ae=()=>{P.value&&(P.value.visible=!0),v.value&&v.value.parent&&v.value.parent.remove(v.value),P.value=null,v.value=null,T.value=null},ie=l=>l==null?void 0:l.reduce((t,o)=>(t[o]="0",t),{});e.watch($,(l,t)=>{if(JSON.stringify(l)!==JSON.stringify(t))if(l.length>0){const o=ie(l);c.value=[o]}else c.value=[]},{immediate:!0});const se=e.ref(0),ve=l=>{se.value=l},ee=(l,t)=>{if(!l||!t)return;const o=Y.getTargetJoint(l,t),y=Me();y.visible=!1,o==null||o.add(y)},le=l=>{k.value=new O.URDFRobotController(l),L.value=Y.getAllLinkName(l),M.value="Pipe_Joint"},fe=()=>{k.value=null,L.value=[],M.value=null},ge=l=>{le(l),ee(l,M.value),ve(se.value+1),oe()};e.watch(()=>a.model,l=>{if(ae(),l){ge(l);return}fe()},{immediate:!0});const ce=l=>{var o,y;const t=new n.Mesh(l.geometry.clone(),l.material);return t.name="managed_pipe_clone",(y=(o=l==null?void 0:l.parent)==null?void 0:o.add)==null||y.call(o,t),t.position.copy(l.position),t.rotation.copy(l.rotation),t.scale.copy(l.scale),t};e.watch([M,R,S,se],([l,t])=>{if(ae(),a.model&&l){const o=Y.getMeshFromJoint(a.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=ce(o);if(u.value===O.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,u.value===O.robotMode.DOUBLE){const N=ce(o);T.value=N}I(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const he=async()=>{if($.value.length===0){A.ElMessage.warning("没有可导出的表头");return}const l=$.value.join(" ");try{await navigator.clipboard.writeText(l),A.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),A.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},Ve=()=>{if(!r.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as fe, ref as m, watch as H, createElementBlock as G, openBlock as F, createStaticVNode as ot, createVNode as d, unref as v, withCtx as le, createElementVNode as a, normalizeClass as Pe, toDisplayString as y, nextTick as pe, computed as P, onBeforeUnmount as ze, resolveComponent as q, inject as xe, shallowRef as te, onMounted as it, withDirectives as $, createCommentVNode as Y, vShow as ae, renderSlot as me, createBlock as we, isRef as re, vModelRadio as ue } from "vue";
|
|
2
2
|
import { aD as rt } from "./index.vue_vue_type_style_index_1_lang-BKgS2iFu.js";
|
|
3
|
-
import { s as Ce, u as ut, a as ct, U as dt, W as vt } from "./workpieceTreePanel-
|
|
4
|
-
import { d as mt, u as pt, a as ft, b as bt } from "./iconfont-
|
|
3
|
+
import { s as Ce, u as ut, a as ct, U as dt, W as vt } from "./workpieceTreePanel-_Vo2EKuP.js";
|
|
4
|
+
import { d as mt, u as pt, a as ft, b as bt } from "./iconfont-B8t8JT6z.js";
|
|
5
5
|
import { E as ce } from "./index-CA0SFykF.js";
|
|
6
|
-
import { s as ht, b as _t, l as gt } from "./pointTrack-
|
|
6
|
+
import { s as ht, b as _t, l as gt } from "./pointTrack-CMyadDzE.js";
|
|
7
7
|
import { _ as be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
-
import { b as yt, c as xt } from "./threeViewerHost-
|
|
9
|
-
import { d as wt, e as Ct, f as kt } from "./robotUtil-
|
|
10
|
-
import { V as Pt, y as ke } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
11
|
-
import { U as zt, J as At } from "./urdfTree-
|
|
12
|
-
import { a as Vt } from "./index-
|
|
8
|
+
import { b as yt, c as xt } from "./threeViewerHost-DUzh9-TD.js";
|
|
9
|
+
import { d as wt, e as Ct, f as kt } from "./robotUtil-BAK-GNOJ.js";
|
|
10
|
+
import { V as Pt, y as ke } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
11
|
+
import { U as zt, J as At } from "./urdfTree-BVGBRI7Z.js";
|
|
12
|
+
import { a as Vt } from "./index-BVXIOYWQ.js";
|
|
13
13
|
import { T as k } from "./svgIcon-OBhwktPM.js";
|
|
14
|
-
import { K as Tt, j as Dt } from "./index-
|
|
14
|
+
import { K as Tt, j as Dt } from "./index-dTA9hAgr.js";
|
|
15
15
|
const Ut = { class: "table-container" }, jt = ["title"], Mt = ["title"], $t = ["title"], Ft = ["title"], Nt = ["title"], Bt = ["title"], St = /* @__PURE__ */ fe({
|
|
16
16
|
__name: "virtualScroller",
|
|
17
17
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),qe=require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs"),O=require("./workpieceTreePanel-CbsK-tey.cjs"),Z=require("./iconfont-BELvOiht.cjs"),Y=require("./index-CEwxrYB-.cjs"),te=require("./pointTrack-05CcPzgf.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=require("./threeViewerHost-BPu_LZha.cjs"),ee=require("./robotUtil-_esgRFP3.cjs"),Q=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),ie=require("./urdfTree-BjckM2-i.cjs"),Le=require("./index-DsOj_EOL.cjs"),V=require("./svgIcon-BH_8oaav.cjs"),re=require("./index-IvJ1OjwT.cjs"),Ge={class:"table-container"},Je=["title"],Xe=["title"],We=["title"],Ze=["title"],Ye=["title"],He=["title"],Ke=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(m){const l=m,_=e.ref();function p(s){e.nextTick(()=>{var c;const r=l.list.findIndex(y=>y.id===s);r>-1&&((c=_.value)==null||c.scrollToItem(r,"center"))})}return e.watch(()=>l.currentId,p,{immediate:!0}),(s,r)=>(e.openBlock(),e.createElementBlock("div",Ge,[r[0]||(r[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(te.script$2),{class:"scroller",ref_key:"scrollerRef",ref:_,items:s.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:c,index:y})=>{var f,w,M,$,F,b,S,k,D,R;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:c.id===s.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:y+1},e.toDisplayString(y+1),9,Je),e.createElementVNode("div",{class:"cell",title:(f=c.x)==null?void 0:f.toFixed(5)},e.toDisplayString((w=c.x)==null?void 0:w.toFixed(5)),9,Xe),e.createElementVNode("div",{class:"cell",title:(M=c.y)==null?void 0:M.toFixed(5)},e.toDisplayString(($=c.y)==null?void 0:$.toFixed(5)),9,We),e.createElementVNode("div",{class:"cell",title:(F=c.z)==null?void 0:F.toFixed(5)},e.toDisplayString((b=c.z)==null?void 0:b.toFixed(5)),9,Ze),e.createElementVNode("div",{class:"cell",title:(S=c.b_axis)==null?void 0:S.toFixed(5)},e.toDisplayString((k=c.b_axis)==null?void 0:k.toFixed(5)),9,Ye),e.createElementVNode("div",{class:"cell",title:(D=c.c_axis)==null?void 0:D.toFixed(5)},e.toDisplayString((R=c.c_axis)==null?void 0:R.toFixed(5)),9,He)],2)]}),_:1},8,["items"])]))}}),Qe=ne._export_sfc(Ke,[["__scopeId","data-v-b02c9b80"]]);function et(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function tt(m){const l=te.getPointGeometry(m);return l&&(l.material.sizeAttenuation=!1),l}async function nt(m){return await ce.downloadFile(m)}async function at(m){return await ce.readCsv(m)}async function ot(m){const l=await nt(m);return(await at(l)).map(s=>{const r=et();return r.x_axis=s.X_Axis,r.y_axis=s.Y_Axis,r.z_axis=s.Z_Axis,r.b_axis=s.B_Axis,r.c_axis=s.C_Axis,r.x=s.X,r.y=s.Y,r.z=s.Z,r})}const lt={class:"panel-content"},st={class:"animation-controls"},it={class:"control-row"},rt={class:"control-row"},ct={class:"frame-info"},ut={class:"control-row"},dt={class:"scroller-row"},vt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(m,{expose:l,emit:_}){const p=m,s=e.computed(()=>(p.animationData||[]).map((o,u)=>({...o,id:u}))),r=e.ref(!1),c=e.ref(0),y=e.ref(100);let f=!1;const w={bladeAxis:"叶片模型位置"},M=e.ref(null),$=a=>{if(a<0||a>=s.value.length)return null;const o=ee.getObjectWorldMatrix(p.robot,w.bladeAxis);if(!o)return null;const u=s.value[a];return new Q.Vector3(u.x,u.y,u.z).applyMatrix4(o)},F=(a,o)=>{a&&a.setJointValues(o)},b=(a,o,u,h,E)=>{const q={B_Axis:Q.MathUtils.degToRad(h),C_Axis:Q.MathUtils.degToRad(E),X_Axis:a,Y_Axis:o,Z_Axis:u};F(p.robot,q)},S=()=>{const a=p.scene;if(!a)return;const o=[];a.traverse(u=>{u.name==="TrajectoryPoints"&&o.push(u)}),o.forEach(u=>{a.remove(u),Z.disposeObj(u)})},k=a=>{const o=[];for(let u=0;u<=a;u++){const h=$(u);h&&o.push(h.x,h.y,h.z)}return o},D=a=>{const o=tt(a);if(o)return o.name="TrajectoryPoints",M.value=o,o},R=a=>{S();const o=k(a),u=D(o);p.scene&&u&&p.scene.add(u)},z=a=>`第 ${a+1} 帧`,A=a=>{if(a<0||a>=s.value.length){console.error(`帧索引 ${a} 超出范围`);return}const o=s.value[a];c.value=a,b(o.x_axis,o.y_axis,o.z_axis,o.b_axis,o.c_axis);const u=p.scene;u&&u.updateMatrixWorld(!0),R(a)},G=async()=>{if(s.value.length===0){Y.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,f=!1,s.value.length-1===c.value&&(c.value=0);try{for(let a=c.value+1;a<s.value.length&&!f;a++)await new Promise(o=>setTimeout(o,y.value)),A(a);f||Y.ElMessage.success("动画播放完成")}catch(a){console.error("动画播放出错:",a)}finally{r.value=!1}}},C=async()=>{r.value&&(f=!0,await new Promise(a=>{const o=e.watch(()=>r.value,u=>{o(),a()})}))},T=async a=>{r.value&&await C(),A(a)},U=async()=>{r.value&&await C(),!(c.value+1>=s.value.length)&&A(c.value+1)},N=async()=>{r.value&&await C(),c.value!==0&&A(c.value-1)},x=()=>{c.value=0},j=async()=>{await C(),S(),x()};return e.onBeforeUnmount(()=>{j()}),l({playAnimation:G,stopAnimation:C,forwardFrame:U,backwardFrame:N,resetAnimationFrame:x,reset:j}),(a,o)=>{const u=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),q=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",st,[e.createElementVNode("div",it,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(h,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:y.value,"onUpdate:modelValue":o[0]||(o[0]=I=>y.value=I),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",rt,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",ct,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",ut,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(q,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=I=>c.value=I),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":z,onInput:T,disabled:s.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",dt,[e.createVNode(Qe,{class:"scroller",list:s.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),mt=ne._export_sfc(vt,[["__scopeId","data-v-228866a6"]]),pt=async m=>{const l=await te.loadObjByUrl(m);return l==null||l.traverse(_=>{_.isMesh&&_.geometry.computeVertexNormals()}),l},ft={class:"obj-viewer-container"},ht={key:0,class:"machine-casing"},bt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},_t={class:"buttonGroup-right"},Vt={class:"left-panel"},yt={class:"panel-header"},Nt={class:"panel-body"},xt={key:1,class:"clipping-content"},wt={class:"radio-group"},kt={class:"radio-label"},Ct={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},St={class:"right-panel"},Dt={class:"panel-header"},Tt={class:"panel-body"},Bt={key:1,class:"loading-overlay"},Mt={key:2,class:"brand"},zt={class:"brand-item"},At={class:"item-value"},Ut={class:"brand-item"},jt={class:"item-value"},$t={class:"brand-item"},Ft={class:"item-value"},Rt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(m){const l=m,_=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),s=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.machine}),r=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.产品型号}),c=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.编号}),y=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.厂家}),f=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.workpieceInfo}),w=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.knife}),M=e.ref([]),$=async n=>{!n||!n.isExtra||(await F(n),_==null||_(n==null?void 0:n.pageName),p==null||p(!0))},F=re.debounce(async n=>{await re.onPageBack();const{mainKey:t,baseMenuPath:i}=n||{};qe.copyAdd(i,t)},500);e.watch(()=>[r.value,f.value,w.value],()=>{var P,d,le,se;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};r.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:r.value,label:r.value,baseMenuPath:"设备库/机床"});const i={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};f.value&&i.children.push({isExtra:!0,type:(P=f.value)==null?void 0:P.type,pageName:"工件",mainKey:(d=f.value)==null?void 0:d.name,label:(le=f.value)==null?void 0:le.name,baseMenuPath:`工件库/${(se=f.value)==null?void 0:se.type}`});const W={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};w.value&&W.children.push({isExtra:!0,pageName:"刀具",mainKey:w.value,label:w.value,baseMenuPath:"设备库/刀具"}),n.push(t,i,W),M.value=n},{immediate:!0});const b=e.ref(!1),S=e.ref([]),k=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.csvUrl});e.watch(()=>k.value,async()=>{if(console.log("three data",l==null?void 0:l.threeData),console.log("csvUrl",k.value),k.value){b.value=!0;const n=await ot(k.value);S.value=n,b.value=!1}},{immediate:!0});const D=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.bladeObjUrl}),R=e.ref(O.sceneType.ROBOT),z=e.ref(null),A=e.ref(!1),G=e.ref(""),C=e.ref(!1),T=e.ref(""),U=e.ref(!1),N=e.ref(""),x=e.shallowRef(null),j=e.ref(null),a=e.ref("叶片模型"),o=e.shallowRef(null),u=e.shallowRef(null),h=e.ref(!0),E=e.shallowRef(null),q=e.computed(()=>!!E.value),I=e.shallowRef(null),v=e.ref(),{currentModels:J,resetView:ue,initThreeJS:de,handleResize:ve,getThreeJSObjects:L,cleanup:me,setModels:ae,axesHelperVisible:pe,toggleAxesVisibility:fe,zoomIn:he,zoomOut:be}=Z.useThreeJS(z),{loadSceneFromFile:ge}=O.useUrdfLoader(L,J,A,G),{isAnimating:oe,toggleAnimation:_e,stopAnimation:Ve}=Z.useAnimation(L,J),{isClipping:ye,activeClippingAxis:g,toggleClipping:Ne,updateClippingPlanes:B}=Z.useClipping(L,J),{initRaycaster:xe,selectedObject3D:we,setSelectedObjVisible:ke,updatePosition:Ce,updateRotation:Ee,dispose:Pe}=O.useRaycaster(z,L,J),Se=()=>{fe()},De=e.computed(()=>R.value===O.sceneType.ROBOT),Te=n=>{C.value=!0,T.value=n,n==="剖面视图"&&!ye.value&&Ne()},H=n=>{U.value=!0,N.value=n},Be=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.playAnimation()},Me=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.stopAnimation()},ze=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.forwardFrame()},Ae=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.backwardFrame()},K=()=>{var n;(n=v==null?void 0:v.value)==null||n.reset()},Ue=()=>{K(),ue(),j.value&&j.value.resetToZero()},je=n=>{if(!n){E.value=null,h.value=!1;return}const t=ee.getTargetLink(n,"Base1");E.value=t,h.value=!!(t!=null&&t.visible)},$e=n=>{h.value=n,E.value.visible=n},Fe=(n,t)=>ee.getMeshFromLink(n,t),Re=async n=>{const t=Fe(n,a.value);if(u.value=t,console.log("bladeObjUrl",D.value),t&&t.parent&&D.value){const i=await pt(D.value);i.name="blade_clone",t.parent.add(i),i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),t.visible=!1,o.value=i}else a.value&&console.warn(`在 Blade '${a.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>l.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ge(t).then(i=>{x.value=i,i&&Re(i)}).catch(i=>{console.error("加载URDF文件时发生错误:",i),Y.ElMessage.error("加载urdf模型失败"),x.value=null})}else x.value=null},{immediate:!0,deep:!0}),e.watch(x,n=>{K(),n?(ae([n]),j.value=new O.URDFRobotController(n)):(ae([]),j.value=null),je(n),xe()});let X=null;const Ie=()=>{de(),e.nextTick(()=>{z.value&&(X=new ResizeObserver(ve),X.observe(z.value))});const n=L();I.value=n.scene},Oe=()=>{T.value="",N.value="",X&&X.disconnect(),oe.value&&Ve(),K(),me(),Pe()};return e.onMounted(async()=>{await e.nextTick();try{Ie()}catch(n){console.error("Three.js 初始化失败:",n),Y.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Oe()}),(n,t)=>{const i=e.resolveComponent("el-scrollbar"),W=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",ft,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:z,class:"threejs-container"},null,512),[[e.vShow,De.value]]),q.value?(e.openBlock(),e.createElementBlock("div",ht,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Le._sfc_main$1,{value:h.value,onChange:$e,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",bt,[e.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Ue,title:"重置"}),e.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(he)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(be)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(_e),title:e.unref(oe)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(pe),onClick:Se,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",gt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:Te},void 0,!0)]),e.createElementVNode("div",_t,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:H},void 0,!0),e.createVNode(V.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=P=>H("机床控制")),active:U.value&&N.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=P=>H("轨迹路径")),active:U.value&&N.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":b.value}])},[e.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ae}),e.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Be}),e.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ze}),e.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Me})],2),e.withDirectives(e.createElementVNode("div",Vt,[e.createElementVNode("div",yt,[e.createElementVNode("span",null,e.toDisplayString(T.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=P=>C.value=!1)}," X ")]),e.createElementVNode("div",Nt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var P;return[T.value==="场景树"?(e.openBlock(),e.createBlock(ie.UrdfTree,{key:0,model:x.value,extraNodes:M.value,onNodeClick:$},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),T.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",wt,[e.createElementVNode("label",kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(g)?g.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Ct,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(g)?g.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(g)?g.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(g)?g.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),T.value==="工件树"?(e.openBlock(),e.createBlock(O.WorkpieceTreePanel,{key:2,model:(P=e.unref(we))==null?void 0:P.obj,onVisibleChange:e.unref(ke),onUpdatePosition:e.unref(Ce),onUpdateRotation:e.unref(Ee)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",St,[e.createElementVNode("div",Dt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=P=>U.value=!1)}," X ")]),e.createElementVNode("div",Tt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ie.JointPanel,{model:x.value},null,8,["model"]),[[e.vShow,N.value==="机床控制"]]),e.withDirectives(e.createVNode(mt,{robot:x.value,scene:I.value,animationData:S.value,ref_key:"bladeTrackPanelRef",ref:v},null,8,["robot","scene","animationData"]),[[e.vShow,N.value==="轨迹路径"&&!b.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:N.value},void 0,!0)]),_:3})])],512),[[e.vShow,U.value]]),A.value?(e.openBlock(),e.createElementBlock("div",Bt,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(G.value),1)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Mt,[e.createElementVNode("div",zt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",At,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Ut,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",jt,e.toDisplayString(r.value),1)]),e.createElementVNode("div",$t,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createVNode(W,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),It=ne._export_sfc(Rt,[["__scopeId","data-v-2a433236"]]);exports.default=It;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),qe=require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs"),O=require("./workpieceTreePanel-B1eC1Q8u.cjs"),Z=require("./iconfont-Btynh8XG.cjs"),Y=require("./index-CEwxrYB-.cjs"),te=require("./pointTrack-BkpbGc8n.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=require("./threeViewerHost-BcIsHd7R.cjs"),ee=require("./robotUtil-BtBh1-GY.cjs"),Q=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bgts3--T.cjs"),ie=require("./urdfTree-C_RPoplj.cjs"),Le=require("./index-hKbFMqEu.cjs"),V=require("./svgIcon-BH_8oaav.cjs"),re=require("./index-DvfqgYXo.cjs"),Ge={class:"table-container"},Je=["title"],Xe=["title"],We=["title"],Ze=["title"],Ye=["title"],He=["title"],Ke=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(m){const l=m,_=e.ref();function p(s){e.nextTick(()=>{var c;const r=l.list.findIndex(y=>y.id===s);r>-1&&((c=_.value)==null||c.scrollToItem(r,"center"))})}return e.watch(()=>l.currentId,p,{immediate:!0}),(s,r)=>(e.openBlock(),e.createElementBlock("div",Ge,[r[0]||(r[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(te.script$2),{class:"scroller",ref_key:"scrollerRef",ref:_,items:s.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:c,index:y})=>{var f,w,M,$,F,b,S,k,D,R;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:c.id===s.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:y+1},e.toDisplayString(y+1),9,Je),e.createElementVNode("div",{class:"cell",title:(f=c.x)==null?void 0:f.toFixed(5)},e.toDisplayString((w=c.x)==null?void 0:w.toFixed(5)),9,Xe),e.createElementVNode("div",{class:"cell",title:(M=c.y)==null?void 0:M.toFixed(5)},e.toDisplayString(($=c.y)==null?void 0:$.toFixed(5)),9,We),e.createElementVNode("div",{class:"cell",title:(F=c.z)==null?void 0:F.toFixed(5)},e.toDisplayString((b=c.z)==null?void 0:b.toFixed(5)),9,Ze),e.createElementVNode("div",{class:"cell",title:(S=c.b_axis)==null?void 0:S.toFixed(5)},e.toDisplayString((k=c.b_axis)==null?void 0:k.toFixed(5)),9,Ye),e.createElementVNode("div",{class:"cell",title:(D=c.c_axis)==null?void 0:D.toFixed(5)},e.toDisplayString((R=c.c_axis)==null?void 0:R.toFixed(5)),9,He)],2)]}),_:1},8,["items"])]))}}),Qe=ne._export_sfc(Ke,[["__scopeId","data-v-b02c9b80"]]);function et(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function tt(m){const l=te.getPointGeometry(m);return l&&(l.material.sizeAttenuation=!1),l}async function nt(m){return await ce.downloadFile(m)}async function at(m){return await ce.readCsv(m)}async function ot(m){const l=await nt(m);return(await at(l)).map(s=>{const r=et();return r.x_axis=s.X_Axis,r.y_axis=s.Y_Axis,r.z_axis=s.Z_Axis,r.b_axis=s.B_Axis,r.c_axis=s.C_Axis,r.x=s.X,r.y=s.Y,r.z=s.Z,r})}const lt={class:"panel-content"},st={class:"animation-controls"},it={class:"control-row"},rt={class:"control-row"},ct={class:"frame-info"},ut={class:"control-row"},dt={class:"scroller-row"},vt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(m,{expose:l,emit:_}){const p=m,s=e.computed(()=>(p.animationData||[]).map((o,u)=>({...o,id:u}))),r=e.ref(!1),c=e.ref(0),y=e.ref(100);let f=!1;const w={bladeAxis:"叶片模型位置"},M=e.ref(null),$=a=>{if(a<0||a>=s.value.length)return null;const o=ee.getObjectWorldMatrix(p.robot,w.bladeAxis);if(!o)return null;const u=s.value[a];return new Q.Vector3(u.x,u.y,u.z).applyMatrix4(o)},F=(a,o)=>{a&&a.setJointValues(o)},b=(a,o,u,h,E)=>{const q={B_Axis:Q.MathUtils.degToRad(h),C_Axis:Q.MathUtils.degToRad(E),X_Axis:a,Y_Axis:o,Z_Axis:u};F(p.robot,q)},S=()=>{const a=p.scene;if(!a)return;const o=[];a.traverse(u=>{u.name==="TrajectoryPoints"&&o.push(u)}),o.forEach(u=>{a.remove(u),Z.disposeObj(u)})},k=a=>{const o=[];for(let u=0;u<=a;u++){const h=$(u);h&&o.push(h.x,h.y,h.z)}return o},D=a=>{const o=tt(a);if(o)return o.name="TrajectoryPoints",M.value=o,o},R=a=>{S();const o=k(a),u=D(o);p.scene&&u&&p.scene.add(u)},z=a=>`第 ${a+1} 帧`,A=a=>{if(a<0||a>=s.value.length){console.error(`帧索引 ${a} 超出范围`);return}const o=s.value[a];c.value=a,b(o.x_axis,o.y_axis,o.z_axis,o.b_axis,o.c_axis);const u=p.scene;u&&u.updateMatrixWorld(!0),R(a)},G=async()=>{if(s.value.length===0){Y.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,f=!1,s.value.length-1===c.value&&(c.value=0);try{for(let a=c.value+1;a<s.value.length&&!f;a++)await new Promise(o=>setTimeout(o,y.value)),A(a);f||Y.ElMessage.success("动画播放完成")}catch(a){console.error("动画播放出错:",a)}finally{r.value=!1}}},C=async()=>{r.value&&(f=!0,await new Promise(a=>{const o=e.watch(()=>r.value,u=>{o(),a()})}))},T=async a=>{r.value&&await C(),A(a)},U=async()=>{r.value&&await C(),!(c.value+1>=s.value.length)&&A(c.value+1)},N=async()=>{r.value&&await C(),c.value!==0&&A(c.value-1)},x=()=>{c.value=0},j=async()=>{await C(),S(),x()};return e.onBeforeUnmount(()=>{j()}),l({playAnimation:G,stopAnimation:C,forwardFrame:U,backwardFrame:N,resetAnimationFrame:x,reset:j}),(a,o)=>{const u=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),q=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",st,[e.createElementVNode("div",it,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(h,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:y.value,"onUpdate:modelValue":o[0]||(o[0]=I=>y.value=I),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",rt,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",ct,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",ut,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(q,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=I=>c.value=I),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":z,onInput:T,disabled:s.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",dt,[e.createVNode(Qe,{class:"scroller",list:s.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),mt=ne._export_sfc(vt,[["__scopeId","data-v-228866a6"]]),pt=async m=>{const l=await te.loadObjByUrl(m);return l==null||l.traverse(_=>{_.isMesh&&_.geometry.computeVertexNormals()}),l},ft={class:"obj-viewer-container"},ht={key:0,class:"machine-casing"},bt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},_t={class:"buttonGroup-right"},Vt={class:"left-panel"},yt={class:"panel-header"},Nt={class:"panel-body"},xt={key:1,class:"clipping-content"},wt={class:"radio-group"},kt={class:"radio-label"},Ct={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},St={class:"right-panel"},Dt={class:"panel-header"},Tt={class:"panel-body"},Bt={key:1,class:"loading-overlay"},Mt={key:2,class:"brand"},zt={class:"brand-item"},At={class:"item-value"},Ut={class:"brand-item"},jt={class:"item-value"},$t={class:"brand-item"},Ft={class:"item-value"},Rt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(m){const l=m,_=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),s=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.machine}),r=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.产品型号}),c=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.编号}),y=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.厂家}),f=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.workpieceInfo}),w=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.knife}),M=e.ref([]),$=async n=>{!n||!n.isExtra||(await F(n),_==null||_(n==null?void 0:n.pageName),p==null||p(!0))},F=re.debounce(async n=>{await re.onPageBack();const{mainKey:t,baseMenuPath:i}=n||{};qe.copyAdd(i,t)},500);e.watch(()=>[r.value,f.value,w.value],()=>{var P,d,le,se;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};r.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:r.value,label:r.value,baseMenuPath:"设备库/机床"});const i={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};f.value&&i.children.push({isExtra:!0,type:(P=f.value)==null?void 0:P.type,pageName:"工件",mainKey:(d=f.value)==null?void 0:d.name,label:(le=f.value)==null?void 0:le.name,baseMenuPath:`工件库/${(se=f.value)==null?void 0:se.type}`});const W={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};w.value&&W.children.push({isExtra:!0,pageName:"刀具",mainKey:w.value,label:w.value,baseMenuPath:"设备库/刀具"}),n.push(t,i,W),M.value=n},{immediate:!0});const b=e.ref(!1),S=e.ref([]),k=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.csvUrl});e.watch(()=>k.value,async()=>{if(console.log("three data",l==null?void 0:l.threeData),console.log("csvUrl",k.value),k.value){b.value=!0;const n=await ot(k.value);S.value=n,b.value=!1}},{immediate:!0});const D=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.bladeObjUrl}),R=e.ref(O.sceneType.ROBOT),z=e.ref(null),A=e.ref(!1),G=e.ref(""),C=e.ref(!1),T=e.ref(""),U=e.ref(!1),N=e.ref(""),x=e.shallowRef(null),j=e.ref(null),a=e.ref("叶片模型"),o=e.shallowRef(null),u=e.shallowRef(null),h=e.ref(!0),E=e.shallowRef(null),q=e.computed(()=>!!E.value),I=e.shallowRef(null),v=e.ref(),{currentModels:J,resetView:ue,initThreeJS:de,handleResize:ve,getThreeJSObjects:L,cleanup:me,setModels:ae,axesHelperVisible:pe,toggleAxesVisibility:fe,zoomIn:he,zoomOut:be}=Z.useThreeJS(z),{loadSceneFromFile:ge}=O.useUrdfLoader(L,J,A,G),{isAnimating:oe,toggleAnimation:_e,stopAnimation:Ve}=Z.useAnimation(L,J),{isClipping:ye,activeClippingAxis:g,toggleClipping:Ne,updateClippingPlanes:B}=Z.useClipping(L,J),{initRaycaster:xe,selectedObject3D:we,setSelectedObjVisible:ke,updatePosition:Ce,updateRotation:Ee,dispose:Pe}=O.useRaycaster(z,L,J),Se=()=>{fe()},De=e.computed(()=>R.value===O.sceneType.ROBOT),Te=n=>{C.value=!0,T.value=n,n==="剖面视图"&&!ye.value&&Ne()},H=n=>{U.value=!0,N.value=n},Be=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.playAnimation()},Me=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.stopAnimation()},ze=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.forwardFrame()},Ae=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.backwardFrame()},K=()=>{var n;(n=v==null?void 0:v.value)==null||n.reset()},Ue=()=>{K(),ue(),j.value&&j.value.resetToZero()},je=n=>{if(!n){E.value=null,h.value=!1;return}const t=ee.getTargetLink(n,"Base1");E.value=t,h.value=!!(t!=null&&t.visible)},$e=n=>{h.value=n,E.value.visible=n},Fe=(n,t)=>ee.getMeshFromLink(n,t),Re=async n=>{const t=Fe(n,a.value);if(u.value=t,console.log("bladeObjUrl",D.value),t&&t.parent&&D.value){const i=await pt(D.value);i.name="blade_clone",t.parent.add(i),i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),t.visible=!1,o.value=i}else a.value&&console.warn(`在 Blade '${a.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>l.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ge(t).then(i=>{x.value=i,i&&Re(i)}).catch(i=>{console.error("加载URDF文件时发生错误:",i),Y.ElMessage.error("加载urdf模型失败"),x.value=null})}else x.value=null},{immediate:!0,deep:!0}),e.watch(x,n=>{K(),n?(ae([n]),j.value=new O.URDFRobotController(n)):(ae([]),j.value=null),je(n),xe()});let X=null;const Ie=()=>{de(),e.nextTick(()=>{z.value&&(X=new ResizeObserver(ve),X.observe(z.value))});const n=L();I.value=n.scene},Oe=()=>{T.value="",N.value="",X&&X.disconnect(),oe.value&&Ve(),K(),me(),Pe()};return e.onMounted(async()=>{await e.nextTick();try{Ie()}catch(n){console.error("Three.js 初始化失败:",n),Y.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Oe()}),(n,t)=>{const i=e.resolveComponent("el-scrollbar"),W=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",ft,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:z,class:"threejs-container"},null,512),[[e.vShow,De.value]]),q.value?(e.openBlock(),e.createElementBlock("div",ht,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Le._sfc_main$1,{value:h.value,onChange:$e,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",bt,[e.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Ue,title:"重置"}),e.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(he)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(be)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(_e),title:e.unref(oe)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(pe),onClick:Se,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",gt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:Te},void 0,!0)]),e.createElementVNode("div",_t,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:H},void 0,!0),e.createVNode(V.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=P=>H("机床控制")),active:U.value&&N.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=P=>H("轨迹路径")),active:U.value&&N.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":b.value}])},[e.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ae}),e.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Be}),e.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ze}),e.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Me})],2),e.withDirectives(e.createElementVNode("div",Vt,[e.createElementVNode("div",yt,[e.createElementVNode("span",null,e.toDisplayString(T.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=P=>C.value=!1)}," X ")]),e.createElementVNode("div",Nt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var P;return[T.value==="场景树"?(e.openBlock(),e.createBlock(ie.UrdfTree,{key:0,model:x.value,extraNodes:M.value,onNodeClick:$},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),T.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",wt,[e.createElementVNode("label",kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(g)?g.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Ct,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(g)?g.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(g)?g.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(g)?g.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),T.value==="工件树"?(e.openBlock(),e.createBlock(O.WorkpieceTreePanel,{key:2,model:(P=e.unref(we))==null?void 0:P.obj,onVisibleChange:e.unref(ke),onUpdatePosition:e.unref(Ce),onUpdateRotation:e.unref(Ee)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",St,[e.createElementVNode("div",Dt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=P=>U.value=!1)}," X ")]),e.createElementVNode("div",Tt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ie.JointPanel,{model:x.value},null,8,["model"]),[[e.vShow,N.value==="机床控制"]]),e.withDirectives(e.createVNode(mt,{robot:x.value,scene:I.value,animationData:S.value,ref_key:"bladeTrackPanelRef",ref:v},null,8,["robot","scene","animationData"]),[[e.vShow,N.value==="轨迹路径"&&!b.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:N.value},void 0,!0)]),_:3})])],512),[[e.vShow,U.value]]),A.value?(e.openBlock(),e.createElementBlock("div",Bt,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(G.value),1)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Mt,[e.createElementVNode("div",zt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",At,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Ut,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",jt,e.toDisplayString(r.value),1)]),e.createElementVNode("div",$t,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createVNode(W,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),It=ne._export_sfc(Rt,[["__scopeId","data-v-2a433236"]]);exports.default=It;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as g, computed as P, defineComponent as de, watch as ve, createElementBlock as J, openBlock as U, createStaticVNode as Ye, createVNode as d, unref as u, withCtx as X, createElementVNode as l, normalizeClass as Ze, toDisplayString as A, nextTick as xe, resolveComponent as R, shallowRef as B, onMounted as He, onBeforeUnmount as We, withDirectives as I, createCommentVNode as M, createBlock as ce, renderSlot as _e, isRef as Z, vModelRadio as H, vShow as W } from "vue";
|
|
2
|
-
import { u as qe, a as Qe, b as et, f as tt, d as ue } from "./iconfont-
|
|
3
|
-
import { C as ee, V as he, N as lt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import { r as nt } from "./threeViewerHost-
|
|
2
|
+
import { u as qe, a as Qe, b as et, f as tt, d as ue } from "./iconfont-B8t8JT6z.js";
|
|
3
|
+
import { C as ee, V as he, N as lt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-h7N9rXk9.js";
|
|
4
|
+
import { r as nt } from "./threeViewerHost-DUzh9-TD.js";
|
|
5
5
|
import { E as Q } from "./index-CA0SFykF.js";
|
|
6
|
-
import { U as at, J as ot } from "./urdfTree-
|
|
7
|
-
import { s as st, l as it, g as rt, d as Ce, a as Te, c as ct } from "./pointTrack-
|
|
6
|
+
import { U as at, J as ot } from "./urdfTree-BVGBRI7Z.js";
|
|
7
|
+
import { s as st, l as it, g as rt, d as Ce, a as Te, c as ct } from "./pointTrack-CMyadDzE.js";
|
|
8
8
|
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
import { T as h } from "./svgIcon-OBhwktPM.js";
|
|
10
10
|
import { i as ut } from "./isString-C_qk7R_g.js";
|