ss-component-new 1.3.21 → 1.3.23

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 (98) hide show
  1. package/dist/{MTLLoader-YtHulNzU.cjs → MTLLoader-C_XCtjSi.cjs} +1 -1
  2. package/dist/{MTLLoader-CBRDqlja.js → MTLLoader-YR-bfx1D.js} +24 -24
  3. package/dist/{OrbitControls-CKR1ruPg.js → OrbitControls-BGsXD_A7.js} +1 -1
  4. package/dist/{OrbitControls-Bwzpfq8_.cjs → OrbitControls-CktvE4iE.cjs} +1 -1
  5. package/dist/{URDFLoader-DIvTWPgk.cjs → URDFLoader-10oVp_KW.cjs} +1 -1
  6. package/dist/{URDFLoader-D-0fnLWu.js → URDFLoader-m1gMdnSQ.js} +189 -189
  7. package/dist/{animationData-BBVNOO1d.js → animationData-CpK8d_Vm.js} +19 -19
  8. package/dist/{animationData-krmt7b15.cjs → animationData-Cr2ra7rm.cjs} +1 -1
  9. package/dist/{array-AvrqnNoJ.js → array-BmfCVZvi.js} +46 -46
  10. package/dist/{array-CMW4ey7w.cjs → array-COho2hZW.cjs} +1 -1
  11. package/dist/{iconfont-CSj9Ypb0.js → iconfont-0yJB130V.js} +29 -29
  12. package/dist/{iconfont-CUPzGSlt.cjs → iconfont-DsF7kuG5.cjs} +1 -1
  13. package/dist/{index-VF71yUkZ.js → index-5YbplPvi.js} +2 -2
  14. package/dist/{index-I09e-7nF.js → index-76YbJdM8.js} +2 -2
  15. package/dist/{index-BWb8IVmh.js → index-98Ogvz1v.js} +7 -7
  16. package/dist/{index-B7VKjUP4.cjs → index-B4LIBl-a.cjs} +1 -1
  17. package/dist/{index-NB4ig2Zg.js → index-B52TVCSg.js} +8 -8
  18. package/dist/{index-B1Zztqcr.cjs → index-BEBJWYp0.cjs} +1 -1
  19. package/dist/{index-Dx5UzB8t.js → index-BHjvJiFA.js} +5 -5
  20. package/dist/{index-BLxE_tkf.cjs → index-BJPBBWWH.cjs} +1 -1
  21. package/dist/{index-DEF8zy07.js → index-BLcFvu4u.js} +3 -3
  22. package/dist/{index-BPstNH4r.cjs → index-BPlHuTxE.cjs} +4 -4
  23. package/dist/index-BPu9kWR3.js +11883 -0
  24. package/dist/{index-snyYrfwK.cjs → index-BRJ1_Tfi.cjs} +1 -1
  25. package/dist/{index-vCTVD7cV.cjs → index-BWCv7zxy.cjs} +1 -1
  26. package/dist/{index-DWfxnemZ.js → index-BXUByyre.js} +2 -2
  27. package/dist/{index-DUt_5IeJ.js → index-Bnp6YMyE.js} +1461 -1455
  28. package/dist/{index-CGrJyKvT.cjs → index-BxMPyw-Y.cjs} +1 -1
  29. package/dist/{index-DWm4nu2G.cjs → index-CBqGrYej.cjs} +1 -1
  30. package/dist/{index-Dm67w52u.cjs → index-CC9drriV.cjs} +1 -1
  31. package/dist/{index-sMsCzNtW.js → index-COQpDVsv.js} +1570 -1535
  32. package/dist/{index-C4Ohl9vT.js → index-CRbfwrdV.js} +41 -41
  33. package/dist/{index-CuvQZsbE.cjs → index-CVXrjDFh.cjs} +1 -1
  34. package/dist/{index-CEzEaG0d.js → index-CXiOVgoz.js} +1 -1
  35. package/dist/{index-BzGHYxs2.cjs → index-CbBY3TG6.cjs} +1 -1
  36. package/dist/{index-DuGfBNM6.cjs → index-CgFSiyRX.cjs} +1 -1
  37. package/dist/{index-Cu-8pzHm.js → index-Chxt6xBv.js} +5 -5
  38. package/dist/{index-CIrXKpNl.cjs → index-Cjqg29ul.cjs} +1 -1
  39. package/dist/index-CpbBe_mV.cjs +1 -0
  40. package/dist/index-CuAHwR97.cjs +1 -0
  41. package/dist/{index-DHrb-D39.js → index-D-kqGA71.js} +7 -7
  42. package/dist/{index-euZWOilV.cjs → index-D3ixok8t.cjs} +1 -1
  43. package/dist/{index-D39AtL48.js → index-D8HD14bz.js} +1 -1
  44. package/dist/{index-DABBYx7H.js → index-DBh5Z73C.js} +1 -1
  45. package/dist/index-DIWralYr.js +67 -0
  46. package/dist/{index-C8fMwErX.cjs → index-DRTxe12U.cjs} +13 -13
  47. package/dist/{index-BFKUrR1o.cjs → index-DS-YTop9.cjs} +1 -1
  48. package/dist/{index-Cw4Pm2PQ.cjs → index-DU9e5EhS.cjs} +1 -1
  49. package/dist/{index-DN2waPoj.cjs → index-D_Yhv_HV.cjs} +1 -1
  50. package/dist/{index-d6tZBTSp.cjs → index-DaIE9uY1.cjs} +1 -1
  51. package/dist/{index-BT6DSXQW.js → index-Ddoq7kRQ.js} +9 -9
  52. package/dist/{index-CZKslfuq.js → index-Du1HuKYs.js} +2 -2
  53. package/dist/{index-Cxl9cpua.js → index-HgbCIoqo.js} +2 -2
  54. package/dist/index-MK7NdOmS.cjs +1 -0
  55. package/dist/{index-C7WQ1ky5.js → index-NaWMtdUV.js} +2 -2
  56. package/dist/{index-DTttfGgm.js → index-OX4hSXv6.js} +7 -7
  57. package/dist/{index-DXiGkaWi.cjs → index-TMUwtzAm.cjs} +1 -1
  58. package/dist/{index-DGRL8SEt.js → index-Va8AOLWi.js} +1 -1
  59. package/dist/{index-Bjsm8c8q.cjs → index-c4SVf22I.cjs} +1 -1
  60. package/dist/{index-CppJQDiT.js → index-gfdgTjvQ.js} +3 -3
  61. package/dist/{index-CEq2QX9L.js → index-nr6V1FzX.js} +7 -7
  62. package/dist/{index-ovqPs7X7.cjs → index-oMihgN5x.cjs} +1 -1
  63. package/dist/{index-DTuVgYze.cjs → index-r6HP72OA.cjs} +1 -1
  64. package/dist/{index-CBtxzh-u.js → index-tVVurbFz.js} +3 -3
  65. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-1pEFQ04s.js} +29074 -28413
  66. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-ZMwIbmlN.cjs} +392 -382
  67. package/dist/{index.vue_vue_type_style_index_1_lang-DDedRKQj.cjs → index.vue_vue_type_style_index_1_lang--4T7j9qz.cjs} +1 -1
  68. package/dist/{index.vue_vue_type_style_index_1_lang-q8rMzh6x.js → index.vue_vue_type_style_index_1_lang-CNh42_ZH.js} +75 -75
  69. package/dist/{main-CmrBxQsF.cjs → main-BH4e9Of0.cjs} +1 -1
  70. package/dist/{main-ZLB6NnLd.js → main-DU0KTY9Z.js} +4 -4
  71. package/dist/{menuIndex-8RF_0N_y.cjs → menuIndex-D52EAwtb.cjs} +1 -1
  72. package/dist/{menuIndex-BwWrdu20.js → menuIndex-DYaogp2R.js} +1 -1
  73. package/dist/ss-component.cjs +1 -1
  74. package/dist/ss-component.js +10 -10
  75. package/dist/ss-component2.cjs +1 -1
  76. package/dist/ss-component2.js +11 -11
  77. package/dist/{threeModel-DpvPVwlN.js → threeModel-AsOY6mTs.js} +45 -45
  78. package/dist/{threeModel-D5UnPmV3.cjs → threeModel-rcCyHi_m.cjs} +1 -1
  79. package/dist/{threePreview-XQG7sQy9.js → threePreview-CkKl3frr.js} +125 -125
  80. package/dist/{threePreview-CBFQtSls.cjs → threePreview-DOD9HOZn.cjs} +1 -1
  81. package/dist/{threeSceneView-D97Sc8hd.cjs → threeSceneView-DZvOLWv6.cjs} +1 -1
  82. package/dist/{threeSceneView-CdZFIImJ.js → threeSceneView-DlL9pZlj.js} +38 -38
  83. package/dist/{threeSceneViewForCPMPIP-4Cjv1ZS4.cjs → threeSceneViewForCPMPIP-CZvKvfDx.cjs} +1 -1
  84. package/dist/{threeSceneViewForCPMPIP-DH__ogKh.js → threeSceneViewForCPMPIP-DB0Eczbs.js} +8 -8
  85. package/dist/{threeTrackPathView-s17KavQX.cjs → threeTrackPathView-DgyAEYfV.cjs} +1 -1
  86. package/dist/{threeTrackPathView-BFQXaw-a.js → threeTrackPathView-Eb1bvUXJ.js} +78 -78
  87. package/dist/{threeViewerHost-C39tiQj-.cjs → threeViewerHost-BMU1tg9c.cjs} +1 -1
  88. package/dist/{threeViewerHost-BgPjA_94.js → threeViewerHost-Bdzv9iPb.js} +11 -11
  89. package/dist/{urdfTree-HdeBG5se.cjs → urdfTree-CoK2r17Y.cjs} +1 -1
  90. package/dist/{urdfTree-DM6uTeXj.js → urdfTree-hLtm0aFY.js} +10 -10
  91. package/dist/{workpieceTreePanel-C5qUdbmi.js → workpieceTreePanel-Ne_ACq86.js} +63 -63
  92. package/dist/{workpieceTreePanel-BKOHDm85.cjs → workpieceTreePanel-mWvCQyyw.cjs} +1 -1
  93. package/package.json +1 -1
  94. package/dist/index-BteE57Nz.js +0 -103
  95. package/dist/index-C8FzkPpO.cjs +0 -1
  96. package/dist/index-CmctAnWR.cjs +0 -11
  97. package/dist/index-CsbDyIb2.cjs +0 -1
  98. package/dist/index-DdXtt1dh.js +0 -12544
