@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.15 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{length as t,normalize as i,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class h{constructor(t,i,s,h,o){this.vertices=t,this.positionsES=i,this.offset=h,this.positions=o;const n=t.length,g=Math.floor(n/2),v=this.offset+3*g,r=s[v],f=s[v+1],c=s[v+2];this.origin=e(r,f,c);const l=this.offset+3*n;for(let e=this.offset;e<l;e+=3)o[e]=s[e]-r,o[e+1]=s[e+1]-f,o[e+2]=s[e+2]-c;this.updatePathVertexInformation()}updatePathVertexInformation(){const e=this.vertices.length,h=this.vertices[0];let o=this.offset;const n=this.positions;h.vRight[0]=n[o+3]-n[o],h.vRight[1]=n[o+4]-n[o+1],h.vRight[2]=n[o+5]-n[o+2],o+=3;let g=t(h.vRight);h.vMinSiblingLength=g,i(h.vRight,h.vRight);let v=h;for(let r=1;r<e;++r){const h=this.vertices[r];if(h.vLeft=v.vRight,r<e-1){h.vRight[0]=n[o+3]-n[o],h.vRight[1]=n[o+4]-n[o+1],h.vRight[2]=n[o+5]-n[o+2];const s=t(h.vRight);h.vMinSiblingLength=Math.min(g,s),g=s,i(h.vRight,h.vRight)}else s(h.vRight,h.vLeft),h.vMinSiblingLength=g;v=h,o+=3}}}export{h as Path};