ss-component-new 1.2.59 → 1.2.60
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-BlLfoBce.cjs → MTLLoader-Bd8gswVO.cjs} +1 -1
- package/dist/{MTLLoader-Bl6JMZD-.js → MTLLoader-gdzQR_Hk.js} +1 -1
- package/dist/{OrbitControls-BP4_rhtR.cjs → OrbitControls-BDr3JwU7.cjs} +1 -1
- package/dist/{OrbitControls-BbhnJ_4u.js → OrbitControls-DrQG0WwG.js} +1 -1
- package/dist/{animationData-CEkMmPAJ.js → animationData-BebPFu1o.js} +9 -9
- package/dist/{animationData-FLuoH13j.cjs → animationData-DZnytjR7.cjs} +1 -1
- package/dist/{array-BLzorBeE.cjs → array-CsVIMexm.cjs} +1 -1
- package/dist/{array-BkvrJ2GR.js → array-mkPvdkqz.js} +1 -1
- package/dist/{iconfont-ji7A-_XJ.cjs → iconfont-B2jKfn1c.cjs} +1 -1
- package/dist/{iconfont-Dp3iGl32.js → iconfont-sA0TqvpZ.js} +2 -2
- package/dist/{index-DXGiAs1G.cjs → index-3F5KjCbv.cjs} +1 -1
- package/dist/{index-CWG2zhJZ.cjs → index-4M7aervZ.cjs} +1 -1
- package/dist/{index-BiwVpb9o.cjs → index-6A1xf0Gs.cjs} +1 -1
- package/dist/{index-qDBAJZN2.cjs → index-B-zqezDR.cjs} +1 -1
- package/dist/{index-LVKvj2hU.cjs → index-BDOF1BPC.cjs} +1 -1
- package/dist/{index-NUzOUiu0.js → index-BIOzO44u.js} +1 -1
- package/dist/{index-rPWz6KHn.js → index-BLXYg9Gs.js} +4 -4
- package/dist/{index-bcbWOGXs.js → index-BawiQHQM.js} +4 -4
- package/dist/{index-BNES2eKm.js → index-BcGarjC7.js} +1 -1
- package/dist/{index-FUWILZwY.js → index-BdoWr55z.js} +2 -2
- package/dist/{index-CDW8XzWT.cjs → index-BkJkmkcq.cjs} +1 -1
- package/dist/{index-DIpWkFjh.cjs → index-BoVvgAUF.cjs} +1 -1
- package/dist/{index-YoJfAd5X.js → index-BqPYebkC.js} +1 -1
- package/dist/{index-DlClEW8i.js → index-CBHRkOa4.js} +1 -1
- package/dist/{index-DLU6Qv3w.cjs → index-CF9id9ro.cjs} +13 -13
- package/dist/{index-BiUFu7a_.js → index-CK_bms-m.js} +240 -242
- package/dist/{index-gcSJbApQ.cjs → index-CRvxI1hr.cjs} +1 -1
- package/dist/{index-B2xsH_Wl.cjs → index-CaubJFHG.cjs} +1 -1
- package/dist/index-Ch_Cm24f.cjs +1 -0
- package/dist/{index-CHzlphv9.cjs → index-Ck3lmJpc.cjs} +1 -1
- package/dist/{index-BFHCLxvz.js → index-ClCw6ykP.js} +1 -1
- package/dist/{index-BEfSpHE6.js → index-DA4aTMB5.js} +1 -1
- package/dist/{index-ChyicQIl.js → index-DG0upY6_.js} +1 -1
- package/dist/{index-u-f2S6H4.cjs → index-DI5DRRI8.cjs} +1 -1
- package/dist/{index-DuamAhUi.cjs → index-DLiM284R.cjs} +1 -1
- package/dist/{index-BYIlecoJ.cjs → index-DNnfnoYc.cjs} +1 -1
- package/dist/{index-95KyZ7PB.js → index-DVNrIedZ.js} +1 -1
- package/dist/{index-DvgAOa6m.js → index-DXiQ5JKb.js} +1149 -1127
- package/dist/{index-B1U77nyf.cjs → index-DZ3LdxA8.cjs} +1 -1
- package/dist/{index-CxMIdKAy.cjs → index-D_FAvCkR.cjs} +1 -1
- package/dist/{index-JXXdn01K.cjs → index-DgW_swZz.cjs} +1 -1
- package/dist/{index-BxEjroD6.cjs → index-DjQZE_pv.cjs} +1 -1
- package/dist/{index-BTwRUubF.js → index-DmLuog-V.js} +3 -3
- package/dist/{index-BooTgcW2.js → index-Do_4Y2BA.js} +923 -934
- package/dist/{index-DN40xEbb.js → index-Dq9ppmM1.js} +3 -3
- package/dist/{index-DZQjq0ZR.js → index-DuXxVHLY.js} +1 -1
- package/dist/{index-OLQpbvuS.js → index-Duh5yc_7.js} +8 -8
- package/dist/{index-DNs7ujiq.js → index-DunWx7gk.js} +2 -2
- package/dist/{index--qwZeW47.js → index-GbPoL1UR.js} +1 -1
- package/dist/{index-DkNldOC0.cjs → index-MHgc1J83.cjs} +1 -1
- package/dist/{index-BgwYXT31.cjs → index-RhIBaFyU.cjs} +1 -1
- package/dist/{index-DZbNXTrw.js → index-YhC-PbE3.js} +1 -1
- package/dist/{index-lP-_9Gsb.cjs → index-aTpWvup6.cjs} +1 -1
- package/dist/{index-C8IFPtAJ.js → index-ajVsMnUs.js} +7 -7
- package/dist/{index-BN4opOSk.cjs → index-fv_bHYEK.cjs} +1 -1
- package/dist/{index-DAJoy_Z5.js → index-vPR31-Zk.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Bff2sYnQ.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DF-onWE-.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D6uh0ooh.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DVp62_ZP.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BZPnZF-N.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BL1cikD3.js} +1071 -1076
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-fAuSnfOH.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CHavLvPk.cjs} +32 -32
- package/dist/{index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-Dt5lXvbN.js → index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-B60JZATD.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-DlyCfLDJ.cjs → index.vue_vue_type_style_index_0_scoped_b00cbae2_lang-zIOhigw2.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DDYxgdQk.cjs → index.vue_vue_type_style_index_1_lang-B5nfyDvl.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-BUhvhTqt.js → index.vue_vue_type_style_index_1_lang-CChX6Zmx.js} +3 -3
- package/dist/{main-ChUyYPuq.js → main-CIXVap1M.js} +3 -3
- package/dist/{main-D-bdppOV.cjs → main-e1Q2-l7w.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-CDFo3As-.cjs → threeModel-UBx8eTMe.cjs} +1 -1
- package/dist/{threeModel-DcuAlWjb.js → threeModel-cKQrxO3d.js} +4 -4
- package/dist/{threePreview-q4R-oAs6.cjs → threePreview-BAJ00HhJ.cjs} +1 -1
- package/dist/{threePreview-DhMkG1np.js → threePreview-D35fdkMP.js} +3 -3
- package/dist/{threeSceneView-Dav7AGkH.js → threeSceneView-BZenUkiZ.js} +9 -9
- package/dist/{threeSceneView-CAsVH82L.cjs → threeSceneView-OEime_CV.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-9__8NGa5.cjs → threeSceneViewForCPMPIP-C044dPvs.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-DxFYivgN.js → threeSceneViewForCPMPIP-zeiEQd6_.js} +9 -9
- package/dist/{threeTrackPathView-DXCMl3aZ.js → threeTrackPathView-CHosxM5O.js} +4 -4
- package/dist/{threeTrackPathView-B7yrSLKq.cjs → threeTrackPathView-DdZ_W87m.cjs} +1 -1
- package/dist/{threeViewerHost-D70yS3z2.cjs → threeViewerHost-Ba-SeQ6m.cjs} +36 -36
- package/dist/{threeViewerHost-BNnzz6WM.js → threeViewerHost-Co0U6v_d.js} +2126 -2090
- package/dist/{urdfTree-3Jd59vvU.js → urdfTree-CtpNr38F.js} +1 -1
- package/dist/{urdfTree-CPEMi7wo.cjs → urdfTree-DkWqLWnt.cjs} +1 -1
- package/dist/{workpieceTreePanel-KdP9UaVe.cjs → workpieceTreePanel-BPsnvq9b.cjs} +1 -1
- package/dist/{workpieceTreePanel-CCbVIIlm.js → workpieceTreePanel-DimwJSXC.js} +5 -5
- package/package.json +1 -1
- package/dist/index-C9C84gkB.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent as Be, ref as g, watch as ae, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as B, createElementBlock as Ve, openBlock as q, createElementVNode as r, createVNode as l, withCtx as R, createBlock as ye, createCommentVNode as ke, unref as X, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as He, renderList as Ke, nextTick as Qe, withDirectives as pe, vShow as de, renderSlot as Me } from "vue";
|
|
2
|
-
import { r as Te, s as Ye } from "./threeViewerHost-
|
|
3
|
-
import { u as Je, a as qe, b as et, C as tt } from "./iconfont-
|
|
4
|
-
import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-
|
|
2
|
+
import { r as Te, s as Ye } from "./threeViewerHost-Co0U6v_d.js";
|
|
3
|
+
import { u as Je, a as qe, b as et, C as tt } from "./iconfont-sA0TqvpZ.js";
|
|
4
|
+
import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-DimwJSXC.js";
|
|
5
5
|
import { ag as st, c as it, E, aW as rt, aw as ut } from "./index-DsSA-OiE.js";
|
|
6
|
-
import { R as De, T as xe, V, O as H, Q as ct, U as pt, z as Se, Y as dt, Z as mt, _ as vt, $ as ft, a0 as gt, a1 as ht, a2 as bt, a3 as yt, K as _t } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
6
|
+
import { R as De, T as xe, V, O as H, Q as ct, U as pt, z as Se, Y as dt, Z as mt, _ as vt, $ as ft, a0 as gt, a1 as ht, a2 as bt, a3 as yt, K as _t } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BL1cikD3.js";
|
|
7
7
|
import "./index-BHtNKL1L.js";
|
|
8
|
-
import { _ as me, s as wt } from "./index-
|
|
9
|
-
import "./index.vue_vue_type_style_index_1_lang-
|
|
8
|
+
import { _ as me, s as wt } from "./index-CBHRkOa4.js";
|
|
9
|
+
import "./index.vue_vue_type_style_index_1_lang-CChX6Zmx.js";
|
|
10
10
|
import "./index-BIHEqwHC.js";
|
|
11
11
|
import "./index-Ce_gZ72y.js";
|
|
12
|
-
import { a as Ct, b as kt, d as Pt, e as Le, h as xt } from "./animationData-
|
|
13
|
-
import { g as Rt, a as Mt, b as Tt, c as Vt, U as Dt, J as St } from "./urdfTree-
|
|
12
|
+
import { a as Ct, b as kt, d as Pt, e as Le, h as xt } from "./animationData-BebPFu1o.js";
|
|
13
|
+
import { g as Rt, a as Mt, b as Tt, c as Vt, U as Dt, J as St } from "./urdfTree-CtpNr38F.js";
|
|
14
14
|
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
|
-
import { g as At, a as $t } from "./index-
|
|
15
|
+
import { g as At, a as $t } from "./index-DA4aTMB5.js";
|
|
16
16
|
import { g as Ft } from "./index-C14Eek69.js";
|
|
17
17
|
import { T as z } from "./svgIcon-D-_fXUBL.js";
|
|
18
18
|
const I = 1e-3, oe = ct.degToRad, Ee = new dt({
|
|
@@ -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-Ba-SeQ6m.cjs"),me=require("./iconfont-B2jKfn1c.cjs"),fe=require("./workpieceTreePanel-BPsnvq9b.cjs"),D=require("./index-C8qRkCgn.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CHavLvPk.cjs");require("./index-BpPyaNFa.cjs");const K=require("./index-CaubJFHG.cjs");require("./index.vue_vue_type_style_index_1_lang-B5nfyDvl.cjs");require("./index-CF3dfQ01.cjs");require("./index-CX2C-kjD.cjs");const ae=require("./animationData-DZnytjR7.cjs"),ce=require("./urdfTree-DkWqLWnt.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=require("./index-B-zqezDR.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
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
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(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Te=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Te=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CHavLvPk.cjs"),te=require("./threeViewerHost-Ba-SeQ6m.cjs"),H=require("./iconfont-B2jKfn1c.cjs"),G=require("./workpieceTreePanel-BPsnvq9b.cjs"),p=require("./index-C8qRkCgn.cjs"),ne=require("./index-CaubJFHG.cjs"),R=require("./urdfTree-DkWqLWnt.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),b=require("./svgIcon-CUM54R6L.cjs"),xe=require("./animationData-DZnytjR7.cjs"),De=require("./MTLLoader-Bd8gswVO.cjs"),le=require("./index-aTpWvup6.cjs"),Be={class:"panel-content"},ze={key:0,class:"animation-controls"},Le={class:"control-row"},Me={class:"control-row"},je={class:"frame-info"},$e={class:"control-row"},Ae={key:1,class:"empty-state"},Ue={class:"dialog-footer"},Re=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(x,{expose:s}){const y=x,i=e.ref([]),C=e.ref(!1),V=e.ref(""),d=e.ref("stopped"),f=e.ref(0),D=e.ref(0),B=e.ref(10),_=e.ref(null);let v=0;const z=e.ref([]),L=e.computed(()=>y.model?R.getNonFixedJoints(y.model).map(r=>r.name):[]),S=e.computed(()=>[...L.value]),F=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${S.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),M=e.computed(()=>i.value[f.value]||{});e.watch(()=>y.model,o=>{o?(_.value=new G.URDFRobotController(o),z.value=R.getAllLinkName(o),f.value=0):(_.value=null,z.value=[])},{immediate:!0});const E=o=>{if(o<0||o>=i.value.length){console.error(`帧索引 ${o} 超出范围`);return}const l=i.value[o];if(_.value){const r={};L.value.forEach(h=>{const c=parseFloat(l[h]);isNaN(c)||(r[h]=c)}),_.value.setJointAngles(r)}f.value=o,D.value=i.value.length>1?o/(i.value.length-1)*100:100},k=async o=>{try{for(let l=f.value;l<i.value.length;l++){if(o!==v)return;const r=i.value[l],h={};if(_.value)L.value.forEach(c=>{const m=parseFloat(r[c]);isNaN(m)||(h[c]=m)}),await _.value.animateToState(h,B.value,c=>{o===v&&(D.value=(l+c)/i.value.length*100)});else{if(await new Promise(c=>setTimeout(c,B.value)),o!==v)return;D.value=(l+1)/i.value.length*100}f.value=l}o===v&&(p.ElMessage.success("动画播放完成"),d.value="stopped",D.value=100)}catch(l){console.error("动画播放出错:",l),p.ElMessage.error("动画播放出错"),d.value="stopped"}},T=()=>{if(i.value.length===0){p.ElMessage.error("无动画数据");return}d.value==="stopped"&&(f.value=0,E(0)),d.value="playing",v++,k(v),p.ElMessage.info("动画播放中")},w=()=>{d.value==="playing"&&(v++,d.value="paused",p.ElMessage.info("动画已暂停"))},j=()=>{v++,d.value="stopped",f.value=0,D.value=0,E(0),p.ElMessage.info("动画已停止并重置")},I=()=>{d.value==="playing"?w():T()},P=o=>{v++,d.value="paused",E(o)},$=()=>{if(!V.value.trim()){p.ElMessage.warning("导入内容不能为空");return}const o=V.value.trim().split(`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as be, ref as r, computed as L, watch as I, onUnmounted as Je, resolveComponent as G, createElementBlock as R, openBlock as T, createElementVNode as a, createCommentVNode as S, createVNode as s, toDisplayString as D, Fragment as Ie, renderList as Ge, withCtx as q, inject as me, shallowRef as ne, onMounted as He, nextTick as Ke, onBeforeUnmount as Xe, withDirectives as E, vShow as J, unref as A, renderSlot as oe, createBlock as re } from "vue";
|
|
2
|
-
import { b1 as We } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
3
|
-
import { s as fe } from "./threeViewerHost-
|
|
4
|
-
import { u as Ye, a as Ze, b as qe, C as Qe } from "./iconfont-
|
|
5
|
-
import { U as et, u as tt, a as lt, W as at } from "./workpieceTreePanel-
|
|
2
|
+
import { b1 as We } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BL1cikD3.js";
|
|
3
|
+
import { s as fe } from "./threeViewerHost-Co0U6v_d.js";
|
|
4
|
+
import { u as Ye, a as Ze, b as qe, C as Qe } from "./iconfont-sA0TqvpZ.js";
|
|
5
|
+
import { U as et, u as tt, a as lt, W as at } from "./workpieceTreePanel-DimwJSXC.js";
|
|
6
6
|
import { c as nt, E as k } from "./index-DsSA-OiE.js";
|
|
7
|
-
import { _ as he } from "./index-
|
|
8
|
-
import { g as ot, b as st, U as it, J as rt, d as ut } from "./urdfTree-
|
|
7
|
+
import { _ as he } from "./index-CBHRkOa4.js";
|
|
8
|
+
import { g as ot, b as st, U as it, J as rt, d as ut } from "./urdfTree-CtpNr38F.js";
|
|
9
9
|
import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
import { T as y } from "./svgIcon-D-_fXUBL.js";
|
|
11
|
-
import { i as ct } from "./animationData-
|
|
12
|
-
import { O as dt } from "./MTLLoader-
|
|
13
|
-
import { L as vt, j as pt } from "./index-
|
|
11
|
+
import { i as ct } from "./animationData-BebPFu1o.js";
|
|
12
|
+
import { O as dt } from "./MTLLoader-gdzQR_Hk.js";
|
|
13
|
+
import { L as vt, j as pt } from "./index-ajVsMnUs.js";
|
|
14
14
|
const mt = { class: "panel-content" }, ft = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "animation-controls"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as Ve, ref as T, shallowRef as ue, computed as V, watch as He, onMounted as Ne, onBeforeUnmount as qe, resolveComponent as $e, createElementBlock as fe, openBlock as H, createElementVNode as g, withDirectives as Z, createCommentVNode as J, 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 Xe, a as Ye, b as Ze, C as Je, f as Ke, d as Qe } from "./iconfont-
|
|
3
|
-
import { aT as et, aU as ie, aV as se, aK as O, aW as tt, B as oe, aS as Se, V as U, aX as nt, aY as X, aZ as ze, ab as Ce, a_ as Y, z as it, a$ as W, b0 as st, O as ot, Q as _e, R as at, _ as rt, av as lt, aD as ct } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import { c as dt } from "./threeViewerHost-
|
|
2
|
+
import { u as Xe, a as Ye, b as Ze, C as Je, f as Ke, d as Qe } from "./iconfont-sA0TqvpZ.js";
|
|
3
|
+
import { aT as et, aU as ie, aV as se, aK as O, aW as tt, B as oe, aS as Se, V as U, aX as nt, aY as X, aZ as ze, ab as Ce, a_ as Y, z as it, a$ as W, b0 as st, O as ot, Q as _e, R as at, _ as rt, av as lt, aD as ct } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BL1cikD3.js";
|
|
4
|
+
import { c as dt } from "./threeViewerHost-Co0U6v_d.js";
|
|
5
5
|
import { E as ut } from "./index-DsSA-OiE.js";
|
|
6
|
-
import { U as ft, J as pt } from "./urdfTree-
|
|
6
|
+
import { U as ft, J as pt } from "./urdfTree-CtpNr38F.js";
|
|
7
7
|
import { T as v } from "./svgIcon-D-_fXUBL.js";
|
|
8
8
|
import { i as mt } from "./isString-RZ1z_1Z2.js";
|
|
9
9
|
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -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-B2jKfn1c.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CHavLvPk.cjs"),xe=require("./threeViewerHost-Ba-SeQ6m.cjs"),Se=require("./index-C8qRkCgn.cjs"),Z=require("./urdfTree-DkWqLWnt.cjs"),g=require("./svgIcon-CUM54R6L.cjs"),be=require("./isString--eJE54G5.cjs"),ze=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>
|