ss-component-new 1.3.49 → 1.3.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/{MTLLoader-D-urUdrf.cjs → MTLLoader-CEOtxyh2.cjs} +1 -1
  2. package/dist/{MTLLoader-EdMOXCr9.js → MTLLoader-GkOcupU3.js} +40 -40
  3. package/dist/{OrbitControls-Bqm95jie.js → OrbitControls-BFsEQ8wY.js} +1 -1
  4. package/dist/{OrbitControls-CsZhoVbh.cjs → OrbitControls-Cg-eGwSp.cjs} +1 -1
  5. package/dist/{URDFLoader-Dv2_yu9H.cjs → URDFLoader-VqEU-Bt0.cjs} +1 -1
  6. package/dist/{URDFLoader-Dj_qDDyi.js → URDFLoader-ehXmhBFT.js} +200 -200
  7. package/dist/{animationData-B3clqdCz.js → animationData-5o0D2SPA.js} +18 -18
  8. package/dist/{animationData-j8q9GL9s.cjs → animationData-h3_OEBhG.cjs} +1 -1
  9. package/dist/{array-DBmb_dbA.cjs → array-DN-yv0nl.cjs} +1 -1
  10. package/dist/{array-CuxW2kDp.js → array-_E6SKuKJ.js} +4 -4
  11. package/dist/{iconfont-CNymCHn6.cjs → iconfont-D0Cr9kuj.cjs} +1 -1
  12. package/dist/{iconfont-CvYchHEP.js → iconfont-DCFi7bPb.js} +46 -46
  13. package/dist/{index-CNydDYrN.cjs → index-B-1umMBk.cjs} +1 -1
  14. package/dist/{index-DQQGHkNg.cjs → index-B1U12Kov.cjs} +1 -1
  15. package/dist/{index-CISOplCk.js → index-B2iB_sIJ.js} +7 -8
  16. package/dist/{index-C2uQtrJb.js → index-B6jDYtpC.js} +8 -8
  17. package/dist/{index-BU_tmMwb.js → index-B7QR-Lou.js} +2 -2
  18. package/dist/index-BEQHIheQ.cjs +1 -0
  19. package/dist/{index-BeljvnZD.cjs → index-BFKHCjkd.cjs} +1 -1
  20. package/dist/{index-DAMlyIHp.js → index-BFMsMcD8.js} +4936 -5119
  21. package/dist/{index-C--Cb4yz.cjs → index-BJWrNIga.cjs} +1 -1
  22. package/dist/index-BJac5xKn.cjs +1 -0
  23. package/dist/{index-DOMPCPNk.js → index-BQSHrnLz.js} +3 -3
  24. package/dist/{index-Dqqp33r1.cjs → index-BZST7lPo.cjs} +11 -11
  25. package/dist/{index-COudEqtW.js → index-B_4AbtRg.js} +7 -7
  26. package/dist/{index-DVccu9rG.js → index-BdgLWDfL.js} +2111 -2353
  27. package/dist/{index-XroQ9gxP.js → index-BfEF_JC6.js} +7 -7
  28. package/dist/{index-CS4i2VJg.js → index-BgDSEEhr.js} +7 -7
  29. package/dist/{index-BRRItZG6.js → index-BnlicLlu.js} +2 -2
  30. package/dist/{index-N47WYmXL.cjs → index-C0KanvaS.cjs} +1 -1
  31. package/dist/{index-DvkpICHb.js → index-C1QaJ_Nu.js} +3 -3
  32. package/dist/{index-BvlEnbTN.js → index-CFn5-3eu.js} +2 -2
  33. package/dist/index-CGchY9n4.cjs +1 -0
  34. package/dist/{index-DQdNqcDC.js → index-CJIRsR3f.js} +2 -2
  35. package/dist/{index-CwhxnRyA.js → index-CX12hzsx.js} +1545 -1510
  36. package/dist/{index-D7dH9fVy.js → index-ClKAqw9M.js} +8 -8
  37. package/dist/{index-Dnry90NJ.js → index-CnKvPKWE.js} +3 -3
  38. package/dist/{index-CW3QZYd0.cjs → index-Cw_ZOIg_.cjs} +1 -1
  39. package/dist/{index-CaQxsLai.js → index-CwiUgaGI.js} +5 -5
  40. package/dist/index-D3MoBe24.cjs +15 -0
  41. package/dist/index-D6D9SCPa.cjs +1 -0
  42. package/dist/{index-DfcsvIY5.cjs → index-DB8oLdoK.cjs} +1 -1
  43. package/dist/{index-B94M9CMw.cjs → index-DLPQoVA6.cjs} +1 -1
  44. package/dist/{index-D3_jq7cX.cjs → index-DQJPWEqk.cjs} +1 -1
  45. package/dist/{index-9nY56-QR.cjs → index-DYQ5ZvYh.cjs} +1 -1
  46. package/dist/{index-CVLV7-M9.js → index-DYSziVz4.js} +9 -9
  47. package/dist/{index-BKrkAcBB.cjs → index-DcLb0XZD.cjs} +1 -1
  48. package/dist/{index-C9K9NG79.cjs → index-Dg5D5xCR.cjs} +1 -1
  49. package/dist/{index-DO_oafZe.js → index-Dg8irIqw.js} +5 -5
  50. package/dist/{index-DECdW2FW.js → index-DgVgB13t.js} +1 -1
  51. package/dist/{index-7G6RnWL-.js → index-DnkflWQf.js} +1 -1
  52. package/dist/{index-DLsU_7sc.js → index-DrFxQ8Ki.js} +2 -2
  53. package/dist/{index-D1TGlpbP.cjs → index-DwaW_eAE.cjs} +1 -1
  54. package/dist/{index-CGAzwavt.js → index-DzkWy2PD.js} +638 -639
  55. package/dist/{index-osT7gQ0k.cjs → index-F3XHv6p-.cjs} +1 -1
  56. package/dist/{index-DaObODQd.cjs → index-FrwJsit5.cjs} +1 -1
  57. package/dist/{index-CebyFRzl.cjs → index-KJ5I6heb.cjs} +1 -1
  58. package/dist/{index-CVhEAMxc.cjs → index-WSa1Enje.cjs} +1 -1
  59. package/dist/{index-C4Y_0Pqx.js → index-Wkp3bFzx.js} +1 -1
  60. package/dist/{index-MtuCSFch.js → index-XyzV8czh.js} +3 -3
  61. package/dist/{index-BBpfH3U5.cjs → index-aliiazw8.cjs} +1 -1
  62. package/dist/{index-B_ab3YNj.js → index-hkchRNAV.js} +10 -11
  63. package/dist/{index-CZ_1yrbo.cjs → index-tADecIkG.cjs} +1 -1
  64. package/dist/{index-DhdGSuCy.cjs → index-z2md-yku.cjs} +1 -1
  65. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dim6PXfX.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DCz-I5jm.js} +27358 -26694
  66. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BimFR8f6.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DD10WrJ2.cjs} +392 -382
  67. package/dist/{index.vue_vue_type_style_index_1_lang-DlkNXxzZ.cjs → index.vue_vue_type_style_index_1_lang-CdWzb_V-.cjs} +1 -1
  68. package/dist/{index.vue_vue_type_style_index_1_lang-RJi0lv4v.js → index.vue_vue_type_style_index_1_lang-LDqCgKnI.js} +57 -57
  69. package/dist/{main-aZoig-Ic.cjs → main-Bv2Plrj7.cjs} +1 -1
  70. package/dist/{main-CKRcAjah.js → main-CsLazQpe.js} +4 -4
  71. package/dist/{menuIndex-BOUigvDC.cjs → menuIndex-CnGLkky9.cjs} +1 -1
  72. package/dist/{menuIndex-C1JdgI18.js → menuIndex-I5ECgNWt.js} +1 -1
  73. package/dist/ss-component.cjs +1 -1
  74. package/dist/ss-component.js +15 -15
  75. package/dist/ss-component2.cjs +1 -1
  76. package/dist/ss-component2.js +11 -11
  77. package/dist/{threeModel-BZ92nN2I.js → threeModel-Cnyc_Xfm.js} +45 -45
  78. package/dist/{threeModel-DocL2Wps.cjs → threeModel-Dy7yCJzh.cjs} +1 -1
  79. package/dist/{threePreview-Bg9IDV16.js → threePreview-CAXTHct3.js} +137 -137
  80. package/dist/{threePreview-rZ-Mn3yx.cjs → threePreview-rc0Y3L69.cjs} +1 -1
  81. package/dist/{threeSceneView-D9GroZ9j.cjs → threeSceneView-BUb8pd-o.cjs} +1 -1
  82. package/dist/{threeSceneView-FqQJ7ZrG.js → threeSceneView-DsioOlOb.js} +137 -137
  83. package/dist/{threeSceneViewForCPMPIP-WugeC6sT.cjs → threeSceneViewForCPMPIP-D6en-lGr.cjs} +1 -1
  84. package/dist/{threeSceneViewForCPMPIP-BKeIA1xt.js → threeSceneViewForCPMPIP-vG44vNGe.js} +8 -8
  85. package/dist/{threeTrackPathView-Dx18ZIwF.js → threeTrackPathView-BaONHAhM.js} +56 -56
  86. package/dist/{threeTrackPathView-BE28zw_v.cjs → threeTrackPathView-CZTeW2Pq.cjs} +1 -1
  87. package/dist/{threeViewerHost-Dn4RvDFi.js → threeViewerHost-CLtCJAE_.js} +14 -14
  88. package/dist/{threeViewerHost-ZjhprZMr.cjs → threeViewerHost-DO4F_9O0.cjs} +1 -1
  89. package/dist/{urdfTree-C_IB0S4H.cjs → urdfTree-CnCpOTGQ.cjs} +1 -1
  90. package/dist/{urdfTree-D4JGxfMF.js → urdfTree-DrdQVTXa.js} +1 -1
  91. package/dist/{workpieceTreePanel-Di9vo3vC.cjs → workpieceTreePanel-BFPaqDJD.cjs} +1 -1
  92. package/dist/{workpieceTreePanel-jgqhd2py.js → workpieceTreePanel-BLpxZYf-.js} +72 -72
  93. package/package.json +1 -1
  94. package/dist/index-3m8kfH7_.js +0 -38
  95. package/dist/index-BM--4cI-.cjs +0 -1
  96. package/dist/index-DX9jk8Sp.cjs +0 -11
  97. package/dist/index-Dc1Bh93L.cjs +0 -1
  98. package/dist/index-LEeC_fJN.cjs +0 -1
  99. package/dist/index-syxWjmqB.cjs +0 -15
  100. package/dist/index-ytduJbtp.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-Dv2_yu9H.cjs"),S=require("./MTLLoader-D-urUdrf.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BimFR8f6.cjs"),e=require("vue"),D=require("./iconfont-CNymCHn6.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(this,"movableJoints");this.robot=i,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(i=>i.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(i=>i.name)}setJointAngle(i,o){const l=this.robot.joints[i];if(!l||l.jointType==="fixed")return console.warn(`关节 ${i} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${i} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(i){Object.entries(i).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const i={};return this.movableJoints.forEach(o=>{i[o.name]=o.angle||0}),i}resetToZero(){this.movableJoints.forEach(i=>{i.setJointValue(0)})}getJointLimits(i){const o=this.robot.joints[i];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(i,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}easeInOutCubic(i){return i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2}async playSequence(i,o=1e3,l){for(let m=0;m<i.length;m++)await this.animateToState(i[m],o,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level: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:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
1
+ "use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-VqEU-Bt0.cjs"),S=require("./MTLLoader-CEOtxyh2.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DD10WrJ2.cjs"),e=require("vue"),D=require("./iconfont-D0Cr9kuj.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(this,"movableJoints");this.robot=i,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(i=>i.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(i=>i.name)}setJointAngle(i,o){const l=this.robot.joints[i];if(!l||l.jointType==="fixed")return console.warn(`关节 ${i} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${i} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(i){Object.entries(i).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const i={};return this.movableJoints.forEach(o=>{i[o.name]=o.angle||0}),i}resetToZero(){this.movableJoints.forEach(i=>{i.setJointValue(0)})}getJointLimits(i){const o=this.robot.joints[i];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(i,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}easeInOutCubic(i){return i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2}async playSequence(i,o=1e3,l){for(let m=0;m<i.length;m++)await this.animateToState(i[m],o,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level: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:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
@@ -1,22 +1,22 @@
1
1
  var ce = Object.defineProperty;
2
2
  var de = (b, l, t) => l in b ? ce(b, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : b[l] = t;
3
- var E = (b, l, t) => de(b, typeof l != "symbol" ? l + "" : l, t);
4
- import { U as me } from "./URDFLoader-Dj_qDDyi.js";
5
- import { S as ve, M as pe, O as fe } from "./MTLLoader-EdMOXCr9.js";
6
- import { bC as be, bD as re, av as J, $ as we, T as he, bE as O, G as _e, bF as ge, aZ as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dim6PXfX.js";
7
- import { ref as V, defineComponent as Le, computed as F, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as T, createVNode as $, createElementVNode as c, withCtx as M, createTextVNode as D, toDisplayString as U } from "vue";
8
- import { c as Re, e as $e, g as Ce } from "./iconfont-CvYchHEP.js";
9
- import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- const Se = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
11
- function Fe(b) {
3
+ var O = (b, l, t) => de(b, typeof l != "symbol" ? l + "" : l, t);
4
+ import { U as me } from "./URDFLoader-ehXmhBFT.js";
5
+ import { S as ve, M as pe, O as fe } from "./MTLLoader-GkOcupU3.js";
6
+ import { bK as be, bL as re, aD as J, a6 as we, a1 as he, bM as E, O as _e, bN as ge, b5 as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DCz-I5jm.js";
7
+ import { ref as T, defineComponent as Le, computed as S, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as V, createVNode as U, createElementVNode as c, withCtx as D, createTextVNode as F, toDisplayString as C } from "vue";
8
+ import { c as Re, e as Ue, g as $e } from "./iconfont-DCFi7bPb.js";
9
+ import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ const Me = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
11
+ function Se(b) {
12
12
  const { mtlUrl: l, manager: t, resourcePath: s, onLoad: m, onProgress: i, onError: h } = b, v = new pe(t);
13
13
  return s && v.setResourcePath(s), v.load(l, m, i, h), v;
14
14
  }
15
- function Me(b) {
15
+ function De(b) {
16
16
  const { objUrl: l, manager: t, materials: s, onLoad: m, onProgress: i, onError: h } = b, v = new fe(t);
17
17
  return s && v.setMaterials(s), v.load(l, m, i, h), v;
18
18
  }
19
- function De(b) {
19
+ function Fe(b) {
20
20
  const { manager: l, baseFolderUrl: t, onFileProgress: s } = b, m = new me(l);
21
21
  return m.packages = (i) => `${t.endsWith("/") ? t : t + "/"}${i}/`, m.loadMeshCb = (i, h, v) => {
22
22
  const y = (() => {
@@ -37,7 +37,7 @@ function De(b) {
37
37
  var u;
38
38
  return (((u = i.split("/").pop()) == null ? void 0 : u.split("?")[0].split("#")[0]) ?? "").replace(/\.[^/.?#]+$/, "");
39
39
  })(), f = `${_}${r}.mtl`, g = (n) => {
40
- Me({
40
+ De({
41
41
  objUrl: i,
42
42
  manager: h,
43
43
  materials: n,
@@ -48,7 +48,7 @@ function De(b) {
48
48
  }
49
49
  });
50
50
  };
51
- Fe({
51
+ Se({
52
52
  mtlUrl: f,
53
53
  manager: h,
54
54
  resourcePath: _,
@@ -94,8 +94,8 @@ function dt(b, l, t, s) {
94
94
  y = j || 0, _ = u || 0, s.value = y > 0 ? `开始下载资源: 0 / ${y}` : "开始下载资源...", t.value = !0;
95
95
  }, f.onProgress = (n, u, j) => {
96
96
  _ = u, y = j;
97
- const C = `正在加载 ${u} / ${j} 个文件: ${re(n)}`;
98
- s.value = C, u === j && (s.value = "资源加载完成,正在处理模型...", setTimeout(() => {
97
+ const $ = `正在加载 ${u} / ${j} 个文件: ${re(n)}`;
98
+ s.value = $, u === j && (s.value = "资源加载完成,正在处理模型...", setTimeout(() => {
99
99
  if (r) {
100
100
  r.updateMatrixWorld(!0);
101
101
  const p = new _e().setFromObject(r);
@@ -112,15 +112,15 @@ function dt(b, l, t, s) {
112
112
  console.warn(`LoadingManager 报告一个资源加载失败: ${n}。加载流程将继续。`);
113
113
  };
114
114
  const g = (n, u, j) => {
115
- const C = re(n);
115
+ const $ = re(n);
116
116
  let p;
117
- j && j > 0 ? p = `${C}(${O(u)} / ${O(j)})` : u && u > 0 ? p = `${C}(已下载 ${O(u)})` : p = `${C}`, s.value = `正在下载第 ${_ + 1} / ${y} 个文件: ${p}`;
117
+ j && j > 0 ? p = `${$}(${E(u)} / ${E(j)})` : u && u > 0 ? p = `${$}(已下载 ${E(u)})` : p = `${$}`, s.value = `正在下载第 ${_ + 1} / ${y} 个文件: ${p}`;
118
118
  };
119
119
  try {
120
120
  const n = URL.createObjectURL(i);
121
- De({
121
+ Fe({
122
122
  manager: f,
123
- baseFolderUrl: Se,
123
+ baseFolderUrl: Me,
124
124
  onFileProgress: g
125
125
  }).load(
126
126
  n,
@@ -139,7 +139,7 @@ function dt(b, l, t, s) {
139
139
  }
140
140
  function mt(b, l, t, s = ["URDFVisual"]) {
141
141
  let m = null;
142
- const i = V(null), h = new ge(), v = new je(), y = /* @__PURE__ */ new Map();
142
+ const i = T(null), h = new ge(), v = new je(), y = /* @__PURE__ */ new Map();
143
143
  function _() {
144
144
  t.value.forEach((p) => {
145
145
  p.traverse((d) => {
@@ -189,9 +189,9 @@ function mt(b, l, t, s = ["URDFVisual"]) {
189
189
  function j(p) {
190
190
  var o;
191
191
  const { axis: d, value: e } = p;
192
- $e((o = i.value) == null ? void 0 : o.obj, d, e);
192
+ Ue((o = i.value) == null ? void 0 : o.obj, d, e);
193
193
  }
194
- function C(p) {
194
+ function $(p) {
195
195
  var o;
196
196
  const { axis: d, value: e } = p;
197
197
  Re((o = i.value) == null ? void 0 : o.obj, d, e);
@@ -202,13 +202,13 @@ function mt(b, l, t, s = ["URDFVisual"]) {
202
202
  selectedObject3D: i,
203
203
  setSelectedObjVisible: u,
204
204
  updatePosition: j,
205
- updateRotation: C
205
+ updateRotation: $
206
206
  };
207
207
  }
208
208
  class vt {
209
209
  constructor(l) {
210
- E(this, "robot");
211
- E(this, "movableJoints");
210
+ O(this, "robot");
211
+ O(this, "movableJoints");
212
212
  this.robot = l, this.movableJoints = this.getMovableJoints();
213
213
  }
214
214
  /**
@@ -304,10 +304,10 @@ class vt {
304
304
  });
305
305
  }
306
306
  }
307
- const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
307
+ const Oe = { class: "panel-content" }, Je = { class: "obj" }, Ee = {
308
308
  key: 0,
309
309
  class: "obj-base"
310
- }, xe = ["title"], ke = ["title"], Te = { key: 1 }, Ve = { class: "obj-position" }, ze = { class: "coord-item" }, Pe = { class: "coord-item" }, Ae = { class: "coord-item" }, Ie = { class: "obj-rotation" }, Be = { class: "coord-item" }, Ne = { class: "coord-item" }, We = { class: "coord-item" }, Ze = { class: "world" }, qe = { class: "coord-line" }, Xe = { class: "coord-text" }, Ye = { class: "world-position-item" }, Ge = { class: "world-position-item" }, Ke = { class: "world-position-item" }, He = { class: "coord-line" }, Qe = { class: "coord-text" }, et = { class: "world-rotation-item" }, tt = { class: "world-rotation-item" }, ot = { class: "world-rotation-item" }, st = /* @__PURE__ */ Le({
310
+ }, xe = ["title"], ke = ["title"], Ve = { key: 1 }, Te = { class: "obj-position" }, ze = { class: "coord-item" }, Pe = { class: "coord-item" }, Ae = { class: "coord-item" }, Ie = { class: "obj-rotation" }, Be = { class: "coord-item" }, Ne = { class: "coord-item" }, We = { class: "coord-item" }, qe = { class: "world" }, Ke = { class: "coord-line" }, Xe = { class: "coord-text" }, Ye = { class: "world-position-item" }, Ze = { class: "world-position-item" }, Ge = { class: "world-position-item" }, He = { class: "coord-line" }, Qe = { class: "coord-text" }, et = { class: "world-rotation-item" }, tt = { class: "world-rotation-item" }, ot = { class: "world-rotation-item" }, st = /* @__PURE__ */ Le({
311
311
  __name: "workpieceTreePanel",
312
312
  props: {
313
313
  model: {},
@@ -316,7 +316,7 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
316
316
  },
317
317
  emits: ["nodeClick", "visibleChange", "updatePosition", "updateRotation"],
318
318
  setup(b, { emit: l }) {
319
- const t = b, s = l, m = V([]), i = V({}), h = (e, o = 0) => {
319
+ const t = b, s = l, m = T([]), i = T({}), h = (e, o = 0) => {
320
320
  const w = [];
321
321
  return Array.isArray(e) && (e == null ? void 0 : e.length) > 0 && e.forEach((a) => {
322
322
  if (!(a != null && a.isMesh)) {
@@ -358,12 +358,12 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
358
358
  return e.forEach((a) => {
359
359
  if (a.children && a.children.length > 0) {
360
360
  w.push(a.id);
361
- const L = a.children.filter((S) => S.children && S.children.length > 0).slice(0, o).map((S) => S.id);
361
+ const L = a.children.filter((M) => M.children && M.children.length > 0).slice(0, o).map((M) => M.id);
362
362
  w.push(...L);
363
363
  }
364
364
  }), w.slice(0, o + 1);
365
365
  };
366
- F(() => !m.value || m.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? _(m.value, t.maxExpandCount) : y(m.value, t.maxExpandCount));
366
+ S(() => !m.value || m.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? _(m.value, t.maxExpandCount) : y(m.value, t.maxExpandCount));
367
367
  const r = (e) => e ? parseFloat(e.toFixed(3)) : 0, f = (e) => e ? parseFloat(e.toFixed(1)) : 0, g = (e, o) => {
368
368
  s("updatePosition", {
369
369
  obj: t.model,
@@ -378,18 +378,18 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
378
378
  });
379
379
  }, u = (e) => {
380
380
  s("visibleChange", e);
381
- }, j = F(() => t != null && t.model ? v(t.model) : []), C = F(() => {
381
+ }, j = S(() => t != null && t.model ? v(t.model) : []), $ = S(() => {
382
382
  var e, o;
383
383
  return ((e = t == null ? void 0 : t.model) == null ? void 0 : e.name) || ((o = t == null ? void 0 : t.model) == null ? void 0 : o.type);
384
- }), p = F(() => {
384
+ }), p = S(() => {
385
385
  var e;
386
386
  return (e = t == null ? void 0 : t.model) == null ? void 0 : e.type;
387
- }), d = F(() => {
387
+ }), d = S(() => {
388
388
  var e;
389
389
  return (e = t == null ? void 0 : t.model) == null ? void 0 : e.visible;
390
390
  });
391
391
  return ue(() => t.model, () => {
392
- t.model && (i.value = Ce(t.model));
392
+ t.model && (i.value = $e(t.model));
393
393
  }, {
394
394
  deep: !0,
395
395
  immediate: !0
@@ -400,44 +400,44 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
400
400
  },
401
401
  { immediate: !0 }
402
402
  ), (e, o) => {
403
- var S, z, P, A, I, B, N, W, Z, q, X, Y, G, K, H, Q, ee, te, oe, se, ie, le, ae, ne;
403
+ var M, z, P, A, I, B, N, W, q, K, X, Y, Z, G, H, Q, ee, te, oe, se, ie, le, ae, ne;
404
404
  const w = x("el-divider"), a = x("el-switch"), L = x("el-input-number");
405
- return T(), k("div", Ee, [
406
- $(w, null, {
407
- default: M(() => o[6] || (o[6] = [
408
- D("对象")
405
+ return V(), k("div", Oe, [
406
+ U(w, null, {
407
+ default: D(() => o[6] || (o[6] = [
408
+ F("对象")
409
409
  ])),
410
410
  _: 1,
411
411
  __: [6]
412
412
  }),
413
413
  c("div", Je, [
414
- t.model ? (T(), k("div", Oe, [
414
+ t.model ? (V(), k("div", Ee, [
415
415
  c("div", {
416
416
  class: "obj-name",
417
- title: C.value
418
- }, U(C.value), 9, xe),
417
+ title: $.value
418
+ }, C($.value), 9, xe),
419
419
  c("div", {
420
420
  class: "obj-type",
421
421
  title: p.value
422
- }, "[" + U(p.value) + "]", 9, ke)
423
- ])) : (T(), k("div", Te, "空")),
424
- $(a, {
422
+ }, "[" + C(p.value) + "]", 9, ke)
423
+ ])) : (V(), k("div", Ve, "空")),
424
+ U(a, {
425
425
  "model-value": d.value,
426
426
  onChange: u
427
427
  }, null, 8, ["model-value"])
428
428
  ]),
429
- $(w, null, {
430
- default: M(() => o[7] || (o[7] = [
431
- D("相对位置")
429
+ U(w, null, {
430
+ default: D(() => o[7] || (o[7] = [
431
+ F("相对位置")
432
432
  ])),
433
433
  _: 1,
434
434
  __: [7]
435
435
  }),
436
- c("div", Ve, [
436
+ c("div", Te, [
437
437
  c("div", ze, [
438
438
  o[8] || (o[8] = c("span", { class: "axis-label" }, "X", -1)),
439
- $(L, {
440
- "model-value": r((z = (S = i.value) == null ? void 0 : S.position) == null ? void 0 : z.x),
439
+ U(L, {
440
+ "model-value": r((z = (M = i.value) == null ? void 0 : M.position) == null ? void 0 : z.x),
441
441
  onChange: o[0] || (o[0] = (R) => g(R, "x")),
442
442
  size: "small",
443
443
  class: "coord-input-compact",
@@ -449,7 +449,7 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
449
449
  ]),
450
450
  c("div", Pe, [
451
451
  o[9] || (o[9] = c("span", { class: "axis-label" }, "Y", -1)),
452
- $(L, {
452
+ U(L, {
453
453
  "model-value": r((A = (P = i.value) == null ? void 0 : P.position) == null ? void 0 : A.y),
454
454
  onChange: o[1] || (o[1] = (R) => g(R, "y")),
455
455
  size: "small",
@@ -462,7 +462,7 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
462
462
  ]),
463
463
  c("div", Ae, [
464
464
  o[10] || (o[10] = c("span", { class: "axis-label" }, "Z", -1)),
465
- $(L, {
465
+ U(L, {
466
466
  "model-value": r((B = (I = i.value) == null ? void 0 : I.position) == null ? void 0 : B.z),
467
467
  onChange: o[2] || (o[2] = (R) => g(R, "z")),
468
468
  size: "small",
@@ -474,9 +474,9 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
474
474
  }, null, 8, ["model-value"])
475
475
  ])
476
476
  ]),
477
- $(w, null, {
478
- default: M(() => o[11] || (o[11] = [
479
- D("相对旋转")
477
+ U(w, null, {
478
+ default: D(() => o[11] || (o[11] = [
479
+ F("相对旋转")
480
480
  ])),
481
481
  _: 1,
482
482
  __: [11]
@@ -484,7 +484,7 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
484
484
  c("div", Ie, [
485
485
  c("div", Be, [
486
486
  o[12] || (o[12] = c("span", { class: "axis-label" }, "X°", -1)),
487
- $(L, {
487
+ U(L, {
488
488
  "model-value": f((W = (N = i.value) == null ? void 0 : N.rotation) == null ? void 0 : W.x),
489
489
  onChange: o[3] || (o[3] = (R) => n(R, "x")),
490
490
  size: "small",
@@ -497,8 +497,8 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
497
497
  ]),
498
498
  c("div", Ne, [
499
499
  o[13] || (o[13] = c("span", { class: "axis-label" }, "Y°", -1)),
500
- $(L, {
501
- "model-value": f((q = (Z = i.value) == null ? void 0 : Z.rotation) == null ? void 0 : q.y),
500
+ U(L, {
501
+ "model-value": f((K = (q = i.value) == null ? void 0 : q.rotation) == null ? void 0 : K.y),
502
502
  onChange: o[4] || (o[4] = (R) => n(R, "y")),
503
503
  size: "small",
504
504
  class: "coord-input-compact",
@@ -510,7 +510,7 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
510
510
  ]),
511
511
  c("div", We, [
512
512
  o[14] || (o[14] = c("span", { class: "axis-label" }, "Z°", -1)),
513
- $(L, {
513
+ U(L, {
514
514
  "model-value": f((Y = (X = i.value) == null ? void 0 : X.rotation) == null ? void 0 : Y.z),
515
515
  onChange: o[5] || (o[5] = (R) => n(R, "z")),
516
516
  size: "small",
@@ -522,35 +522,35 @@ const Ee = { class: "panel-content" }, Je = { class: "obj" }, Oe = {
522
522
  }, null, 8, ["model-value"])
523
523
  ])
524
524
  ]),
525
- $(w, null, {
526
- default: M(() => o[15] || (o[15] = [
527
- D("世界信息")
525
+ U(w, null, {
526
+ default: D(() => o[15] || (o[15] = [
527
+ F("世界信息")
528
528
  ])),
529
529
  _: 1,
530
530
  __: [15]
531
531
  }),
532
- c("div", Ze, [
533
- c("div", qe, [
532
+ c("div", qe, [
533
+ c("div", Ke, [
534
534
  o[16] || (o[16] = c("span", { class: "coord-label" }, "世界位置:", -1)),
535
535
  c("span", Xe, [
536
- c("div", Ye, U(r((K = (G = i.value) == null ? void 0 : G.worldPosition) == null ? void 0 : K.x)) + ", ", 1),
537
- c("div", Ge, U(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
538
- c("div", Ke, U(r((te = (ee = i.value) == null ? void 0 : ee.worldPosition) == null ? void 0 : te.z)), 1)
536
+ c("div", Ye, C(r((G = (Z = i.value) == null ? void 0 : Z.worldPosition) == null ? void 0 : G.x)) + ", ", 1),
537
+ c("div", Ze, C(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
538
+ c("div", Ge, C(r((te = (ee = i.value) == null ? void 0 : ee.worldPosition) == null ? void 0 : te.z)), 1)
539
539
  ])
540
540
  ]),
541
541
  c("div", He, [
542
542
  o[17] || (o[17] = c("span", { class: "coord-label" }, "世界旋转:", -1)),
543
543
  c("span", Qe, [
544
- c("div", et, U(f((se = (oe = i.value) == null ? void 0 : oe.worldRotation) == null ? void 0 : se.x)) + "°, ", 1),
545
- c("div", tt, U(f((le = (ie = i.value) == null ? void 0 : ie.worldRotation) == null ? void 0 : le.y)) + "°, ", 1),
546
- c("div", ot, U(f((ne = (ae = i.value) == null ? void 0 : ae.worldRotation) == null ? void 0 : ne.z)) + "° ", 1)
544
+ c("div", et, C(f((se = (oe = i.value) == null ? void 0 : oe.worldRotation) == null ? void 0 : se.x)) + "°, ", 1),
545
+ c("div", tt, C(f((le = (ie = i.value) == null ? void 0 : ie.worldRotation) == null ? void 0 : le.y)) + "°, ", 1),
546
+ c("div", ot, C(f((ne = (ae = i.value) == null ? void 0 : ae.worldRotation) == null ? void 0 : ne.z)) + "° ", 1)
547
547
  ])
548
548
  ])
549
549
  ])
550
550
  ]);
551
551
  };
552
552
  }
553
- }), pt = /* @__PURE__ */ Ue(st, [["__scopeId", "data-v-00d48931"]]);
553
+ }), pt = /* @__PURE__ */ Ce(st, [["__scopeId", "data-v-00d48931"]]);
554
554
  export {
555
555
  vt as U,
556
556
  pt as W,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.3.49",
4
+ "version": "1.3.50",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1,38 +0,0 @@
1
- import { a } from "./index-B8HqIYd5.js";
2
- function e(t) {
3
- return a.post(
4
- "http://222.92.178.198:63002/platform/create",
5
- t
6
- );
7
- }
8
- function o(t) {
9
- return a.post(
10
- "http://222.92.178.198:63002/platform/get",
11
- t
12
- );
13
- }
14
- function r(t) {
15
- return a.post(
16
- "http://222.92.178.198:63002/platform/getPage",
17
- t
18
- );
19
- }
20
- function n(t) {
21
- return a.post(
22
- "http://222.92.178.198:63002/platform/delete",
23
- t
24
- );
25
- }
26
- function i(t) {
27
- return a.post(
28
- "http://222.92.178.198:63002/platform/page/add",
29
- t
30
- );
31
- }
32
- export {
33
- e as c,
34
- n as d,
35
- r as g,
36
- o as l,
37
- i as p
38
- };
@@ -1 +0,0 @@
1
- "use strict";const a=require("./index-C5pQXH0_.cjs");function e(t){return a.axios.post("http://222.92.178.198:63002/platform/create",t)}function p(t){return a.axios.post("http://222.92.178.198:63002/platform/get",t)}function o(t){return a.axios.post("http://222.92.178.198:63002/platform/getPage",t)}function i(t){return a.axios.post("http://222.92.178.198:63002/platform/delete",t)}function r(t){return a.axios.post("http://222.92.178.198:63002/platform/page/add",t)}exports.createPlatFormDataApi=e;exports.deletePageDataApi=i;exports.getPageDataApi=o;exports.loginPlatFormDataApi=p;exports.pageBatchAddApi=r;