Agriculture-front-end/dist/Cesium/Workers/createPolygonGeometry.js

2 lines
15 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./when-b60132fc","./Cartesian2-47311507","./ArcType-29cf2197","./arrayFill-4513d7ad","./BoundingRectangle-01b3e970","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./EllipsoidGeodesic-0f19ac62","./EllipsoidTangentPlane-b2b18d75","./GeometryAttribute-3a42bbdc","./GeometryInstance-41780fb6","./GeometryOffsetAttribute-fbeb6f1a","./GeometryPipeline-e1b82a4e","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolygonGeometryLibrary-ae9ad77c","./PolygonPipeline-f49953b9","./Transforms-cb0006b0","./VertexFormat-6446fca0","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./PrimitiveType-39acab88","./AttributeCompression-90851096","./EncodedCartesian3-f1396b05","./arrayRemoveDuplicates-d2f048c5","./EllipsoidRhumbLine-ed1a6bf4","./GeometryAttributes-252e9929","./earcut-2.2.1-20c8012f","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206"],(function(e,t,a,r,o,i,n,s,l,u,c,p,y,d,g,m,h,f,b,v,_,P,x,C,w,T,A,E,I,G,V,F,N,H,O){"use strict";var R=new n.Cartographic,D=new n.Cartographic;function L(e,t,a,r){var o=r.cartesianToCartographic(e,R).height,i=r.cartesianToCartographic(t,D);i.height=o,r.cartographicToCartesian(i,t);var n=r.cartesianToCartographic(a,D);n.height=o-100,r.cartographicToCartesian(n,a)}var M=new o.BoundingRectangle,S=new n.Cartesian3,B=new n.Cartesian3,k=new n.Cartesian3,z=new n.Cartesian3,Y=new n.Cartesian3,U=new n.Cartesian3,W=new n.Cartesian3,j=new n.Cartesian3,Q=new n.Cartesian3,q=new t.Cartesian2,K=new t.Cartesian2,Z=new n.Cartesian3,J=new v.Quaternion,X=new i.Matrix3,$=new i.Matrix3;function ee(a){var o=a.vertexFormat,s=a.geometry,u=a.shadowVolume,c=s.attributes.position.values,y=c.length,g=a.wall,m=a.top||g,f=a.bottom||g;if(o.st||o.normal||o.tangent||o.bitangent||u){var b=a.boundingRectangle,_=a.tangentPlane,P=a.ellipsoid,x=a.stRotation,C=a.perPositionHeight,w=q;w.x=b.x,w.y=b.y;var T,A=o.st?new Float32Array(y/3*2):void 0;o.normal&&(T=C&&m&&!g?s.attributes.normal.values:new Float32Array(y));var E=o.tangent?new Float32Array(y):void 0,I=o.bitangent?new Float32Array(y):void 0,G=u?new Float32Array(y):void 0,V=0,F=0,N=B,H=k,O=z,R=!0,D=X,M=$;if(0!==x){var ee=v.Quaternion.fromAxisAngle(_._plane.normal,x,J);D=i.Matrix3.fromQuaternion(ee,D),ee=v.Quaternion.fromAxisAngle(_._plane.normal,-x,J),M=i.Matrix3.fromQuaternion(ee,M)}else D=i.Matrix3.clone(i.Matrix3.IDENTITY,D),M=i.Matrix3.clone(i.Matrix3.IDENTITY,M);var te=0,ae=0;m&&f&&(te=y/2,ae=y/3,y/=2);for(var re=0;re<y;re+=3){var oe=n.Cartesian3.fromArray(c,re,Z);if(o.st){var ie=i.Matrix3.multiplyByVector(D,oe,S);ie=P.scaleToGeodeticSurface(ie,ie);var ne=_.projectPointOntoPlane(ie,K);t.Cartesian2.subtract(ne,w,ne);var se=h.CesiumMath.clamp(ne.x/b.width,0,1),le=h.CesiumMath.clamp(ne.y/b.height,0,1);f&&(A[V+ae]=se,A[V+1+ae]=le),m&&(A[V]=se,A[V+1]=le),V+=2}if(o.normal||o.tangent||o.bitangent||u){var ue=F+1,ce=F+2;if(g){if(re+3<y){var pe=n.Cartesian3.fromArray(c,re+3,Y);if(R){var ye=n.Cartesian3.fromArray(c,re+y,U);C&&L(oe,pe,ye,P),n.Cartesian3.subtract(pe,oe,pe),n.Cartesian3.subtract(ye,oe,ye),N=n.Cartesian3.normalize(n.Cartesian3.cross(ye,pe,N),N),R=!1}n.Cartesian3.equalsEpsilon(pe,oe,h.CesiumMath.EPSILON10)&&(R=!0)}(o.tangent||o.bitangent)&&(O=P.geodeticSurfaceNormal(oe,O),o.tangent&&(H=n.Cartesian3.normalize(n.Cartesian3.cross(O,N,H),H)))}else N=P.geodeticSurfaceNormal(oe,N),(o.tangent||o.bitangent)&&(C&&(W=n.Cartesian3.fromArray(T,F,W),j=n.Cartesian3.cross(n.Cartesian3.UNIT_Z,W,j),j=n.Cartesian3.normalize(i.Matrix3.multiplyByVector(M,j,j),j),o.bitangent&&(Q=n.Cartesian3.normalize(n.Cartesian3.cross(W,j,Q),Q))),H=n.Cartesian3.cross(n.Cartesian3.UNIT_Z,N,H),H=n.Cartesian3.normalize(i.Matrix3.multiplyByVector(M,H,H),H),o.bitangent&&(O=n.Cartesian3.normalize(n.Cartesian3.cross(N,H,O),O)));o.normal&&(a.wall?(T[F+te]=N.x,T[ue+te]=N.y,T[ce+te]=N.z):f&&(T[F+te]=-N.x,T[ue+te]=-N.y,T[ce+te]=-N.z),(m&&!C||g)&&(T[F]=N.x,T[ue]=N.y,T[ce]=N.z)),u&&(g&&(N=P.geodeticSurfaceNormal(oe,N)),G[F+te]=-N.x,G[ue+te]=-N.y,G[ce+te]=-N.z),o.tangent&&(a.wall?(E[F