define(["./when-b60132fc","./Cartesian2-47311507","./arrayFill-4513d7ad","./buildModuleUrl-4e1b81e7","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./GeometryAttribute-3a88ba31","./GeometryAttributes-252e9929","./GeometryInstance-68aae013","./GeometryOffsetAttribute-fbeb6f1a","./GeometryPipeline-9d1ef0b6","./IndexDatatype-8a5eead4","./Math-119be1a3","./PrimitiveType-a54dc62f","./PolygonPipeline-660e1625","./RectangleGeometryLibrary-9785d88b","./VertexFormat-6446fca0","./Event-16a2dfbf","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./FeatureDetection-c3b71206","./Cartesian4-3ca25aab","./AttributeCompression-90851096","./EncodedCartesian3-f1396b05","./IntersectionTests-7386ffbf","./Plane-7ae8294c","./earcut-2.2.1-20c8012f","./EllipsoidRhumbLine-ed1a6bf4"],(function(t,e,a,r,n,i,o,s,l,u,c,m,d,p,g,y,f,h,v,b,_,A,x,w,C,R,E,F,G){"use strict";var P=new n.Cartesian3,V=new n.Cartesian3,L=new n.Cartesian3,D=new n.Cartesian3,M=new e.Rectangle,T=new e.Cartesian2,O=new r.BoundingSphere,N=new r.BoundingSphere;function S(t,e){var a=new s.Geometry({attributes:new l.GeometryAttributes,primitiveType:g.PrimitiveType.TRIANGLES});return a.attributes.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var I=new n.Cartesian3,k=new n.Cartesian3;function H(t,e){var a=t._vertexFormat,r=t._ellipsoid,i=e.height,l=e.width,u=e.northCap,c=e.southCap,m=0,p=i,y=i,h=0;u&&(m=1,y-=1,h+=1),c&&(p-=1,y-=1,h+=1),h+=l*y;for(var v=a.position?new Float64Array(3*h):void 0,b=a.st?new Float32Array(2*h):void 0,_=0,A=0,x=P,w=T,C=Number.MAX_VALUE,R=Number.MAX_VALUE,E=-Number.MAX_VALUE,F=-Number.MAX_VALUE,G=m;G1||F>1))for(var O=0;O0;i-=x)dt=z(dt,vt,ht=3*i,R,M),vt+=6,f.st&&(yt=U(yt,bt,2*i,T),bt+=4),l&&(_t+=3,pt[_t++]=O[ht],pt[_t++]=O[ht+1],pt[_t++]=O[ht+2]),ft&&(gt[At++]=1,At+=1);if(nt){var Ct=xt;for(ht=3*Ct,i=0;i<2;i++)dt=z(dt,vt,ht,R,M),vt+=6,f.st&&(yt=U(yt,bt,2*Ct,T),bt+=4),l&&(_t+=3,pt[_t++]=O[ht],pt[_t++]=O[ht+1],pt[_t++]=O[ht+2]),ft&&(gt[At++]=1,At+=1)}else for(i=x-1;i>=0;i--)dt=z(dt,vt,ht=3*i,R,M),vt+=6,f.st&&(yt=U(yt,bt,2*i,T),bt+=4),l&&(_t+=3,pt[_t++]=O[ht],pt[_t++]=O[ht+1],pt[_t++]=O[ht+2]),ft&&(gt[At++]=1,At+=1);var Rt=function(t,e,a){var r=t.length,i=e.normal?new Float32Array(r):void 0,o=e.tangent?new Float32Array(r):void 0,s=e.bitangent?new Float32Array(r):void 0,l=0,u=0,c=0,m=!0,d=D,g=L,y=V;if(e.normal||e.tangent||e.bitangent)for(var f=0;f