define(["./when-4bbc8319","./Matrix2-9aa31791","./GeometryOffsetAttribute-1772960d","./Transforms-d13cc04e","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./GeometryAttribute-43536dc0","./GeometryAttributes-7827a6c2","./GeometryInstance-47b34185","./GeometryPipeline-2356afec","./IndexDatatype-b7d979a6","./PolygonPipeline-da7fc5ca","./RectangleGeometryLibrary-d589ac1e","./VertexFormat-71718faa","./combine-83860057","./WebGLConstants-1c8239cc","./AttributeCompression-af389d04","./EncodedCartesian3-f286cedc","./IntersectionTests-96a04219","./Plane-318d6937","./EllipsoidRhumbLine-30c47ff4"],(function(t,e,a,r,n,i,o,s,l,u,c,m,p,d,g,y,f,h,v,b,_){"use strict";var A=new e.Cartesian3,x=new e.Cartesian3,w=new e.Cartesian3,C=new e.Cartesian3,R=new e.Rectangle,E=new e.Cartesian2,F=new r.BoundingSphere,G=new r.BoundingSphere;function P(t,e){var a=new o.Geometry({attributes:new s.GeometryAttributes,primitiveType:o.PrimitiveType.TRIANGLES});return a.attributes.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var V=new e.Cartesian3,L=new e.Cartesian3;function D(t,a){var r=t._vertexFormat,n=t._ellipsoid,s=a.height,l=a.width,u=a.northCap,m=a.southCap,d=0,g=s,y=s,f=0;u&&(d=1,y-=1,f+=1),m&&(g-=1,y-=1,f+=1),f+=l*y;for(var h=r.position?new Float64Array(3*f):void 0,v=r.st?new Float32Array(2*f):void 0,b=0,_=0,R=A,F=E,G=Number.MAX_VALUE,V=Number.MAX_VALUE,L=-Number.MAX_VALUE,D=-Number.MAX_VALUE,M=d;M1||D>1))for(var O=0;O0;s-=_)ct=M(ct,ft,yt=3*s,F,I),ft+=6,y.st&&(dt=T(dt,ht,2*s,k),ht+=4),p&&(vt+=3,mt[vt++]=H[yt],mt[vt++]=H[yt+1],mt[vt++]=H[yt+2]),gt&&(pt[bt++]=1,bt+=1);if(at){var xt=_t;for(yt=3*xt,s=0;s<2;s++)ct=M(ct,ft,yt,F,I),ft+=6,y.st&&(dt=T(dt,ht,2*xt,k),ht+=4),p&&(vt+=3,mt[vt++]=H[yt],mt[vt++]=H[yt+1],mt[vt++]=H[yt+2]),gt&&(pt[bt++]=1,bt+=1)}else for(s=_-1;s>=0;s--)ct=M(ct,ft,yt=3*s,F,I),ft+=6,y.st&&(dt=T(dt,ht,2*s,k),ht+=4),p&&(vt+=3,mt[vt++]=H[yt],mt[vt++]=H[yt+1],mt[vt++]=H[yt+2]),gt&&(pt[bt++]=1,bt+=1);var wt=function(t,a,r){var n=t.length,o=a.normal?new Float32Array(n):void 0,s=a.tangent?new Float32Array(n):void 0,l=a.bitangent?new Float32Array(n):void 0,u=0,c=0,m=0,p=!0,d=C,g=w,y=x;if(a.normal||a.tangent||a.bitangent)for(var f=0;f