ss-component-new 1.2.57 → 1.2.59
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/animationData-CEkMmPAJ.js +111 -0
- package/dist/animationData-FLuoH13j.cjs +1 -0
- package/dist/{iconfont-Du5a0yIR.js → iconfont-Dp3iGl32.js} +318 -244
- package/dist/iconfont-ji7A-_XJ.cjs +1 -0
- package/dist/icons/svg/CopyAddMenu.svg +1 -0
- package/dist/icons/svg/DeleteMenu.svg +1 -0
- package/dist/icons/svg/FixedMenu.svg +1 -0
- package/dist/icons/svg//345/273/272/346/250/241/345/210/206/346/236/220.svg +1 -0
- package/dist/icons/svg//347/256/227/346/263/225.svg +1 -1
- package/dist/{index-BMMCYEsB.js → index--qwZeW47.js} +1 -1
- package/dist/{index-DtlFU8RR.cjs → index-B1U77nyf.cjs} +1 -1
- package/dist/index-BEfSpHE6.js +17 -0
- package/dist/{index-CEkY4nFt.js → index-BFHCLxvz.js} +1 -1
- package/dist/index-BN4opOSk.cjs +1 -0
- package/dist/{index-B55haWsS.js → index-BNES2eKm.js} +1 -1
- package/dist/{index-kXlrQUA8.js → index-BTwRUubF.js} +2 -2
- package/dist/{index-DmfzZIKw.cjs → index-BYIlecoJ.cjs} +1 -1
- package/dist/{index-D0NMKMU8.cjs → index-BgwYXT31.cjs} +1 -1
- package/dist/{index-hL7adbcf.js → index-BiUFu7a_.js} +1500 -1636
- package/dist/{index-DYopbovE.js → index-BooTgcW2.js} +1633 -1632
- package/dist/{index-CJVA_tHw.cjs → index-BxEjroD6.cjs} +1 -1
- package/dist/index-C14Eek69.js +32 -0
- package/dist/index-C8IFPtAJ.js +12233 -0
- package/dist/index-C9C84gkB.cjs +1 -0
- package/dist/{index-BO7R6DCb.cjs → index-CDW8XzWT.cjs} +1 -1
- package/dist/index-CHzlphv9.cjs +1 -0
- package/dist/{index-vrO7i-BX.cjs → index-CWG2zhJZ.cjs} +1 -1
- package/dist/{index-DURGsNBh.js → index-ChyicQIl.js} +1 -1
- package/dist/index-D57Bv8co.cjs +1 -0
- package/dist/{index-BPiXU1VF.js → index-DAJoy_Z5.js} +1 -1
- package/dist/{index-DhbAgrix.cjs → index-DIpWkFjh.cjs} +1 -1
- package/dist/index-DLU6Qv3w.cjs +15 -0
- package/dist/{index-BQWUpvXk.js → index-DN40xEbb.js} +2 -2
- package/dist/{index-HsZY-XbO.js → index-DNs7ujiq.js} +1 -1
- package/dist/{index-C8x2JQx7.cjs → index-DXGiAs1G.cjs} +1 -1
- package/dist/{index-D3cFqWf8.js → index-DZQjq0ZR.js} +1 -1
- package/dist/index-DkNldOC0.cjs +1 -0
- package/dist/{index-CgHWXZbW.cjs → index-DuamAhUi.cjs} +1 -1
- package/dist/index-DvgAOa6m.js +2858 -0
- package/dist/{index-By-PfzqJ.js → index-FUWILZwY.js} +16 -16
- package/dist/{index-C9QGZutp.cjs → index-JXXdn01K.cjs} +1 -1
- package/dist/{index-Du-GlV8c.cjs → index-LVKvj2hU.cjs} +1 -1
- package/dist/{index-D2vsFTnY.js → index-OLQpbvuS.js} +6 -6
- package/dist/{index-JGSZNtiO.js → index-YoJfAd5X.js} +1 -1
- package/dist/{index-BgLb2tvo.js → index-bcbWOGXs.js} +3 -3
- package/dist/{index-cOj9uZ5B.cjs → index-gcSJbApQ.cjs} +1 -1
- package/dist/index-lP-_9Gsb.cjs +1 -0
- package/dist/index-qDBAJZN2.cjs +1 -0
- package/dist/{index-GShz2NEi.js → index-rPWz6KHn.js} +2 -2
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Bff2sYnQ.cjs +37 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DkxmFS5P.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D6uh0ooh.js} +10026 -10039
- package/dist/index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-DlyCfLDJ.cjs +1 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-Dt5lXvbN.js +195 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-BEmLh6pe.js → index.vue_vue_type_style_index_1_lang-BUhvhTqt.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-Dsas9C9w.cjs → index.vue_vue_type_style_index_1_lang-DDYxgdQk.cjs} +1 -1
- package/dist/{main-B59ixZA7.js → main-ChUyYPuq.js} +2 -2
- package/dist/{main-B3gx12Xo.cjs → main-D-bdppOV.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +6 -6
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-CxRJigCx.cjs → threeModel-CDFo3As-.cjs} +1 -1
- package/dist/{threeModel-ardn7Q2K.js → threeModel-DcuAlWjb.js} +2 -2
- package/dist/{threePreview-L8T-JdQL.js → threePreview-DhMkG1np.js} +350 -380
- package/dist/threePreview-q4R-oAs6.cjs +1 -0
- package/dist/threeSceneView-CAsVH82L.cjs +5 -0
- package/dist/threeSceneView-Dav7AGkH.js +1288 -0
- package/dist/threeSceneViewForCPMPIP-9__8NGa5.cjs +5 -0
- package/dist/threeSceneViewForCPMPIP-DxFYivgN.js +599 -0
- package/dist/threeTrackPathView-B7yrSLKq.cjs +370 -0
- package/dist/{threeTrackPathView-gTDb6Ckq.js → threeTrackPathView-DXCMl3aZ.js} +307 -376
- package/dist/{xlsx-ByPOQ6N_.js → threeViewerHost-BNnzz6WM.js} +4414 -4032
- package/dist/threeViewerHost-D70yS3z2.cjs +104 -0
- package/dist/{workpieceTreePanel-GlMrvoGI.js → workpieceTreePanel-CCbVIIlm.js} +92 -101
- package/dist/workpieceTreePanel-KdP9UaVe.cjs +1 -0
- package/package.json +1 -1
- package/public/icons/svg/CopyAddMenu.svg +1 -0
- package/public/icons/svg/DeleteMenu.svg +1 -0
- package/public/icons/svg/FixedMenu.svg +1 -0
- package/public/icons/svg//345/273/272/346/250/241/345/210/206/346/236/220.svg +1 -0
- package/public/icons/svg//347/256/227/346/263/225.svg +1 -1
- package/dist/animationData-CSjRG83z.cjs +0 -1
- package/dist/animationData-DgukZCiZ.js +0 -69
- package/dist/dataUtil-Bg8jgTaT.js +0 -52
- package/dist/dataUtil-CflXOlIl.cjs +0 -1
- package/dist/fileUtil-CVIZ039M.js +0 -99
- package/dist/fileUtil-DugRTZPB.cjs +0 -1
- package/dist/iconfont-BUDQryy4.cjs +0 -1
- package/dist/index-BAkz3vaY.js +0 -12229
- package/dist/index-BE76NHis.js +0 -2848
- package/dist/index-CXGkiovm.cjs +0 -1
- package/dist/index-CaV-J52G.cjs +0 -1
- package/dist/index-D4y4pCNq.cjs +0 -1
- package/dist/index-DKQuP1UM.cjs +0 -1
- package/dist/index-DhPNGzbc.cjs +0 -1
- package/dist/index-fw0RZg-d.cjs +0 -15
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-til9urRl.cjs +0 -37
- package/dist/index.vue_vue_type_style_index_0_scoped_92477073_lang-5Hi_RNl1.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_92477073_lang-DIFWhOl8.js +0 -212
- package/dist/threePreview-5-O-sZIc.cjs +0 -1
- package/dist/threeSceneView-BYl4rYgi.js +0 -1369
- package/dist/threeSceneView-igg9HZ8X.cjs +0 -5
- package/dist/threeSceneViewForCPMPIP-C-o-rOZ9.js +0 -662
- package/dist/threeSceneViewForCPMPIP-DfPj5iau.cjs +0 -5
- package/dist/threeTrackPathView-CgjLFXmL.cjs +0 -370
- package/dist/threeViewerHost-DvAkN_z-.js +0 -322
- package/dist/threeViewerHost-PGblwq3d.cjs +0 -1
- package/dist/workpieceTreePanel-Cr4nTOQE.cjs +0 -1
- package/dist/xlsx-BPHygxEf.cjs +0 -104
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),f=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-fAuSnfOH.cjs"),q=require("./index-C8qRkCgn.cjs"),G=require("./iconfont-ji7A-_XJ.cjs"),B=require("./MTLLoader-BlLfoBce.cjs"),F=require("./svgIcon-CUM54R6L.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function W(d,t){if(t===f.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),d;if(t===f.TriangleFanDrawMode||t===f.TriangleStripDrawMode){let e=d.getIndex();if(e===null){const r=[],a=d.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);d.setIndex(r),e=d.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),d}const i=e.count-2,n=[];if(t===f.TriangleFanDrawMode)for(let r=1;r<=i;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<i;r++)r%2===0?(n.push(e.getX(r)),n.push(e.getX(r+1)),n.push(e.getX(r+2))):(n.push(e.getX(r+2)),n.push(e.getX(r+1)),n.push(e.getX(r)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=d.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),d}class oe extends f.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new fe(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new Me(e)}),this.register(function(e){return new Le(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new Se(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=f.LoaderUtils.extractUrlBase(t);r=f.LoaderUtils.resolveURL(c,this.path)}else r=f.LoaderUtils.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},o=new f.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,r,function(u){e(u),s.manager.itemEnd(t)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let s;const r={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===Z){try{r[M.KHR_BINARY_GLTF]=new ye(t)}catch(l){n&&n(l);return}s=JSON.parse(r[M.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Ge(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const l=s.extensionsUsed[u],h=s.extensionsRequired||[];switch(l){case M.KHR_MATERIALS_UNLIT:r[l]=new le;break;case M.KHR_DRACO_MESH_COMPRESSION:r[l]=new we(s,this.dracoLoader);break;case M.KHR_TEXTURE_TRANSFORM:r[l]=new be;break;case M.KHR_MESH_QUANTIZATION:r[l]=new Ne;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,s){i.parse(t,e,n,s)})}}function ae(){let d={};return{get:function(t){return d[t]},add:function(t,e){d[t]=e},remove:function(t){delete d[t]},removeAll:function(){d={}}}}const M={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ce{constructor(t){this.parser=t,this.name=M.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const s=e[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const u=new f.Color(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],f.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new f.DirectionalLight(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new f.PointLight(u),c.distance=l;break;case"spot":c=new f.SpotLight(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),O(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,s=i.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class le{constructor(){this.name=M.KHR_MATERIALS_UNLIT}getMaterialType(){return f.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new f.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const r=s.baseColorFactor;t.color.setRGB(r[0],r[1],r[2],f.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,f.SRGBColorSpace))}return Promise.all(n)}}class ue{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}}class fe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(e.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new f.Vector2(a,a)}return Promise.all(s)}}class de{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class he{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(e.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(e.iridescenceIOR=r.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class pe{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new f.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,f.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class me{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(e.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&s.push(i.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class ge{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&s.push(i.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),Promise.all(s)}}class Te{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class Re{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&s.push(i.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,f.SRGBColorSpace)),Promise.all(s)}}class xe{constructor(t){this.parser=t,this.name=M.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return e.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&s.push(i.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class Ee{constructor(t){this.parser=t,this.name=M.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(e.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(e.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&s.push(i.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class Me{constructor(t){this.parser=t,this.name=M.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,r)}}class Le{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class _e{constructor(t){this.parser=t,this.name=M.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Ae{constructor(t){this.name=M.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const o=n.byteOffset||0,c=n.byteLength||0,u=n.count,l=n.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,n.mode,n.filter).then(function(p){return p.buffer}):r.ready.then(function(){const p=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(p),u,l,h,n.mode,n.filter),p})})}else return null}}class Se{constructor(t){this.name=M.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==I.TRIANGLES&&c.mode!==I.TRIANGLE_STRIP&&c.mode!==I.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=i.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,p=[];for(const m of l){const E=new f.Matrix4,T=new f.Vector3,R=new f.Quaternion,L=new f.Vector3(1,1,1),_=new f.InstancedMesh(m.geometry,m.material,h);for(let x=0;x<h;x++)o.TRANSLATION&&T.fromBufferAttribute(o.TRANSLATION,x),o.ROTATION&&R.fromBufferAttribute(o.ROTATION,x),o.SCALE&&L.fromBufferAttribute(o.SCALE,x),_.setMatrixAt(x,E.compose(T,R,L));for(const x in o)if(x==="_COLOR_0"){const S=o[x];_.instanceColor=new f.InstancedBufferAttribute(S.array,S.itemSize,S.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&m.geometry.setAttribute(x,o[x]);f.Object3D.prototype.copy.call(_,m),this.parser.assignFinalMaterial(_),p.push(_)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const Z="glTF",H=12,Y={JSON:1313821514,BIN:5130562};class ye{constructor(t){this.name=M.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,H),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Z)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-H,s=new DataView(t,H);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const o=s.getUint32(r,!0);if(r+=4,o===Y.JSON){const c=new Uint8Array(t,H+r,a);this.content=i.decode(c)}else if(o===Y.BIN){const c=H+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class we{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=M.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=V[u]||u.toLowerCase();a[l]=r[u]}for(const u in t.attributes){const l=V[u]||u.toLowerCase();if(r[u]!==void 0){const h=i.accessors[t.attributes[u]],p=D[h.componentType];c[l]=p.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(u){return new Promise(function(l,h){n.decodeDracoFile(u,function(p){for(const m in p.attributes){const E=p.attributes[m],T=o[m];T!==void 0&&(E.normalized=T)}l(p)},a,c,f.LinearSRGBColorSpace,h)})})}}class be{constructor(){this.name=M.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Ne{constructor(){this.name=M.KHR_MESH_QUANTIZATION}}class ee extends f.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=i[s+r];return e}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=n-e,l=(i-e)/u,h=l*l,p=h*l,m=t*c,E=m-c,T=-2*p+3*h,R=p-h,L=1-T,_=R-h+l;for(let x=0;x!==a;x++){const S=r[E+x+a],b=r[E+x+o]*u,y=r[m+x+a],C=r[m+x]*u;s[x]=L*S+_*b+T*y+R*C}return s}}const Ie=new f.Quaternion;class Ce extends ee{interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return Ie.fromArray(s).normalize().toArray(s),s}}const I={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},D={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},$={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},J={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},U={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},V={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"},Oe={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},j={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ve(d){return d.DefaultMaterial===void 0&&(d.DefaultMaterial=new f.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:f.FrontSide})),d.DefaultMaterial}function P(d,t,e){for(const i in e.extensions)d[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(d,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(d.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function ke(d,t,e){let i=!1,n=!1,s=!1;for(let c=0,u=t.length;c<u;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(d);const r=[],a=[],o=[];for(let c=0,u=t.length;c<u;c++){const l=t[c];if(i){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):d.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):d.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):d.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return i&&(d.morphAttributes.position=u),n&&(d.morphAttributes.normal=l),s&&(d.morphAttributes.color=h),d.morphTargetsRelative=!0,d})}function Pe(d,t){if(d.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)d.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(d.morphTargetInfluences.length===e.length){d.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)d.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Fe(d){let t;const e=d.extensions&&d.extensions[M.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+K(e.attributes):t=d.indices+":"+K(d.attributes)+":"+d.mode,d.targets!==void 0)for(let i=0,n=d.targets.length;i<n;i++)t+=":"+K(d.targets[i]);return t}function K(d){let t="";const e=Object.keys(d).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+d[e[i]]+";";return t}function X(d){switch(d){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function De(d){return d.search(/\.jpe?g($|\?)/i)>0||d.search(/^data\:image\/jpeg/)===0?"image/jpeg":d.search(/\.webp($|\?)/i)>0||d.search(/^data\:image\/webp/)===0?"image/webp":d.search(/\.ktx2($|\?)/i)>0||d.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const He=new f.Matrix4;class Ge{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&r<98?this.textureLoader=new f.TextureLoader(this.options.manager):this.textureLoader=new f.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new f.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:i,userData:{}};return P(s,a,n),O(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,o=r.length;a<o;a++)t[r[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){const r=t[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(i[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),s=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())s(u,a.children[c])};return s(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&i.push(s)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return i.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[M.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){i.load(f.LoaderUtils.resolveURL(e.uri,n.path),s,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,s=e.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=U[n.type],a=D[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new f.BufferAttribute(c,r,o))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(r){const a=r[0],o=U[n.type],c=D[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=n.byteOffset||0,p=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0;let E,T;if(p&&p!==l){const R=Math.floor(h/p),L="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+R+":"+n.count;let _=e.cache.get(L);_||(E=new c(a,R*p,n.count*p/u),_=new f.InterleavedBuffer(E,p/u),e.cache.add(L,_)),T=new f.InterleavedBufferAttribute(_,o,h%p/u,m)}else a===null?E=new c(n.count*o):E=new c(a,h,n.count*o),T=new f.BufferAttribute(E,o,m);if(n.sparse!==void 0){const R=U.SCALAR,L=D[n.sparse.indices.componentType],_=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,S=new L(r[1],_,n.sparse.count*R),b=new c(r[2],x,n.sparse.count*o);a!==null&&(T=new f.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let y=0,C=S.length;y<C;y++){const w=S[y];if(T.setX(w,b[y*o]),o>=2&&T.setY(w,b[y*o+1]),o>=3&&T.setZ(w,b[y*o+2]),o>=4&&T.setW(w,b[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=m}return T})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const o=i.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,i){const n=this,s=this.json,r=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return u.magFilter=$[h.magFilter]||f.LinearFilter,u.minFilter=$[h.minFilter]||f.LinearMipmapLinearFilter,u.wrapS=J[h.wrapS]||f.RepeatWrapping,u.wrapT=J[h.wrapT]||f.RepeatWrapping,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==f.NearestFilter&&u.minFilter!==f.LinearFilter,n.associations.set(u,{textures:t}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const r=n.images[t],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=i.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,p){let m=h;e.isImageBitmapLoader===!0&&(m=function(E){const T=new f.Texture(E);T.needsUpdate=!0,h(T)}),e.load(f.LoaderUtils.resolveURL(l,s.path),m,void 0,p)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||De(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=u,u}assignTexture(t,e,i,n){const s=this;return this.getDependency("texture",i.index).then(function(r){if(!r)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(r=r.clone(),r.channel=i.texCoord),s.extensions[M.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[M.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=s.associations.get(r);r=s.extensions[M.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,o)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.PointsMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new f.LineBasicMaterial,f.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||s||r){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),s&&(o.vertexColors=!0),r&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return f.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,n=this.extensions,s=i.materials[t];let r;const a={},o=s.extensions||{},c=[];if(o[M.KHR_MATERIALS_UNLIT]){const l=n[M.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new f.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],f.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,f.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=f.DoubleSide);const u=s.alphaMode||j.OPAQUE;if(u===j.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===j.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new f.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==f.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==f.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new f.Color().setRGB(l[0],l[1],l[2],f.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==f.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,f.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),O(l,s),e.associations.set(l,{materials:t}),s.extensions&&P(n,l,s),l})}createUniqueName(t){const e=f.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function s(a){return i[M.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return Q(o,a,e)})}const r=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],u=Fe(c),l=n[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[M.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=Q(new f.BufferGeometry,c,e),n[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,i=this.json,n=this.extensions,s=i.meshes[t],r=s.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?ve(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let p=0,m=u.length;p<m;p++){const E=u[p],T=r[p];let R;const L=c[p];if(T.mode===I.TRIANGLES||T.mode===I.TRIANGLE_STRIP||T.mode===I.TRIANGLE_FAN||T.mode===void 0)R=s.isSkinnedMesh===!0?new f.SkinnedMesh(E,L):new f.Mesh(E,L),R.isSkinnedMesh===!0&&R.normalizeSkinWeights(),T.mode===I.TRIANGLE_STRIP?R.geometry=W(R.geometry,f.TriangleStripDrawMode):T.mode===I.TRIANGLE_FAN&&(R.geometry=W(R.geometry,f.TriangleFanDrawMode));else if(T.mode===I.LINES)R=new f.LineSegments(E,L);else if(T.mode===I.LINE_STRIP)R=new f.Line(E,L);else if(T.mode===I.LINE_LOOP)R=new f.LineLoop(E,L);else if(T.mode===I.POINTS)R=new f.Points(E,L);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(R.geometry.morphAttributes).length>0&&Pe(R,s),R.name=e.createUniqueName(s.name||"mesh_"+t),O(R,s),T.extensions&&P(n,R,T),e.assignFinalMaterial(R),l.push(R)}for(let p=0,m=l.length;p<m;p++)e.associations.set(l[p],{meshes:t,primitives:p});if(l.length===1)return s.extensions&&P(n,l[0],s),l[0];const h=new f.Group;s.extensions&&P(n,h,s),e.associations.set(h,{meshes:t});for(let p=0,m=l.length;p<m;p++)h.add(l[p]);return h})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new f.PerspectiveCamera(f.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new f.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),O(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,s=e.joints.length;n<s;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),r=n,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new f.Matrix4;s!==null&&h.fromArray(s.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new f.Skeleton(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=n.channels.length;l<h;l++){const p=n.channels[l],m=n.samplers[p.sampler],E=p.target,T=E.node,R=n.parameters!==void 0?n.parameters[m.input]:m.input,L=n.parameters!==void 0?n.parameters[m.output]:m.output;E.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",R)),o.push(this.getDependency("accessor",L)),c.push(m),u.push(E))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],p=l[1],m=l[2],E=l[3],T=l[4],R=[];for(let L=0,_=h.length;L<_;L++){const x=h[L],S=p[L],b=m[L],y=E[L],C=T[L];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const w=i._createAnimationTracks(x,S,b,y,C);if(w)for(let v=0;v<w.length;v++)R.push(w[v])}return new f.AnimationClip(s,void 0,R)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const r=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),r})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],s=i._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,u=a.length;c<u;c++)r.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(p){p.isSkinnedMesh&&p.bind(h,He)});for(let p=0,m=l.length;p<m;p++)u.add(l[p]);return u})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const s=e.nodes[t],r=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let u;if(s.isBone===!0?u=new f.Bone:c.length>1?u=new f.Group:c.length===1?u=c[0]:u=new f.Object3D,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(s.name&&(u.userData.name=s.name,u.name=r),O(u,s),s.extensions&&P(i,u,s),s.matrix!==void 0){const l=new f.Matrix4;l.fromArray(s.matrix),u.applyMatrix4(l)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);if(!n.associations.has(u))n.associations.set(u,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(u);n.associations.set(u,{...l})}return n.associations.get(u).nodes=t,u}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,s=new f.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&P(e,s,i);const r=i.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(n.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++)s.add(o[u]);const c=u=>{const l=new Map;for(const[h,p]of n.associations)(h instanceof f.Material||h instanceof f.Texture)&&l.set(h,p);return u.traverse(h=>{const p=n.associations.get(h);p!=null&&l.set(h,p)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,i,n,s){const r=[],a=t.name?t.name:t.uuid,o=[];k[s.path]===k.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(k[s.path]){case k.weights:c=f.NumberKeyframeTrack;break;case k.rotation:c=f.QuaternionKeyframeTrack;break;case k.translation:case k.scale:c=f.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=f.NumberKeyframeTrack;break;case 2:case 3:default:c=f.VectorKeyframeTrack;break}break}const u=n.interpolation!==void 0?Oe[n.interpolation]:f.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,p=o.length;h<p;h++){const m=new c(o[h]+"."+k[s.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),r.push(m)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=X(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof f.QuaternionKeyframeTrack?Ce:ee;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Be(d,t,e){const i=t.attributes,n=new f.Box3;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new f.Vector3(o[0],o[1],o[2]),new f.Vector3(c[0],c[1],c[2])),a.normalized){const u=X(D[a.componentType]);n.min.multiplyScalar(u),n.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new f.Vector3,o=new f.Vector3;for(let c=0,u=s.length;c<u;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],p=h.min,m=h.max;if(p!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(p[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(p[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(p[2]),Math.abs(m[2]))),h.normalized){const E=X(D[h.componentType]);o.multiplyScalar(E)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}d.boundingBox=n;const r=new f.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,d.boundingSphere=r}function Q(d,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){d.setAttribute(a,o)})}for(const r in i){const a=V[r]||r.toLowerCase();a in d.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!d.index){const r=e.getDependency("accessor",t.indices).then(function(a){d.setIndex(a)});n.push(r)}return f.ColorManagement.workingColorSpace!==f.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${f.ColorManagement.workingColorSpace}" not supported.`),O(d,t),Be(d,t,e),Promise.all(n).then(function(){return t.targets!==void 0?ke(d,t.targets,e):d})}function Ue(){const d=g.ref(!1),t=g.ref(""),e=g.shallowRef([]),i=g.ref(null),n=new B.MTLLoader,s=new B.OBJLoader,r=new B.STLLoader,a=new oe;return{isLoading:d,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var p;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}d.value=!0,t.value="准备加载...",e.value=[],i.value=null;const u=new Map;c.forEach(m=>{m instanceof File&&u.set(m.name.toLowerCase(),m)});const l=[],h=[];try{for(const m of c){const E=m.name||"unknown_file",T=(p=E.split(".").pop())==null?void 0:p.toLowerCase();if(T==="mtl")continue;const R=URL.createObjectURL(m);l.push(R);let L=null;const _=x=>{const S=x.lengthComputable?x.loaded/x.total*100:0;t.value=`正在加载 ${E}... ${Math.round(S)}%`};switch(t.value=`正在加载 ${E}... 0%`,T){case"obj":const x=E.replace(/\.obj$/i,".mtl").toLowerCase();if(u.has(x)){const C=u.get(x),w=URL.createObjectURL(C);l.push(w);const v=await n.loadAsync(w);v.preload(),s.setMaterials(v)}else s.setMaterials(null);L=await s.loadAsync(R,_);break;case"stl":const S=await r.loadAsync(R,_),b=new f.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});L=new f.Mesh(S,b);break;case"gltf":case"glb":L=(await a.loadAsync(R,_)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${E}`;continue}L&&(L.userData.boundingBox=new f.Box3().setFromObject(L),h.push(L))}e.value=h,t.value="加载完成!"}catch(m){throw console.error("加载模型时出错:",m),i.value=`加载失败: ${m.message||"未知错误"}`,t.value="加载失败!",e.value=[],m}finally{d.value=!1,l.forEach(m=>URL.revokeObjectURL(m))}}}}function je(d,t={}){const e={threeInfo:{},modelLoader:{},animation:{},clipping:{}},i=G.useThreeJS(d);e.threeInfo=i;const{currentModels:n,getThreeJSObjects:s}=i,{useModelLoaderHook:r,useAnimationHook:a,useClippingHook:o}=t;return r&&(e.modelLoader=Ue()),a&&(e.animation=G.useAnimation(s,n)),o&&(e.clipping=G.useClipping(s,n)),e}const Ke={class:"obj-viewer-container"},Ve={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},ze={class:"buttonGroup-right"},qe={class:"left-panel"},We={class:"panel-header"},Ye={key:0,class:"loading-overlay"},$e=g.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(d){const t=d,e=g.ref(null),i=g.ref(!1),n=g.ref(""),{threeInfo:{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:u,setAndFitModels:l,axesHelperVisible:h,toggleAxesVisibility:p},modelLoader:{isLoading:m,loadingProgress:E,loadedModels:T,error:R,loadModelsFromBlobs:L},animation:{isAnimating:_,toggleAnimation:x,startAnimation:S,stopAnimation:b},clipping:{isClipping:y,activeClippingAxis:C,toggleClipping:w,updateClippingPlanes:v}}=je(e,{useModelLoaderHook:!0,useAnimationHook:!0,useClippingHook:!0}),te=()=>{p()},ne=A=>{C.value=A,v()};g.watch(()=>t.fileBlobs,A=>{A&&A.length>0&&L(A).catch(N=>{console.error("加载错误:",N)})},{immediate:!0,deep:!0}),g.watch(T,A=>{A&&A.length>0&&l(A)}),g.watch(R,A=>{A&&q.ElMessage.error(`模型加载失败: ${A}`)});const z=A=>{i.value=!0,n.value=A,A==="剖面视图"&&!y.value&&w()};return g.onMounted(async()=>{await g.nextTick();try{a(),window.addEventListener("resize",o)}catch(A){console.error("Three.js 初始化失败:",A),q.ElMessage.error("渲染引擎初始化失败!")}}),g.onBeforeUnmount(()=>{n.value="",window.removeEventListener("resize",o),_.value&&b(),u()}),(A,N)=>{const se=g.resolveComponent("el-scrollbar");return g.openBlock(),g.createElementBlock("div",Ke,[g.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),N[3]||(N[3]=g.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),g.createElementVNode("div",Ve,[g.createVNode(F.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:g.unref(r),title:"重置"},null,8,["onClick"]),g.createVNode(F.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),g.createVNode(F.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),g.createVNode(F.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:g.unref(x),title:g.unref(_)?"停止动画":"动画视图"},null,8,["onClick","title"]),g.createVNode(F.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:g.unref(h),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),g.createElementVNode("div",Xe,[g.renderSlot(A.$slots,"button-left",{switchRightPanel:z},void 0,!0),g.createVNode(F.ThreeSvgIcon,{name:"clipping",size:"24",onClick:N[0]||(N[0]=re=>z("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),g.createElementVNode("div",ze,[g.renderSlot(A.$slots,"button-right",{},void 0,!0)]),N[4]||(N[4]=g.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),g.withDirectives(g.createElementVNode("div",qe,[g.createElementVNode("div",We,[g.createElementVNode("span",null,g.toDisplayString(n.value),1),g.createElementVNode("span",{class:"close",onClick:N[1]||(N[1]=re=>i.value=!1)}," X ")]),g.createVNode(se,{"max-height":"650px"},{default:g.withCtx(()=>[n.value==="剖面视图"?(g.openBlock(),g.createBlock(G.ClippingPanel,{key:0,value:g.unref(C),onChange:ne},null,8,["value"])):g.createCommentVNode("",!0)]),_:1})],512),[[g.vShow,i.value]]),g.unref(m)?(g.openBlock(),g.createElementBlock("div",Ye,[N[2]||(N[2]=g.createElementVNode("div",{class:"loading-spinner"},null,-1)),g.createElementVNode("p",null,g.toDisplayString(g.unref(E)),1)])):g.createCommentVNode("",!0)])}}}),Je=ie._export_sfc($e,[["__scopeId","data-v-e55581e6"]]);exports.default=Je;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-D70yS3z2.cjs"),me=require("./iconfont-ji7A-_XJ.cjs"),fe=require("./workpieceTreePanel-KdP9UaVe.cjs"),D=require("./index-C8qRkCgn.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-fAuSnfOH.cjs");require("./index-BpPyaNFa.cjs");const K=require("./index-B2xsH_Wl.cjs");require("./index.vue_vue_type_style_index_1_lang-DDYxgdQk.cjs");require("./index-CF3dfQ01.cjs");require("./index-CX2C-kjD.cjs");const ae=require("./animationData-FLuoH13j.cjs"),ce=require("./urdfTree-CPEMi7wo.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=require("./index-qDBAJZN2.cjs"),Ee=require("./index-D57Bv8co.cjs"),R=require("./svgIcon-CUM54R6L.cjs"),G=.001,W=s.MathUtils.degToRad,ye=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Te(g=.005,m=64){const d=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),r=new s.TubeGeometry(d,m,g,16,!1),p=ye;return new s.Mesh(r,p)}const ke=g=>g.reduce((m,d)=>{let r=0;const p=d.Y??0,b=d.C??0,a=d.R??0;return p>0&&(r+=p),b>0&&a>0&&(r+=a*W(b)),m+r},0),Me=g=>{const m=[],d=g.Y??0,r=g.B??0,p=g.C??0,b=g.R??0,a={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!d&&!p)return m;if(m.push(a.pos.clone()),r!==0){const h=new s.Matrix4().makeRotationAxis(a.localY,W(r));a.localX.applyMatrix4(h),a.localZ.applyMatrix4(h)}if(d>0&&(a.pos.add(a.localY.clone().multiplyScalar(d*G)),m.push(a.pos.clone())),p>0&&b>0){const h=W(p),v=b*G,w=a.pos.clone().add(a.localX.clone().multiplyScalar(-v)),n=Math.max(16,Math.ceil(p/5));for(let y=1;y<=n;y++){const u=h*y/n,_=new s.Matrix4().makeRotationAxis(a.localZ,u),c=a.localX.clone().multiplyScalar(v).applyMatrix4(_),x=w.clone().add(c);m.push(x)}}return m};function Se(g,m){const d=new s.Group;d.name="CompletePipe";const r={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let p=0,b=1;for(let a=0;a<g.length;a++){const h=g[a],v=h.Y??0,w=h.B??0,n=h.C??0,y=h.R??0;if(w!==0){const u=new s.Matrix4().makeRotationAxis(r.localY,W(w));r.localX.applyMatrix4(u),r.localZ.applyMatrix4(u)}if(v>0){const u=r.pos.clone();r.pos.add(r.localY.clone().multiplyScalar(v*G));const _=r.pos.clone(),i=De(u,_,m*G);i.userData={segmentType:"straight",segmentIndex:p,frameIndex:a,length:v,frame:{Y:v,B:w,C:n,R:y}},i.name=`直段_${p}`,d.add(i);const c=u.clone();Pe(d,b,c,m*G),p++}if(n>0&&y>0){const u=W(n),_=y*G,i=[];i.push(r.pos.clone());const c=r.pos.clone().add(r.localX.clone().multiplyScalar(-_)),x=Math.max(16,Math.ceil(n/5));for(let f=1;f<=x;f++){const k=u*f/x,B=new s.Matrix4().makeRotationAxis(r.localZ,k),L=r.localX.clone().multiplyScalar(_).applyMatrix4(B),q=c.clone().add(L);i.push(q)}const E=Re(i,m*G);E.userData={segmentType:"bend",segmentIndex:p,frameIndex:a,angle:n,radius:y,centerPoint:c.toArray(),frame:{Y:v,B:w,C:n,R:y}},E.name=`弯段_${p}`,d.add(E),Math.floor(i.length/2),i[0],r.pos=i[i.length-1].clone();const T=new s.Matrix4().makeRotationAxis(r.localZ,u);r.localY.applyMatrix4(T),r.localX.applyMatrix4(T),p++,b++}}return d}function Pe(g,m,d,r){const p=new s.Vector3(0,r*2,r*5),b=d.clone().add(p),a=[d,b],h=new s.BufferGeometry().setFromPoints(a),v=new s.LineDashedMaterial({color:16711680,dashSize:r*.5,gapSize:r*.3,linewidth:1}),w=new s.Line(h,v);w.computeLineDistances(),g.add(w);const n=document.createElement("canvas"),y=n.getContext("2d");n.width=128,n.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(m.toString(),64,64);const u=new s.CanvasTexture(n),_=new s.SpriteMaterial({map:u,transparent:!0,depthTest:!1,depthWrite:!1}),i=new s.Sprite(_),c=r*3;i.scale.set(c,c,1),i.position.copy(b),i.name=`Label_${m}`,i.userData={labelNumber:m},g.add(i)}function De(g,m,d){const r=new s.LineCurve3(g,m),p=new s.TubeGeometry(r,2,d,18,!1);return new s.Mesh(p,ye)}function Re(g,m){const d=new s.CatmullRomCurve3(g,!1,"catmullrom",.01),r=new s.TubeGeometry(d,Math.max(16,g.length*2),m,18,!1);return new s.Mesh(r,ye)}function _e(g,m,d,r,p,b=0){let a=m.slice(0,p+1);const h=m[p+1];if(h&&b>0){const i={...h,B:(h.B??0)*b,C:(h.C??0)*b};a.push(i)}const v=ke(a),w=Math.max(0,d-v),n=[];n.push(new s.Vector3(0,0,0));const y=new s.Vector3(0,w*G,0);w>0&&n.push(y);let u={pos:y.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const _=[];for(let i=a.length-1;i>=0;i--){const c=a[i],x=Me(c);if(x.length>0){const E=x.map(B=>{const A=B.clone(),L=new s.Matrix4;return L.makeBasis(u.localX,u.localY,u.localZ),A.applyMatrix4(L),A.add(u.pos)});_.push(E);const T=E[E.length-1];u.pos=T.clone();const f=c.B??0,k=c.C??0;if(f!==0){const B=new s.Matrix4().makeRotationAxis(u.localY,W(f));u.localX.applyMatrix4(B),u.localZ.applyMatrix4(B)}if(k>0){const B=W(k),A=new s.Matrix4().makeRotationAxis(u.localZ,B);u.localY.applyMatrix4(A),u.localX.applyMatrix4(A)}}}for(const i of _)i.length>1&&n.push(...i.slice(1));n.length<2&&n.push(new s.Vector3(0,.001,0));try{const i=new s.CatmullRomCurve3(n,!1,"catmullrom",.01),c=new s.TubeGeometry(i,Math.max(2,n.length*4),r*G,18,!1);g.geometry.dispose(),g.geometry=c}catch(i){console.error("管件更新失败",i)}}function Ce(g,m,d,r=0){let p=g.slice(0,d+1);const b=g[d+1];if(b&&r>0){const u={...b,B:(b.B??0)*r,C:(b.C??0)*r};p.push(u)}const a=ke(p),h=Math.max(0,m-a),v=[];v.push(new s.Vector3(0,0,0));const w=new s.Vector3(0,h*G,0);h>0&&v.push(w);let n={pos:w.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const y=[];for(let u=p.length-1;u>=0;u--){const _=p[u],i=Me(_);if(i.length>0){const c=i.map(f=>{const k=f.clone(),B=new s.Matrix4;return B.makeBasis(n.localX,n.localY,n.localZ),k.applyMatrix4(B),k.add(n.pos)});y.push(c);const x=c[c.length-1];n.pos=x.clone();const E=_.B??0,T=_.C??0;if(E!==0){const f=new s.Matrix4().makeRotationAxis(n.localY,W(E));n.localX.applyMatrix4(f),n.localZ.applyMatrix4(f)}if(T>0){const f=W(T),k=new s.Matrix4().makeRotationAxis(n.localZ,f);n.localY.applyMatrix4(k),n.localX.applyMatrix4(k)}}}for(const u of y)u.length>1&&v.push(...u.slice(1));return v.length<2&&v.push(new s.Vector3(0,.001,0)),v}function Ne(g,m,d,r,p,b,a,h=0,v=0){const w=p-v,n=Ce(r,w,a,h);let u=Ce(d,v,a,h);u.forEach(i=>i.y=-i.y),u.reverse();const _=[...u,...n];try{const i=new s.CatmullRomCurve3(_,!1,"catmullrom",.01),c=new s.TubeGeometry(i,Math.max(2,_.length*4),b*G,18,!1);m.geometry.dispose(),g.geometry.dispose(),m.parent&&m.parent.remove(m),g.geometry=c}catch(i){console.error("管件更新失败",i)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},Fe={class:"control-row"},ze={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ue={class:"progress-bar"},Ie={class:"dialog-footer"},je=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(g,{expose:m}){const d=g,r=e.ref(),p=e.ref();e.watch(()=>d.threeData,o=>{const t=o==null?void 0:o.data;p.value=t==null?void 0:t.type},{immediate:!0});const b=async()=>{let o={};p.value===ne.robotMode.SINGLE&&(o=await ae.fetchSingleRobotAnimationData()),p.value===ne.robotMode.DOUBLE&&(o=await ae.fetchDoubleRobotAnimationData());const{initialPipeLength:t=0,pipeRadius:l=0,clampLength:V=0,animationData:C}=o;T.value=t,f.value=l,k.value=V,r.value=C;const $=D.cloneDeep(r.value),J=se(Y.value),X=($==null?void 0:$["输出(动画数据)"])||[];a.value=X.length?X:[J]},a=e.ref([]),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),n=e.ref(0),y=e.ref(0),u=e.ref(1e3);let _=!1;const i=e.ref(null),c=e.shallowRef(null),x=e.shallowRef(null),E=e.shallowRef(null),T=e.ref(0),f=e.ref(12.5),k=e.ref(30),B=e.ref([]),A=e.ref(null),L=e.computed(()=>d.model?ce.getNonFixedJoints(d.model).map(l=>l.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ue=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
|
+
${Y.value.join(" ")}
|
|
3
|
+
0 0 0 ...
|
|
4
|
+
1 2 3 ...`:"请先加载模型。"),re=()=>a.value.map(o=>({Y:parseFloat(o.Y)||0,B:parseFloat(o.B)||0,C:parseFloat(o.C)||0,R:parseFloat(o.R)||0})),Q=()=>{const o=[],t=[];return a.value.forEach(l=>{const{Y1:V,B1:C,C1:$,R1:J,Y2:X,B2:le,C2:pe,R2:P}=l;o.push({Y:parseFloat(V)||0,B:parseFloat(C)||0,C:parseFloat($)||0,R:parseFloat(J)||0}),t.push({Y:parseFloat(X)||0,B:parseFloat(le)||0,C:parseFloat(pe)||0,R:parseFloat(P)||0})}),{posPipeYbcr:o,negPipeYbcr:t}},M=(o=0,t=0)=>{if(c.value&&x.value){const l=Q();Ne(c.value,x.value,l.posPipeYbcr,l.negPipeYbcr,T.value,f.value,o,t,k.value)}else if(c.value){const l=re();_e(c.value,l,T.value,f.value,o,t)}},N=o=>{if(o<0||o>=a.value.length){console.error(`帧索引 ${o} 超出范围`);return}const t=a.value[o];if(console.log(`应用第 ${o} 帧数据 ${t}`),n.value=o,i.value){const l={};L.value.forEach(V=>{const C=parseFloat(t[V]);isNaN(C)||(l[V]=C)}),i.value.setJointAngles(l)}M(o,0)},U=async()=>{if(a.value.length===0){D.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,a.value.length-1===n.value&&(n.value=0);try{for(let o=n.value+1;o<a.value.length&&!_;o++){n.value=o;const t=a.value[o],l={};i.value&&L.value.forEach(V=>{const C=parseFloat(t[V]);isNaN(C)||(l[V]=C)}),i.value?await i.value.animateToState(l,u.value,V=>{y.value=(o+V)/a.value.length*100,M(o-1,V)}):(await new Promise(V=>setTimeout(V,u.value)),y.value=(o+1)/a.value.length*100)}_||D.ElMessage.success("动画播放完成")}catch(o){console.error("动画播放出错:",o),D.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,D.ElMessage.info("动画已停止")},I=()=>{n.value=0},z=()=>{if(c.value&&x.value){const o=Q();Ne(c.value,x.value,o.posPipeYbcr,o.negPipeYbcr,T.value,f.value,-1,0,k.value)}else if(c.value){const o=re();_e(c.value,o,T.value,f.value,-1,0)}},Z=()=>{i.value&&i.value.resetToZero(),z(),I(),D.ElMessage.success("机器人和管件已重置")},O=o=>`第 ${o+1} 帧`,j=o=>{w.value&&F(),N(o)},ee=()=>{w.value&&F(),!(n.value+1>=a.value.length)&&N(n.value+1)},S=()=>{w.value&&F(),n.value!==0&&N(n.value-1)},H=()=>{E.value&&(E.value.visible=!0),c.value&&c.value.parent&&c.value.parent.remove(c.value),E.value=null,c.value=null,x.value=null},se=o=>o==null?void 0:o.reduce((t,l)=>(t[l]="0",t),{});e.watch(Y,(o,t)=>{if(JSON.stringify(o)!==JSON.stringify(t))if(o.length>0){const l=se(o);a.value=[l]}else a.value=[]},{immediate:!0});const te=e.ref(0),de=o=>{te.value=o},he=(o,t)=>{if(!o||!t)return;const l=ce.getTargetJoint(o,t),V=Te();V.visible=!1,l==null||l.add(V)},ge=o=>{i.value=new fe.URDFRobotController(o),B.value=ce.getAllLinkName(o),A.value="Pipe_Joint"},oe=()=>{i.value=null,B.value=[],A.value=null},ie=o=>{ge(o),he(o,A.value),de(te.value+1),Z()};e.watch(()=>d.model,o=>{if(H(),o){ie(o);return}oe()},{immediate:!0});const ve=o=>{var l,V;const t=new s.Mesh(o.geometry.clone(),o.material);return t.name="managed_pipe_clone",(V=(l=o==null?void 0:o.parent)==null?void 0:l.add)==null||V.call(l,t),t.position.copy(o.position),t.rotation.copy(o.rotation),t.scale.copy(o.scale),t};e.watch([A,k,T,te],([o,t])=>{if(H(),d.model&&o){const l=ce.getMeshFromJoint(d.model,o);if(console.log(l,"meshToReplace"),l&&l.parent){E.value=l,l.visible=!1;const V=ve(l);if(p.value===ne.robotMode.SINGLE&&(V.position.y-=t*.001),c.value=V,p.value===ne.robotMode.DOUBLE){const C=ve(l);x.value=C}M(0,0)}else o&&console.warn(`在 link '${o}' 中未找到可替换的网格或其没有父级。`)}});const Ve=async()=>{if(Y.value.length===0){D.ElMessage.warning("没有可导出的表头");return}const o=Y.value.join(" ");try{await navigator.clipboard.writeText(o),D.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),D.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!v.value.trim()){D.ElMessage.warning("导入内容不能为空");return}const o=v.value.trim().split(`
|
|
5
|
+
`).filter($=>$.trim()!=="");if(o.length<2){D.ElMessage.error("导入数据至少需要包含表头行和一行数据");return}const t=o[0].split(" ").map($=>$.trim()),l={};if(t.forEach(($,J)=>{Y.value.includes($)&&(l[J]=$)}),Object.keys(l).length===0){D.ElMessage.error("没有找到匹配的表头,请检查表头名称是否正确");return}const C=o.slice(1).map($=>{const J=$.split(" "),X={};return Y.value.forEach(le=>{X[le]="0"}),Object.entries(l).forEach(([le,pe])=>{const P=J[parseInt(le)];P!==void 0&&P.trim()!==""&&(X[pe]=P.trim())}),X});C.length>0?(a.value=C,D.ElMessage.success(`成功导入 ${C.length} 行数据!`),h.value=!1,v.value=""):D.ElMessage.error("未能解析到有效数据,请检查格式。")};return e.onUnmounted(()=>{H(),_=!0}),m({playAnimation:U,stopAnimation:F,forwardFrame:ee,backwardFrame:S}),(o,t)=>{const l=e.resolveComponent("el-icon"),V=e.resolveComponent("el-input-number"),C=e.resolveComponent("el-form-item"),$=e.resolveComponent("el-form"),J=e.resolveComponent("el-slider"),X=e.resolveComponent("el-progress"),le=e.resolveComponent("el-input"),pe=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Ae,[e.createVNode(K._sfc_main,{onClick:b,modelValue:"获取数据"}),e.createVNode(K._sfc_main,{onClick:Ve,disabled:Y.value.length===0,modelValue:"导出表头"},null,8,["disabled"]),e.createVNode(K._sfc_main,{modelValue:"播放",onClick:U,disabled:a.value.length===0||w.value,buttonType:"primary"},{default:e.withCtx(()=>[w.value?(e.openBlock(),e.createBlock(l,{key:0,class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.loading_default))]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["disabled"]),e.createVNode(K._sfc_main,{onClick:F,modelValue:"停止",buttonType:"danger"}),e.createVNode(K._sfc_main,{onClick:Z,modelValue:"重置",buttonType:"primary"})]),e.createElementVNode("div",$e,[e.createElementVNode("div",Fe,[e.createVNode($,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(C,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(V,{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=P=>u.value=P),min:100,max:5e3,step:100,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(C,{label:"管件总长 (mm):",prop:"initialPipeLength"},{default:e.withCtx(()=>[e.createVNode(V,{modelValue:T.value,"onUpdate:modelValue":t[1]||(t[1]=P=>T.value=P),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(C,{label:"管件半径 (mm):",prop:"pipeRadius"},{default:e.withCtx(()=>[e.createVNode(V,{modelValue:f.value,"onUpdate:modelValue":t[2]||(t[2]=P=>f.value=P),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(C,{label:"夹持长度 (mm):",prop:"clampLength"},{default:e.withCtx(()=>[e.createVNode(V,{modelValue:k.value,"onUpdate:modelValue":t[3]||(t[3]=P=>k.value=P),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t[10]||(t[10]=e.createElementVNode("div",{class:"control-row"},[e.createElementVNode("label",null,"管件 Mesh:")],-1)),e.createElementVNode("div",ze,[t[8]||(t[8]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ye,e.toDisplayString(n.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Le,[t[9]||(t[9]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(J,{modelValue:n.value,"onUpdate:modelValue":t[4]||(t[4]=P=>n.value=P),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":O,onInput:j,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Ue,[e.createVNode(X,{percentage:y.value,"show-text":!1,"stroke-width":6},null,8,["percentage"])])]),e.createVNode(pe,{modelValue:h.value,"onUpdate:modelValue":t[7]||(t[7]=P=>h.value=P),title:"导入数据",width:"500px"},{footer:e.withCtx(()=>[e.createElementVNode("span",Ie,[e.createVNode(K._sfc_main,{modelValue:"取消",onClick:t[6]||(t[6]=P=>h.value=!1)}),e.createVNode(K._sfc_main,{modelValue:"确认导入",onClick:be,type:"primary"})])]),default:e.withCtx(()=>[t[11]||(t[11]=e.createElementVNode("p",{class:"import-instructions"}," 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ",-1)),e.createVNode(le,{modelValue:v.value,"onUpdate:modelValue":t[5]||(t[5]=P=>v.value=P),type:"textarea",rows:10,placeholder:ue.value},null,8,["modelValue","placeholder"])]),_:1,__:[11]},8,["modelValue"])])}}}),Ge=we._export_sfc(je,[["__scopeId","data-v-49a19db9"]]),Oe=async()=>{const g=["工件库","弯管"],m=await ae.getMenuData(g),d=ae.getTargetGroup("工件列表",m),r=xe.getMainKeysFromGroup(d);return r==null?void 0:r.map(b=>({name:b,mainKey:b}))},Xe=async g=>{const m=["工件库","弯管"],d=await xe.getDetailData(m,g),r=ae.getTargetGroup("弯管基础参数",d),p=ae.getTargetGroup("弯管特征尺寸",d),b={outerDiameter:0,ybcrList:[]},a=ae.getFormData(r),h=Ee.getTableData(p);return b.outerDiameter=(a==null?void 0:a.外径)||0,b.ybcrList=h||[],b},qe={class:"pipe-analysis-dialog-header"},Ze={class:"header-right"},Je={class:"pipe-analysis-dialog-body"},We={class:"panel-left"},He={class:"pipe-analysis-input"},Ke={class:"input-params"},Qe={class:"pipe-analysis-output"},et={class:"ouput-params"},tt=e.defineComponent({__name:"pipeAnalysisPanel",emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(g,{expose:m,emit:d}){const r=e.ref(null),p=e.shallowRef(null),{currentModels:b,resetView:a,initThreeJS:h,handleResize:v,getThreeJSObjects:w,cleanup:n,setModels:y,clearAllModels:u,axesHelperVisible:_,toggleAxesVisibility:i,addModelAndFit:c}=me.useThreeJS(r);e.ref(null);const x=e.ref({file:null,pipe:""});e.ref(null),e.ref(!1);const E=e.ref([]),T=M=>{E.value=M};e.ref("ybcr");const f=e.ref({form:{},list:[],reverse:!1}),k=M=>{const{length:N,outerDiameter:U,innerDiameter:F,thickness:I,ybcrList:z}=M||{};f.value.form={length:N,outerDiameter:U,innerDiameter:F,thickness:I},f.value.list=z},B=()=>{const{form:M,list:N}=f.value,{outerDiameter:U}=M,F=U/2,I=N==null?void 0:N.map(Z=>{const{y:O,b:j,c:ee,r:S,Y:H,B:se,C:te,R:de}=Z;return H?{Y:H,B:se,C:te,R:de}:{Y:O,B:j,C:ee,R:S}});u();const z=Se(I,F);c(z)},A=e.ref(!1),L=()=>{const M=A.value;A.value=!M},q=e.ref(!1),Y=()=>{q.value=!1},ue=()=>{q.value=!0},re=async()=>{const M=await Oe();T(M)},Q=async M=>{const N=await Xe(M);k(N)};return e.watch(()=>f,()=>{B()},{deep:!0}),e.watch(()=>r,()=>{try{if(p.value)return;h(),window.addEventListener("resize",v)}catch(M){console.error("Three.js 初始化失败:",M),D.ElMessage.error("渲染引擎初始化失败!")}},{deep:!0}),e.onMounted(async()=>{re()}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",v),n()}),m({openDialog:ue}),(M,N)=>{const U=e.resolveComponent("el-icon"),F=e.resolveComponent("el-option"),I=e.resolveComponent("el-select"),z=e.resolveComponent("el-form-item"),Z=e.resolveComponent("el-form"),O=e.resolveComponent("el-input"),j=e.resolveComponent("el-table-column"),ee=e.resolveComponent("el-table");return e.openBlock(),e.createBlock(K.ssDialog,{class:"pipe-analysis-dialog",visible:q.value,onBeforeDestroy:M.onDestroy,showClose:!1,fullScreen:A.value},{header:e.withCtx(()=>[e.createElementVNode("div",qe,[N[6]||(N[6]=e.createElementVNode("div",{class:"header-left",title:"管件解析"}," 管件解析 ",-1)),e.createElementVNode("div",Ze,[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(D.full_screen_default),{onClick:L})]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(D.close_default),{onClick:Y})]),_:1})])])]),default:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createElementVNode("div",We,[e.createElementVNode("div",He,[N[7]||(N[7]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输入")],-1)),e.createElementVNode("div",Ke,[e.createVNode(Z,{model:x.value,"label-width":"auto","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(z,{label:"弯管"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:x.value.pipe,"onUpdate:modelValue":N[0]||(N[0]=S=>x.value.pipe=S),placeholder:"请选择弯管",onChange:Q},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,S=>(e.openBlock(),e.createBlock(F,{label:S.name,value:S.mainKey},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),e.createElementVNode("div",Qe,[e.createVNode(z,{label:"加工方向"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:f.value.reverse,"onUpdate:modelValue":N[1]||(N[1]=S=>f.value.reverse=S),placeholder:"请选择加工方向"},{default:e.withCtx(()=>[e.createVNode(F,{label:"正向",value:!1}),e.createVNode(F,{label:"反向",value:!0})]),_:1},8,["modelValue"])]),_:1}),N[8]||(N[8]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输出(弯管基础参数)")],-1)),e.createElementVNode("div",et,[e.createVNode(Z,{model:f.value.form,"label-width":"auto","label-position":"top",inline:!0},{default:e.withCtx(()=>[e.createVNode(z,{label:"管长"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:f.value.form.length,"onUpdate:modelValue":N[2]||(N[2]=S=>f.value.form.length=S)},null,8,["modelValue"])]),_:1}),e.createVNode(z,{label:"外径"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:f.value.form.outerDiameter,"onUpdate:modelValue":N[3]||(N[3]=S=>f.value.form.outerDiameter=S)},null,8,["modelValue"])]),_:1}),e.createVNode(z,{label:"内径"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:f.value.form.innerDiameter,"onUpdate:modelValue":N[4]||(N[4]=S=>f.value.form.innerDiameter=S)},null,8,["modelValue"])]),_:1}),e.createVNode(z,{label:"壁厚"},{default:e.withCtx(()=>[e.createVNode(O,{modelValue:f.value.form.thickness,"onUpdate:modelValue":N[5]||(N[5]=S=>f.value.form.thickness=S)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),e.createVNode(ee,{ref:"singleTableRef",data:f.value.list,"highlight-current-rowstyle":"width: 100%"},{default:e.withCtx(()=>[e.createVNode(j,{type:"index",width:"50"}),e.createVNode(j,{property:"y",label:"Y"}),e.createVNode(j,{property:"b",label:"B"}),e.createVNode(j,{property:"c",label:"C"}),e.createVNode(j,{property:"r",label:"R"})]),_:1},8,["data"])])])]),e.createElementVNode("div",{class:"panel-right",ref_key:"threejsContainer",ref:r},null,512)])]),_:1},8,["visible","onBeforeDestroy","fullScreen"])}}}),ot=we._export_sfc(tt,[["__scopeId","data-v-61e834a4"]]),lt={class:"obj-viewer-container"},nt={class:"pipe-comparison"},at={ref:"pipe1",class:"pipe-container"},rt={ref:"pipe2",class:"pipe-container"},st={class:"buttonGroup-topLeft"},it={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ut={class:"buttonGroup-bottom"},dt={class:"top-panel"},pt={class:"panel-header"},mt={class:"panel-body"},vt={class:"left-panel"},ft={class:"panel-header"},ht={class:"panel-body"},gt={class:"right-panel"},Vt={class:"panel-header"},bt={class:"panel-body"},wt={key:0,class:"loading-overlay"},yt=e.defineComponent({__name:"threeSceneView",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(g){const m=g,d=e.ref(ne.sceneType.ROBOT),r=e.ref(null),p=e.ref(),b=e.ref(!1),a=e.ref(""),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),n=e.ref(""),y=e.ref(!1),u=e.ref(""),_=e.shallowRef(null),i=e.shallowRef(null),c=e.ref(),{currentModels:x,resetView:E,initThreeJS:T,handleResize:f,getThreeJSObjects:k,cleanup:B,setAndFitModels:A,axesHelperVisible:L,toggleAxesVisibility:q,zoomIn:Y,zoomOut:ue}=me.useThreeJS(r),{loadSceneFromFile:re}=fe.useUrdfLoader(k,x,b,a),{isAnimating:Q,toggleAnimation:M,startAnimation:N,stopAnimation:U}=me.useAnimation(k,x),{isClipping:F,activeClippingAxis:I,toggleClipping:z,updateClippingPlanes:Z}=me.useClipping(k,x),{initRaycaster:O,selectedObject3D:j,setSelectedObjVisible:ee,updatePosition:S,updateRotation:H,dispose:se}=fe.useRaycaster(r,k,x),te=()=>{q()},de=t=>{I.value=t,Z()},he=e.computed(()=>d.value===ne.sceneType.ROBOT),ge=e.computed(()=>d.value===ne.sceneType.PIPECOMPARSION),oe=t=>{h.value=!0,v.value=t,t==="剖面视图"&&!F.value&&z()},ie=t=>{w.value=!0,n.value=t},ve=()=>{var t;(t=c==null?void 0:c.value)==null||t.playAnimation()},Ve=()=>{var t;(t=c==null?void 0:c.value)==null||t.stopAnimation()},be=()=>{var t;(t=c==null?void 0:c.value)==null||t.forwardFrame()},o=()=>{var t;(t=c==null?void 0:c.value)==null||t.backwardFrame()};return e.watch(()=>m.fileBlobs,t=>{if(t&&t.length>0){const l=t[0];if(!l.name.toLowerCase().endsWith(".urdf"))return;re(l).then(V=>{_.value=V}).catch(V=>{console.error("加载URDF文件时发生错误:",V),D.ElMessage.error("加载urdf模型失败"),_.value=null})}else _.value=null},{immediate:!0,deep:!0}),e.watch(_,t=>{A(t?[t]:[]),O()}),e.onMounted(async()=>{await e.nextTick();try{T(),window.addEventListener("resize",f);const t=k();i.value=t.scene}catch(t){console.error("Three.js 初始化失败:",t),D.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{v.value="",n.value="",window.removeEventListener("resize",f),Q.value&&U(),B(),se()}),(t,l)=>{const V=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",lt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),[[e.vShow,he.value]]),e.withDirectives(e.createElementVNode("div",nt,[e.createElementVNode("div",at,null,512),e.createElementVNode("div",rt,null,512)],512),[[e.vShow,ge.value]]),l[11]||(l[11]=e.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),e.createElementVNode("div",st,[e.createVNode(R.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:e.unref(E),title:"重置"},null,8,["onClick"]),e.createVNode(R.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(Y)},null,8,["onClick"]),e.createVNode(R.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(ue)},null,8,["onClick"]),e.createVNode(R.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(M),title:e.unref(Q)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(R.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",it,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:oe},void 0,!0),e.createVNode(R.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:l[0]||(l[0]=C=>oe("场景树")),active:h.value&&v.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"clipping",size:"24",onClick:l[1]||(l[1]=C=>oe("剖面视图")),active:h.value&&v.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"zhaozi",size:"24",onClick:l[2]||(l[2]=C=>oe("工件树")),active:h.value&&v.value==="工件树",title:"工件 "},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:l[3]||(l[3]=C=>oe("场景4"))})]),e.createElementVNode("div",ct,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:ie},void 0,!0),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode(R.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:l[4]||(l[4]=C=>ie("关节控制")),active:w.value&&n.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:l[5]||(l[5]=C=>ie("动画仿真")),active:w.value&&n.value==="动画仿真"},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:l[6]||(l[6]=C=>ie("urdf动画")),active:w.value&&n.value==="urdf动画"},null,8,["active"]),e.createVNode(R.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ut,[e.createVNode(R.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:o}),e.createVNode(R.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ve}),e.createVNode(R.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:be}),e.createVNode(R.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ve})]),e.withDirectives(e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:l[7]||(l[7]=C=>y.value=!1)}," X ")]),e.createElementVNode("div",mt,[e.createVNode(V,{height:"100%"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"top-panel",{topPanelType:u.value},void 0,!0)]),_:3})])],512),[[e.vShow,y.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",ft,[e.createElementVNode("span",null,e.toDisplayString(v.value),1),e.createElementVNode("span",{class:"close",onClick:l[8]||(l[8]=C=>h.value=!1)}," X ")]),e.createElementVNode("div",ht,[e.createVNode(V,{height:"100%"},{default:e.withCtx(()=>{var C;return[v.value==="场景树"?(e.openBlock(),e.createBlock(ce.UrdfTree,{key:0,model:_.value},null,8,["model"])):e.createCommentVNode("",!0),v.value==="剖面视图"?(e.openBlock(),e.createBlock(me.ClippingPanel,{key:1,value:e.unref(I),onChange:de},null,8,["value"])):e.createCommentVNode("",!0),v.value==="工件树"?(e.openBlock(),e.createBlock(fe.WorkpieceTreePanel,{key:2,model:(C=e.unref(j))==null?void 0:C.obj,onVisibleChange:e.unref(ee),onUpdatePosition:e.unref(S),onUpdateRotation:e.unref(H)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,h.value]]),e.withDirectives(e.createElementVNode("div",gt,[e.createElementVNode("div",Vt,[e.createElementVNode("span",null,e.toDisplayString(n.value),1),e.createElementVNode("span",{class:"close",onClick:l[9]||(l[9]=C=>w.value=!1)}," X ")]),e.createElementVNode("div",bt,[e.createVNode(V,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ce.JointPanel,{model:_.value},null,8,["model"]),[[e.vShow,n.value==="关节控制"]]),e.withDirectives(e.createVNode(Ge,{ref_key:"animationPanelRef",ref:c,model:_.value,threeData:m.threeData},null,8,["model","threeData"]),[[e.vShow,n.value==="动画仿真"]]),e.renderSlot(t.$slots,"right-panel",{rightPanelType:n.value},void 0,!0)]),_:3})])],512),[[e.vShow,w.value]]),b.value?(e.openBlock(),e.createElementBlock("div",wt,[l[10]||(l[10]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0),e.createVNode(ot,{ref_key:"pipeAnalysisPanelRef",ref:p},null,512)])}}}),_t=we._export_sfc(yt,[["__scopeId","data-v-d2340d87"]]);exports.default=_t;
|