@@ -1 +1 @@
1
- "use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.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;
1
+ "use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-ZMwIbmlN.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;
@@ -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 { Y as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js";
2
+ import { a1 as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-1pEFQ04s.js";
3
3
  import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const D = (i, a) => {
5
5
  if (!a)
@@ -40,10 +40,10 @@ const D = (i, a) => {
40
40
  }, R = { class: "panel-content" }, O = {
41
41
  key: 0,
42
42
  class: "joints-list"
43
- }, K = { class: "joint-info-row" }, B = { class: "joint-left" }, q = { class: "joint-name" }, $ = { class: "joint-range" }, Y = { class: "joint-type" }, z = {
43
+ }, K = { class: "joint-info-row" }, B = { class: "joint-left" }, q = { class: "joint-name" }, $ = { class: "joint-range" }, z = { class: "joint-type" }, G = {
44
44
  key: 0,
45
45
  class: "joint-control-row"
46
- }, G = { class: "slider-container" }, H = ["min", "max", "value", "onInput"], Q = { class: "value-display" }, W = { class: "joint-value" }, X = { class: "unit" }, Z = {
46
+ }, H = { class: "slider-container" }, Q = ["min", "max", "value", "onInput"], W = { class: "value-display" }, X = { class: "joint-value" }, Y = { class: "unit" }, Z = {
47
47
  key: 1,
48
48
  class: "empty-state"
49
49
  }, j = /* @__PURE__ */ I({
@@ -120,10 +120,10 @@ const D = (i, a) => {
120
120
  c("span", q, h(s.name), 1),
121
121
  c("span", $, " [" + h(s.limit.lower.toFixed(2)) + ", " + h(s.limit.upper.toFixed(2)) + "] ", 1)
122
122
  ]),
123
- c("span", Y, h(s.type), 1)
123
+ c("span", z, h(s.type), 1)
124
124
  ]),
125
- s.type === "revolute" || s.type === "prismatic" || s.type === "continuous" ? (f(), m("div", z, [
126
- c("div", G, [
125
+ s.type === "revolute" || s.type === "prismatic" || s.type === "continuous" ? (f(), m("div", G, [
126
+ c("div", H, [
127
127
  c("input", {
128
128
  type: "range",
129
129
  min: s.limit.lower,
@@ -132,11 +132,11 @@ const D = (i, a) => {
132
132
  value: s.currentValue,
133
133
  onInput: (r) => v(s.name, r.target.value),
134
134
  class: "joint-slider"
135
- }, null, 40, H)
135
+ }, null, 40, Q)
136
136
  ]),
137
- c("div", Q, [
138
- c("span", W, h(s.currentValue ? Number(s.currentValue).toFixed(3) : "0.000"), 1),
139
- c("span", X, h(s.type === "prismatic" ? "m" : "rad"), 1)
137
+ c("div", W, [
138
+ c("span", X, h(s.currentValue ? Number(s.currentValue).toFixed(3) : "0.000"), 1),
139
+ c("span", Y, h(s.type === "prismatic" ? "m" : "rad"), 1)
140
140
  ])
141
141
  ])) : U("", !0)
142
142
  ]))), 128))
@@ -1,18 +1,18 @@
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
3
  var J = (b, l, t) => de(b, typeof l != "symbol" ? l + "" : l, t);
4
- import { U as me } from "./URDFLoader-D-0fnLWu.js";
5
- import { S as ve, M as pe, O as fe } from "./MTLLoader-CBRDqlja.js";
6
- import { bD as be, bE as re, aw as E, a1 as we, Y as he, bF as O, J as _e, bG as ge, a_ as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js";
7
- import { ref as T, defineComponent as Le, computed as F, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as V, createVNode as U, createElementVNode as c, withCtx as M, createTextVNode as D, toDisplayString as C } from "vue";
8
- import { c as Re, e as Ue, g as $e } from "./iconfont-CSj9Ypb0.js";
9
- import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- const Se = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
11
- function Fe(b) {
4
+ import { U as me } from "./URDFLoader-m1gMdnSQ.js";
5
+ import { S as ve, M as pe, O as fe } from "./MTLLoader-YR-bfx1D.js";
6
+ import { bJ as be, bK as re, aC as O, a6 as we, a1 as he, bL as E, O as _e, bM as ge, b4 as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-1pEFQ04s.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 C, createElementVNode as c, withCtx as F, createTextVNode as D, toDisplayString as $ } from "vue";
8
+ import { c as Re, e as Ce, g as Ue } from "./iconfont-0yJB130V.js";
9
+ import { _ as $e } 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 Fe(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
  }
@@ -37,18 +37,18 @@ 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
+ Fe({
41
41
  objUrl: i,
42
42
  manager: h,
43
43
  materials: n,
44
44
  onLoad: (u) => v(u),
45
45
  onProgress: (u) => s == null ? void 0 : s(i, u == null ? void 0 : u.loaded, u == null ? void 0 : u.total),
46
46
  onError: (u) => {
47
- console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${i}`, u), v(new E());
47
+ console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${i}`, u), v(new O());
48
48
  }
49
49
  });
50
50
  };
51
- Fe({
51
+ Se({
52
52
  mtlUrl: f,
53
53
  manager: h,
54
54
  resourcePath: _,
@@ -75,13 +75,13 @@ function De(b) {
75
75
  },
76
76
  (r) => s == null ? void 0 : s(i, r == null ? void 0 : r.loaded, r == null ? void 0 : r.total),
77
77
  (r) => {
78
- console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${i}`, r), v(new E());
78
+ console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${i}`, r), v(new O());
79
79
  }
80
80
  );
81
81
  break;
82
82
  }
83
83
  default:
84
- console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${y} (路径: ${i})`), v(new E());
84
+ console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${y} (路径: ${i})`), v(new O());
85
85
  }
86
86
  }, m;
