ss-component-new 1.2.77 → 1.2.78
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/{MTLLoader-BruI0iCV.js → MTLLoader-BDMG6YfL.js} +5 -5
- package/dist/{MTLLoader-Bseg1sor.cjs → MTLLoader-CnPy8SIM.cjs} +1 -1
- package/dist/{OrbitControls-Bxqvo8Mr.js → OrbitControls-CY4nXrtT.js} +1 -1
- package/dist/{OrbitControls-BiNnC97N.cjs → OrbitControls-CuLYwxjN.cjs} +1 -1
- package/dist/{URDFLoader-DWo3pDBH.js → URDFLoader-B-_NDbTy.js} +174 -174
- package/dist/{URDFLoader-DexIn4xU.cjs → URDFLoader-CMLpHJvm.cjs} +1 -1
- package/dist/{animationData-BVpXOZwe.cjs → animationData-CU7hS77W.cjs} +1 -1
- package/dist/{animationData-BDkjPdQf.js → animationData-x63hYcF2.js} +18 -18
- package/dist/{array-6LpFOZ5o.cjs → array-CuFsDmBp.cjs} +1 -1
- package/dist/{array-D5Rc5rM9.js → array-DGGaDihY.js} +27 -27
- package/dist/{iconfont-Bnhc7fLw.cjs → iconfont-DapI438c.cjs} +1 -1
- package/dist/{iconfont-14del5d2.js → iconfont-Dh5vye0Q.js} +27 -27
- package/dist/{index-D_coIVx9.cjs → index-B5IQ7gb8.cjs} +1 -1
- package/dist/{index-BMwOfyZG.js → index-B5J3L2e2.js} +2 -2
- package/dist/{index-Da8kLXUi.js → index-B5SNHDlg.js} +1 -1
- package/dist/{index-CiluLmLS.js → index-B6afWPV2.js} +11 -11
- package/dist/{index-Cc_IAZBO.js → index-BHWTQgQr.js} +4 -4
- package/dist/{index-CjipjSmP.cjs → index-BHfg6eX1.cjs} +1 -1
- package/dist/{index-BXCI98KY.js → index-BNw0thEl.js} +6 -6
- package/dist/{index-Bq27i8N6.js → index-BQVxgmhe.js} +4 -4
- package/dist/{index-C5AMx3DP.js → index-BRjEFy0A.js} +2 -2
- package/dist/{index-Pg_Ez4Na.cjs → index-BVm32wTk.cjs} +1 -1
- package/dist/{index-BPWX1kmE.cjs → index-B_8I59kW.cjs} +1 -1
- package/dist/{index-Ai5OAXHo.js → index-BgE_6FYY.js} +6 -6
- package/dist/{index-jKLdvV3y.js → index-BhSs5oWU.js} +20 -20
- package/dist/{index-CV0wJjuo.cjs → index-Bk-2miD0.cjs} +1 -1
- package/dist/{index-D9iPLSwS.js → index-Bmtw8a5p.js} +2 -2
- package/dist/index-Bo1rw4RK.js +12694 -0
- package/dist/{index-DNp4E_lQ.cjs → index-BoRc53Op.cjs} +1 -1
- package/dist/{index-BP1mTaAy.js → index-BpdTJyQA.js} +4 -4
- package/dist/{index-Cv58m2R8.js → index-BuNPE4NQ.js} +1 -1
- package/dist/{index-Do4pZeLF.cjs → index-ByfRHlqN.cjs} +1 -1
- package/dist/{index-BjDn0YhH.cjs → index-CB5nu_Oy.cjs} +1 -1
- package/dist/{index-BCGURMXa.js → index-CCofb6hR.js} +2 -2
- package/dist/{index-sCZuOhEC.js → index-CD_POzdO.js} +1 -1
- package/dist/{index-BU__qorE.cjs → index-CG6XNbRF.cjs} +1 -1
- package/dist/index-CHM2ty3v.cjs +1 -0
- package/dist/{index-BOttcNaR.js → index-CLz_5ZZr.js} +2 -2
- package/dist/{index-C3DC8sX2.js → index-CMI2loKt.js} +9 -9
- package/dist/{index-DRbQJezd.cjs → index-CPIcSR8X.cjs} +1 -1
- package/dist/{index-CTfB2BO7.cjs → index-CRAmNrm9.cjs} +1 -1
- package/dist/{index-B3jUJ0ml.js → index-CRSa1xvW.js} +7 -7
- package/dist/{index-BXumaiVx.js → index-CWlvSpb2.js} +2 -2
- package/dist/{index-CwvAshmz.js → index-CWny47Cz.js} +3 -3
- package/dist/{index-CT1bDBZy.js → index-C_vmgWYF.js} +5 -5
- package/dist/{index-iqnKq5qd.js → index-CdWi5i0R.js} +1 -1
- package/dist/{index-cGnhqEuy.cjs → index-CeLtly50.cjs} +1 -1
- package/dist/{index-1uzZjqSR.cjs → index-CiGUPby0.cjs} +1 -1
- package/dist/{index-CEuxxYEp.cjs → index-CrtAijF6.cjs} +1 -1
- package/dist/{index-CS2SJFa5.cjs → index-Cu_c71UK.cjs} +1 -1
- package/dist/{index-DZboVCcU.cjs → index-CuboYYZp.cjs} +1 -1
- package/dist/{index-CBIrHmhA.cjs → index-D59u4uun.cjs} +1 -1
- package/dist/{index-aG7MmrtC.js → index-DLhzF-SN.js} +3 -3
- package/dist/{index-PkJYBcS-.js → index-DOW-WHBS.js} +25 -22
- package/dist/{index-CZkjboM8.js → index-DPtclCKc.js} +6 -6
- package/dist/{index-BWjhL8R0.js → index-D_qR3hDI.js} +1 -1
- package/dist/{index-DndAdSGT.js → index-DqxXG1QQ.js} +3 -3
- package/dist/{index-CNDlskJD.cjs → index-N59Ddt9i.cjs} +1 -1
- package/dist/{index-nzQPJif1.cjs → index-NwVeUXHo.cjs} +1 -1
- package/dist/{index-lkxTc6vy.js → index-RGPE_-6J.js} +6 -6
- package/dist/{index-DEyzKyXf.cjs → index-_295fBTp.cjs} +1 -1
- package/dist/{index-BYc9jyiE.js → index-bfMyItzl.js} +3 -3
- package/dist/{index-B3x0Un8L.js → index-c_dxTNA1.js} +3 -3
- package/dist/{index-BJizDAnh.cjs → index-id7MTN5D.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CnNB3KR5.cjs +37 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Ctqs6jS6.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Dd4fwgC2.js} +14195 -14528
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bqxa7GJA.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Jb-pxYCE.js} +14268 -14110
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D6FKmWHb.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs} +352 -352
- package/dist/index.vue_vue_type_style_index_0_scoped_140f5e74_lang-RIZ8CIk5.cjs +1 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_140f5e74_lang-t-qpDVld.js +377 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-DQ90IC2k.cjs → index.vue_vue_type_style_index_1_lang-BJyabOtw.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-CrcbIeWl.js → index.vue_vue_type_style_index_1_lang-CNsmX3gg.js} +37 -37
- package/dist/{isString-8mN8gX27.js → isString-Bb0EYAKj.js} +1 -1
- package/dist/{main-D3WREi0-.cjs → main-DIQ7mQ8a.cjs} +1 -1
- package/dist/{main-BkI9SlJQ.js → main-wl0-ex-A.js} +5 -5
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/{threeModel-CVlu8rK_.js → threeModel-C0oPO7tY.js} +5 -5
- package/dist/{threeModel-Bp11Ni6H.cjs → threeModel-Tv_tZqCA.cjs} +1 -1
- package/dist/{threePreview-Dw4LR6jh.cjs → threePreview-BaI2wC-D.cjs} +1 -1
- package/dist/{threePreview-CdzNCx3-.js → threePreview-D5UPnEBN.js} +4 -4
- package/dist/{threeSceneView-jhQi8rSG.js → threeSceneView-CInjoNVf.js} +134 -134
- package/dist/{threeSceneView-BdVTjYBI.cjs → threeSceneView-DVmaCW7K.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-DgAoijFZ.js → threeSceneViewForCPMPIP-C8CXMOuk.js} +8 -8
- package/dist/{threeSceneViewForCPMPIP-DRYioXDE.cjs → threeSceneViewForCPMPIP-DohzLUui.cjs} +1 -1
- package/dist/{threeTrackPathView-Ds9FmHU1.cjs → threeTrackPathView-B3rKlzro.cjs} +1 -1
- package/dist/{threeTrackPathView-C1HVNI2F.js → threeTrackPathView-CVpyIv5S.js} +48 -48
- package/dist/{threeViewerHost-DvIwe0xo.js → threeViewerHost-BgQmCw2g.js} +15 -15
- package/dist/{threeViewerHost-Cazxmy9Q.cjs → threeViewerHost-DqCoBmb3.cjs} +1 -1
- package/dist/{urdfTree-CMKhj8xM.js → urdfTree-BmNTo-xk.js} +1 -1
- package/dist/{urdfTree-dHyqQi6d.cjs → urdfTree-CShYg3Vd.cjs} +1 -1
- package/dist/{workpieceTreePanel-4MfitYyo.cjs → workpieceTreePanel-BXdDwos2.cjs} +1 -1
- package/dist/{workpieceTreePanel-BM7lPJRO.js → workpieceTreePanel-GI4Y-wNL.js} +29 -29
- package/package.json +1 -1
- package/dist/index-C-Cn4YSI.js +0 -12234
- package/dist/index-qqyeENwY.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-wPtij0q7.cjs +0 -37
- package/dist/index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Ddv_4Qcm.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_140f5e74_lang-DmUFTzw3.js +0 -376
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-DqCoBmb3.cjs"),pe=require("./iconfont-DapI438c.cjs"),ve=require("./workpieceTreePanel-BXdDwos2.cjs"),D=require("./index-C8qRkCgn.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index.vue_vue_type_style_index_1_lang-BJyabOtw.cjs");require("./index-CLJYSvkY.cjs");require("./index-DeBHVrj0.cjs");const fe=require("./animationData-CU7hS77W.cjs"),ie=require("./urdfTree-CShYg3Vd.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Me=require("./index-CG6XNbRF.cjs"),R=require("./svgIcon-CUM54R6L.cjs"),G=.001,W=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Ee(g=.005,m=64){const d=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),s=new n.TubeGeometry(d,m,g,16,!1),p=ye;return new n.Mesh(s,p)}const xe=g=>g.reduce((m,d)=>{let s=0;const p=d.Y??0,b=d.C??0,r=d.R??0;return p>0&&(s+=p),b>0&&r>0&&(s+=r*W(b)),m+s},0),ke=g=>{const m=[],d=g.Y??0,s=g.B??0,p=g.C??0,b=g.R??0,r={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(!d&&!p)return m;if(m.push(r.pos.clone()),s!==0){const h=new n.Matrix4().makeRotationAxis(r.localY,W(s));r.localX.applyMatrix4(h),r.localZ.applyMatrix4(h)}if(d>0&&(r.pos.add(r.localY.clone().multiplyScalar(d*G)),m.push(r.pos.clone())),p>0&&b>0){const h=W(p),v=b*G,w=r.pos.clone().add(r.localX.clone().multiplyScalar(-v)),a=Math.max(16,Math.ceil(p/5));for(let y=1;y<=a;y++){const u=h*y/a,_=new n.Matrix4().makeRotationAxis(r.localZ,u),c=r.localX.clone().multiplyScalar(v).applyMatrix4(_),x=w.clone().add(c);m.push(x)}}return m};function Te(g,m){const d=new n.Group;d.name="CompletePipe";const s={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 p=0,b=1;for(let r=0;r<g.length;r++){const h=g[r],v=h.Y??0,w=h.B??0,a=h.C??0,y=h.R??0;if(w!==0){const u=new n.Matrix4().makeRotationAxis(s.localY,W(w));s.localX.applyMatrix4(u),s.localZ.applyMatrix4(u)}if(v>0){const u=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(v*G));const _=s.pos.clone(),i=Pe(u,_,m*G);i.userData={segmentType:"straight",segmentIndex:p,frameIndex:r,length:v,frame:{Y:v,B:w,C:a,R:y}},i.name=`直段_${p}`,d.add(i);const c=u.clone();Se(d,b,c,m*G),p++}if(a>0&&y>0){const u=W(a),_=y*G,i=[];i.push(s.pos.clone());const c=s.pos.clone().add(s.localX.clone().multiplyScalar(-_)),x=Math.max(16,Math.ceil(a/5));for(let f=1;f<=x;f++){const k=u*f/x,B=new n.Matrix4().makeRotationAxis(s.localZ,k),L=s.localX.clone().multiplyScalar(_).applyMatrix4(B),q=c.clone().add(L);i.push(q)}const E=De(i,m*G);E.userData={segmentType:"bend",segmentIndex:p,frameIndex:r,angle:a,radius:y,centerPoint:c.toArray(),frame:{Y:v,B:w,C:a,R:y}},E.name=`弯段_${p}`,d.add(E),Math.floor(i.length/2),i[0],s.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(s.localZ,u);s.localY.applyMatrix4(T),s.localX.applyMatrix4(T),p++,b++}}return d}function Se(g,m,d,s){const p=new n.Vector3(0,s*2,s*5),b=d.clone().add(p),r=[d,b],h=new n.BufferGeometry().setFromPoints(r),v=new n.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),w=new n.Line(h,v);w.computeLineDistances(),g.add(w);const a=document.createElement("canvas"),y=a.getContext("2d");a.width=128,a.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 n.CanvasTexture(a),_=new n.SpriteMaterial({map:u,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(_),c=s*3;i.scale.set(c,c,1),i.position.copy(b),i.name=`Label_${m}`,i.userData={labelNumber:m},g.add(i)}function Pe(g,m,d){const s=new n.LineCurve3(g,m),p=new n.TubeGeometry(s,2,d,18,!1);return new n.Mesh(p,ye)}function De(g,m){const d=new n.CatmullRomCurve3(g,!1,"catmullrom",.01),s=new n.TubeGeometry(d,Math.max(16,g.length*2),m,18,!1);return new n.Mesh(s,ye)}function _e(g,m,d,s,p,b=0){let r=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};r.push(i)}const v=xe(r),w=Math.max(0,d-v),a=[];a.push(new n.Vector3(0,0,0));const y=new n.Vector3(0,w*G,0);w>0&&a.push(y);let u={pos:y.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const _=[];for(let i=r.length-1;i>=0;i--){const c=r[i],x=ke(c);if(x.length>0){const E=x.map(B=>{const A=B.clone(),L=new n.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 n.Matrix4().makeRotationAxis(u.localY,W(f));u.localX.applyMatrix4(B),u.localZ.applyMatrix4(B)}if(k>0){const B=W(k),A=new n.Matrix4().makeRotationAxis(u.localZ,B);u.localY.applyMatrix4(A),u.localX.applyMatrix4(A)}}}for(const i of _)i.length>1&&a.push(...i.slice(1));a.length<2&&a.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(a,!1,"catmullrom",.01),c=new n.TubeGeometry(i,Math.max(2,a.length*4),s*G,18,!1);g.geometry.dispose(),g.geometry=c}catch(i){console.error("管件更新失败",i)}}function Ce(g,m,d,s=0){let p=g.slice(0,d+1);const b=g[d+1];if(b&&s>0){const u={...b,B:(b.B??0)*s,C:(b.C??0)*s};p.push(u)}const r=xe(p),h=Math.max(0,m-r),v=[];v.push(new n.Vector3(0,0,0));const w=new n.Vector3(0,h*G,0);h>0&&v.push(w);let a={pos:w.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const y=[];for(let u=p.length-1;u>=0;u--){const _=p[u],i=ke(_);if(i.length>0){const c=i.map(f=>{const k=f.clone(),B=new n.Matrix4;return B.makeBasis(a.localX,a.localY,a.localZ),k.applyMatrix4(B),k.add(a.pos)});y.push(c);const x=c[c.length-1];a.pos=x.clone();const E=_.B??0,T=_.C??0;if(E!==0){const f=new n.Matrix4().makeRotationAxis(a.localY,W(E));a.localX.applyMatrix4(f),a.localZ.applyMatrix4(f)}if(T>0){const f=W(T),k=new n.Matrix4().makeRotationAxis(a.localZ,f);a.localY.applyMatrix4(k),a.localX.applyMatrix4(k)}}}for(const u of y)u.length>1&&v.push(...u.slice(1));return v.length<2&&v.push(new n.Vector3(0,.001,0)),v}function Ne(g,m,d,s,p,b,r,h=0,v=0){const w=p-v,a=Ce(s,w,r,h);let u=Ce(d,v,r,h);u.forEach(i=>i.y=-i.y),u.reverse();const _=[...u,...a];try{const i=new n.CatmullRomCurve3(_,!1,"catmullrom",.01),c=new n.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 Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(g,{expose:m}){const d=g,s=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 fe.fetchSingleRobotAnimationData()),p.value===ne.robotMode.DOUBLE&&(o=await fe.fetchDoubleRobotAnimationData());const{initialPipeLength:t=0,pipeRadius:l=0,clampLength:V=0,animationData:C}=o;T.value=t,f.value=l,k.value=V,s.value=C;const $=D.cloneDeep(s.value),J=re(Y.value),X=($==null?void 0:$["输出(动画数据)"])||[];r.value=X.length?X:[J]},r=e.ref([]),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),a=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?ie.getNonFixedJoints(d.model).map(l=>l.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),ae=()=>r.value.map(o=>({Y:parseFloat(o.Y)||0,B:parseFloat(o.B)||0,C:parseFloat(o.C)||0,R:parseFloat(o.R)||0})),K=()=>{const o=[],t=[];return r.value.forEach(l=>{const{Y1:V,B1:C,C1:$,R1:J,Y2:X,B2:oe,C2:de,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(oe)||0,C:parseFloat(de)||0,R:parseFloat(P)||0})}),{posPipeYbcr:o,negPipeYbcr:t}},M=(o=0,t=0)=>{if(c.value&&x.value){const l=K();Ne(c.value,x.value,l.posPipeYbcr,l.negPipeYbcr,T.value,f.value,o,t,k.value)}else if(c.value){const l=ae();_e(c.value,l,T.value,f.value,o,t)}},N=o=>{if(o<0||o>=r.value.length){console.error(`帧索引 ${o} 超出范围`);return}const t=r.value[o];if(console.log(`应用第 ${o} 帧数据 ${t}`),a.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(r.value.length===0){D.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,r.value.length-1===a.value&&(a.value=0);try{for(let o=a.value+1;o<r.value.length&&!_;o++){a.value=o;const t=r.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)/r.value.length*100,M(o-1,V)}):(await new Promise(V=>setTimeout(V,u.value)),y.value=(o+1)/r.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=()=>{a.value=0},z=()=>{if(c.value&&x.value){const o=K();Ne(c.value,x.value,o.posPipeYbcr,o.negPipeYbcr,T.value,f.value,-1,0,k.value)}else if(c.value){const o=ae();_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)},Q=()=>{w.value&&F(),!(a.value+1>=r.value.length)&&N(a.value+1)},S=()=>{w.value&&F(),a.value!==0&&N(a.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},re=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=re(o);r.value=[l]}else r.value=[]},{immediate:!0});const ee=e.ref(0),ue=o=>{ee.value=o},he=(o,t)=>{if(!o||!t)return;const l=ie.getTargetJoint(o,t),V=Ee();V.visible=!1,l==null||l.add(V)},ge=o=>{i.value=new ve.URDFRobotController(o),B.value=ie.getAllLinkName(o),A.value="Pipe_Joint"},te=()=>{i.value=null,B.value=[],A.value=null},se=o=>{ge(o),he(o,A.value),ue(ee.value+1),Z()};e.watch(()=>d.model,o=>{if(H(),o){se(o);return}te()},{immediate:!0});const me=o=>{var l,V;const t=new n.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,ee],([o,t])=>{if(H(),d.model&&o){const l=ie.getMeshFromJoint(d.model,o);if(console.log(l,"meshToReplace"),l&&l.parent){E.value=l,l.visible=!1;const V=me(l);if(p.value===ne.robotMode.SINGLE&&(V.position.y-=t*.001),c.value=V,p.value===ne.robotMode.DOUBLE){const C=me(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(`
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as ve, ref as r, computed as S, watch as W, onUnmounted as Ae, resolveComponent as M, createElementBlock as R, openBlock as z, createElementVNode as n, createCommentVNode as D, createVNode as a, toDisplayString as B, Fragment as Ve, renderList as $e, withCtx as te, shallowRef as ee, onMounted as Te, nextTick as Fe, onBeforeUnmount as Oe, withDirectives as H, vShow as I, unref as U, renderSlot as se, createBlock as ie } from "vue";
|
|
2
|
-
import { s as re } from "./threeViewerHost-
|
|
3
|
-
import { u as Re, a as Se, b as De, C as Be } from "./iconfont-
|
|
4
|
-
import { U as Ee, u as Je, a as Ne, W as Me } from "./workpieceTreePanel-
|
|
5
|
-
import { c as Ge, E as h } from "./index-
|
|
6
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
2
|
+
import { s as re } from "./threeViewerHost-BgQmCw2g.js";
|
|
3
|
+
import { u as Re, a as Se, b as De, C as Be } from "./iconfont-Dh5vye0Q.js";
|
|
4
|
+
import { U as Ee, u as Je, a as Ne, W as Me } from "./workpieceTreePanel-GI4Y-wNL.js";
|
|
5
|
+
import { c as Ge, E as h } from "./index-BgE_6FYY.js";
|
|
6
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Jb-pxYCE.js";
|
|
7
7
|
import { _ as ue } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
8
|
-
import { g as He, b as Ie, U as We, J as Xe, d as Ye } from "./urdfTree-
|
|
8
|
+
import { g as He, b as Ie, U as We, J as Xe, d as Ye } from "./urdfTree-BmNTo-xk.js";
|
|
9
9
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
import { T as b } from "./svgIcon-D-_fXUBL.js";
|
|
11
|
-
import { i as Ze } from "./animationData-
|
|
12
|
-
import { O as qe } from "./MTLLoader-
|
|
11
|
+
import { i as Ze } from "./animationData-x63hYcF2.js";
|
|
12
|
+
import { O as qe } from "./MTLLoader-BDMG6YfL.js";
|
|
13
13
|
const Ke = { class: "panel-content" }, Qe = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "animation-controls"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),W=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),W=require("./threeViewerHost-DqCoBmb3.cjs"),I=require("./iconfont-DapI438c.cjs"),q=require("./workpieceTreePanel-BXdDwos2.cjs"),p=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs");const Y=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),A=require("./urdfTree-CShYg3Vd.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CUM54R6L.cjs"),ge=require("./animationData-CU7hS77W.cjs"),he=require("./MTLLoader-CnPy8SIM.cjs"),Ve={class:"panel-content"},be={key:0,class:"animation-controls"},ye={class:"control-row"},Ne={class:"control-row"},ke={class:"frame-info"},Ee={class:"control-row"},Ce={key:1,class:"empty-state"},we={class:"dialog-footer"},_e=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:h}){const k=P,a=e.ref([]),C=e.ref(!1),T=e.ref(""),d=e.ref("stopped"),f=e.ref(0),w=e.ref(0),V=e.ref(10),i=e.ref(null);let u=0;const b=e.ref([]),y=e.computed(()=>k.model?A.getNonFixedJoints(k.model).map(v=>v.name):[]),_=e.computed(()=>[...y.value]),J=e.computed(()=>_.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${_.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),U=e.computed(()=>a.value[f.value]||{});e.watch(()=>k.model,o=>{o?(i.value=new q.URDFRobotController(o),b.value=A.getAllLinkName(o),f.value=0):(i.value=null,b.value=[])},{immediate:!0});const z=o=>{if(o<0||o>=a.value.length){console.error(`帧索引 ${o} 超出范围`);return}const t=a.value[o];if(i.value){const v={};y.value.forEach(N=>{const r=parseFloat(t[N]);isNaN(r)||(v[N]=r)}),i.value.setJointAngles(v)}f.value=o,w.value=a.value.length>1?o/(a.value.length-1)*100:100},L=async o=>{try{for(let t=f.value;t<a.value.length;t++){if(o!==u)return;const v=a.value[t],N={};if(i.value)y.value.forEach(r=>{const m=parseFloat(v[r]);isNaN(m)||(N[r]=m)}),await i.value.animateToState(N,V.value,r=>{o===u&&(w.value=(t+r)/a.value.length*100)});else{if(await new Promise(r=>setTimeout(r,V.value)),o!==u)return;w.value=(t+1)/a.value.length*100}f.value=t}o===u&&(p.ElMessage.success("动画播放完成"),d.value="stopped",w.value=100)}catch(t){console.error("动画播放出错:",t),p.ElMessage.error("动画播放出错"),d.value="stopped"}},x=()=>{if(a.value.length===0){p.ElMessage.error("无动画数据");return}d.value==="stopped"&&(f.value=0,z(0)),d.value="playing",u++,L(u),p.ElMessage.info("动画播放中")},M=()=>{d.value==="playing"&&(u++,d.value="paused",p.ElMessage.info("动画已暂停"))},$=()=>{u++,d.value="stopped",f.value=0,w.value=0,z(0),p.ElMessage.info("动画已停止并重置")},R=()=>{d.value==="playing"?M():x()},B=o=>{u++,d.value="paused",z(o)},H=()=>{if(!T.value.trim()){p.ElMessage.warning("导入内容不能为空");return}const o=T.value.trim().split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),P=require("./iconfont-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),P=require("./iconfont-DapI438c.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs"),xe=require("./index-C8qRkCgn.cjs"),Z=require("./urdfTree-CShYg3Vd.cjs"),g=require("./svgIcon-CUM54R6L.cjs"),Se=require("./isString--eJE54G5.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),J=new c.Box3,O=new c.Vector3;class ie extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,o=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),o.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),J.setFromBufferAttribute(n),this.boundingBox.union(J))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let t=0;for(let r=0,l=e.count;r<l;r++)O.fromBufferAttribute(e,r),t=Math.max(t,o.distanceToSquared(O)),O.fromBufferAttribute(n,r),t=Math.max(t,o.distanceToSquared(O));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
|
|
2
2
|
#include <common>
|
|
3
3
|
#include <color_pars_vertex>
|
|
4
4
|
#include <fog_pars_vertex>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as He, ref as T, shallowRef as ue, computed as H, watch as Ne, onMounted as Ve, onBeforeUnmount as qe, resolveComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import {
|
|
4
|
-
import { E as ut } from "./index-
|
|
5
|
-
import { U as ft, J as pt } from "./urdfTree-
|
|
1
|
+
import { defineComponent as He, ref as T, shallowRef as ue, computed as H, watch as Ne, onMounted as Ve, onBeforeUnmount as qe, resolveComponent as Xe, createElementBlock as fe, openBlock as N, createElementVNode as g, withDirectives as J, createCommentVNode as Z, createVNode as h, unref as R, renderSlot as pe, toDisplayString as K, withCtx as me, createBlock as he, vShow as Q } from "vue";
|
|
2
|
+
import { u as $e, a as Ye, b as Je, C as Ze, f as Ke, d as Qe } from "./iconfont-Dh5vye0Q.js";
|
|
3
|
+
import { bK as et, aV as ie, bL as se, bC as O, bM as tt, X as oe, bJ as Se, W as U, bN as nt, bO as $, bP as ze, b7 as Ce, bQ as Y, a8 as it, bR as W, bS as st, ah as ot, ai as _e, aj as rt, aJ as at, aX as lt, aY as ct, bT as dt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Jb-pxYCE.js";
|
|
4
|
+
import { E as ut } from "./index-BgE_6FYY.js";
|
|
5
|
+
import { U as ft, J as pt } from "./urdfTree-BmNTo-xk.js";
|
|
6
6
|
import { T as v } from "./svgIcon-D-_fXUBL.js";
|
|
7
|
-
import { i as mt } from "./isString-
|
|
7
|
+
import { i as mt } from "./isString-Bb0EYAKj.js";
|
|
8
8
|
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const ve = new oe(), V = new U();
|
|
10
10
|
class Ee extends et {
|
|
@@ -120,7 +120,7 @@ Y.line = {
|
|
|
120
120
|
gapSize: { value: 1 }
|
|
121
121
|
// todo FIX - maybe change to totalSize
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
$.line = {
|
|
124
124
|
uniforms: ze.merge([
|
|
125
125
|
Y.common,
|
|
126
126
|
Y.fog,
|
|
@@ -517,9 +517,9 @@ class re extends nt {
|
|
|
517
517
|
constructor(e) {
|
|
518
518
|
super({
|
|
519
519
|
type: "LineMaterial",
|
|
520
|
-
uniforms: ze.clone(
|
|
521
|
-
vertexShader:
|
|
522
|
-
fragmentShader:
|
|
520
|
+
uniforms: ze.clone($.line.uniforms),
|
|
521
|
+
vertexShader: $.line.vertexShader,
|
|
522
|
+
fragmentShader: $.line.fragmentShader,
|
|
523
523
|
clipping: !0
|
|
524
524
|
// required for clipping support
|
|
525
525
|
}), this.isLineMaterial = !0, this.setValues(e);
|
|
@@ -659,7 +659,7 @@ class re extends nt {
|
|
|
659
659
|
this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
const ee = new
|
|
662
|
+
const ee = new W(), ge = new U(), ye = new U(), y = new W(), w = new W(), C = new W(), te = new U(), ne = new ot(), x = new st(), we = new U(), q = new oe(), X = new Se(), _ = new W();
|
|
663
663
|
let E, B;
|
|
664
664
|
function xe(s, e, n) {
|
|
665
665
|
return _.set(0, 0, -e, 1).applyMatrix4(s.projectionMatrix), _.multiplyScalar(1 / _.w), _.x = B / n.width, _.y = B / n.height, _.applyMatrix4(s.projectionMatrixInverse), _.multiplyScalar(1 / _.w), Math.abs(Math.max(_.x, _.y));
|
|
@@ -697,8 +697,8 @@ function gt(s, e, n) {
|
|
|
697
697
|
y.applyMatrix4(i), w.applyMatrix4(i), y.multiplyScalar(1 / y.w), w.multiplyScalar(1 / w.w), y.x *= o.x / 2, y.y *= o.y / 2, w.x *= o.x / 2, w.y *= o.y / 2, x.start.copy(y), x.start.z = 0, x.end.copy(w), x.end.z = 0;
|
|
698
698
|
const b = x.closestPointToPointParameter(te, !0);
|
|
699
699
|
x.at(b, we);
|
|
700
|
-
const S = _e.lerp(y.z, w.z, b), k = S >= -1 && S <= 1,
|
|
701
|
-
if (k &&
|
|
700
|
+
const S = _e.lerp(y.z, w.z, b), k = S >= -1 && S <= 1, j = te.distanceTo(we) < B * 0.5;
|
|
701
|
+
if (k && j) {
|
|
702
702
|
x.start.fromBufferAttribute(c, m), x.end.fromBufferAttribute(u, m), x.start.applyMatrix4(a), x.end.applyMatrix4(a);
|
|
703
703
|
const z = new U(), A = new U();
|
|
704
704
|
E.distanceSqToSegment(x.start, x.end, A, z), n.push({
|
|
@@ -750,15 +750,15 @@ class yt extends it {
|
|
|
750
750
|
const o = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
|
|
751
751
|
E = e.ray;
|
|
752
752
|
const a = this.matrixWorld, r = this.geometry, c = this.material;
|
|
753
|
-
B = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(),
|
|
753
|
+
B = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), X.copy(r.boundingSphere).applyMatrix4(a);
|
|
754
754
|
let u;
|
|
755
755
|
if (i)
|
|
756
756
|
u = B * 0.5;
|
|
757
757
|
else {
|
|
758
|
-
const p = Math.max(t.near,
|
|
758
|
+
const p = Math.max(t.near, X.distanceToPoint(E.origin));
|
|
759
759
|
u = xe(t, p, c.resolution);
|
|
760
760
|
}
|
|
761
|
-
if (
|
|
761
|
+
if (X.radius += u, E.intersectsSphere(X) === !1)
|
|
762
762
|
return;
|
|
763
763
|
r.boundingBox === null && r.computeBoundingBox(), q.copy(r.boundingBox).applyMatrix4(a);
|
|
764
764
|
let f;
|
|
@@ -956,8 +956,8 @@ function Tt(s, e) {
|
|
|
956
956
|
function Bt(s, e, n, i = 4, t = 50) {
|
|
957
957
|
let o = 1 / 0, a = -1 / 0, r = 1 / 0, c = -1 / 0, u = 1 / 0, f = -1 / 0;
|
|
958
958
|
for (let S = 0; S < s.length; S += 3) {
|
|
959
|
-
const k = s[S],
|
|
960
|
-
o = Math.min(o, k), a = Math.max(a, k), r = Math.min(r,
|
|
959
|
+
const k = s[S], j = s[S + 1], z = s[S + 2];
|
|
960
|
+
o = Math.min(o, k), a = Math.max(a, k), r = Math.min(r, j), c = Math.max(c, j), u = Math.min(u, z), f = Math.max(f, z);
|
|
961
961
|
}
|
|
962
962
|
const m = Math.sqrt((a - o) ** 2 + (c - r) ** 2 + (f - u) ** 2) * 0.05, M = _e.degToRad(e.fov), L = 2 * Math.tan(M / 2) * t, b = m / L * n.domElement.height * (i / 4);
|
|
963
963
|
return Math.max(1, b);
|
|
@@ -984,10 +984,10 @@ function Dt(s, e) {
|
|
|
984
984
|
const r = Bt(e, i, t, 0.5, 50);
|
|
985
985
|
return a.material.size = r, a;
|
|
986
986
|
}
|
|
987
|
-
const Ot = { class: "obj-viewer-container" },
|
|
987
|
+
const Ot = { class: "obj-viewer-container" }, jt = { class: "buttonGroup-topLeft" }, It = { class: "buttonGroup-left" }, Ft = { class: "buttonGroup-right" }, Rt = { class: "buttonGroup-bottom" }, Wt = { class: "left-panel" }, Gt = { class: "panel-header" }, Ht = { class: "panel-body" }, Nt = { class: "right-panel" }, Vt = { class: "panel-header" }, qt = { class: "panel-body" }, Xt = {
|
|
988
988
|
key: 0,
|
|
989
989
|
class: "loading-overlay"
|
|
990
|
-
},
|
|
990
|
+
}, $t = /* @__PURE__ */ He({
|
|
991
991
|
__name: "threeTrackPathView",
|
|
992
992
|
props: {
|
|
993
993
|
fileUrls: {},
|
|
@@ -1003,14 +1003,14 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1003
1003
|
getThreeJSObjects: b,
|
|
1004
1004
|
cleanup: S,
|
|
1005
1005
|
setModels: k,
|
|
1006
|
-
setAndFitModels:
|
|
1006
|
+
setAndFitModels: j,
|
|
1007
1007
|
axesHelperVisible: z,
|
|
1008
1008
|
toggleAxesVisibility: A
|
|
1009
|
-
} =
|
|
1009
|
+
} = $e(n), { isAnimating: ae, toggleAnimation: Ae, startAnimation: Yt, stopAnimation: Me } = Ye(b, p), { isClipping: Le, activeClippingAxis: le, toggleClipping: Pe, updateClippingPlanes: Te } = Je(b, p), Be = () => {
|
|
1010
1010
|
A();
|
|
1011
1011
|
}, ke = (d) => {
|
|
1012
1012
|
le.value = d, Te();
|
|
1013
|
-
},
|
|
1013
|
+
}, I = (d) => {
|
|
1014
1014
|
o.value = !0, a.value = d, d === "剖面视图" && !Le.value && Pe();
|
|
1015
1015
|
}, G = (d) => {
|
|
1016
1016
|
r.value = !0, c.value = d;
|
|
@@ -1020,10 +1020,10 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1020
1020
|
}), Oe = H(() => {
|
|
1021
1021
|
var l;
|
|
1022
1022
|
return (l = e.trackFileType) == null ? void 0 : l.isCyd;
|
|
1023
|
-
}),
|
|
1023
|
+
}), je = H(() => {
|
|
1024
1024
|
var l;
|
|
1025
1025
|
return (l = e.trackFileType) == null ? void 0 : l.isCpt;
|
|
1026
|
-
}),
|
|
1026
|
+
}), Ie = H(() => {
|
|
1027
1027
|
const d = e.fileUrls || [];
|
|
1028
1028
|
return d == null ? void 0 : d[0];
|
|
1029
1029
|
});
|
|
@@ -1036,19 +1036,19 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1036
1036
|
if (mt(l)) {
|
|
1037
1037
|
ce.value = await Pt(l, e.trackFileType) || [];
|
|
1038
1038
|
const F = ce.value;
|
|
1039
|
-
return De.value && (D = Tt(b, F)), (Oe.value ||
|
|
1039
|
+
return De.value && (D = Tt(b, F)), (Oe.value || je.value) && (D = Dt(b, F)), D;
|
|
1040
1040
|
}
|
|
1041
|
-
},
|
|
1041
|
+
}, Re = async (d) => {
|
|
1042
1042
|
const l = await Fe(d);
|
|
1043
1043
|
l && (k([l]), Ke(b, l));
|
|
1044
1044
|
};
|
|
1045
|
-
Ne(() =>
|
|
1046
|
-
d && (de(), await
|
|
1045
|
+
Ne(() => Ie.value, async (d) => {
|
|
1046
|
+
d && (de(), await Re(d));
|
|
1047
1047
|
}, {
|
|
1048
1048
|
immediate: !0,
|
|
1049
1049
|
deep: !0
|
|
1050
1050
|
});
|
|
1051
|
-
const
|
|
1051
|
+
const We = () => {
|
|
1052
1052
|
M(), window.addEventListener("resize", L);
|
|
1053
1053
|
const d = b();
|
|
1054
1054
|
f.value = d.scene, f.value && (f.value.name = "CPMPIP");
|
|
@@ -1057,14 +1057,14 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1057
1057
|
};
|
|
1058
1058
|
return Ve(async () => {
|
|
1059
1059
|
try {
|
|
1060
|
-
|
|
1060
|
+
We();
|
|
1061
1061
|
} catch (d) {
|
|
1062
1062
|
console.error("Three.js 初始化失败:", d), ut.error("渲染引擎初始化失败!");
|
|
1063
1063
|
}
|
|
1064
1064
|
}), qe(() => {
|
|
1065
1065
|
Ge();
|
|
1066
1066
|
}), (d, l) => {
|
|
1067
|
-
const F =
|
|
1067
|
+
const F = Xe("el-scrollbar");
|
|
1068
1068
|
return N(), fe("div", Ot, [
|
|
1069
1069
|
g("div", {
|
|
1070
1070
|
ref_key: "threejsContainer",
|
|
@@ -1072,11 +1072,11 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1072
1072
|
class: "threejs-container"
|
|
1073
1073
|
}, null, 512),
|
|
1074
1074
|
l[15] || (l[15] = g("div", { class: "buttonGroup-top" }, null, -1)),
|
|
1075
|
-
g("div",
|
|
1075
|
+
g("div", jt, [
|
|
1076
1076
|
h(v, {
|
|
1077
1077
|
name: "viewReset",
|
|
1078
1078
|
size: "24",
|
|
1079
|
-
onClick:
|
|
1079
|
+
onClick: R(m),
|
|
1080
1080
|
title: "重置"
|
|
1081
1081
|
}, null, 8, ["onClick"]),
|
|
1082
1082
|
h(v, {
|
|
@@ -1092,42 +1092,42 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1092
1092
|
h(v, {
|
|
1093
1093
|
name: "lookAround",
|
|
1094
1094
|
size: "24",
|
|
1095
|
-
onClick:
|
|
1096
|
-
title:
|
|
1095
|
+
onClick: R(Ae),
|
|
1096
|
+
title: R(ae) ? "停止动画" : "动画视图"
|
|
1097
1097
|
}, null, 8, ["onClick", "title"]),
|
|
1098
1098
|
h(v, {
|
|
1099
1099
|
name: "zuobiaoxi",
|
|
1100
1100
|
size: "24",
|
|
1101
|
-
active:
|
|
1101
|
+
active: R(z),
|
|
1102
1102
|
onClick: Be,
|
|
1103
1103
|
title: "显隐坐标轴"
|
|
1104
1104
|
}, null, 8, ["active"])
|
|
1105
1105
|
]),
|
|
1106
|
-
g("div",
|
|
1107
|
-
pe(d.$slots, "button-left", { switchRightPanel:
|
|
1106
|
+
g("div", It, [
|
|
1107
|
+
pe(d.$slots, "button-left", { switchRightPanel: I }, void 0, !0),
|
|
1108
1108
|
h(v, {
|
|
1109
1109
|
name: "jiegoushu",
|
|
1110
1110
|
size: "24",
|
|
1111
|
-
onClick: l[0] || (l[0] = (P) =>
|
|
1111
|
+
onClick: l[0] || (l[0] = (P) => I("场景树")),
|
|
1112
1112
|
active: o.value && a.value === "场景树",
|
|
1113
1113
|
title: "场景树"
|
|
1114
1114
|
}, null, 8, ["active"]),
|
|
1115
1115
|
h(v, {
|
|
1116
1116
|
name: "clipping",
|
|
1117
1117
|
size: "24",
|
|
1118
|
-
onClick: l[1] || (l[1] = (P) =>
|
|
1118
|
+
onClick: l[1] || (l[1] = (P) => I("剖面视图")),
|
|
1119
1119
|
active: o.value && a.value === "剖面视图",
|
|
1120
1120
|
title: "剖面视图"
|
|
1121
1121
|
}, null, 8, ["active"]),
|
|
1122
1122
|
h(v, {
|
|
1123
1123
|
name: "donghuafangzhen",
|
|
1124
1124
|
size: "24",
|
|
1125
|
-
onClick: l[2] || (l[2] = (P) =>
|
|
1125
|
+
onClick: l[2] || (l[2] = (P) => I("场景树3"))
|
|
1126
1126
|
}),
|
|
1127
1127
|
h(v, {
|
|
1128
1128
|
name: "donghuafangzhen",
|
|
1129
1129
|
size: "24",
|
|
1130
|
-
onClick: l[3] || (l[3] = (P) =>
|
|
1130
|
+
onClick: l[3] || (l[3] = (P) => I("场景4"))
|
|
1131
1131
|
})
|
|
1132
1132
|
]),
|
|
1133
1133
|
g("div", Ft, [
|
|
@@ -1162,7 +1162,7 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1162
1162
|
size: "24"
|
|
1163
1163
|
})
|
|
1164
1164
|
]),
|
|
1165
|
-
g("div",
|
|
1165
|
+
g("div", Rt, [
|
|
1166
1166
|
h(v, {
|
|
1167
1167
|
name: "kuaitui",
|
|
1168
1168
|
size: "24",
|
|
@@ -1204,7 +1204,7 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1204
1204
|
})
|
|
1205
1205
|
})
|
|
1206
1206
|
]),
|
|
1207
|
-
J(g("div",
|
|
1207
|
+
J(g("div", Wt, [
|
|
1208
1208
|
g("div", Gt, [
|
|
1209
1209
|
g("span", null, K(a.value), 1),
|
|
1210
1210
|
g("span", {
|
|
@@ -1221,7 +1221,7 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1221
1221
|
}, null, 8, ["model"])) : Z("", !0),
|
|
1222
1222
|
a.value === "剖面视图" ? (N(), he(Ze, {
|
|
1223
1223
|
key: 1,
|
|
1224
|
-
value:
|
|
1224
|
+
value: R(le),
|
|
1225
1225
|
onChange: ke
|
|
1226
1226
|
}, null, 8, ["value"])) : Z("", !0)
|
|
1227
1227
|
]),
|
|
@@ -1252,14 +1252,14 @@ const Ot = { class: "obj-viewer-container" }, It = { class: "buttonGroup-topLeft
|
|
|
1252
1252
|
], 512), [
|
|
1253
1253
|
[Q, r.value]
|
|
1254
1254
|
]),
|
|
1255
|
-
i.value ? (N(), fe("div",
|
|
1255
|
+
i.value ? (N(), fe("div", Xt, [
|
|
1256
1256
|
l[14] || (l[14] = g("div", { class: "loading-spinner" }, null, -1)),
|
|
1257
1257
|
g("p", null, K(t.value), 1)
|
|
1258
1258
|
])) : Z("", !0)
|
|
1259
1259
|
]);
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
|
-
}), on = /* @__PURE__ */ ht(
|
|
1262
|
+
}), on = /* @__PURE__ */ ht($t, [["__scopeId", "data-v-20775f32"]]);
|
|
1263
1263
|
export {
|
|
1264
1264
|
on as default
|
|
1265
1265
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as U, defineAsyncComponent as S, computed as I, ref as N, watch as H, createElementBlock as V, openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import { u as $ } from "./index-
|
|
4
|
-
import { b as j,
|
|
1
|
+
import { defineComponent as U, defineAsyncComponent as S, computed as I, ref as N, watch as H, createElementBlock as V, openBlock as T, createElementVNode as K, createBlock as F, createCommentVNode as B, renderSlot as l, unref as m, withCtx as d } from "vue";
|
|
2
|
+
import { bS as W, p as D, s as A } from "./index-BgE_6FYY.js";
|
|
3
|
+
import { u as $ } from "./index-D_qR3hDI.js";
|
|
4
|
+
import { b as j, aE as M, aF as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Jb-pxYCE.js";
|
|
5
5
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const se = {
|
|
7
7
|
SINGLE: "单机",
|
|
@@ -35,7 +35,7 @@ const se = {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
function Y() {
|
|
38
|
-
const E = $(
|
|
38
|
+
const E = $(D), { platform: O } = A(E), y = z(D), i = ["uv", "cyd"], p = ["urdf"], n = ["obj", "stl"], P = [...i, ...p, ...n], u = (e) => {
|
|
39
39
|
if (!g())
|
|
40
40
|
throw new Error("不是三维系统");
|
|
41
41
|
y.setData(e);
|
|
@@ -49,7 +49,7 @@ function Y() {
|
|
|
49
49
|
return !1;
|
|
50
50
|
const r = c(e);
|
|
51
51
|
return n == null ? void 0 : n.includes(r);
|
|
52
|
-
},
|
|
52
|
+
}, v = (e) => {
|
|
53
53
|
if (!e)
|
|
54
54
|
return !1;
|
|
55
55
|
const r = c(e);
|
|
@@ -82,7 +82,7 @@ function Y() {
|
|
|
82
82
|
isThreeSystem: g,
|
|
83
83
|
isUrdf: C,
|
|
84
84
|
isGeneralFile: _,
|
|
85
|
-
isTrackPathFile:
|
|
85
|
+
isTrackPathFile: v,
|
|
86
86
|
isThreeFile: h,
|
|
87
87
|
isUseBackdrop: k,
|
|
88
88
|
initTrackFileType: f,
|
|
@@ -111,7 +111,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
111
111
|
height: { default: "100%" }
|
|
112
112
|
},
|
|
113
113
|
setup(E) {
|
|
114
|
-
const O = S(() => import("./threeSceneView-
|
|
114
|
+
const O = S(() => import("./threeSceneView-CInjoNVf.js")), y = S(() => import("./threePreview-D5UPnEBN.js")), i = S(() => import("./threeTrackPathView-CVpyIv5S.js")), p = S(() => import("./threeSceneViewForCPMPIP-C8CXMOuk.js")), n = E, P = $(D), { platName: u } = A(P), { isUrdf: b, isTrackPathFile: g } = Y(), c = I(() => {
|
|
115
115
|
var t;
|
|
116
116
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
117
117
|
const { url: e } = s;
|
|
@@ -124,7 +124,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
124
124
|
}), _ = I(() => {
|
|
125
125
|
var t, s;
|
|
126
126
|
return (s = (t = n == null ? void 0 : n.threeData) == null ? void 0 : t.data) == null ? void 0 : s.trackFileType;
|
|
127
|
-
}),
|
|
127
|
+
}), v = I(() => {
|
|
128
128
|
if (n.componentType)
|
|
129
129
|
switch (n.componentType) {
|
|
130
130
|
case "robot":
|
|
@@ -163,11 +163,11 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
163
163
|
await k(s ?? []);
|
|
164
164
|
},
|
|
165
165
|
{ immediate: !0, deep: !0 }
|
|
166
|
-
), (t, s) => (
|
|
166
|
+
), (t, s) => (T(), V("div", q, [
|
|
167
167
|
K("div", J, [
|
|
168
168
|
l(t.$slots, "top-menu", {}, void 0, !0)
|
|
169
169
|
]),
|
|
170
|
-
|
|
170
|
+
v.value === m(o).ROBOT_SCENE ? (T(), F(m(O), {
|
|
171
171
|
key: 0,
|
|
172
172
|
"file-blobs": f.value,
|
|
173
173
|
threeData: n.threeData
|
|
@@ -179,7 +179,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
179
179
|
l(t.$slots, "management-page", {}, void 0, !0)
|
|
180
180
|
]),
|
|
181
181
|
_: 3
|
|
182
|
-
}, 8, ["file-blobs", "threeData"])) :
|
|
182
|
+
}, 8, ["file-blobs", "threeData"])) : v.value === m(o).TRACK_PATH ? (T(), F(m(i), {
|
|
183
183
|
key: 1,
|
|
184
184
|
fileUrls: c.value,
|
|
185
185
|
threeData: n.threeData,
|
|
@@ -192,7 +192,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
192
192
|
l(t.$slots, "management-page", {}, void 0, !0)
|
|
193
193
|
]),
|
|
194
194
|
_: 3
|
|
195
|
-
}, 8, ["fileUrls", "threeData", "trackFileType"])) :
|
|
195
|
+
}, 8, ["fileUrls", "threeData", "trackFileType"])) : v.value === m(o).CPMPIP_SCENE ? (T(), F(m(p), {
|
|
196
196
|
key: 2,
|
|
197
197
|
"file-blobs": f.value,
|
|
198
198
|
threeData: n.threeData
|
|
@@ -204,7 +204,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
204
204
|
l(t.$slots, "management-page", {}, void 0, !0)
|
|
205
205
|
]),
|
|
206
206
|
_: 3
|
|
207
|
-
}, 8, ["file-blobs", "threeData"])) :
|
|
207
|
+
}, 8, ["file-blobs", "threeData"])) : v.value === m(o).PREVIEW ? (T(), F(m(y), {
|
|
208
208
|
key: 3,
|
|
209
209
|
"file-blobs": f.value
|
|
210
210
|
}, {
|
|
@@ -216,7 +216,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
216
216
|
]),
|
|
217
217
|
_: 3
|
|
218
218
|
}, 8, ["file-blobs"])) : B("", !0),
|
|
219
|
-
C.value ? (
|
|
219
|
+
C.value ? (T(), V("div", Q, " 文件下载中,请稍候... ")) : B("", !0)
|
|
220
220
|
]));
|
|
221
221
|
}
|
|
222
222
|
}), Z = /* @__PURE__ */ G(X, [["__scopeId", "data-v-2562c7ef"]]), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h=require("./index-C8qRkCgn.cjs"),B=require("./index-DeBHVrj0.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./index-C8qRkCgn.cjs"),B=require("./index-DeBHVrj0.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={SINGLE:"单机",DOUBLE:"双机"},V={ROBOT:1,PIPECOMPARSION:2},a={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},I=h.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function O(){const v=B.useMenuState(h.pinia),{platform:g}=h.storeToRefs(v),P=I(h.pinia),c=["uv","cyd"],d=["urdf"],r=["obj","stl"],T=[...c,...d,...r],u=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),m=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},p=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},f=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1};const o=l(t),i=c==null?void 0:c.find(k=>k===o);return{isCpt:i==="cpt",isCyd:i==="cyd",isUv:i==="uv"}},_=t=>{if(!t)return!1;const o=l(t);return d==null?void 0:d.includes(o)},b=t=>C()&&m(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:u,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:p,isThreeFile:m,isUseBackdrop:b,initTrackFileType:f,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let i=0;i<t.length;i++){const w=t[i],k=n(w);o.push(k)}return o}}}const N={class:"three-platform mv-inline"},A={class:"top-menu"},M={key:4,class:"loading"},H=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-DVmaCW7K.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-BaI2wC-D.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-B3rKlzro.cjs"))),d=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-DohzLUui.cjs"))),r=v,T=B.useMenuState(h.pinia),{platName:u}=h.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=O(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),m=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),p=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return a.ROBOT_SCENE;case"track":return a.TRACK_PATH;case"cpmpip":return a.CPMPIP_SCENE;case"preview":return a.PREVIEW}return(u==null?void 0:u.value)===S.platNameConstants.CPMPIP&&y(m.value)?a.CPMPIP_SCENE:(u==null?void 0:u.value)===S.platNameConstants.ROBOT&&y(m.value)?a.ROBOT_SCENE:C(m.value)&&E.value?a.TRACK_PATH:a.PREVIEW}),f=e.ref([]),_=e.ref(!1);async function b(n){if(!n||!n.length){f.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));f.value=s}catch(s){console.error("文件下载时发生错误:",s),f.value=[]}finally{_.value=!1}}return e.watch(()=>r.files,async n=>{const s=n.map(t=>{const{url:o}=t;return o});await b(s??[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",A,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),p.value===e.unref(a).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,"file-blobs":f.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","threeData"])):p.value===e.unref(a).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileUrls:l.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileUrls","threeData","trackFileType"])):p.value===e.unref(a).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(d),{key:2,"file-blobs":f.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","threeData"])):p.value===e.unref(a).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,"file-blobs":f.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",M," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),D=F._export_sfc(H,[["__scopeId","data-v-2562c7ef"]]),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=D;exports.robotMode=R;exports.sceneType=V;exports.threeViewerHost=$;exports.useThreeState=I;exports.useThreeSystem=O;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as I, ref as F, watch as M, onMounted as C, onUnmounted as E, createElementBlock as m, openBlock as f, Fragment as P, renderList as T, createElementVNode as c, createCommentVNode as U, toDisplayString as h, computed as L, resolveComponent as S, createVNode as A } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { a8 as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Jb-pxYCE.js";
|
|
3
3
|
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const D = (i, a) => {
|
|
5
5
|
if (!a)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-pgm7LZ2p.cjs"),x=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),J=(o,a)=>{if(!a)return null;const i=o.joints[a];return i||null},V=(o,a)=>{if(!a)return null;const i=J(o,a);if(!i)return null;let u=null;return i.traverse(c=>{c instanceof k.Mesh&&!u&&(u=c)}),u},F=(o,a)=>{if(!a)return null;const i=o.links[a];return i||null},L=(o,a)=>{if(!a)return null;const i=F(o,a);if(!i)return null;let u=null;return i.traverse(c=>{c instanceof k.Mesh&&!u&&(u=c)}),u},E=o=>{const a=o.joints;return Object.values(a)},M=o=>E(o).filter(u=>u.jointType!=="fixed"),N=o=>{const a=o.links;return Object.keys(a)},w={class:"panel-content"},B={key:0,class:"joints-list"},b={class:"joint-info-row"},I={class:"joint-left"},S={class:"joint-name"},C={class:"joint-range"},D={class:"joint-type"},P={key:0,class:"joint-control-row"},T={class:"slider-container"},U=["min","max","value","onInput"],A={class:"value-display"},R={class:"joint-value"},q={class:"unit"},O={key:1,class:"empty-state"},K=n.defineComponent({__name:"urdfJointPanel",props:{model:{}},setup(o,{expose:a}){const i=o,u=n.ref([]),c=n.ref(null),f=(r,e=!1)=>r==="revolute"?e?Math.PI:-Math.PI:r==="prismatic"?e?1:-1:0,h=r=>{if(!r||!r.joints)return console.warn("URDF模型无效或不包含关节信息"),[];const e=[];return E(r).forEach(l=>{var d,p;if(l.jointType==="fixed")return;let t={lower:((d=l.limit)==null?void 0:d.lower)??f(l.jointType,!1),upper:((p=l.limit)==null?void 0:p.upper)??f(l.jointType,!0)};l.jointType==="continuous"&&(t={lower:-10*Math.PI,upper:10*Math.PI}),e.push({name:l.name,type:l.jointType||"unknown",limit:t,currentValue:l.angle||0,urdfJoint:l})}),e},m=(r,e)=>{var d;const s=u.value.find(p=>p.name===r);if(!s)return;const l=parseFloat(e),t=Math.max(s.limit.lower,Math.min(s.limit.upper,l));s.currentValue=t,(d=i.model)!=null&&d.setJointValue?i.model.setJointValue(r,t):s.urdfJoint.setJointValue(t)},_=()=>{u.value.forEach(r=>{(r.type==="revolute"||r.type==="continuous"||r.type==="prismatic")&&m(r.name,0)})},g=()=>{i.model&&u.value.forEach(r=>{r.urdfJoint.angle!==void 0&&r.currentValue!==r.urdfJoint.angle&&(r.currentValue=r.urdfJoint.angle)})},v=()=>{const r=()=>{g(),c.value=requestAnimationFrame(r)};r()},y=()=>{c.value&&(cancelAnimationFrame(c.value),c.value=null)};return n.watch(()=>i.model,r=>{r?u.value=h(r):u.value=[]},{immediate:!0}),n.onMounted(()=>{v()}),n.onUnmounted(()=>{y()}),a({resetAllJoints:_}),(r,e)=>(n.openBlock(),n.createElementBlock("div",w,[u.value.length>0?(n.openBlock(),n.createElementBlock("div",B,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,s=>(n.openBlock(),n.createElementBlock("div",{key:s.name,class:"joint-item"},[n.createElementVNode("div",b,[n.createElementVNode("div",I,[n.createElementVNode("span",S,n.toDisplayString(s.name),1),n.createElementVNode("span",C," ["+n.toDisplayString(s.limit.lower.toFixed(2))+", "+n.toDisplayString(s.limit.upper.toFixed(2))+"] ",1)]),n.createElementVNode("span",D,n.toDisplayString(s.type),1)]),s.type==="revolute"||s.type==="prismatic"||s.type==="continuous"?(n.openBlock(),n.createElementBlock("div",P,[n.createElementVNode("div",T,[n.createElementVNode("input",{type:"range",min:s.limit.lower,max:s.limit.upper,step:"0.001",value:s.currentValue,onInput:l=>m(s.name,l.target.value),class:"joint-slider"},null,40,U)]),n.createElementVNode("div",A,[n.createElementVNode("span",R,n.toDisplayString(s.currentValue?Number(s.currentValue).toFixed(3):"0.000"),1),n.createElementVNode("span",q,n.toDisplayString(s.type==="prismatic"?"m":"rad"),1)])])):n.createCommentVNode("",!0)]))),128))])):(n.openBlock(),n.createElementBlock("div",O,e[0]||(e[0]=[n.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}}),$=x._export_sfc(K,[["__scopeId","data-v-750b831d"]]),H={class:"panel-content"},z="id",G={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:o=>["breadth","firstLevel"].includes(o)}},emits:["nodeClick"],setup(o,{emit:a}){const i=o,u=a,c=n.ref([]),f={children:"children",label:"label"},h=e=>{u("nodeClick",e)},m=(e,s=0)=>{const l=[];return Array.isArray(e)&&(e==null?void 0:e.length)>0&&e.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const d={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:s+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:m(t==null?void 0:t.children,s+1),path:t==null?void 0:t.name};l.push(d)}}),l},_=e=>e?[{name:e==null?void 0:e.name,label:e==null?void 0:e.name,show:!0,level:1,isPenultimate:!1,type:e==null?void 0:e.type,id:e==null?void 0:e.id,limit:(e==null?void 0:e.limit)??"",children:m(e==null?void 0:e.children,1)||[],path:e==null?void 0:e.name}]:[],g=(e,s)=>{const l=[],t=[...e];for(;t.length>0&&l.length<s;){const d=t.shift();d.children&&d.children.length>0&&(l.push(d.id),t.push(...d.children))}return l},v=(e,s)=>{const l=[];return e.forEach(t=>{if(t.children&&t.children.length>0){l.push(t.id);const d=t.children.filter(p=>p.children&&p.children.length>0).slice(0,s).map(p=>p.id);l.push(...d)}}),l.slice(0,s+1)},y=n.computed(()=>!c.value||c.value.length===0?[]:i.expandStrategy==="firstLevel"?v(c.value,i.maxExpandCount):g(c.value,i.maxExpandCount)),r=n.computed(()=>[{name:"场景",label:"场景",show:!0,level:1,isPenultimate:!1,type:"场景",id:"场景",children:i!=null&&i.model?_(i.model):[],path:"场景"}]);return n.watch(r,e=>{c.value=JSON.parse(JSON.stringify(e))},{immediate:!0}),(e,s)=>{const l=n.resolveComponent("el-tree");return n.openBlock(),n.createElementBlock("div",H,[n.createVNode(l,{data:c.value,props:f,"default-expanded-keys":y.value,"node-key":z,onNodeClick:h},null,8,["data","default-expanded-keys"])])}}},Q=x._export_sfc(G,[["__scopeId","data-v-cfde50c3"]]);exports.JointPanel=$;exports.UrdfTree=Q;exports.getAllLinkName=N;exports.getMeshFromJoint=V;exports.getMeshFromLink=L;exports.getNonFixedJoints=M;exports.getTargetJoint=J;
|