Agriculture-front-end/public/Cesium/Workers/PolylineVolumeGeometryLibrary-3333255c.js

2 lines
9.9 KiB
JavaScript
Raw Normal View History

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