87
87
  }
@@ -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 $ = `正在加载 ${u} / ${j} 个文件: ${re(n)}`;
98
- s.value = $, u === j && (s.value = "资源加载完成,正在处理模型...", setTimeout(() => {
97
+ const U = `正在加载 ${u} / ${j} 个文件: ${re(n)}`;
98
+ s.value = U, 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 $ = re(n);
115
+ const U = re(n);
116
116
  let p;
117
- j && j > 0 ? p = `${$}(${O(u)} / ${O(j)})` : u && u > 0 ? p = `${$}(已下载 ${O(u)})` : p = `${$}`, s.value = `正在下载第 ${_ + 1} / ${y} 个文件: ${p}`;
117
+ j && j > 0 ? p = `${U}(${E(u)} / ${E(j)})` : u && u > 0 ? p = `${U}(已下载 ${E(u)})` : p = `${U}`, s.value = `正在下载第 ${_ + 1} / ${y} 个文件: ${p}`;
118
118
  };
119
119
  try {
120
120
  const n = URL.createObjectURL(i);
121
121
  De({
122
122
  manager: f,
123
- baseFolderUrl: Se,
123
+ baseFolderUrl: Me,
124
124
  onFileProgress: g
125
125
  }).load(
126
126
  n,
@@ -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
- Ue((o = i.value) == null ? void 0 : o.obj, d, e);
192
+ Ce((o = i.value) == null ? void 0 : o.obj, d, e);
193
193
  }
194
- function $(p) {
194
+ function U(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,7 +202,7 @@ function mt(b, l, t, s = ["URDFVisual"]) {
202
202
  selectedObject3D: i,
203
203
  setSelectedObjVisible: u,
204
204
  updatePosition: j,
205
- updateRotation: $
205
+ updateRotation: U
206
206
  };
207
207
  }
208
208
  class vt {
@@ -304,10 +304,10 @@ class vt {
304
304
  });
305
305
  }
306
306
  }
307
- const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
307
+ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
308
308
  key: 0,
309
309
  class: "obj-base"
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" }, Ye = { class: "world" }, qe = { class: "coord-line" }, Xe = { class: "coord-text" }, Ze = { 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: {},
@@ -358,12 +358,12 @@ const Je = { class: "panel-content" }, Ee = { 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 Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
378
378
  });
379
379
  }, u = (e) => {
380
380
  s("visibleChange", e);
381
- }, j = F(() => t != null && t.model ? v(t.model) : []), $ = F(() => {
381
+ }, j = S(() => t != null && t.model ? v(t.model) : []), U = 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 = $e(t.model));
392
+ t.model && (i.value = Ue(t.model));
393
393
  }, {
394
394
  deep: !0,
395
395
  immediate: !0
@@ -400,34 +400,34 @@ const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
400
400
  },
