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

2 lines
17 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./arrayFill-4513d7ad","./arrayRemoveDuplicates-d2f048c5","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./PolylineVolumeGeometryLibrary-3333255c","./CorridorGeometryLibrary-63feb55c","./when-b60132fc","./Cartesian2-47311507","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./GeometryOffsetAttribute-fbeb6f1a","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolygonPipeline-f49953b9","./PrimitiveType-39acab88","./VertexFormat-6446fca0","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./EllipsoidTangentPlane-b2b18d75","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206","./PolylinePipeline-971d8853","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./earcut-2.2.1-20c8012f"],(function(t,e,r,a,i,o,n,s,l,d,u,m,y,f,c,p,h,g,b,C,v,A,_,w,T,G,E,V,F,L,P){"use strict";var x=new a.Cartesian3,N=new a.Cartesian3,D=new a.Cartesian3,M=new a.Cartesian3,O=new a.Cartesian3,I=new a.Cartesian3,S=new a.Cartesian3,R=new a.Cartesian3;function k(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function H(t,e,r,i,o,n){var l=t.normals,d=t.tangents,u=t.bitangents,m=a.Cartesian3.normalize(a.Cartesian3.cross(r,e,S),S);n.normal&&s.CorridorGeometryLibrary.addAttribute(l,e,i,o),n.tangent&&s.CorridorGeometryLibrary.addAttribute(d,m,i,o),n.bitangent&&s.CorridorGeometryLibrary.addAttribute(u,r,i,o)}function z(t,e,r){var i,n,d,y=t.positions,p=t.corners,h=t.endPositions,g=t.lefts,b=t.normals,C=new m.GeometryAttributes,v=0,A=0,_=0;for(n=0;n<y.length;n+=2)v+=d=y[n].length-3,_+=2*d,A+=y[n+1].length-3;for(v+=3,A+=3,n=0;n<p.length;n++){i=p[n];var w=p[n].leftPositions;l.defined(w)?(v+=d=w.length,_+=d):(A+=d=p[n].rightPositions.length,_+=d)}var T,G=l.defined(h);G&&(v+=T=h[0].length-3,A+=T,_+=6*(T/=3));var E,V,F,L,P,O,k=v+A,z=new Float64Array(k),U={normals:e.normal?new Float32Array(k):void 0,tangents:e.tangent?new Float32Array(k):void 0,bitangents:e.bitangent?new Float32Array(k):void 0},B=0,Y=k-1,W=x,q=N,J=T/2,j=f.IndexDatatype.createTypedArray(k/3,_),K=0;if(G){O=D,P=M;var Q=h[0];for(W=a.Cartesian3.fromArray(b,0,W),q=a.Cartesian3.fromArray(g,0,q),n=0;n<J;n++)O=a.Cartesian3.fromArray(Q,3*(J-1-n),O),P=a.Cartesian3.fromArray(Q,3*(J+n),P),s.CorridorGeometryLibrary.addAttribute(z,P,B),s.CorridorGeometryLibrary.addAttribute(z,O,void 0,Y),H(U,W,q,B,Y,e),L=(V=B/3)+1,F=(E=(Y-2)/3)-1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3}var X,Z,$=0,tt=0,et=y[$++],rt=y[$++];for(z.set(et,B),z.set(rt,Y-rt.length+1),q=a.Cartesian3.fromArray(g,tt,q),d=rt.length-3,n=0;n<d;n+=3)X=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(et,n,S),S),Z=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(rt,d-n,R),R),H(U,W=a.Cartesian3.normalize(a.Cartesian3.add(X,Z,W),W),q,B,Y,e),L=(V=B/3)+1,F=(E=(Y-2)/3)-1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3;for(X=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(et,d,S),S),Z=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(rt,d,R),R),W=a.Cartesian3.normalize(a.Cartesian3.add(X,Z,W),W),tt+=3,n=0;n<p.length;n++){var at,it,ot,nt=(i=p[n]).leftPositions,st=i.rightPositions,lt=I,dt=D,ut=M;if(W=a.Cartesian3.fromArray(b,tt,W),l.defined(nt)){for(H(U,W,q,void 0,Y,e),Y-=3,it=L,ot=F,at=0;at<nt.length/3;at++)lt=a.Cartesian3.fromArray(nt,3*at,lt),j[K++]=it,j[K++]=ot-at-1,j[K++]=ot-at,s.CorridorGeometryLibrary.addAttribute(z,lt,void 0,Y),dt=a.Cartesian3.fromArray(z,3*(ot-at-1),dt),ut=a.Cartesian3.fromArray(z,3*it,ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.subtract(dt,ut,q),q),void 0,Y,e),Y-=3;lt=a.Cartesian3.fromArray(z,3*it,lt),dt=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*ot,dt),lt,dt),ut=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*(ot-at),ut),lt,ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.add(dt,ut,q),q),B,void 0,e),B+=3}else{for(H(U,W,q,B,void 0,e),B+=3,it=F,ot=L,at=0;at<st.length/3;at++)lt=a.Cartesian3.fromArray(st,3*at,lt),j[K++]=it,j[K++]=ot+at,j[K++]=ot+at+1,s.CorridorGeometryLibrary.addAt