Agriculture-front-end/public/Cesium/Workers/PolylineVolumeGeometryLibrary-c92e851a.js

2 lines
9.9 KiB
JavaScript
Raw Normal View History

2023-04-16 22:33:44 +08:00
define(["exports","./Cartesian2-47311507","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./EllipsoidTangentPlane-edb321d3","./Math-119be1a3","./PrimitiveType-a54dc62f","./PolylinePipeline-11e50058","./GeometryAttribute-3a88ba31"],(function(a,e,r,t,n,i,s,o,l){"use strict";var C=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2}),c=[new r.Cartesian3,new r.Cartesian3],u=new r.Cartesian3,y=new r.Cartesian3,m=new r.Cartesian3,d=new r.Cartesian3,p=new r.Cartesian3,f=new r.Cartesian3,g=new r.Cartesian3,v=new r.Cartesian3,h=new r.Cartesian3,w=new r.Cartesian3,x=new r.Cartesian3,P={},M=new r.Cartographic;function E(a,e){for(var r=new Array(a.length),t=0;t<a.length;t++){var n=a[t];M=e.cartesianToCartographic(n,M),r[t]=M.height,a[t]=e.scaleToGeodeticSurface(n,n)}return r}function B(a,e,t,n){var i,s=a[0],o=a[1],l=r.Cartesian3.angleBetween(s,o),C=Math.ceil(l/n),c=new Array(C);if(e===t){for(i=0;i<C;i++)c[i]=e;return c.push(t),c}var u=(t-e)/C;for(i=1;i<C;i++){var y=e+i*u;c[i]=y}return c[0]=e,c.push(t),c}var T=new r.Cartesian3,z=new r.Cartesian3;function S(a,t,i,s){var o=new n.EllipsoidTangentPlane(i,s),l=o.projectPointOntoPlane(r.Cartesian3.add(i,a,T),T),C=o.projectPointOntoPlane(r.Cartesian3.add(i,t,z),z),c=e.Cartesian2.angleBetween(l,C);return C.x*l.y-C.y*l.x>=0?-c:c}var A=new r.Cartesian3(-1,0,0),b=s.Matrix4.clone(s.Matrix4.IDENTITY),D=new s.Matrix4,N=new s.Matrix3,O=s.Matrix3.IDENTITY.clone(),V=new r.Cartesian3,R=new t.Cartesian4,I=new r.Cartesian3;function L(a,e,t,n,i,o,C,c){var u=V,y=R;b=l.Transforms.eastNorthUpToFixedFrame(a,i,b),u=s.Matrix4.multiplyByPointAsVector(b,A,u);var m=S(u=r.Cartesian3.normalize(u,u),e,a,i);N=s.Matrix3.fromRotationZ(m,N),I.z=o,b=s.Matrix4.multiplyTransformation(b,s.Matrix4.fromRotationTranslation(N,I,D),b);var d=O;d[0]=C;for(var p=0;p<c;p++)for(var f=0;f<t.length;f+=3)y=r.Cartesian3.fromArray(t,f,y),y=s.Matrix3.multiplyByVector(d,y,y),y=s.Matrix4.multiplyByPoint(b,y,y),n.push(y.x,y.y,y.z);return n}function F(a,e,t,n,i,o,C,c,u){var y=V,m=R;b=l.Transforms.eastNorthUpToFixedFrame(a,i,b),y=s.Matrix4.multiplyByPointAsVector(b,A,y);var d=S(y=r.Cartesian3.normalize(y,y),e,a,i);N=s.Matrix3.fromRotationZ(d,N),I.z=o,b=s.Matrix4.multiplyTransformation(b,s.Matrix4.fromRotationTranslation(N,I,D),b);var p=O;p[0]=C;for(var f=0;f<c;f++)for(var g=0;g<t.length;g+=3)m=r.Cartesian3.fromArray(t,g,m),m=s.Matrix3.multiplyByVector(p,m,m),m=s.Matrix4.multiplyByPoint(b,m,m),m=s.Matrix4.multiplyByPoint(u,m,m),n.push(m.x,m.y,m.z);return n}var G=new r.Cartesian3;function U(a,e,t,n,i,s,o){for(var l=0;l<a.length;l+=3){n=L(r.Cartesian3.fromArray(a,l,G),e,t,n,i,s[l/3],o,1)}return n}function _(a,e){var r=a.length,t=new Array(6*r),n=0,i=e.x+e.width/2,s=e.y+e.height/2,o=a[0];t[n++]=o.x-i,t[n++]=0,t[n++]=o.y-s;for(var l=1;l<r;l++){var C=(o=a[l]).x-i,c=o.y-s;t[n++]=C,t[n++]=0,t[n++]=c,t[n++]=C,t[n++]=0,t[n++]=c}return o=a[0],t[n++]=o.x-i,t[n++]=0,t[n++]=o.y-s,t}function j(a,e){for(var r=a.length,t=new Array(3*r),n=0,i=e.x+e.width/2,s=e.y+e.height/2,o=0;o<r;o++)t[n++]=a[o].x-i,t[n++]=0,t[n++]=a[o].y-s;return t}var Q=new l.Quaternion,q=new r.Cartesian3,Y=new s.Matrix3;function Z(a,e,t,n,o,c,u,y,m,d){var p,f,g=r.Cartesian3.angleBetween(r.Cartesian3.subtract(e,a,w),r.Cartesian3.subtract(t,a,x)),v=n===C.BEVELED?0:Math.ceil(g/i.CesiumMath.toRadians(5));if(p=o?s.Matrix3.fromQuaternion(l.Quaternion.fromAxisAngle(r.Cartesian3.negate(a,w),g/(v+1),Q),Y):s.Matrix3.fromQuaternion(l.Quaternion.fromAxisAngle(a,g/(v+1),Q),Y),e=r.Cartesian3.clone(e,q),v>0)for(var h=d?2:1,P=0;P<v;P++)e=s.Matrix3.multiplyByVector(p,e,e),f=r.Cartesian3.subtract(e,a,w),f=r.Cartesian3.normalize(f,f),o||(f=r.Cartesian3.negate(f,f)),u=L(c.scaleToGeodeticSurface(e,x),f,y,u,c,m,1,h);else f=r.Cartesian3.subtract(e,a,w),f=r.Cartesian3.normalize(f,f),o||(f=r.Cartesian3.negate(f,f)),u=L(c.scaleToGeodeticSurface(e,x),f,y,u,c,m,1,1),t=r.Cartesian3.clone(t,q),f=r.Cartesian3.subtract(t,a,w),f=r.Cartesian3.normalize(f,f),o||(f=r.Cartesian3.negate(f,f)),u=L(c.scaleToGeodeticSurface(t,x),f,y,u,c,m,1,1);return u}P.removeDuplicatesFromShape=function(a){for(var r=a.length,t=[],n=r-1,i=0;i<r;n=i++