401
401
  { immediate: !0 }
402
402
  ), (e, o) => {
403
- var S, z, P, A, I, B, N, W, Y, q, X, Z, 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
405
  return V(), k("div", Je, [
406
- U(w, null, {
407
- default: M(() => o[6] || (o[6] = [
406
+ C(w, null, {
407
+ default: F(() => o[6] || (o[6] = [
408
408
  D("对象")
409
409
  ])),
410
410
  _: 1,
411
411
  __: [6]
412
412
  }),
413
- c("div", Ee, [
414
- t.model ? (V(), k("div", Oe, [
413
+ c("div", Oe, [
414
+ t.model ? (V(), k("div", Ee, [
415
415
  c("div", {
416
416
  class: "obj-name",
417
- title: $.value
418
- }, C($.value), 9, xe),
417
+ title: U.value
418
+ }, $(U.value), 9, xe),
419
419
  c("div", {
420
420
  class: "obj-type",
421
421
  title: p.value
422
- }, "[" + C(p.value) + "]", 9, ke)
422
+ }, "[" + $(p.value) + "]", 9, ke)
423
423
  ])) : (V(), k("div", Ve, "空")),
424
- U(a, {
424
+ C(a, {
425
425
  "model-value": d.value,
426
426
  onChange: u
427
427
  }, null, 8, ["model-value"])
428
428
  ]),
429
- U(w, null, {
430
- default: M(() => o[7] || (o[7] = [
429
+ C(w, null, {
430
+ default: F(() => o[7] || (o[7] = [
431
431
  D("相对位置")
432
432
  ])),
433
433
  _: 1,
@@ -436,8 +436,8 @@ const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
436
436
  c("div", Te, [
437
437
  c("div", ze, [
438
438
  o[8] || (o[8] = c("span", { class: "axis-label" }, "X", -1)),
439
- U(L, {
440
- "model-value": r((z = (S = i.value) == null ? void 0 : S.position) == null ? void 0 : z.x),
439
+ C(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 Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
449
449
  ]),
450
450
  c("div", Pe, [
451
451
  o[9] || (o[9] = c("span", { class: "axis-label" }, "Y", -1)),
452
- U(L, {
452
+ C(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 Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
462
462
  ]),
463
463
  c("div", Ae, [
464
464
  o[10] || (o[10] = c("span", { class: "axis-label" }, "Z", -1)),
465
- U(L, {
465
+ C(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,8 +474,8 @@ const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
474
474
  }, null, 8, ["model-value"])
475
475
  ])
476
476
  ]),
477
- U(w, null, {
478
- default: M(() => o[11] || (o[11] = [
477
+ C(w, null, {
478
+ default: F(() => o[11] || (o[11] = [
479
479
  D("相对旋转")
480
480
  ])),
481
481
  _: 1,
@@ -484,7 +484,7 @@ const Je = { class: "panel-content" }, Ee = { 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
- U(L, {
487
+ C(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 Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
497
497
  ]),
498
498
  c("div", Ne, [
499
499
  o[13] || (o[13] = c("span", { class: "axis-label" }, "Y°", -1)),
500
- U(L, {
501
- "model-value": f((q = (Y = i.value) == null ? void 0 : Y.rotation) == null ? void 0 : q.y),
500
+ C(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,8 +510,8 @@ const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
510
510
  ]),
511
511
  c("div", We, [
512
512
  o[14] || (o[14] = c("span", { class: "axis-label" }, "Z°", -1)),
513
- U(L, {
514
- "model-value": f((Z = (X = i.value) == null ? void 0 : X.rotation) == null ? void 0 : Z.z),
513
+ C(L, {
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",
517
517
  class: "coord-input-compact",
@@ -522,35 +522,35 @@ const Je = { class: "panel-content" }, Ee = { class: "obj" }, Oe = {
522
522
  }, null, 8, ["model-value"])
523
523
  ])
524
524
  ]),
525
- U(w, null, {
526
- default: M(() => o[15] || (o[15] = [
525
+ C(w, null, {
526
+ default: F(() => o[15] || (o[15] = [
527
527
  D("世界信息")
528
528
  ])),
529
529
  _: 1,
530
530
  __: [15]
531
531
  }),
532
- c("div", Ye, [
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", Ze, C(r((K = (G = i.value) == null ? void 0 : G.worldPosition) == null ? void 0 : K.x)) + ", ", 1),
537
- c("div", Ge, C(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
538
- c("div", Ke, C(r((te = (ee = i.value) == null ? void 0 : ee.worldPosition) == null ? void 0 : te.z)), 1)
536
+ c("div", Ye, $(r((G = (Z = i.value) == null ? void 0 : Z.worldPosition) == null ? void 0 : G.x)) + ", ", 1),
537
+ c("div", Ze, $(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
538
+ c("div", Ge, $(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, 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)
544
+ c("div", et, $(f((se = (oe = i.value) == null ? void 0 : oe.worldRotation) == null ? void 0 : se.x)) + "°, ", 1),
545
+ c("div", tt, $(f((le = (ie = i.value) == null ? void 0 : ie.worldRotation) == null ? void 0 : le.y)) + "°, ", 1),
546
+ c("div", ot, $(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__ */ Ce(st, [["__scopeId", "data-v-00d48931"]]);
553
+ }), pt = /* @__PURE__ */ $e(st, [["__scopeId", "data-v-00d48931"]]);
554
554
  export {
555
555
  vt as U,
556
556
  pt as W,
@@ -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-DIvTWPgk.cjs"),S=require("./MTLLoader-YtHulNzU.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.cjs"),e=require("vue"),D=require("./iconfont-CUPzGSlt.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-10oVp_KW.cjs"),S=require("./MTLLoader-C_XCtjSi.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-ZMwIbmlN.cjs"),e=require("vue"),D=require("./iconfont-DsF7kuG5.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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.3.21",
4
+ "version": "1.3.23",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1,103 +0,0 @@
1
- import { s as d, u as j, b, p as E } from "./index-sMsCzNtW.js";
2
- import { ref as y } from "vue";
3
- import { a as i } from "./index-B8HqIYd5.js";
4
- function w(t) {
5
- return i.post(
6
- "http://222.92.178.198:63002/platform/create",
7
- t
8
- );
9
- }
10
- function F(t) {
11
- return i.post(
12
- "http://222.92.178.198:63002/platform/get",
13
- t
14
- );
15
- }
16
- function S(t) {
17
- return i.post(
18
- "http://222.92.178.198:63002/platform/getPage",
19
- t
20
- );
21
- }
22
- function L(t) {
23
- return i.post(
24
- "http://222.92.178.198:63002/platform/delete",
25
- t
26
- );
27
- }
28
- function M(t) {
29
- return i.post(
30
- "http://222.92.178.198:63002/platform/page/add",
31
- t
32
- );
33
- }
34
- const A = (t) => {
35
- var n, c;
36
- if (Array.isArray(Object.keys(t)) && ((n = Object.keys(t)) == null ? void 0 : n.length) > 0) {
37
- let o = [];
38
- return (c = Object.entries(t)) == null || c.forEach(([p, a]) => {
39
- var l, u;
40
- let r = [];
41
- if (r.push(p), ((l = Object.keys(a)) == null ? void 0 : l.length) > 0) {
42
- let e = [];
43
- (u = A(a)) == null || u.forEach((s) => {
44
- e.push(s);
45
- }), e == null || e.forEach((s) => {
46
- r.push(s);
47
- });
48
- }
49
- o.push(r);
50
- }), o;
51
- }
52
- }, _ = (t, n) => {
53
- var o;
54
- let c = n;
55
- return Array.isArray(Object.keys(t)) && ((o = Object.entries(t)) == null || o.forEach(([p, a]) => {
56
- let r = [p];
57
- if (typeof a == "object" && a !== null) {
58
- let l = A(a);
59
- l == null || l.forEach((u) => {
60
- r.push(u);
61
- });
62
- }
63
- c.push(r);
64
- })), c;
65
- }, x = (t) => {
66
- const n = {};
67
- return t.forEach((o) => {
68
- const p = o.split("/");
69
- let a = n;
70
- p.forEach((r) => {
71
- a[r] || (a[r] = {}), a = a[r];
72
- });
73
- }), _(n, []);
74
- }, h = y(!1), g = y(!1), O = b(E), { loginUserInfo: f } = d(O), P = j(), N = async () => {
75
- var n, c, o, p, a, r, l;
76
- let t = await S({
77
- platId: parseInt((n = f == null ? void 0 : f.value) == null ? void 0 : n.plat_id),
78
- pageName: "menu"
79
- });
80
- if (((o = (c = t == null ? void 0 : t.data) == null ? void 0 : c.result) == null ? void 0 : o.length) > 0) {
81
- let u = (l = (r = (a = (p = t == null ? void 0 : t.data) == null ? void 0 : p.result) == null ? void 0 : a.filter((e) => {
82
- var s, m;
83
- return ((m = e == null ? void 0 : e.object_name) == null ? void 0 : m[((s = e == null ? void 0 : e.object_name) == null ? void 0 : s.length) - 1]) !== "/" && (e == null ? void 0 : e.is_show);
84
- })) == null ? void 0 : r.sort((e, s) => (e == null ? void 0 : e.object_id) - (s == null ? void 0 : s.object_id))) == null ? void 0 : l.map((e) => {
85
- var s;
86
- return (s = e == null ? void 0 : e.object_name) == null ? void 0 : s.replaceAll("**^", "/");
87
- });
88
- u = [...new Set(u)], u = x(u), P.setRawMenus(u ?? []), h.value = !0, g.value = !0;
89
- }
90
- return {
91
- menuExist: h.value,
92
- structureExist: g.value
93
- };
94
- };
95
- export {
96
- w as c,
97
- L as d,
98
- S as g,
99
- F as l,
100
- x as m,
101
- M as p,
102
- N as v
103
- };
@@ -1 +0,0 @@
1
- "use strict";const f=require("./index-C8fMwErX.cjs"),d=require("vue"),p=require("./index-C5pQXH0_.cjs");function E(e){return p.axios.post("http://222.92.178.198:63002/platform/create",e)}function b(e){return p.axios.post("http://222.92.178.198:63002/platform/get",e)}function y(e){return p.axios.post("http://222.92.178.198:63002/platform/getPage",e)}function D(e){return p.axios.post("http://222.92.178.198:63002/platform/delete",e)}function P(e){return p.axios.post("http://222.92.178.198:63002/platform/page/add",e)}const j=e=>{var s,i;if(Array.isArray(Object.keys(e))&&((s=Object.keys(e))==null?void 0:s.length)>0){let o=[];return(i=Object.entries(e))==null||i.forEach(([l,a])=>{var c,u;let r=[];if(r.push(l),((c=Object.keys(a))==null?void 0:c.length)>0){let t=[];(u=j(a))==null||u.forEach(n=>{t.push(n)}),t==null||t.forEach(n=>{r.push(n)})}o.push(r)}),o}},S=(e,s)=>{var o;let i=s;return Array.isArray(Object.keys(e))&&((o=Object.entries(e))==null||o.forEach(([l,a])=>{let r=[l];if(typeof a=="object"&&a!==null){let c=j(a);c==null||c.forEach(u=>{r.push(u)})}i.push(r)})),i},x=e=>{const s={};return e.forEach(o=>{const l=o.split("/");let a=s;l.forEach(r=>{a[r]||(a[r]={}),a=a[r]})}),S(s,[])},g=d.ref(!1),A=d.ref(!1),_=f.useLoginState(f.pinia),{loginUserInfo:h}=f.storeToRefs(_),v=f.useMenuState(),O=async()=>{var s,i,o,l,a,r,c;let e=await y({platId:parseInt((s=h==null?void 0:h.value)==null?void 0:s.plat_id),pageName:"menu"});if(((o=(i=e==null?void 0:e.data)==null?void 0:i.result)==null?void 0:o.length)>0){let u=(c=(r=(a=(l=e==null?void 0:e.data)==null?void 0:l.result)==null?void 0:a.filter(t=>{var n,m;return((m=t==null?void 0:t.object_name)==null?void 0:m[((n=t==null?void 0:t.object_name)==null?void 0:n.length)-1])!=="/"&&(t==null?void 0:t.is_show)}))==null?void 0:r.sort((t,n)=>(t==null?void 0:t.object_id)-(n==null?void 0:n.object_id)))==null?void 0:c.map(t=>{var n;return(n=t==null?void 0:t.object_name)==null?void 0:n.replaceAll("**^","/")});u=[...new Set(u)],u=x(u),v.setRawMenus(u??[]),g.value=!0,A.value=!0}return{menuExist:g.value,structureExist:A.value}};exports.createPlatFormDataApi=E;exports.deletePageDataApi=D;exports.getPageDataApi=y;exports.loginPlatFormDataApi=b;exports.menuArray=x;exports.pageBatchAddApi=P;exports.verifyStructureDataToStore=O;