1 |
- define(["exports","./Cartographic-67e73ef9","./PolylineVolumeGeometryLibrary-9a645937","./when-92c6cf3c","./Math-92c3b5f7","./PrimitiveType-cdfe443e","./PolylinePipeline-c0932bf7","./GeometryAttribute-ef657318"],(function(t,e,r,a,n,i,o,l){"use strict";var s={},c=new e.t,u=new e.t,y=new e.t,d=new e.t,p=[new e.t,new e.t],m=new e.t,g=new e.t,f=new e.t,h=new e.t,w=new e.t,z=new e.t,S=new e.t,v=new e.t,x=new e.t,A=new e.t,B=new l.n,E=new i.p;function b(t,a,o,s,y){var d,p=e.t.angleBetween(e.t.subtract(a,t,c),e.t.subtract(o,t,u)),m=s===r.S.BEVELED?1:Math.ceil(p/n.e.toRadians(5))+1,g=3*m,f=new Array(g);f[g-3]=o.x,f[g-2]=o.y,f[g-1]=o.z,d=y?i.p.fromQuaternion(l.n.fromAxisAngle(e.t.negate(t,c),p/m,B),E):i.p.fromQuaternion(l.n.fromAxisAngle(t,p/m,B),E);var h=0;a=e.t.clone(a,c);for(var w=0;w<m;w++)a=i.p.multiplyByVector(d,a,a),f[h++]=a.x,f[h++]=a.y,f[h++]=a.z;return f}function D(t,r,a,n){var i=c;return n||(r=e.t.negate(r,r)),[(i=e.t.add(t,r,i)).x,i.y,i.z,a.x,a.y,a.z]}function P(t,r,a,n){for(var i=new Array(t.length),o=new Array(t.length),l=e.t.multiplyByScalar(r,a,c),s=e.t.negate(l,u),p=0,m=t.length-1,g=0;g<t.length;g+=3){var f=e.t.fromArray(t,g,y),h=e.t.add(f,s,d);i[p++]=h.x,i[p++]=h.y,i[p++]=h.z;var w=e.t.add(f,l,d);o[m--]=w.z,o[m--]=w.y,o[m--]=w.x}return n.push(i,o),n}s.addAttribute=function(t,e,r,n){var i=e.x,o=e.y,l=e.z;a.e(r)&&(t[r]=i,t[r+1]=o,t[r+2]=l),a.e(n)&&(t[n]=l,t[n-1]=o,t[n-2]=i)};var N=new e.t,O=new e.t;s.computePositions=function(t){var a=t.granularity,i=t.positions,l=t.ellipsoid,s=t.width/2,u=t.cornerType,y=t.saveAttributes,d=m,B=g,E=f,R=h,L=w,U=z,V=S,M=v,G=x,T=A,I=[],Q=y?[]:void 0,q=y?[]:void 0,C=i[0],J=i[1];B=e.t.normalize(e.t.subtract(J,C,B),B),d=l.geodeticSurfaceNormal(C,d),R=e.t.normalize(e.t.cross(d,B,R),R),y&&(Q.push(R.x,R.y,R.z),q.push(d.x,d.y,d.z)),V=e.t.clone(C,V),C=J,E=e.t.negate(B,E);var j,k,F=[],H=i.length;for(j=1;j<H-1;j++){d=l.geodeticSurfaceNormal(C,d),J=i[j+1],B=e.t.normalize(e.t.subtract(J,C,B),B),L=e.t.normalize(e.t.add(B,E,L),L);var K=e.t.multiplyByScalar(d,e.t.dot(B,d),N);e.t.subtract(B,K,K),e.t.normalize(K,K);var W=e.t.multiplyByScalar(d,e.t.dot(E,d),O);if(e.t.subtract(E,W,W),e.t.normalize(W,W),!n.e.equalsEpsilon(Math.abs(e.t.dot(K,W)),1,n.e.EPSILON7)){L=e.t.cross(L,d,L),L=e.t.cross(d,L,L),L=e.t.normalize(L,L);var X=s/Math.max(.25,e.t.magnitude(e.t.cross(L,E,c))),Y=r.J.angleIsGreaterThanPi(B,E,C,l);L=e.t.multiplyByScalar(L,X,L),Y?(M=e.t.add(C,L,M),T=e.t.add(M,e.t.multiplyByScalar(R,s,T),T),G=e.t.add(M,e.t.multiplyByScalar(R,2*s,G),G),p[0]=e.t.clone(V,p[0]),p[1]=e.t.clone(T,p[1]),I=P(o.m.generateArc({positions:p,granularity:a,ellipsoid:l}),R,s,I),y&&(Q.push(R.x,R.y,R.z),q.push(d.x,d.y,d.z)),U=e.t.clone(G,U),R=e.t.normalize(e.t.cross(d,B,R),R),G=e.t.add(M,e.t.multiplyByScalar(R,2*s,G),G),V=e.t.add(M,e.t.multiplyByScalar(R,s,V),V),u===r.S.ROUNDED||u===r.S.BEVELED?F.push({leftPositions:b(M,U,G,u,Y)}):F.push({leftPositions:D(C,e.t.negate(L,L),G,Y)})):(G=e.t.add(C,L,G),T=e.t.add(G,e.t.negate(e.t.multiplyByScalar(R,s,T),T),T),M=e.t.add(G,e.t.negate(e.t.multiplyByScalar(R,2*s,M),M),M),p[0]=e.t.clone(V,p[0]),p[1]=e.t.clone(T,p[1]),I=P(o.m.generateArc({positions:p,granularity:a,ellipsoid:l}),R,s,I),y&&(Q.push(R.x,R.y,R.z),q.push(d.x,d.y,d.z)),U=e.t.clone(M,U),R=e.t.normalize(e.t.cross(d,B,R),R),M=e.t.add(G,e.t.negate(e.t.multiplyByScalar(R,2*s,M),M),M),V=e.t.add(G,e.t.negate(e.t.multiplyByScalar(R,s,V),V),V),u===r.S.ROUNDED||u===r.S.BEVELED?F.push({rightPositions:b(G,U,M,u,Y)}):F.push({rightPositions:D(C,L,M,Y)})),E=e.t.negate(B,E)}C=J}return d=l.geodeticSurfaceNormal(C,d),p[0]=e.t.clone(V,p[0]),p[1]=e.t.clone(C,p[1]),I=P(o.m.generateArc({positions:p,granularity:a,ellipsoid:l}),R,s,I),y&&(Q.push(R.x,R.y,R.z),q.push(d.x,d.y,d.z)),u===r.S.ROUNDED&&(k=function(t){var a=m,n=g,i=f,o=t[1];n=e.t.fromArray(t[1],o.length-3,n),i=e.t.fromArray(t[0],0,i);var l=b(a=e.t.midpoint(n,i,a),n,i,r.S.ROUNDED,!1),s=t.length-1,c=t[s-1];return o=t[s],n=e.t.fromArray(c,c.length-3,n),i=e.t.fromArray(o,0,i),[l,b(a=e.t.midpoint(n,i,a),n,i,r.S.ROUNDED,!1)]}(I)),{positions:I,corners:F,lefts:Q,normals:q,endPositions:k}},t.b=s}));
|