ss-component-new 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OrbitControls-Co_9huz0.cjs +1 -0
- package/dist/OrbitControls-DA4VpOM_.js +458 -0
- package/dist/STLLoader-DmGTF0Nv.js +657 -0
- package/dist/STLLoader-RU7KqloS.cjs +6 -0
- package/dist/{animationData-BDq02_ir.js → animationData-9n1X4UvO.js} +4 -4
- package/dist/{animationData-BRDoJBuV.cjs → animationData-CfT99nMO.cjs} +1 -1
- package/dist/{array-BtZq8qON.cjs → array-BPHS7JFA.cjs} +1 -1
- package/dist/{array-A59WrroX.js → array-pg68Qbs1.js} +1 -1
- package/dist/config.js +1 -1
- package/dist/{iconfont-7cEds3Xj.js → iconfont-ljBfzBSE.js} +2 -2
- package/dist/{iconfont-CsuwJCas.cjs → iconfont-t5epssvu.cjs} +1 -1
- package/dist/{index-wq8KZGnQ.js → index---6UATT0.js} +3 -3
- package/dist/{index-D8S0DVkq.cjs → index-1DtctdYW.cjs} +1 -1
- package/dist/index-5hLZZ6t-.cjs +1 -0
- package/dist/{index-DygW4mGC.js → index-8CcD03tl.js} +6 -6
- package/dist/{index-C6Uddqal.js → index-B5gNufYw.js} +2 -2
- package/dist/{index-BgJn4mlV.js → index-B5srJr0o.js} +2 -2
- package/dist/{index-B_k7wRBo.cjs → index-B5vIeQUq.cjs} +1 -1
- package/dist/{index-DS3OziT5.cjs → index-B8J_v2Ky.cjs} +1 -1
- package/dist/{index-DQTI3BuS.cjs → index-B9nZeing.cjs} +1 -1
- package/dist/{index-BeqNCviq.js → index-BAj0dyBF.js} +152 -152
- package/dist/{index-BeTQ6ief.js → index-BEJOd_29.js} +4 -4
- package/dist/{index-Dn9I5-1H.cjs → index-BKhDFqMM.cjs} +1 -1
- package/dist/{index-Cz03X-rX.js → index-BNNxPuEV.js} +1 -1
- package/dist/{index-DmwVXfrE.cjs → index-BOVdAFDH.cjs} +1 -1
- package/dist/{index-Crd4LGue.cjs → index-Bi7yv8jC.cjs} +1 -1
- package/dist/{index-CFg3-0Tk.js → index-BjXcyVvp.js} +2 -2
- package/dist/{index-CxnH4vfV.cjs → index-BrsIZVyD.cjs} +1 -1
- package/dist/{index-BB6zZsmY.cjs → index-Bsdjuxq1.cjs} +1 -1
- package/dist/{index-C461j30b.js → index-BuKHInQb.js} +1 -1
- package/dist/{index-CJzA3AAO.cjs → index-Bx4qIiIa.cjs} +1 -1
- package/dist/{index-HFf3Z0Ft.cjs → index-C-AOuDkl.cjs} +1 -1
- package/dist/{index-C3CD2NW8.cjs → index-C0HHmjrg.cjs} +1 -1
- package/dist/{index-BTrjEMt1.js → index-C1lB8apW.js} +4 -4
- package/dist/{index-DqquxuCt.cjs → index-CAHYTZ1Q.cjs} +1 -1
- package/dist/{index-BdL8I_2i.cjs → index-CCIJ-P3X.cjs} +1 -1
- package/dist/{index-B9j8fCyS.js → index-CCsSOTaB.js} +2 -2
- package/dist/{index-YQnrEK_K.js → index-CDXq3gs4.js} +21 -21
- package/dist/{index-CrWFG4Wb.cjs → index-CK_O7QdV.cjs} +1 -1
- package/dist/{index-N7dEiXLQ.js → index-CLtFz5gE.js} +3 -3
- package/dist/{index-6t33eejU.cjs → index-CMlYJD5U.cjs} +1 -1
- package/dist/{index-BxPnA2or.js → index-CdPbJekh.js} +448 -448
- package/dist/{index-CjI5pDiU.cjs → index-CmlXlH2b.cjs} +1 -1
- package/dist/{index-C_VamYcq.js → index-CpE8hbs0.js} +6 -6
- package/dist/{index-CNJzNn6z.cjs → index-CxNBcsll.cjs} +1 -1
- package/dist/{index-BqCCREh3.js → index-CyP2hcVu.js} +6 -6
- package/dist/{index-gjDjqhNq.cjs → index-D-r_YKrq.cjs} +2 -2
- package/dist/{index-C23iUpXa.js → index-D0_4keB8.js} +5 -5
- package/dist/{index-db5CgGrA.js → index-DBScQH7L.js} +13 -13
- package/dist/{index-Cx302rHQ.cjs → index-DCf7Tz40.cjs} +1 -1
- package/dist/{index-DNE4QDIf.js → index-DEwcUkb-.js} +3 -3
- package/dist/{index-qoqka5Nb.js → index-DFg-bhPI.js} +1 -1
- package/dist/{index-CtPy-3S1.cjs → index-DJ1PTHpx.cjs} +1 -1
- package/dist/{index-DqaA5Rvx.cjs → index-DOlPMLvf.cjs} +1 -1
- package/dist/{index-Kg96Vvn5.cjs → index-DPaTtF3h.cjs} +1 -1
- package/dist/{index-CVl84S8B.cjs → index-DPyzaxnq.cjs} +1 -1
- package/dist/{index-DH0dVg0N.js → index-DS5z17Mc.js} +7 -7
- package/dist/{index-B35e4i9n.js → index-DSsZtYMz.js} +2 -2
- package/dist/{index-DVvt9_w0.js → index-Dk8D9SRm.js} +1 -1
- package/dist/{index-wHil9Fox.js → index-DsHRVZ0E.js} +2 -2
- package/dist/{index-DmB0dlGH.cjs → index-DszzdQnM.cjs} +1 -1
- package/dist/{index-BwjuTBrR.js → index-FxX6NP0J.js} +1 -1
- package/dist/{index-CtG-uyjY.cjs → index-LXb5DfDE.cjs} +1 -1
- package/dist/{index-byBdKAky.cjs → index-NFCeQcv4.cjs} +1 -1
- package/dist/{index-BvPC1LSv.js → index-PIEkAjRf.js} +12 -12
- package/dist/{index-CYp77kPp.js → index-UN4JU0ly.js} +1 -1
- package/dist/{index-CvEj4aiY.js → index-Y7MUJdPv.js} +2 -2
- package/dist/{index-aneoZx5F.js → index-bj8hK6Pe.js} +2 -2
- package/dist/{index-1z9RrjZc.cjs → index-d6tSWKtY.cjs} +1 -1
- package/dist/{index-DIm3MBK_.cjs → index-nUEWiqy9.cjs} +1 -1
- package/dist/{index-dqBbhGfy.js → index-pLeOyTaj.js} +6 -6
- package/dist/{index-nq9fleOT.js → index-xHEf6hcO.js} +2 -2
- package/dist/{index-XQxaEXgz.cjs → index-zQVJFawn.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dmm4yqcc.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CzcK5mCc.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cmc1oALS.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-B0Ivzvcp.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Bg_c-oAL.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-xm0hMPwT.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-C795GAHK.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Czu5g16A.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-9kDr7Iek.js} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CMx9TLjC.cjs → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Bn5qXF4J.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-CXwGS60-.cjs → index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs} +46 -45
- package/dist/{index.vue_vue_type_style_index_1_lang-BxEXAMMV.js → index.vue_vue_type_style_index_1_lang-D1n_3_F6.js} +5100 -5012
- package/dist/{index.vue_vue_type_style_index_1_lang-AXp5rRSK.js → index.vue_vue_type_style_index_1_lang-Exyt6qTf.js} +525 -525
- package/dist/{index.vue_vue_type_style_index_1_lang-j5HrYuvy.cjs → index.vue_vue_type_style_index_1_lang-zN5mc8b0.cjs} +2 -2
- package/dist/{isString-BNK38WbE.js → isString-BAN9KLwf.js} +1 -1
- package/dist/{isString-BmAegMGI.cjs → isString-ChvWbctO.cjs} +1 -1
- package/dist/{main-BgpAXuSa.cjs → main-BUEuCNq-.cjs} +1 -1
- package/dist/{main-t7yIujwl.js → main-Dk3BZDsa.js} +5 -5
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/three-viewport-gizmo-BHznJ6W3.js +26015 -0
- package/dist/three-viewport-gizmo-BV37JzRa.cjs +4197 -0
- package/dist/{threeLatheView-sTBlm0tt.js → threeLatheView-DcuDjVv0.js} +4 -4
- package/dist/{threeLatheView-BzHB-t_G.cjs → threeLatheView-DfSxRY8B.cjs} +1 -1
- package/dist/{threeModel-BudPgWiX.cjs → threeModel-DjjtL0-a.cjs} +1 -1
- package/dist/{threeModel-11Yk8w2d.js → threeModel-YRFvkgXU.js} +5 -5
- package/dist/threePreview-ByUYJkts.cjs +1 -0
- package/dist/threePreview-CyYfnbB6.js +1972 -0
- package/dist/{threeSceneView-DT-STxuj.cjs → threeSceneView-mhrcH0WG.cjs} +1 -1
- package/dist/{threeSceneView-Bwed326O.js → threeSceneView-zvyCHrp1.js} +24 -24
- package/dist/{threeSceneViewForCPMPIP-RRDb_tZ0.cjs → threeSceneViewForCPMPIP-DA-twBdG.cjs} +2 -2
- package/dist/{threeSceneViewForCPMPIP-PgPPGBxu.js → threeSceneViewForCPMPIP-axjwKt9X.js} +27 -27
- package/dist/{threeViewerHost-Brgx-J3Q.cjs → threeViewerHost-B02OtfCk.cjs} +1 -1
- package/dist/{threeViewerHost-k5I66uBW.js → threeViewerHost-D7L1FW__.js} +4 -4
- package/dist/{useRayCaster-TCYe6KMI.js → useRayCaster-CAqupK7D.js} +12 -12
- package/dist/{useRayCaster-CLcetetd.cjs → useRayCaster-ClcofJkf.cjs} +1 -1
- package/package.json +1 -1
- package/public/config.js +1 -1
- package/dist/OrbitControls-D1lM0xvz.cjs +0 -1
- package/dist/OrbitControls-DI8fa9gz.js +0 -419
- package/dist/STLLoader-KxFIlfhN.cjs +0 -6
- package/dist/STLLoader-memlq1bT.js +0 -609
- package/dist/index-TXrydBPq.cjs +0 -1
- package/dist/three-viewport-gizmo-BxFHxv_x.js +0 -18587
- package/dist/three-viewport-gizmo-CwaL5sMV.cjs +0 -4195
- package/dist/threePreview-Cy7NY-gw.cjs +0 -1
- package/dist/threePreview-DPyqhBkJ.js +0 -1873
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var te=Object.defineProperty;var oe=(r,i,o)=>i in r?te(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o;var D=(r,i,o)=>oe(r,typeof i!="symbol"?i+"":i,o);const R=require("./three-viewport-gizmo-CwaL5sMV.cjs"),se=require("./index.vue_vue_type_style_index_1_lang-CXwGS60-.cjs"),C=require("./STLLoader-KxFIlfhN.cjs"),e=require("vue"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le={SINGLE:"单机",DOUBLE:"双机"},ne={ROBOT:1,PIPECOMPARSION:2},re="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function x(r){if(r==null||!isFinite(r))return"";const i=r/(1024*1024);if(i>=1)return`${i.toFixed(1)} MB`;const o=r/1024;return o>=1?`${o.toFixed(1)} KB`:`${r} B`}function ee(r){try{const i=r.split("?")[0].split("#")[0];return i.substring(i.lastIndexOf("/")+1)||i}catch{return r}}function ae(r){const{manager:i,baseFolderUrl:o,onFileProgress:l}=r,m=new se.URDFLoader(i);return m.packages=n=>`${o.endsWith("/")?o:o+"/"}${n}/`,m.loadMeshCb=(n,N,h)=>{const g=(()=>{const _=n.split("?")[0].split("#")[0],u=_.lastIndexOf(".");return u>=0?_.slice(u+1).toLowerCase():void 0})();switch(g){case"obj":{const _=(()=>{try{return new URL(".",n).toString()}catch{const c=n.lastIndexOf("/");return c>=0?n.slice(0,c+1):n}})(),u=(()=>{var v;return(((v=n.split("/").pop())==null?void 0:v.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${_}${u}.mtl`,E=c=>{const v=new C.OBJLoader(N);c&&v.setMaterials(c),v.load(n,b=>h(b),b=>l==null?void 0:l(n,b==null?void 0:b.loaded,b==null?void 0:b.total),b=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${n}`,b),h(new R.Group)})},w=new C.MTLLoader(N);w.setResourcePath(_),w.load(f,c=>{try{c.preload()}catch{}E(c)},c=>l==null?void 0:l(f,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),E(void 0)});break}case"stl":{new C.STLLoader(N).load(n,u=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),E=new R.Mesh(u,f);E.castShadow=!0,E.receiveShadow=!0,h(E)},u=>l==null?void 0:l(n,u==null?void 0:u.loaded,u==null?void 0:u.total),u=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${n}`,u),h(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${n})`),h(new R.Group)}},m}function ce(r,i,o,l){return{loadSceneFromFile:n=>new Promise((N,h)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,_=0,u=null;const f=new R.LoadingManager;f.onStart=(w,c,v)=>{g=v||0,_=c||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(w,c,v)=>{_=c,g=v;const b=`正在加载 ${c} / ${v} 个文件: ${ee(w)}`;l.value=b,c===v&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(u){u.updateMatrixWorld(!0);const p=new R.Box3().setFromObject(u);p.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),u.userData.boundingBox=p,u.traverse(d=>{d.isMesh&&(d.castShadow=!0,d.receiveShadow=!0)}),N(u)}else h(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=w=>{console.warn(`LoadingManager 报告一个资源加载失败: ${w}。加载流程将继续。`)};const E=(w,c,v)=>{const b=ee(w);let p;v&&v>0?p=`${b}(${x(c)} / ${x(v)})`:c&&c>0?p=`${b}(已下载 ${x(c)})`:p=`${b}`,l.value=`正在下载第 ${_+1} / ${g} 个文件: ${p}`};try{const w=URL.createObjectURL(n);ae({manager:f,baseFolderUrl:re,onFileProgress:E}).load(w,v=>{u=v},void 0,v=>{console.error(`加载 URDF 文件 (${n.name}) 时发生致命错误:`,v),l.value="URDF 文件解析失败",o.value=!1,h(new Error(`加载 URDF 文件失败: ${n.name}`,{cause:v}))})}catch(w){console.error("初始化 URDF 加载时发生致命错误:",w),l.value="模型加载失败",o.value=!1,h(w)}})}}class ue{constructor(i){D(this,"robot");D(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(),n=Date.now();return new Promise(N=>{const h=()=>{const g=Date.now()-n,_=Math.min(g/o,1),u=this.easeInOutCubic(_),f={};Object.keys(i).forEach(E=>{const w=m[E]||0,c=i[E];f[E]=w+(c-w)*u}),this.setJointAngles(f),l&&l(_),_<1?requestAnimationFrame(h):N()};h()})}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,n=>{l&&l(m,n)})}}const de=(r,i="YZX")=>{const o=new R.Vector3,l=new R.Quaternion,m=new R.Vector3,n=new R.Euler;r.getWorldPosition(o),r.getWorldQuaternion(l),r.getWorldScale(m),n.setFromQuaternion(l,i);const N={x:r.rotation.x*180/Math.PI,y:r.rotation.y*180/Math.PI,z:r.rotation.z*180/Math.PI},h={x:n.x*180/Math.PI,y:n.y*180/Math.PI,z:n.z*180/Math.PI};return{position:r.position,rotation:N,scale:r.scale,worldPosition:o,worldRotation:h,worldScale:m}},me=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.position[i]=l,r.updateMatrixWorld(!0))},pe=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.rotation[i]=l*Math.PI/180,r.updateMatrixWorld(!0))},ve={class:"panel-content"},fe={class:"obj"},we={key:0,class:"obj-base"},be=["title"],he=["title"],Ve={key:1},_e={class:"obj-position"},Ee={class:"coord-item"},Ne={class:"coord-item"},ge={class:"coord-item"},ye={class:"obj-rotation"},Re={class:"coord-item"},Se={class:"coord-item"},Me={class:"coord-item"},De={class:"world"},Ce={class:"coord-line"},xe={class:"coord-text"},Fe={class:"world-position-item"},$e={class:"world-position-item"},Le={class:"world-position-item"},Oe={class:"coord-line"},Ue={class:"coord-text"},je={class:"world-rotation-item"},Je={class:"world-rotation-item"},ke={class:"world-rotation-item"},Ie=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(r,{emit:i}){const o=r,l=i,m=e.ref([]),n=e.ref({}),N=(t,s=0)=>{const V=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(a=>{if(!(a!=null&&a.isMesh)){const y={name:a==null?void 0:a.name,label:(a==null?void 0:a.name)||(a==null?void 0:a.type),show:!0,level:s+1,isPenultimate:!1,type:a==null?void 0:a.type,id:a==null?void 0:a.id,limit:(a==null?void 0:a.limit)??"",children:N(a==null?void 0:a.children,s+1),path:a==null?void 0:a.name};V.push(y)}}),V},h=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:N(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const V=[],a=[...t];for(;a.length>0&&V.length<s;){const y=a.shift();y.children&&y.children.length>0&&(V.push(y.id),a.push(...y.children))}return V},_=(t,s)=>{const V=[];return t.forEach(a=>{if(a.children&&a.children.length>0){V.push(a.id);const y=a.children.filter(M=>M.children&&M.children.length>0).slice(0,s).map(M=>M.id);V.push(...y)}}),V.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?_(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const u=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,E=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},w=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},c=t=>{l("visibleChange",t)},v=e.computed(()=>o!=null&&o.model?h(o.model):[]),b=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)}),p=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),d=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(n.value=de(o.model))},{deep:!0,immediate:!0}),e.watch(v,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var M,F,$,L,O,U,j,J,k,I,T,P,z,B,A,W,q,G,Q,X,Y,Z,K,H;const V=e.resolveComponent("el-divider"),a=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(V,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",fe,[o.model?(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",{class:"obj-name",title:b.value},e.toDisplayString(b.value),9,be),e.createElementVNode("div",{class:"obj-type",title:p.value},"["+e.toDisplayString(p.value)+"]",9,he)])):(e.openBlock(),e.createElementBlock("div",Ve,"空")),e.createVNode(a,{"model-value":d.value,onChange:c},null,8,["model-value"])]),e.createVNode(V,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",_e,[e.createElementVNode("div",Ee,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":u((F=(M=n.value)==null?void 0:M.position)==null?void 0:F.x),onChange:s[0]||(s[0]=S=>E(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":u((L=($=n.value)==null?void 0:$.position)==null?void 0:L.y),onChange:s[1]||(s[1]=S=>E(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ge,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":u((U=(O=n.value)==null?void 0:O.position)==null?void 0:U.z),onChange:s[2]||(s[2]=S=>E(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",ye,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(j=n.value)==null?void 0:j.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=S=>w(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((I=(k=n.value)==null?void 0:k.rotation)==null?void 0:I.y),onChange:s[4]||(s[4]=S=>w(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Me,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((P=(T=n.value)==null?void 0:T.rotation)==null?void 0:P.z),onChange:s[5]||(s[5]=S=>w(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",De,[e.createElementVNode("div",Ce,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Fe,e.toDisplayString(u((B=(z=n.value)==null?void 0:z.worldPosition)==null?void 0:B.x))+", ",1),e.createElementVNode("div",$e,e.toDisplayString(u((W=(A=n.value)==null?void 0:A.worldPosition)==null?void 0:W.y))+", ",1),e.createElementVNode("div",Le,e.toDisplayString(u((G=(q=n.value)==null?void 0:q.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Oe,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",je,e.toDisplayString(f((X=(Q=n.value)==null?void 0:Q.worldRotation)==null?void 0:X.x))+"°, ",1),e.createElementVNode("div",Je,e.toDisplayString(f((Z=(Y=n.value)==null?void 0:Y.worldRotation)==null?void 0:Z.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((H=(K=n.value)==null?void 0:K.worldRotation)==null?void 0:H.z))+"° ",1)])])])])}}}),Te=ie._export_sfc(Ie,[["__scopeId","data-v-00d48931"]]);function Pe(r,i,o,l=["URDFVisual"]){let m=null;const n=e.ref(null),N=new R.Raycaster,h=new R.Vector2,g=new Map;function _(){o.value.forEach(p=>{p.traverse(d=>{l!=null&&l.includes(d.type)&&g.set(d.id,{obj:d,axis:d.axis||new R.Vector3(1,0,0),limits:d.limits})})})}function u(p){n.value&&n.value.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(0))}),n.value=p,p.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(65280))})}function f(p){const d=r.value.getBoundingClientRect();h.x=(p.clientX-d.left)/d.width*2-1,h.y=-((p.clientY-d.top)/d.height)*2+1,N.setFromCamera(h,m);const t=N.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,V=null;for(;s;){if(g.has(s.id)){V=g.get(s.id);break}s=s.parent}V&&u(V)}function E(){r.value&&r.value.removeEventListener("click",f,!1)}function w(){const{scene:p,camera:d}=i();m=d,_(),r.value&&r.value.addEventListener("click",f,!1)}function c(p){n.value&&(n.value.obj.visible=p)}function v(p){var s;const{axis:d,value:t}=p;me((s=n.value)==null?void 0:s.obj,d,t)}function b(p){var s;const{axis:d,value:t}=p;pe((s=n.value)==null?void 0:s.obj,d,t)}return{initRaycaster:w,dispose:E,selectedObject3D:n,setSelectedObjVisible:c,updatePosition:v,updateRotation:b}}exports.URDFRobotController=ue;exports.WorkpieceTreePanel=Te;exports.robotMode=le;exports.sceneType=ne;exports.useRaycaster=Pe;exports.useUrdfLoader=ce;
|
|
1
|
+
"use strict";var te=Object.defineProperty;var oe=(r,i,o)=>i in r?te(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o;var D=(r,i,o)=>oe(r,typeof i!="symbol"?i+"":i,o);const se=require("./index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs"),C=require("./STLLoader-RU7KqloS.cjs"),R=require("./three-viewport-gizmo-BV37JzRa.cjs"),e=require("vue"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le={SINGLE:"单机",DOUBLE:"双机"},ne={ROBOT:1,PIPECOMPARSION:2},re="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function x(r){if(r==null||!isFinite(r))return"";const i=r/(1024*1024);if(i>=1)return`${i.toFixed(1)} MB`;const o=r/1024;return o>=1?`${o.toFixed(1)} KB`:`${r} B`}function ee(r){try{const i=r.split("?")[0].split("#")[0];return i.substring(i.lastIndexOf("/")+1)||i}catch{return r}}function ae(r){const{manager:i,baseFolderUrl:o,onFileProgress:l}=r,m=new se.URDFLoader(i);return m.packages=n=>`${o.endsWith("/")?o:o+"/"}${n}/`,m.loadMeshCb=(n,N,h)=>{const g=(()=>{const _=n.split("?")[0].split("#")[0],u=_.lastIndexOf(".");return u>=0?_.slice(u+1).toLowerCase():void 0})();switch(g){case"obj":{const _=(()=>{try{return new URL(".",n).toString()}catch{const c=n.lastIndexOf("/");return c>=0?n.slice(0,c+1):n}})(),u=(()=>{var v;return(((v=n.split("/").pop())==null?void 0:v.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${_}${u}.mtl`,E=c=>{const v=new C.OBJLoader(N);c&&v.setMaterials(c),v.load(n,b=>h(b),b=>l==null?void 0:l(n,b==null?void 0:b.loaded,b==null?void 0:b.total),b=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${n}`,b),h(new R.Group)})},w=new C.MTLLoader(N);w.setResourcePath(_),w.load(f,c=>{try{c.preload()}catch{}E(c)},c=>l==null?void 0:l(f,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),E(void 0)});break}case"stl":{new C.STLLoader(N).load(n,u=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),E=new R.Mesh(u,f);E.castShadow=!0,E.receiveShadow=!0,h(E)},u=>l==null?void 0:l(n,u==null?void 0:u.loaded,u==null?void 0:u.total),u=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${n}`,u),h(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${n})`),h(new R.Group)}},m}function ce(r,i,o,l){return{loadSceneFromFile:n=>new Promise((N,h)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,_=0,u=null;const f=new R.LoadingManager;f.onStart=(w,c,v)=>{g=v||0,_=c||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(w,c,v)=>{_=c,g=v;const b=`正在加载 ${c} / ${v} 个文件: ${ee(w)}`;l.value=b,c===v&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(u){u.updateMatrixWorld(!0);const p=new R.Box3().setFromObject(u);p.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),u.userData.boundingBox=p,u.traverse(d=>{d.isMesh&&(d.castShadow=!0,d.receiveShadow=!0)}),N(u)}else h(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=w=>{console.warn(`LoadingManager 报告一个资源加载失败: ${w}。加载流程将继续。`)};const E=(w,c,v)=>{const b=ee(w);let p;v&&v>0?p=`${b}(${x(c)} / ${x(v)})`:c&&c>0?p=`${b}(已下载 ${x(c)})`:p=`${b}`,l.value=`正在下载第 ${_+1} / ${g} 个文件: ${p}`};try{const w=URL.createObjectURL(n);ae({manager:f,baseFolderUrl:re,onFileProgress:E}).load(w,v=>{u=v},void 0,v=>{console.error(`加载 URDF 文件 (${n.name}) 时发生致命错误:`,v),l.value="URDF 文件解析失败",o.value=!1,h(new Error(`加载 URDF 文件失败: ${n.name}`,{cause:v}))})}catch(w){console.error("初始化 URDF 加载时发生致命错误:",w),l.value="模型加载失败",o.value=!1,h(w)}})}}class ue{constructor(i){D(this,"robot");D(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(),n=Date.now();return new Promise(N=>{const h=()=>{const g=Date.now()-n,_=Math.min(g/o,1),u=this.easeInOutCubic(_),f={};Object.keys(i).forEach(E=>{const w=m[E]||0,c=i[E];f[E]=w+(c-w)*u}),this.setJointAngles(f),l&&l(_),_<1?requestAnimationFrame(h):N()};h()})}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,n=>{l&&l(m,n)})}}const de=(r,i="YZX")=>{const o=new R.Vector3,l=new R.Quaternion,m=new R.Vector3,n=new R.Euler;r.getWorldPosition(o),r.getWorldQuaternion(l),r.getWorldScale(m),n.setFromQuaternion(l,i);const N={x:r.rotation.x*180/Math.PI,y:r.rotation.y*180/Math.PI,z:r.rotation.z*180/Math.PI},h={x:n.x*180/Math.PI,y:n.y*180/Math.PI,z:n.z*180/Math.PI};return{position:r.position,rotation:N,scale:r.scale,worldPosition:o,worldRotation:h,worldScale:m}},me=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.position[i]=l,r.updateMatrixWorld(!0))},pe=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.rotation[i]=l*Math.PI/180,r.updateMatrixWorld(!0))},ve={class:"panel-content"},fe={class:"obj"},we={key:0,class:"obj-base"},be=["title"],he=["title"],Ve={key:1},_e={class:"obj-position"},Ee={class:"coord-item"},Ne={class:"coord-item"},ge={class:"coord-item"},ye={class:"obj-rotation"},Re={class:"coord-item"},Se={class:"coord-item"},Me={class:"coord-item"},De={class:"world"},Ce={class:"coord-line"},xe={class:"coord-text"},Fe={class:"world-position-item"},$e={class:"world-position-item"},Le={class:"world-position-item"},Oe={class:"coord-line"},Ue={class:"coord-text"},je={class:"world-rotation-item"},Je={class:"world-rotation-item"},ke={class:"world-rotation-item"},Ie=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(r,{emit:i}){const o=r,l=i,m=e.ref([]),n=e.ref({}),N=(t,s=0)=>{const V=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(a=>{if(!(a!=null&&a.isMesh)){const y={name:a==null?void 0:a.name,label:(a==null?void 0:a.name)||(a==null?void 0:a.type),show:!0,level:s+1,isPenultimate:!1,type:a==null?void 0:a.type,id:a==null?void 0:a.id,limit:(a==null?void 0:a.limit)??"",children:N(a==null?void 0:a.children,s+1),path:a==null?void 0:a.name};V.push(y)}}),V},h=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:N(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const V=[],a=[...t];for(;a.length>0&&V.length<s;){const y=a.shift();y.children&&y.children.length>0&&(V.push(y.id),a.push(...y.children))}return V},_=(t,s)=>{const V=[];return t.forEach(a=>{if(a.children&&a.children.length>0){V.push(a.id);const y=a.children.filter(M=>M.children&&M.children.length>0).slice(0,s).map(M=>M.id);V.push(...y)}}),V.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?_(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const u=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,E=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},w=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},c=t=>{l("visibleChange",t)},v=e.computed(()=>o!=null&&o.model?h(o.model):[]),b=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)}),p=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),d=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(n.value=de(o.model))},{deep:!0,immediate:!0}),e.watch(v,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var M,F,$,L,O,U,j,J,k,I,T,P,z,B,A,W,q,G,Q,X,Y,Z,K,H;const V=e.resolveComponent("el-divider"),a=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(V,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",fe,[o.model?(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",{class:"obj-name",title:b.value},e.toDisplayString(b.value),9,be),e.createElementVNode("div",{class:"obj-type",title:p.value},"["+e.toDisplayString(p.value)+"]",9,he)])):(e.openBlock(),e.createElementBlock("div",Ve,"空")),e.createVNode(a,{"model-value":d.value,onChange:c},null,8,["model-value"])]),e.createVNode(V,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",_e,[e.createElementVNode("div",Ee,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":u((F=(M=n.value)==null?void 0:M.position)==null?void 0:F.x),onChange:s[0]||(s[0]=S=>E(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":u((L=($=n.value)==null?void 0:$.position)==null?void 0:L.y),onChange:s[1]||(s[1]=S=>E(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ge,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":u((U=(O=n.value)==null?void 0:O.position)==null?void 0:U.z),onChange:s[2]||(s[2]=S=>E(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",ye,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(j=n.value)==null?void 0:j.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=S=>w(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((I=(k=n.value)==null?void 0:k.rotation)==null?void 0:I.y),onChange:s[4]||(s[4]=S=>w(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Me,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((P=(T=n.value)==null?void 0:T.rotation)==null?void 0:P.z),onChange:s[5]||(s[5]=S=>w(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",De,[e.createElementVNode("div",Ce,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Fe,e.toDisplayString(u((B=(z=n.value)==null?void 0:z.worldPosition)==null?void 0:B.x))+", ",1),e.createElementVNode("div",$e,e.toDisplayString(u((W=(A=n.value)==null?void 0:A.worldPosition)==null?void 0:W.y))+", ",1),e.createElementVNode("div",Le,e.toDisplayString(u((G=(q=n.value)==null?void 0:q.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Oe,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",je,e.toDisplayString(f((X=(Q=n.value)==null?void 0:Q.worldRotation)==null?void 0:X.x))+"°, ",1),e.createElementVNode("div",Je,e.toDisplayString(f((Z=(Y=n.value)==null?void 0:Y.worldRotation)==null?void 0:Z.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((H=(K=n.value)==null?void 0:K.worldRotation)==null?void 0:H.z))+"° ",1)])])])])}}}),Te=ie._export_sfc(Ie,[["__scopeId","data-v-00d48931"]]);function Pe(r,i,o,l=["URDFVisual"]){let m=null;const n=e.ref(null),N=new R.Raycaster,h=new R.Vector2,g=new Map;function _(){o.value.forEach(p=>{p.traverse(d=>{l!=null&&l.includes(d.type)&&g.set(d.id,{obj:d,axis:d.axis||new R.Vector3(1,0,0),limits:d.limits})})})}function u(p){n.value&&n.value.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(0))}),n.value=p,p.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(65280))})}function f(p){const d=r.value.getBoundingClientRect();h.x=(p.clientX-d.left)/d.width*2-1,h.y=-((p.clientY-d.top)/d.height)*2+1,N.setFromCamera(h,m);const t=N.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,V=null;for(;s;){if(g.has(s.id)){V=g.get(s.id);break}s=s.parent}V&&u(V)}function E(){r.value&&r.value.removeEventListener("click",f,!1)}function w(){const{scene:p,camera:d}=i();m=d,_(),r.value&&r.value.addEventListener("click",f,!1)}function c(p){n.value&&(n.value.obj.visible=p)}function v(p){var s;const{axis:d,value:t}=p;me((s=n.value)==null?void 0:s.obj,d,t)}function b(p){var s;const{axis:d,value:t}=p;pe((s=n.value)==null?void 0:s.obj,d,t)}return{initRaycaster:w,dispose:E,selectedObject3D:n,setSelectedObjVisible:c,updatePosition:v,updateRotation:b}}exports.URDFRobotController=ue;exports.WorkpieceTreePanel=Te;exports.robotMode=le;exports.sceneType=ne;exports.useRaycaster=Pe;exports.useUrdfLoader=ce;
|
package/package.json
CHANGED
package/public/config.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__env__ = {
|
|
|
4
4
|
"VITE_OPEN_CDN": "false",
|
|
5
5
|
"VITE_PUBLIC_PATH": "",
|
|
6
6
|
"VITE_SM_PUBLIC_KEY": "0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312",
|
|
7
|
-
"VITE_API_URL": "http://222.92.178.198:
|
|
7
|
+
"VITE_API_URL": "http://222.92.178.198:62009",
|
|
8
8
|
"VITE_DEFAULT_USER": "",
|
|
9
9
|
"VITE_DEFAULT_USER_PASSWORD": ""
|
|
10
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./three-viewport-gizmo-CwaL5sMV.cjs"),ye={type:"change"},B={type:"start"},ge={type:"end"},_=new n.Ray,Ee=new n.Plane,_e=Math.cos(70*n.MathUtils.DEG2RAD);class He extends n.EventDispatcher{constructor(H,Te){super(),this.object=H,this.domElement=Te,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new n.Vector3,this.cursor=new n.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",q),this._domElementKeyEvents=t},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",q),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(ye),e.update(),c=i.NONE},this.update=function(){const t=new n.Vector3,o=new n.Quaternion().setFromUnitVectors(H.up,new n.Vector3(0,1,0)),a=o.clone().invert(),s=new n.Vector3,u=new n.Quaternion,y=new n.Vector3,d=2*Math.PI;return function(Ve=null){const fe=e.object.position;t.copy(fe).sub(e.target),t.applyQuaternion(o),r.setFromVector3(t),e.autoRotate&&c===i.NONE&&N(Pe(Ve)),e.enableDamping?(r.theta+=m.theta*e.dampingFactor,r.phi+=m.phi*e.dampingFactor):(r.theta+=m.theta,r.phi+=m.phi);let p=e.minAzimuthAngle,h=e.maxAzimuthAngle;isFinite(p)&&isFinite(h)&&(p<-Math.PI?p+=d:p>Math.PI&&(p-=d),h<-Math.PI?h+=d:h>Math.PI&&(h-=d),p<=h?r.theta=Math.max(p,Math.min(h,r.theta)):r.theta=r.theta>(p+h)/2?Math.max(p,r.theta):Math.min(h,r.theta)),r.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,r.phi)),r.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(w,e.dampingFactor):e.target.add(w),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let C=!1;if(e.zoomToCursor&&Y||e.object.isOrthographicCamera)r.radius=W(r.radius);else{const f=r.radius;r.radius=W(r.radius*g),C=f!=r.radius}if(t.setFromSpherical(r),t.applyQuaternion(a),fe.copy(e.target).add(t),e.object.lookAt(e.target),e.enableDamping===!0?(m.theta*=1-e.dampingFactor,m.phi*=1-e.dampingFactor,w.multiplyScalar(1-e.dampingFactor)):(m.set(0,0,0),w.set(0,0,0)),e.zoomToCursor&&Y){let f=null;if(e.object.isPerspectiveCamera){const I=t.length();f=W(I*g);const V=I-f;e.object.position.addScaledVector(Q,V),e.object.updateMatrixWorld(),C=!!V}else if(e.object.isOrthographicCamera){const I=new n.Vector3(b.x,b.y,0);I.unproject(e.object);const V=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/g)),e.object.updateProjectionMatrix(),C=V!==e.object.zoom;const be=new n.Vector3(b.x,b.y,0);be.unproject(e.object),e.object.position.sub(be).add(I),e.object.updateMatrixWorld(),f=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;f!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(f).add(e.object.position):(_.origin.copy(e.object.position),_.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(_.direction))<_e?H.lookAt(e.target):(Ee.setFromNormalAndCoplanarPoint(e.object.up,e.target),_.intersectPlane(Ee,e.target))))}else if(e.object.isOrthographicCamera){const f=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/g)),f!==e.object.zoom&&(e.object.updateProjectionMatrix(),C=!0)}return g=1,Y=!1,C||s.distanceToSquared(e.object.position)>K||8*(1-u.dot(e.object.quaternion))>K||y.distanceToSquared(e.target)>K?(e.dispatchEvent(ye),s.copy(e.object.position),u.copy(e.object.quaternion),y.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",pe),e.domElement.removeEventListener("pointerdown",ce),e.domElement.removeEventListener("pointercancel",k),e.domElement.removeEventListener("wheel",le),e.domElement.removeEventListener("pointermove",G),e.domElement.removeEventListener("pointerup",k),e.domElement.getRootNode().removeEventListener("keydown",ue,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",q),e._domElementKeyEvents=null)};const e=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=i.NONE;const K=1e-6,r=new n.Spherical,m=new n.Spherical;let g=1;const w=new n.Vector3,E=new n.Vector2,T=new n.Vector2,j=new n.Vector2,P=new n.Vector2,O=new n.Vector2,A=new n.Vector2,L=new n.Vector2,D=new n.Vector2,M=new n.Vector2,Q=new n.Vector3,b=new n.Vector2;let Y=!1;const l=[],x={};let Z=!1;function Pe(t){return t!==null?2*Math.PI/60*e.autoRotateSpeed*t:2*Math.PI/60/60*e.autoRotateSpeed}function z(t){const o=Math.abs(t*.01);return Math.pow(.95,e.zoomSpeed*o)}function N(t){m.theta-=t}function U(t){m.phi-=t}const v=function(){const t=new n.Vector3;return function(a,s){t.setFromMatrixColumn(s,0),t.multiplyScalar(-a),w.add(t)}}(),J=function(){const t=new n.Vector3;return function(a,s){e.screenSpacePanning===!0?t.setFromMatrixColumn(s,1):(t.setFromMatrixColumn(s,0),t.crossVectors(e.object.up,t)),t.multiplyScalar(a),w.add(t)}}(),R=function(){const t=new n.Vector3;return function(a,s){const u=e.domElement;if(e.object.isPerspectiveCamera){const y=e.object.position;t.copy(y).sub(e.target);let d=t.length();d*=Math.tan(e.object.fov/2*Math.PI/180),v(2*a*d/u.clientHeight,e.object.matrix),J(2*s*d/u.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(v(a*(e.object.right-e.object.left)/e.object.zoom/u.clientWidth,e.object.matrix),J(s*(e.object.top-e.object.bottom)/e.object.zoom/u.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function X(t){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?g/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function $(t){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?g*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function F(t,o){if(!e.zoomToCursor)return;Y=!0;const a=e.domElement.getBoundingClientRect(),s=t-a.left,u=o-a.top,y=a.width,d=a.height;b.x=s/y*2-1,b.y=-(u/d)*2+1,Q.set(b.x,b.y,1).unproject(e.object).sub(e.object.position).normalize()}function W(t){return Math.max(e.minDistance,Math.min(e.maxDistance,t))}function ee(t){E.set(t.clientX,t.clientY)}function Oe(t){F(t.clientX,t.clientX),L.set(t.clientX,t.clientY)}function te(t){P.set(t.clientX,t.clientY)}function Me(t){T.set(t.clientX,t.clientY),j.subVectors(T,E).multiplyScalar(e.rotateSpeed);const o=e.domElement;N(2*Math.PI*j.x/o.clientHeight),U(2*Math.PI*j.y/o.clientHeight),E.copy(T),e.update()}function we(t){D.set(t.clientX,t.clientY),M.subVectors(D,L),M.y>0?X(z(M.y)):M.y<0&&$(z(M.y)),L.copy(D),e.update()}function je(t){O.set(t.clientX,t.clientY),A.subVectors(O,P).multiplyScalar(e.panSpeed),R(A.x,A.y),P.copy(O),e.update()}function Ae(t){F(t.clientX,t.clientY),t.deltaY<0?$(z(t.deltaY)):t.deltaY>0&&X(z(t.deltaY)),e.update()}function Le(t){let o=!1;switch(t.code){case e.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?U(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(0,e.keyPanSpeed),o=!0;break;case e.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?U(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(0,-e.keyPanSpeed),o=!0;break;case e.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?N(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(e.keyPanSpeed,0),o=!0;break;case e.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?N(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(-e.keyPanSpeed,0),o=!0;break}o&&(t.preventDefault(),e.update())}function oe(t){if(l.length===1)E.set(t.pageX,t.pageY);else{const o=S(t),a=.5*(t.pageX+o.x),s=.5*(t.pageY+o.y);E.set(a,s)}}function ne(t){if(l.length===1)P.set(t.pageX,t.pageY);else{const o=S(t),a=.5*(t.pageX+o.x),s=.5*(t.pageY+o.y);P.set(a,s)}}function ae(t){const o=S(t),a=t.pageX-o.x,s=t.pageY-o.y,u=Math.sqrt(a*a+s*s);L.set(0,u)}function De(t){e.enableZoom&&ae(t),e.enablePan&&ne(t)}function Re(t){e.enableZoom&&ae(t),e.enableRotate&&oe(t)}function ie(t){if(l.length==1)T.set(t.pageX,t.pageY);else{const a=S(t),s=.5*(t.pageX+a.x),u=.5*(t.pageY+a.y);T.set(s,u)}j.subVectors(T,E).multiplyScalar(e.rotateSpeed);const o=e.domElement;N(2*Math.PI*j.x/o.clientHeight),U(2*Math.PI*j.y/o.clientHeight),E.copy(T)}function se(t){if(l.length===1)O.set(t.pageX,t.pageY);else{const o=S(t),a=.5*(t.pageX+o.x),s=.5*(t.pageY+o.y);O.set(a,s)}A.subVectors(O,P).multiplyScalar(e.panSpeed),R(A.x,A.y),P.copy(O)}function re(t){const o=S(t),a=t.pageX-o.x,s=t.pageY-o.y,u=Math.sqrt(a*a+s*s);D.set(0,u),M.set(0,Math.pow(D.y/L.y,e.zoomSpeed)),X(M.y),L.copy(D);const y=(t.pageX+o.x)*.5,d=(t.pageY+o.y)*.5;F(y,d)}function Se(t){e.enableZoom&&re(t),e.enablePan&&se(t)}function xe(t){e.enableZoom&&re(t),e.enableRotate&&ie(t)}function ce(t){e.enabled!==!1&&(l.length===0&&(e.domElement.setPointerCapture(t.pointerId),e.domElement.addEventListener("pointermove",G),e.domElement.addEventListener("pointerup",k)),!Ue(t)&&(Ye(t),t.pointerType==="touch"?me(t):Ne(t)))}function G(t){e.enabled!==!1&&(t.pointerType==="touch"?Ie(t):ke(t))}function k(t){switch(ze(t),l.length){case 0:e.domElement.releasePointerCapture(t.pointerId),e.domElement.removeEventListener("pointermove",G),e.domElement.removeEventListener("pointerup",k),e.dispatchEvent(ge),c=i.NONE;break;case 1:const o=l[0],a=x[o];me({pointerId:o,pageX:a.x,pageY:a.y});break}}function Ne(t){let o;switch(t.button){case 0:o=e.mouseButtons.LEFT;break;case 1:o=e.mouseButtons.MIDDLE;break;case 2:o=e.mouseButtons.RIGHT;break;default:o=-1}switch(o){case n.MOUSE.DOLLY:if(e.enableZoom===!1)return;Oe(t),c=i.DOLLY;break;case n.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(e.enablePan===!1)return;te(t),c=i.PAN}else{if(e.enableRotate===!1)return;ee(t),c=i.ROTATE}break;case n.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(e.enableRotate===!1)return;ee(t),c=i.ROTATE}else{if(e.enablePan===!1)return;te(t),c=i.PAN}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(B)}function ke(t){switch(c){case i.ROTATE:if(e.enableRotate===!1)return;Me(t);break;case i.DOLLY:if(e.enableZoom===!1)return;we(t);break;case i.PAN:if(e.enablePan===!1)return;je(t);break}}function le(t){e.enabled===!1||e.enableZoom===!1||c!==i.NONE||(t.preventDefault(),e.dispatchEvent(B),Ae(Ce(t)),e.dispatchEvent(ge))}function Ce(t){const o=t.deltaMode,a={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(o){case 1:a.deltaY*=16;break;case 2:a.deltaY*=100;break}return t.ctrlKey&&!Z&&(a.deltaY*=10),a}function ue(t){t.key==="Control"&&(Z=!0,e.domElement.getRootNode().addEventListener("keyup",de,{passive:!0,capture:!0}))}function de(t){t.key==="Control"&&(Z=!1,e.domElement.getRootNode().removeEventListener("keyup",de,{passive:!0,capture:!0}))}function q(t){e.enabled===!1||e.enablePan===!1||Le(t)}function me(t){switch(he(t),l.length){case 1:switch(e.touches.ONE){case n.TOUCH.ROTATE:if(e.enableRotate===!1)return;oe(t),c=i.TOUCH_ROTATE;break;case n.TOUCH.PAN:if(e.enablePan===!1)return;ne(t),c=i.TOUCH_PAN;break;default:c=i.NONE}break;case 2:switch(e.touches.TWO){case n.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;De(t),c=i.TOUCH_DOLLY_PAN;break;case n.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Re(t),c=i.TOUCH_DOLLY_ROTATE;break;default:c=i.NONE}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(B)}function Ie(t){switch(he(t),c){case i.TOUCH_ROTATE:if(e.enableRotate===!1)return;ie(t),e.update();break;case i.TOUCH_PAN:if(e.enablePan===!1)return;se(t),e.update();break;case i.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Se(t),e.update();break;case i.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;xe(t),e.update();break;default:c=i.NONE}}function pe(t){e.enabled!==!1&&t.preventDefault()}function Ye(t){l.push(t.pointerId)}function ze(t){delete x[t.pointerId];for(let o=0;o<l.length;o++)if(l[o]==t.pointerId){l.splice(o,1);return}}function Ue(t){for(let o=0;o<l.length;o++)if(l[o]==t.pointerId)return!0;return!1}function he(t){let o=x[t.pointerId];o===void 0&&(o=new n.Vector2,x[t.pointerId]=o),o.set(t.pageX,t.pageY)}function S(t){const o=t.pointerId===l[0]?l[1]:l[0];return x[o]}e.domElement.addEventListener("contextmenu",pe),e.domElement.addEventListener("pointerdown",ce),e.domElement.addEventListener("pointercancel",k),e.domElement.addEventListener("wheel",le,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",ue,{passive:!0,capture:!0}),this.update()}}exports.OrbitControls=He;
|
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { aJ as Ve, V as u, M as k, aK as S, aL as Pe, Q as Te, J as m, aM as We, j as Ge, l as qe } from "./three-viewport-gizmo-BxFHxv_x.js";
|
|
2
|
-
const Oe = { type: "change" }, J = { type: "start" }, we = { type: "end" }, X = new We(), Me = new Ge(), Be = Math.cos(70 * qe.DEG2RAD);
|
|
3
|
-
class et extends Ve {
|
|
4
|
-
constructor(F, je) {
|
|
5
|
-
super(), this.object = F, this.domElement = je, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new u(), this.cursor = new u(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: k.ROTATE, MIDDLE: k.DOLLY, RIGHT: k.PAN }, this.touches = { ONE: S.ROTATE, TWO: S.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
|
6
|
-
return s.phi;
|
|
7
|
-
}, this.getAzimuthalAngle = function() {
|
|
8
|
-
return s.theta;
|
|
9
|
-
}, this.getDistance = function() {
|
|
10
|
-
return this.object.position.distanceTo(this.target);
|
|
11
|
-
}, this.listenToKeyEvents = function(t) {
|
|
12
|
-
t.addEventListener("keydown", v), this._domElementKeyEvents = t;
|
|
13
|
-
}, this.stopListenToKeyEvents = function() {
|
|
14
|
-
this._domElementKeyEvents.removeEventListener("keydown", v), this._domElementKeyEvents = null;
|
|
15
|
-
}, this.saveState = function() {
|
|
16
|
-
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
|
17
|
-
}, this.reset = function() {
|
|
18
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Oe), e.update(), r = a.NONE;
|
|
19
|
-
}, this.update = function() {
|
|
20
|
-
const t = new u(), o = new Te().setFromUnitVectors(F.up, new u(0, 1, 0)), n = o.clone().invert(), i = new u(), l = new Te(), g = new u(), d = 2 * Math.PI;
|
|
21
|
-
return function(Fe = null) {
|
|
22
|
-
const ge = e.object.position;
|
|
23
|
-
t.copy(ge).sub(e.target), t.applyQuaternion(o), s.setFromVector3(t), e.autoRotate && r === a.NONE && C(Ae(Fe)), e.enableDamping ? (s.theta += p.theta * e.dampingFactor, s.phi += p.phi * e.dampingFactor) : (s.theta += p.theta, s.phi += p.phi);
|
|
24
|
-
let h = e.minAzimuthAngle, f = e.maxAzimuthAngle;
|
|
25
|
-
isFinite(h) && isFinite(f) && (h < -Math.PI ? h += d : h > Math.PI && (h -= d), f < -Math.PI ? f += d : f > Math.PI && (f -= d), h <= f ? s.theta = Math.max(h, Math.min(f, s.theta)) : s.theta = s.theta > (h + f) / 2 ? Math.max(h, s.theta) : Math.min(f, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(j, e.dampingFactor) : e.target.add(j), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
|
|
26
|
-
let z = !1;
|
|
27
|
-
if (e.zoomToCursor && K || e.object.isOrthographicCamera)
|
|
28
|
-
s.radius = B(s.radius);
|
|
29
|
-
else {
|
|
30
|
-
const b = s.radius;
|
|
31
|
-
s.radius = B(s.radius * E), z = b != s.radius;
|
|
32
|
-
}
|
|
33
|
-
if (t.setFromSpherical(s), t.applyQuaternion(n), ge.copy(e.target).add(t), e.object.lookAt(e.target), e.enableDamping === !0 ? (p.theta *= 1 - e.dampingFactor, p.phi *= 1 - e.dampingFactor, j.multiplyScalar(1 - e.dampingFactor)) : (p.set(0, 0, 0), j.set(0, 0, 0)), e.zoomToCursor && K) {
|
|
34
|
-
let b = null;
|
|
35
|
-
if (e.object.isPerspectiveCamera) {
|
|
36
|
-
const _ = t.length();
|
|
37
|
-
b = B(_ * E);
|
|
38
|
-
const Z = _ - b;
|
|
39
|
-
e.object.position.addScaledVector($, Z), e.object.updateMatrixWorld(), z = !!Z;
|
|
40
|
-
} else if (e.object.isOrthographicCamera) {
|
|
41
|
-
const _ = new u(y.x, y.y, 0);
|
|
42
|
-
_.unproject(e.object);
|
|
43
|
-
const Z = e.object.zoom;
|
|
44
|
-
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / E)), e.object.updateProjectionMatrix(), z = Z !== e.object.zoom;
|
|
45
|
-
const Ee = new u(y.x, y.y, 0);
|
|
46
|
-
Ee.unproject(e.object), e.object.position.sub(Ee).add(_), e.object.updateMatrixWorld(), b = t.length();
|
|
47
|
-
} else
|
|
48
|
-
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
|
49
|
-
b !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(b).add(e.object.position) : (X.origin.copy(e.object.position), X.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(X.direction)) < Be ? F.lookAt(e.target) : (Me.setFromNormalAndCoplanarPoint(e.object.up, e.target), X.intersectPlane(Me, e.target))));
|
|
50
|
-
} else if (e.object.isOrthographicCamera) {
|
|
51
|
-
const b = e.object.zoom;
|
|
52
|
-
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / E)), b !== e.object.zoom && (e.object.updateProjectionMatrix(), z = !0);
|
|
53
|
-
}
|
|
54
|
-
return E = 1, K = !1, z || i.distanceToSquared(e.object.position) > V || 8 * (1 - l.dot(e.object.quaternion)) > V || g.distanceToSquared(e.target) > V ? (e.dispatchEvent(Oe), i.copy(e.object.position), l.copy(e.object.quaternion), g.copy(e.target), !0) : !1;
|
|
55
|
-
};
|
|
56
|
-
}(), this.dispose = function() {
|
|
57
|
-
e.domElement.removeEventListener("contextmenu", be), e.domElement.removeEventListener("pointerdown", de), e.domElement.removeEventListener("pointercancel", Y), e.domElement.removeEventListener("wheel", me), e.domElement.removeEventListener("pointermove", Q), e.domElement.removeEventListener("pointerup", Y), e.domElement.getRootNode().removeEventListener("keydown", pe, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", v), e._domElementKeyEvents = null);
|
|
58
|
-
};
|
|
59
|
-
const e = this, a = {
|
|
60
|
-
NONE: -1,
|
|
61
|
-
ROTATE: 0,
|
|
62
|
-
DOLLY: 1,
|
|
63
|
-
PAN: 2,
|
|
64
|
-
TOUCH_ROTATE: 3,
|
|
65
|
-
TOUCH_PAN: 4,
|
|
66
|
-
TOUCH_DOLLY_PAN: 5,
|
|
67
|
-
TOUCH_DOLLY_ROTATE: 6
|
|
68
|
-
};
|
|
69
|
-
let r = a.NONE;
|
|
70
|
-
const V = 1e-6, s = new Pe(), p = new Pe();
|
|
71
|
-
let E = 1;
|
|
72
|
-
const j = new u(), P = new m(), T = new m(), A = new m(), O = new m(), w = new m(), L = new m(), D = new m(), R = new m(), M = new m(), $ = new u(), y = new m();
|
|
73
|
-
let K = !1;
|
|
74
|
-
const c = [], I = {};
|
|
75
|
-
let W = !1;
|
|
76
|
-
function Ae(t) {
|
|
77
|
-
return t !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * t : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
|
78
|
-
}
|
|
79
|
-
function H(t) {
|
|
80
|
-
const o = Math.abs(t * 0.01);
|
|
81
|
-
return Math.pow(0.95, e.zoomSpeed * o);
|
|
82
|
-
}
|
|
83
|
-
function C(t) {
|
|
84
|
-
p.theta -= t;
|
|
85
|
-
}
|
|
86
|
-
function U(t) {
|
|
87
|
-
p.phi -= t;
|
|
88
|
-
}
|
|
89
|
-
const ee = function() {
|
|
90
|
-
const t = new u();
|
|
91
|
-
return function(n, i) {
|
|
92
|
-
t.setFromMatrixColumn(i, 0), t.multiplyScalar(-n), j.add(t);
|
|
93
|
-
};
|
|
94
|
-
}(), te = function() {
|
|
95
|
-
const t = new u();
|
|
96
|
-
return function(n, i) {
|
|
97
|
-
e.screenSpacePanning === !0 ? t.setFromMatrixColumn(i, 1) : (t.setFromMatrixColumn(i, 0), t.crossVectors(e.object.up, t)), t.multiplyScalar(n), j.add(t);
|
|
98
|
-
};
|
|
99
|
-
}(), x = function() {
|
|
100
|
-
const t = new u();
|
|
101
|
-
return function(n, i) {
|
|
102
|
-
const l = e.domElement;
|
|
103
|
-
if (e.object.isPerspectiveCamera) {
|
|
104
|
-
const g = e.object.position;
|
|
105
|
-
t.copy(g).sub(e.target);
|
|
106
|
-
let d = t.length();
|
|
107
|
-
d *= Math.tan(e.object.fov / 2 * Math.PI / 180), ee(2 * n * d / l.clientHeight, e.object.matrix), te(2 * i * d / l.clientHeight, e.object.matrix);
|
|
108
|
-
} else e.object.isOrthographicCamera ? (ee(n * (e.object.right - e.object.left) / e.object.zoom / l.clientWidth, e.object.matrix), te(i * (e.object.top - e.object.bottom) / e.object.zoom / l.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
|
109
|
-
};
|
|
110
|
-
}();
|
|
111
|
-
function G(t) {
|
|
112
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? E /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
113
|
-
}
|
|
114
|
-
function oe(t) {
|
|
115
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? E *= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
116
|
-
}
|
|
117
|
-
function q(t, o) {
|
|
118
|
-
if (!e.zoomToCursor)
|
|
119
|
-
return;
|
|
120
|
-
K = !0;
|
|
121
|
-
const n = e.domElement.getBoundingClientRect(), i = t - n.left, l = o - n.top, g = n.width, d = n.height;
|
|
122
|
-
y.x = i / g * 2 - 1, y.y = -(l / d) * 2 + 1, $.set(y.x, y.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
|
123
|
-
}
|
|
124
|
-
function B(t) {
|
|
125
|
-
return Math.max(e.minDistance, Math.min(e.maxDistance, t));
|
|
126
|
-
}
|
|
127
|
-
function ne(t) {
|
|
128
|
-
P.set(t.clientX, t.clientY);
|
|
129
|
-
}
|
|
130
|
-
function Le(t) {
|
|
131
|
-
q(t.clientX, t.clientX), D.set(t.clientX, t.clientY);
|
|
132
|
-
}
|
|
133
|
-
function ae(t) {
|
|
134
|
-
O.set(t.clientX, t.clientY);
|
|
135
|
-
}
|
|
136
|
-
function De(t) {
|
|
137
|
-
T.set(t.clientX, t.clientY), A.subVectors(T, P).multiplyScalar(e.rotateSpeed);
|
|
138
|
-
const o = e.domElement;
|
|
139
|
-
C(2 * Math.PI * A.x / o.clientHeight), U(2 * Math.PI * A.y / o.clientHeight), P.copy(T), e.update();
|
|
140
|
-
}
|
|
141
|
-
function Re(t) {
|
|
142
|
-
R.set(t.clientX, t.clientY), M.subVectors(R, D), M.y > 0 ? G(H(M.y)) : M.y < 0 && oe(H(M.y)), D.copy(R), e.update();
|
|
143
|
-
}
|
|
144
|
-
function xe(t) {
|
|
145
|
-
w.set(t.clientX, t.clientY), L.subVectors(w, O).multiplyScalar(e.panSpeed), x(L.x, L.y), O.copy(w), e.update();
|
|
146
|
-
}
|
|
147
|
-
function Ne(t) {
|
|
148
|
-
q(t.clientX, t.clientY), t.deltaY < 0 ? oe(H(t.deltaY)) : t.deltaY > 0 && G(H(t.deltaY)), e.update();
|
|
149
|
-
}
|
|
150
|
-
function ke(t) {
|
|
151
|
-
let o = !1;
|
|
152
|
-
switch (t.code) {
|
|
153
|
-
case e.keys.UP:
|
|
154
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : x(0, e.keyPanSpeed), o = !0;
|
|
155
|
-
break;
|
|
156
|
-
case e.keys.BOTTOM:
|
|
157
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : x(0, -e.keyPanSpeed), o = !0;
|
|
158
|
-
break;
|
|
159
|
-
case e.keys.LEFT:
|
|
160
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? C(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : x(e.keyPanSpeed, 0), o = !0;
|
|
161
|
-
break;
|
|
162
|
-
case e.keys.RIGHT:
|
|
163
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? C(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : x(-e.keyPanSpeed, 0), o = !0;
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
o && (t.preventDefault(), e.update());
|
|
167
|
-
}
|
|
168
|
-
function ie(t) {
|
|
169
|
-
if (c.length === 1)
|
|
170
|
-
P.set(t.pageX, t.pageY);
|
|
171
|
-
else {
|
|
172
|
-
const o = N(t), n = 0.5 * (t.pageX + o.x), i = 0.5 * (t.pageY + o.y);
|
|
173
|
-
P.set(n, i);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function se(t) {
|
|
177
|
-
if (c.length === 1)
|
|
178
|
-
O.set(t.pageX, t.pageY);
|
|
179
|
-
else {
|
|
180
|
-
const o = N(t), n = 0.5 * (t.pageX + o.x), i = 0.5 * (t.pageY + o.y);
|
|
181
|
-
O.set(n, i);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
function re(t) {
|
|
185
|
-
const o = N(t), n = t.pageX - o.x, i = t.pageY - o.y, l = Math.sqrt(n * n + i * i);
|
|
186
|
-
D.set(0, l);
|
|
187
|
-
}
|
|
188
|
-
function Se(t) {
|
|
189
|
-
e.enableZoom && re(t), e.enablePan && se(t);
|
|
190
|
-
}
|
|
191
|
-
function Ie(t) {
|
|
192
|
-
e.enableZoom && re(t), e.enableRotate && ie(t);
|
|
193
|
-
}
|
|
194
|
-
function ce(t) {
|
|
195
|
-
if (c.length == 1)
|
|
196
|
-
T.set(t.pageX, t.pageY);
|
|
197
|
-
else {
|
|
198
|
-
const n = N(t), i = 0.5 * (t.pageX + n.x), l = 0.5 * (t.pageY + n.y);
|
|
199
|
-
T.set(i, l);
|
|
200
|
-
}
|
|
201
|
-
A.subVectors(T, P).multiplyScalar(e.rotateSpeed);
|
|
202
|
-
const o = e.domElement;
|
|
203
|
-
C(2 * Math.PI * A.x / o.clientHeight), U(2 * Math.PI * A.y / o.clientHeight), P.copy(T);
|
|
204
|
-
}
|
|
205
|
-
function le(t) {
|
|
206
|
-
if (c.length === 1)
|
|
207
|
-
w.set(t.pageX, t.pageY);
|
|
208
|
-
else {
|
|
209
|
-
const o = N(t), n = 0.5 * (t.pageX + o.x), i = 0.5 * (t.pageY + o.y);
|
|
210
|
-
w.set(n, i);
|
|
211
|
-
}
|
|
212
|
-
L.subVectors(w, O).multiplyScalar(e.panSpeed), x(L.x, L.y), O.copy(w);
|
|
213
|
-
}
|
|
214
|
-
function ue(t) {
|
|
215
|
-
const o = N(t), n = t.pageX - o.x, i = t.pageY - o.y, l = Math.sqrt(n * n + i * i);
|
|
216
|
-
R.set(0, l), M.set(0, Math.pow(R.y / D.y, e.zoomSpeed)), G(M.y), D.copy(R);
|
|
217
|
-
const g = (t.pageX + o.x) * 0.5, d = (t.pageY + o.y) * 0.5;
|
|
218
|
-
q(g, d);
|
|
219
|
-
}
|
|
220
|
-
function Ce(t) {
|
|
221
|
-
e.enableZoom && ue(t), e.enablePan && le(t);
|
|
222
|
-
}
|
|
223
|
-
function Ye(t) {
|
|
224
|
-
e.enableZoom && ue(t), e.enableRotate && ce(t);
|
|
225
|
-
}
|
|
226
|
-
function de(t) {
|
|
227
|
-
e.enabled !== !1 && (c.length === 0 && (e.domElement.setPointerCapture(t.pointerId), e.domElement.addEventListener("pointermove", Q), e.domElement.addEventListener("pointerup", Y)), !Xe(t) && (Ue(t), t.pointerType === "touch" ? fe(t) : ze(t)));
|
|
228
|
-
}
|
|
229
|
-
function Q(t) {
|
|
230
|
-
e.enabled !== !1 && (t.pointerType === "touch" ? He(t) : _e(t));
|
|
231
|
-
}
|
|
232
|
-
function Y(t) {
|
|
233
|
-
switch (Ze(t), c.length) {
|
|
234
|
-
case 0:
|
|
235
|
-
e.domElement.releasePointerCapture(t.pointerId), e.domElement.removeEventListener("pointermove", Q), e.domElement.removeEventListener("pointerup", Y), e.dispatchEvent(we), r = a.NONE;
|
|
236
|
-
break;
|
|
237
|
-
case 1:
|
|
238
|
-
const o = c[0], n = I[o];
|
|
239
|
-
fe({ pointerId: o, pageX: n.x, pageY: n.y });
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function ze(t) {
|
|
244
|
-
let o;
|
|
245
|
-
switch (t.button) {
|
|
246
|
-
case 0:
|
|
247
|
-
o = e.mouseButtons.LEFT;
|
|
248
|
-
break;
|
|
249
|
-
case 1:
|
|
250
|
-
o = e.mouseButtons.MIDDLE;
|
|
251
|
-
break;
|
|
252
|
-
case 2:
|
|
253
|
-
o = e.mouseButtons.RIGHT;
|
|
254
|
-
break;
|
|
255
|
-
default:
|
|
256
|
-
o = -1;
|
|
257
|
-
}
|
|
258
|
-
switch (o) {
|
|
259
|
-
case k.DOLLY:
|
|
260
|
-
if (e.enableZoom === !1) return;
|
|
261
|
-
Le(t), r = a.DOLLY;
|
|
262
|
-
break;
|
|
263
|
-
case k.ROTATE:
|
|
264
|
-
if (t.ctrlKey || t.metaKey || t.shiftKey) {
|
|
265
|
-
if (e.enablePan === !1) return;
|
|
266
|
-
ae(t), r = a.PAN;
|
|
267
|
-
} else {
|
|
268
|
-
if (e.enableRotate === !1) return;
|
|
269
|
-
ne(t), r = a.ROTATE;
|
|
270
|
-
}
|
|
271
|
-
break;
|
|
272
|
-
case k.PAN:
|
|
273
|
-
if (t.ctrlKey || t.metaKey || t.shiftKey) {
|
|
274
|
-
if (e.enableRotate === !1) return;
|
|
275
|
-
ne(t), r = a.ROTATE;
|
|
276
|
-
} else {
|
|
277
|
-
if (e.enablePan === !1) return;
|
|
278
|
-
ae(t), r = a.PAN;
|
|
279
|
-
}
|
|
280
|
-
break;
|
|
281
|
-
default:
|
|
282
|
-
r = a.NONE;
|
|
283
|
-
}
|
|
284
|
-
r !== a.NONE && e.dispatchEvent(J);
|
|
285
|
-
}
|
|
286
|
-
function _e(t) {
|
|
287
|
-
switch (r) {
|
|
288
|
-
case a.ROTATE:
|
|
289
|
-
if (e.enableRotate === !1) return;
|
|
290
|
-
De(t);
|
|
291
|
-
break;
|
|
292
|
-
case a.DOLLY:
|
|
293
|
-
if (e.enableZoom === !1) return;
|
|
294
|
-
Re(t);
|
|
295
|
-
break;
|
|
296
|
-
case a.PAN:
|
|
297
|
-
if (e.enablePan === !1) return;
|
|
298
|
-
xe(t);
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function me(t) {
|
|
303
|
-
e.enabled === !1 || e.enableZoom === !1 || r !== a.NONE || (t.preventDefault(), e.dispatchEvent(J), Ne(Ke(t)), e.dispatchEvent(we));
|
|
304
|
-
}
|
|
305
|
-
function Ke(t) {
|
|
306
|
-
const o = t.deltaMode, n = {
|
|
307
|
-
clientX: t.clientX,
|
|
308
|
-
clientY: t.clientY,
|
|
309
|
-
deltaY: t.deltaY
|
|
310
|
-
};
|
|
311
|
-
switch (o) {
|
|
312
|
-
case 1:
|
|
313
|
-
n.deltaY *= 16;
|
|
314
|
-
break;
|
|
315
|
-
case 2:
|
|
316
|
-
n.deltaY *= 100;
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
return t.ctrlKey && !W && (n.deltaY *= 10), n;
|
|
320
|
-
}
|
|
321
|
-
function pe(t) {
|
|
322
|
-
t.key === "Control" && (W = !0, e.domElement.getRootNode().addEventListener("keyup", he, { passive: !0, capture: !0 }));
|
|
323
|
-
}
|
|
324
|
-
function he(t) {
|
|
325
|
-
t.key === "Control" && (W = !1, e.domElement.getRootNode().removeEventListener("keyup", he, { passive: !0, capture: !0 }));
|
|
326
|
-
}
|
|
327
|
-
function v(t) {
|
|
328
|
-
e.enabled === !1 || e.enablePan === !1 || ke(t);
|
|
329
|
-
}
|
|
330
|
-
function fe(t) {
|
|
331
|
-
switch (ye(t), c.length) {
|
|
332
|
-
case 1:
|
|
333
|
-
switch (e.touches.ONE) {
|
|
334
|
-
case S.ROTATE:
|
|
335
|
-
if (e.enableRotate === !1) return;
|
|
336
|
-
ie(t), r = a.TOUCH_ROTATE;
|
|
337
|
-
break;
|
|
338
|
-
case S.PAN:
|
|
339
|
-
if (e.enablePan === !1) return;
|
|
340
|
-
se(t), r = a.TOUCH_PAN;
|
|
341
|
-
break;
|
|
342
|
-
default:
|
|
343
|
-
r = a.NONE;
|
|
344
|
-
}
|
|
345
|
-
break;
|
|
346
|
-
case 2:
|
|
347
|
-
switch (e.touches.TWO) {
|
|
348
|
-
case S.DOLLY_PAN:
|
|
349
|
-
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
350
|
-
Se(t), r = a.TOUCH_DOLLY_PAN;
|
|
351
|
-
break;
|
|
352
|
-
case S.DOLLY_ROTATE:
|
|
353
|
-
if (e.enableZoom === !1 && e.enableRotate === !1) return;
|
|
354
|
-
Ie(t), r = a.TOUCH_DOLLY_ROTATE;
|
|
355
|
-
break;
|
|
356
|
-
default:
|
|
357
|
-
r = a.NONE;
|
|
358
|
-
}
|
|
359
|
-
break;
|
|
360
|
-
default:
|
|
361
|
-
r = a.NONE;
|
|
362
|
-
}
|
|
363
|
-
r !== a.NONE && e.dispatchEvent(J);
|
|
364
|
-
}
|
|
365
|
-
function He(t) {
|
|
366
|
-
switch (ye(t), r) {
|
|
367
|
-
case a.TOUCH_ROTATE:
|
|
368
|
-
if (e.enableRotate === !1) return;
|
|
369
|
-
ce(t), e.update();
|
|
370
|
-
break;
|
|
371
|
-
case a.TOUCH_PAN:
|
|
372
|
-
if (e.enablePan === !1) return;
|
|
373
|
-
le(t), e.update();
|
|
374
|
-
break;
|
|
375
|
-
case a.TOUCH_DOLLY_PAN:
|
|
376
|
-
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
377
|
-
Ce(t), e.update();
|
|
378
|
-
break;
|
|
379
|
-
case a.TOUCH_DOLLY_ROTATE:
|
|
380
|
-
if (e.enableZoom === !1 && e.enableRotate === !1) return;
|
|
381
|
-
Ye(t), e.update();
|
|
382
|
-
break;
|
|
383
|
-
default:
|
|
384
|
-
r = a.NONE;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
function be(t) {
|
|
388
|
-
e.enabled !== !1 && t.preventDefault();
|
|
389
|
-
}
|
|
390
|
-
function Ue(t) {
|
|
391
|
-
c.push(t.pointerId);
|
|
392
|
-
}
|
|
393
|
-
function Ze(t) {
|
|
394
|
-
delete I[t.pointerId];
|
|
395
|
-
for (let o = 0; o < c.length; o++)
|
|
396
|
-
if (c[o] == t.pointerId) {
|
|
397
|
-
c.splice(o, 1);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
function Xe(t) {
|
|
402
|
-
for (let o = 0; o < c.length; o++)
|
|
403
|
-
if (c[o] == t.pointerId) return !0;
|
|
404
|
-
return !1;
|
|
405
|
-
}
|
|
406
|
-
function ye(t) {
|
|
407
|
-
let o = I[t.pointerId];
|
|
408
|
-
o === void 0 && (o = new m(), I[t.pointerId] = o), o.set(t.pageX, t.pageY);
|
|
409
|
-
}
|
|
410
|
-
function N(t) {
|
|
411
|
-
const o = t.pointerId === c[0] ? c[1] : c[0];
|
|
412
|
-
return I[o];
|
|
413
|
-
}
|
|
414
|
-
e.domElement.addEventListener("contextmenu", be), e.domElement.addEventListener("pointerdown", de), e.domElement.addEventListener("pointercancel", Y), e.domElement.addEventListener("wheel", me, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", pe, { passive: !0, capture: !0 }), this.update();
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
export {
|
|
418
|
-
et as O
|
|
419
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./three-viewport-gizmo-CwaL5sMV.cjs"),H=/^[og]\s*(.+)?/,N=/^mtllib /,q=/^usemtl /,J=/^usemap /,R=/\s+/,G=new c.Vector3,z=new c.Vector3,D=new c.Vector3,E=new c.Vector3,j=new c.Vector3,I=new c.Color;function W(){const P={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,s){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=s!==!1;return}const i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:s!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,r){const h=this._finalize(!1);h&&(h.inherited||h.groupCount<=0)&&this.materials.splice(h.index,1);const u={index:this.materials.length,name:t||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:h!==void 0?h.smooth:this.smooth,groupStart:h!==void 0?h.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const n={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return n.clone=this.clone.bind(n),n}};return this.materials.push(u),u},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),t&&this.materials.length>1)for(let h=this.materials.length-1;h>=0;h--)this.materials[h].groupCount<=0&&this.materials.splice(h,1);return t&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},i&&i.name&&typeof i.clone=="function"){const t=i.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/3)*3},parseNormalIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/3)*3},parseUVIndex:function(e,s){const i=parseInt(e,10);return(i>=0?i-1:i+s/2)*2},addVertex:function(e,s,i){const t=this.vertices,r=this.object.geometry.vertices;r.push(t[e+0],t[e+1],t[e+2]),r.push(t[s+0],t[s+1],t[s+2]),r.push(t[i+0],t[i+1],t[i+2])},addVertexPoint:function(e){const s=this.vertices;this.object.geometry.vertices.push(s[e+0],s[e+1],s[e+2])},addVertexLine:function(e){const s=this.vertices;this.object.geometry.vertices.push(s[e+0],s[e+1],s[e+2])},addNormal:function(e,s,i){const t=this.normals,r=this.object.geometry.normals;r.push(t[e+0],t[e+1],t[e+2]),r.push(t[s+0],t[s+1],t[s+2]),r.push(t[i+0],t[i+1],t[i+2])},addFaceNormal:function(e,s,i){const t=this.vertices,r=this.object.geometry.normals;G.fromArray(t,e),z.fromArray(t,s),D.fromArray(t,i),j.subVectors(D,z),E.subVectors(G,z),j.cross(E),j.normalize(),r.push(j.x,j.y,j.z),r.push(j.x,j.y,j.z),r.push(j.x,j.y,j.z)},addColor:function(e,s,i){const t=this.colors,r=this.object.geometry.colors;t[e]!==void 0&&r.push(t[e+0],t[e+1],t[e+2]),t[s]!==void 0&&r.push(t[s+0],t[s+1],t[s+2]),t[i]!==void 0&&r.push(t[i+0],t[i+1],t[i+2])},addUV:function(e,s,i){const t=this.uvs,r=this.object.geometry.uvs;r.push(t[e+0],t[e+1]),r.push(t[s+0],t[s+1]),r.push(t[i+0],t[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const s=this.uvs;this.object.geometry.uvs.push(s[e+0],s[e+1])},addFace:function(e,s,i,t,r,h,u,l,n){const o=this.vertices.length;let a=this.parseVertexIndex(e,o),f=this.parseVertexIndex(s,o),m=this.parseVertexIndex(i,o);if(this.addVertex(a,f,m),this.addColor(a,f,m),u!==void 0&&u!==""){const g=this.normals.length;a=this.parseNormalIndex(u,g),f=this.parseNormalIndex(l,g),m=this.parseNormalIndex(n,g),this.addNormal(a,f,m)}else this.addFaceNormal(a,f,m);if(t!==void 0&&t!==""){const g=this.uvs.length;a=this.parseUVIndex(t,g),f=this.parseUVIndex(r,g),m=this.parseUVIndex(h,g),this.addUV(a,f,m),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const s=this.vertices.length;for(let i=0,t=e.length;i<t;i++){const r=this.parseVertexIndex(e[i],s);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,s){this.object.geometry.type="Line";const i=this.vertices.length,t=this.uvs.length;for(let r=0,h=e.length;r<h;r++)this.addVertexLine(this.parseVertexIndex(e[r],i));for(let r=0,h=s.length;r<h;r++)this.addUVLine(this.parseUVIndex(s[r],t))}};return P.startObject("",!1),P}class Z extends c.Loader{constructor(e){super(e),this.materials=null}load(e,s,i,t){const r=this,h=new c.FileLoader(this.manager);h.setPath(this.path),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s(r.parse(u))}catch(l){t?t(l):console.error(l),r.manager.itemError(e)}},i,t)}setMaterials(e){return this.materials=e,this}parse(e){const s=new W;e.indexOf(`\r
|
|
2
|
-
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
3
|
-
`)),e.indexOf(`\\
|
|
4
|
-
`)!==-1&&(e=e.replace(/\\\n/g,""));const i=e.split(`
|
|
5
|
-
`);let t=[];for(let u=0,l=i.length;u<l;u++){const n=i[u].trimStart();if(n.length===0)continue;const o=n.charAt(0);if(o!=="#")if(o==="v"){const a=n.split(R);switch(a[0]){case"v":s.vertices.push(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3])),a.length>=7?(I.setRGB(parseFloat(a[4]),parseFloat(a[5]),parseFloat(a[6])).convertSRGBToLinear(),s.colors.push(I.r,I.g,I.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]));break;case"vt":s.uvs.push(parseFloat(a[1]),parseFloat(a[2]));break}}else if(o==="f"){const f=n.slice(1).trim().split(R),m=[];for(let p=0,b=f.length;p<b;p++){const x=f[p];if(x.length>0){const w=x.split("/");m.push(w)}}const g=m[0];for(let p=1,b=m.length-1;p<b;p++){const x=m[p],w=m[p+1];s.addFace(g[0],x[0],w[0],g[1],x[1],w[1],g[2],x[2],w[2])}}else if(o==="l"){const a=n.substring(1).trim().split(" ");let f=[];const m=[];if(n.indexOf("/")===-1)f=a;else for(let g=0,p=a.length;g<p;g++){const b=a[g].split("/");b[0]!==""&&f.push(b[0]),b[1]!==""&&m.push(b[1])}s.addLineGeometry(f,m)}else if(o==="p"){const f=n.slice(1).trim().split(" ");s.addPointGeometry(f)}else if((t=H.exec(n))!==null){const a=(" "+t[0].slice(1).trim()).slice(1);s.startObject(a)}else if(q.test(n))s.object.startMaterial(n.substring(7).trim(),s.materialLibraries);else if(N.test(n))s.materialLibraries.push(n.substring(7).trim());else if(J.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(o==="s"){if(t=n.split(" "),t.length>1){const f=t[1].trim().toLowerCase();s.object.smooth=f!=="0"&&f!=="off"}else s.object.smooth=!0;const a=s.object.currentMaterial();a&&(a.smooth=s.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}}s.finalize();const r=new c.Group;if(r.materialLibraries=[].concat(s.materialLibraries),!(s.objects.length===1&&s.objects[0].geometry.vertices.length===0)===!0)for(let u=0,l=s.objects.length;u<l;u++){const n=s.objects[u],o=n.geometry,a=n.materials,f=o.type==="Line",m=o.type==="Points";let g=!1;if(o.vertices.length===0)continue;const p=new c.BufferGeometry;p.setAttribute("position",new c.Float32BufferAttribute(o.vertices,3)),o.normals.length>0&&p.setAttribute("normal",new c.Float32BufferAttribute(o.normals,3)),o.colors.length>0&&(g=!0,p.setAttribute("color",new c.Float32BufferAttribute(o.colors,3))),o.hasUVIndices===!0&&p.setAttribute("uv",new c.Float32BufferAttribute(o.uvs,2));const b=[];for(let w=0,M=a.length;w<M;w++){const L=a[w],A=L.name+"_"+L.smooth+"_"+g;let d=s.materials[A];if(this.materials!==null){if(d=this.materials.create(L.name),f&&d&&!(d instanceof c.LineBasicMaterial)){const y=new c.LineBasicMaterial;c.Material.prototype.copy.call(y,d),y.color.copy(d.color),d=y}else if(m&&d&&!(d instanceof c.PointsMaterial)){const y=new c.PointsMaterial({size:10,sizeAttenuation:!1});c.Material.prototype.copy.call(y,d),y.color.copy(d.color),y.map=d.map,d=y}}d===void 0&&(f?d=new c.LineBasicMaterial:m?d=new c.PointsMaterial({size:1,sizeAttenuation:!1}):d=new c.MeshPhongMaterial,d.name=L.name,d.flatShading=!L.smooth,d.vertexColors=g,s.materials[A]=d),b.push(d)}let x;if(b.length>1){for(let w=0,M=a.length;w<M;w++){const L=a[w];p.addGroup(L.groupStart,L.groupCount,w)}f?x=new c.LineSegments(p,b):m?x=new c.Points(p,b):x=new c.Mesh(p,b)}else f?x=new c.LineSegments(p,b[0]):m?x=new c.Points(p,b[0]):x=new c.Mesh(p,b[0]);x.name=n.name,r.add(x)}else if(s.vertices.length>0){const u=new c.PointsMaterial({size:1,sizeAttenuation:!1}),l=new c.BufferGeometry;l.setAttribute("position",new c.Float32BufferAttribute(s.vertices,3)),s.colors.length>0&&s.colors[0]!==void 0&&(l.setAttribute("color",new c.Float32BufferAttribute(s.colors,3)),u.vertexColors=!0);const n=new c.Points(l,u);r.add(n)}return r}}class X extends c.Loader{constructor(e){super(e)}load(e,s,i,t){const r=this,h=this.path===""?c.LoaderUtils.extractUrlBase(e):this.path,u=new c.FileLoader(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(e,function(l){try{s(r.parse(l,h))}catch(n){t?t(n):console.error(n),r.manager.itemError(e)}},i,t)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,s){const i=e.split(`
|
|
6
|
-
`);let t={};const r=/\s+/,h={};for(let l=0;l<i.length;l++){let n=i[l];if(n=n.trim(),n.length===0||n.charAt(0)==="#")continue;const o=n.indexOf(" ");let a=o>=0?n.substring(0,o):n;a=a.toLowerCase();let f=o>=0?n.substring(o+1):"";if(f=f.trim(),a==="newmtl")t={name:f},h[f]=t;else if(a==="ka"||a==="kd"||a==="ks"||a==="ke"){const m=f.split(r,3);t[a]=[parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])]}else t[a]=f}const u=new Y(this.resourcePath||s,this.materialOptions);return u.setCrossOrigin(this.crossOrigin),u.setManager(this.manager),u.setMaterials(h),u}}class Y{constructor(e="",s={}){this.baseUrl=e,this.options=s,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:c.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:c.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const s={};for(const i in e){const t=e[i],r={};s[i]=r;for(const h in t){let u=!0,l=t[h];const n=h.toLowerCase();switch(n){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(u=!1);break}u&&(r[n]=l)}}return s}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const s in this.materialsInfo)this.materialsArray[e]=this.create(s),this.nameLookup[s]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const s=this,i=this.materialsInfo[e],t={name:e,side:this.side};function r(u,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:u+l}function h(u,l){if(t[u])return;const n=s.getTextureParams(l,t),o=s.loadTexture(r(s.baseUrl,n.url));o.repeat.copy(n.scale),o.offset.copy(n.offset),o.wrapS=s.wrap,o.wrapT=s.wrap,(u==="map"||u==="emissiveMap")&&(o.colorSpace=c.SRGBColorSpace),t[u]=o}for(const u in i){const l=i[u];let n;if(l!=="")switch(u.toLowerCase()){case"kd":t.color=new c.Color().fromArray(l).convertSRGBToLinear();break;case"ks":t.specular=new c.Color().fromArray(l).convertSRGBToLinear();break;case"ke":t.emissive=new c.Color().fromArray(l).convertSRGBToLinear();break;case"map_kd":h("map",l);break;case"map_ks":h("specularMap",l);break;case"map_ke":h("emissiveMap",l);break;case"norm":h("normalMap",l);break;case"map_bump":case"bump":h("bumpMap",l);break;case"map_d":h("alphaMap",l),t.transparent=!0;break;case"ns":t.shininess=parseFloat(l);break;case"d":n=parseFloat(l),n<1&&(t.opacity=n,t.transparent=!0);break;case"tr":n=parseFloat(l),this.options&&this.options.invertTrProperty&&(n=1-n),n>0&&(t.opacity=1-n,t.transparent=!0);break}}return this.materials[e]=new c.MeshPhongMaterial(t),this.materials[e]}getTextureParams(e,s){const i={scale:new c.Vector2(1,1),offset:new c.Vector2(0,0)},t=e.split(/\s+/);let r;return r=t.indexOf("-bm"),r>=0&&(s.bumpScale=parseFloat(t[r+1]),t.splice(r,2)),r=t.indexOf("-s"),r>=0&&(i.scale.set(parseFloat(t[r+1]),parseFloat(t[r+2])),t.splice(r,4)),r=t.indexOf("-o"),r>=0&&(i.offset.set(parseFloat(t[r+1]),parseFloat(t[r+2])),t.splice(r,4)),i.url=t.join(" ").trim(),i}loadTexture(e,s,i,t,r){const h=this.manager!==void 0?this.manager:c.DefaultLoadingManager;let u=h.getHandler(e);u===null&&(u=new c.TextureLoader(h)),u.setCrossOrigin&&u.setCrossOrigin(this.crossOrigin);const l=u.load(e,i,t,r);return s!==void 0&&(l.mapping=s),l}}class K extends c.Loader{constructor(e){super(e)}load(e,s,i,t){const r=this,h=new c.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s(r.parse(u))}catch(l){t?t(l):console.error(l),r.manager.itemError(e)}},i,t)}parse(e){function s(n){const o=new DataView(n),a=32/8*3+32/8*3*3+16/8,f=o.getUint32(80,!0);if(80+32/8+f*a===o.byteLength)return!0;const g=[115,111,108,105,100];for(let p=0;p<5;p++)if(i(g,o,p))return!1;return!0}function i(n,o,a){for(let f=0,m=n.length;f<m;f++)if(n[f]!==o.getUint8(a+f))return!1;return!0}function t(n){const o=new DataView(n),a=o.getUint32(80,!0);let f,m,g,p=!1,b,x,w,M,L;for(let v=0;v<70;v++)o.getUint32(v,!1)==1129270351&&o.getUint8(v+4)==82&&o.getUint8(v+5)==61&&(p=!0,b=new Float32Array(a*3*3),x=o.getUint8(v+6)/255,w=o.getUint8(v+7)/255,M=o.getUint8(v+8)/255,L=o.getUint8(v+9)/255);const A=84,d=12*4+2,y=new c.BufferGeometry,C=new Float32Array(a*3*3),_=new Float32Array(a*3*3),B=new c.Color;for(let v=0;v<a;v++){const k=A+v*d,O=o.getFloat32(k,!0),U=o.getFloat32(k+4,!0),S=o.getFloat32(k+8,!0);if(p){const F=o.getUint16(k+48,!0);(F&32768)===0?(f=(F&31)/31,m=(F>>5&31)/31,g=(F>>10&31)/31):(f=x,m=w,g=M)}for(let F=1;F<=3;F++){const T=k+F*12,V=v*3*3+(F-1)*3;C[V]=o.getFloat32(T,!0),C[V+1]=o.getFloat32(T+4,!0),C[V+2]=o.getFloat32(T+8,!0),_[V]=O,_[V+1]=U,_[V+2]=S,p&&(B.set(f,m,g).convertSRGBToLinear(),b[V]=B.r,b[V+1]=B.g,b[V+2]=B.b)}}return y.setAttribute("position",new c.BufferAttribute(C,3)),y.setAttribute("normal",new c.BufferAttribute(_,3)),p&&(y.setAttribute("color",new c.BufferAttribute(b,3)),y.hasColors=!0,y.alpha=L),y}function r(n){const o=new c.BufferGeometry,a=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,m=/solid\s(.+)/;let g=0;const p=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,b=new RegExp("vertex"+p+p+p,"g"),x=new RegExp("normal"+p+p+p,"g"),w=[],M=[],L=[],A=new c.Vector3;let d,y=0,C=0,_=0;for(;(d=a.exec(n))!==null;){C=_;const B=d[0],v=(d=m.exec(B))!==null?d[1]:"";for(L.push(v);(d=f.exec(B))!==null;){let U=0,S=0;const F=d[0];for(;(d=x.exec(F))!==null;)A.x=parseFloat(d[1]),A.y=parseFloat(d[2]),A.z=parseFloat(d[3]),S++;for(;(d=b.exec(F))!==null;)w.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),M.push(A.x,A.y,A.z),U++,_++;S!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+g),U!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+g),g++}const k=C,O=_-C;o.userData.groupNames=L,o.addGroup(k,O,y),y++}return o.setAttribute("position",new c.Float32BufferAttribute(w,3)),o.setAttribute("normal",new c.Float32BufferAttribute(M,3)),o}function h(n){return typeof n!="string"?new TextDecoder().decode(n):n}function u(n){if(typeof n=="string"){const o=new Uint8Array(n.length);for(let a=0;a<n.length;a++)o[a]=n.charCodeAt(a)&255;return o.buffer||o}else return n}const l=u(e);return s(l)?t(l):r(h(e))}}exports.MTLLoader=X;exports.OBJLoader=Z;exports.STLLoader=K;
|