Commit 625086b0 authored by p x's avatar p x
Browse files

init

parent 5e9d2300
Pipeline #3100 failed with stages
in 0 seconds
define(["./defaultValue-94c3e563","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./FrustumGeometry-f724a035","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./Plane-e20fba8c","./VertexFormat-e46f29d6"],(function(e,t,r,n,a,i,o,u,c,s,p,m,f){"use strict";const d=0,h=1;function k(a){n.Check.typeOf.object("options",a),n.Check.typeOf.object("options.frustum",a.frustum),n.Check.typeOf.object("options.origin",a.origin),n.Check.typeOf.object("options.orientation",a.orientation);const o=a.frustum,u=a.orientation,c=a.origin,s=e.defaultValue(a._drawNearPlane,!0);let p,m;o instanceof i.PerspectiveFrustum?(p=d,m=i.PerspectiveFrustum.packedLength):o instanceof i.OrthographicFrustum&&(p=h,m=i.OrthographicFrustum.packedLength),this._frustumType=p,this._frustum=o.clone(),this._origin=r.Cartesian3.clone(c),this._orientation=t.Quaternion.clone(u),this._drawNearPlane=s,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+m+r.Cartesian3.packedLength+t.Quaternion.packedLength}k.pack=function(a,o,u){n.Check.typeOf.object("value",a),n.Check.defined("array",o),u=e.defaultValue(u,0);const c=a._frustumType,s=a._frustum;return o[u++]=c,c===d?(i.PerspectiveFrustum.pack(s,o,u),u+=i.PerspectiveFrustum.packedLength):(i.OrthographicFrustum.pack(s,o,u),u+=i.OrthographicFrustum.packedLength),r.Cartesian3.pack(a._origin,o,u),u+=r.Cartesian3.packedLength,t.Quaternion.pack(a._orientation,o,u),u+=t.Quaternion.packedLength,o[u]=a._drawNearPlane?1:0,o};const g=new i.PerspectiveFrustum,l=new i.OrthographicFrustum,y=new t.Quaternion,_=new r.Cartesian3;function F(t,r){return e.defined(r)&&(t=k.unpack(t,r)),k.createGeometry(t)}return k.unpack=function(a,o,u){n.Check.defined("array",a),o=e.defaultValue(o,0);const c=a[o++];let s;c===d?(s=i.PerspectiveFrustum.unpack(a,o,g),o+=i.PerspectiveFrustum.packedLength):(s=i.OrthographicFrustum.unpack(a,o,l),o+=i.OrthographicFrustum.packedLength);const p=r.Cartesian3.unpack(a,o,_);o+=r.Cartesian3.packedLength;const m=t.Quaternion.unpack(a,o,y);o+=t.Quaternion.packedLength;const f=1===a[o];if(!e.defined(u))return new k({frustum:s,origin:p,orientation:m,_drawNearPlane:f});const h=c===u._frustumType?u._frustum:void 0;return u._frustum=s.clone(h),u._frustumType=c,u._origin=r.Cartesian3.clone(p,u._origin),u._orientation=t.Quaternion.clone(m,u._orientation),u._drawNearPlane=f,u},k.createGeometry=function(e){const r=e._frustumType,n=e._frustum,c=e._origin,s=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);i.FrustumGeometry._computeNearFarPlanes(c,s,r,n,m);const f=new u.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let d,h;const k=p?2:1,g=new Uint16Array(8*(k+1));let l=p?0:1;for(;l<2;++l)d=p?8*l:0,h=4*l,g[d]=h,g[d+1]=h+1,g[d+2]=h+1,g[d+3]=h+2,g[d+4]=h+2,g[d+5]=h+3,g[d+6]=h+3,g[d+7]=h;for(l=0;l<2;++l)d=8*(k+l),h=4*l,g[d]=h,g[d+1]=h+4,g[d+2]=h+1,g[d+3]=h+5,g[d+4]=h+2,g[d+5]=h+6,g[d+6]=h+3,g[d+7]=h+7;return new o.Geometry({attributes:f,indices:g,primitiveType:o.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},F}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./PrimitivePipeline-4e8648b3","./createTaskProcessorWorker","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./IndexDatatype-db156785","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./WebMercatorProjection-843df830"],(function(e,t,r,n,o,c,i,s,a,f,d,u,m,b,l,p,y,P,k){"use strict";const C={};function G(t){let r=C[t];return e.defined(r)||("object"===typeof exports?C[r]=r=require(`Workers/${t}`):require([`Workers/${t}`],(function(e){r=e,C[r]=e}))),r}function W(r,n){const o=r.subTasks,c=o.length,i=new Array(c);for(let t=0;t<c;t++){const r=o[t],n=r.geometry,c=r.moduleName;if(e.defined(c)){const e=G(c);i[t]=e(n,r.offset)}else i[t]=n}return Promise.all(i).then((function(e){return t.PrimitivePipeline.packCreateGeometryResults(e,n)}))}var A=r(W);return A}));
\ No newline at end of file
define(["./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./ArcType-0cf52f8c","./arrayRemoveDuplicates-06991c15","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./EncodedCartesian3-d3e254ea","./GeometryAttribute-a441ff32","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./WebMercatorProjection-843df830","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96"],(function(e,t,a,n,i,r,s,o,l,c,u,C,d,p,h,g,f){"use strict";function m(a){a=n.defaultValue(a,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84),this._rectangle=n.defaultValue(a.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(a.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(a.numberOfLevelZeroTilesY,1)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),m.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},m.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},m.prototype.rectangleToNativeRectangle=function(e,r){a.Check.defined("rectangle",e);const s=i.CesiumMath.toDegrees(e.west),o=i.CesiumMath.toDegrees(e.south),l=i.CesiumMath.toDegrees(e.east),c=i.CesiumMath.toDegrees(e.north);return n.defined(r)?(r.west=s,r.south=o,r.east=l,r.north=c,r):new t.Rectangle(s,o,l,c)},m.prototype.tileXYToNativeRectangle=function(e,t,a,n){const r=this.tileXYToRectangle(e,t,a,n);return r.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},m.prototype.tileXYToRectangle=function(e,a,i,r){const s=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,d=s.height/l,p=s.north-a*d,h=s.north-(a+1)*d;return n.defined(r)||(r=new t.Rectangle(u,h,C,p)),r.west=u,r.south=h,r.east=C,r.north=p,r},m.prototype.positionToTileXY=function(e,a,r){const s=this._rectangle;if(!t.Rectangle.contains(s,e))return;const o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;let C=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);let d=(C-s.west)/c|0;d>=o&&(d=o-1);let p=(s.north-e.latitude)/u|0;return p>=l&&(p=l-1),n.defined(r)?(r.x=d,r.y=p,r):new t.Cartesian2(d,p)};const w=new t.Cartesian3,y=new t.Cartesian3,T=new t.Cartographic,E=new t.Cartesian3,M=new t.Cartesian3,_=new e.BoundingSphere,O=new m,b=[new t.Cartographic,new t.Cartographic,new t.Cartographic,new t.Cartographic],A=new t.Cartesian2,k={};function P(e){t.Cartographic.fromRadians(e.east,e.north,0,b[0]),t.Cartographic.fromRadians(e.west,e.north,0,b[1]),t.Cartographic.fromRadians(e.east,e.south,0,b[2]),t.Cartographic.fromRadians(e.west,e.south,0,b[3]);let a=0,n=0,i=0,r=0;const s=k._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let t=0;t<4;++t){const a=b[t];if(O.positionToTileXY(a,o,A),0===t)i=A.x,r=A.y;else if(i!==A.x||r!==A.y){e=!0;break}}if(e)break;a=i,n=r}if(0!==o)return{x:a,y:n,level:o>s?s:o-1}}k.initialize=function(){let t=k._initPromise;return n.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){k._terrainHeights=e})),k._initPromise=t),t},k.getMinimumMaximumHeights=function(e,i){if(a.Check.defined("rectangle",e),!n.defined(k._terrainHeights))throw new a.DeveloperError("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=n.defaultValue(i,t.Ellipsoid.WGS84);const r=P(e);let s=k._defaultMinTerrainHeight,o=k._defaultMaxTerrainHeight;if(n.defined(r)){const a=`${r.level}-${r.x}-${r.y}`,l=k._terrainHeights[a];n.defined(l)&&(s=l[0],o=l[1]),i.cartographicToCartesian(t.Rectangle.northeast(e,T),w),i.cartographicToCartesian(t.Rectangle.southwest(e,T),y),t.Cartesian3.midpoint(y,w,E);const c=i.scaleToGeodeticSurface(E,M);if(n.defined(c)){const e=t.Cartesian3.distance(E,c);s=Math.min(s,-e)}else s=k._defaultMinTerrainHeight}return s=Math.max(k._defaultMinTerrainHeight,s),{minimumTerrainHeight:s,maximumTerrainHeight:o}},k.getBoundingSphere=function(i,r){if(a.Check.defined("rectangle",i),!n.defined(k._terrainHeights))throw new a.DeveloperError("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");r=n.defaultValue(r,t.Ellipsoid.WGS84);const s=P(i);let o=k._defaultMaxTerrainHeight;if(n.defined(s)){const e=`${s.level}-${s.x}-${s.y}`,t=k._terrainHeights[e];n.defined(t)&&(o=t[1])}const l=e.BoundingSphere.fromRectangle3D(i,r,0);return e.BoundingSphere.fromRectangle3D(i,r,o,_),e.BoundingSphere.union(l,_,l)},k._terrainHeightsMaxLevel=6,k._defaultMaxTerrainHeight=9e3,k._defaultMinTerrainHeight=-1e5,k._terrainHeights=void 0,k._initPromise=void 0,Object.defineProperties(k,{initialized:{get:function(){return n.defined(k._terrainHeights)}}});const S=[e.GeographicProjection,p.WebMercatorProjection],L=S.length,x=Math.cos(i.CesiumMath.toRadians(30)),I=Math.cos(i.CesiumMath.toRadians(150)),D=0,N=1e3;function R(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);const i=e.positions;if(!n.defined(i)||i.length<2)throw new a.DeveloperError("At least two positions are required.");if(n.defined(e.arcType)&&e.arcType!==r.ArcType.GEODESIC&&e.arcType!==r.ArcType.RHUMB)throw new a.DeveloperError("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=n.defaultValue(e.width,1),this._positions=i,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=t.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(R.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+t.Ellipsoid.packedLength+1+1}}}),R.setProjectionAndEllipsoid=function(e,t){let a=0;for(let n=0;n<L;n++)if(t instanceof S[n]){a=n;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};const v=new t.Cartesian3,H=new t.Cartesian3,z=new t.Cartesian3;function B(e,a,n,i,r){const s=X(i,e,0,v),o=X(i,e,n,H),l=X(i,a,0,z),c=U(o,s,H),u=U(l,s,z);return t.Cartesian3.cross(u,c,r),t.Cartesian3.normalize(r,r)}const j=new t.Cartographic,G=new t.Cartesian3,V=new t.Cartesian3,Y=new t.Cartesian3;function q(e,a,n,i,s,c,u,C,d,p,h){if(0===s)return;let g;c===r.ArcType.GEODESIC?g=new o.EllipsoidGeodesic(e,a,u):c===r.ArcType.RHUMB&&(g=new l.EllipsoidRhumbLine(e,a,u));const f=g.surfaceDistance;if(f<s)return;const m=B(e,a,i,u,Y),w=Math.ceil(f/s),y=f/w;let T=y;const E=w-1;let M=C.length;for(let r=0;r<E;r++){const e=g.interpolateUsingSurfaceDistance(T,j),a=X(u,e,n,G),r=X(u,e,i,V);t.Cartesian3.pack(m,C,M),t.Cartesian3.pack(a,d,M),t.Cartesian3.pack(r,p,M),h.push(e.latitude),h.push(e.longitude),M+=3,T+=y}}const F=new t.Cartographic;function X(e,a,n,i){return t.Cartographic.clone(a,F),F.height=n,t.Cartographic.toCartesian(F,e,i)}function U(e,a,n){return t.Cartesian3.subtract(e,a,n),t.Cartesian3.normalize(n,n),n}function W(e,a,n,i){return i=U(e,a,i),i=t.Cartesian3.cross(i,n,i),i=t.Cartesian3.normalize(i,i),i=t.Cartesian3.cross(n,i,i),i}R.pack=function(e,i,r){a.Check.typeOf.object("value",e),a.Check.defined("array",i);let s=n.defaultValue(r,0);const o=e._positions,l=o.length;i[s++]=l;for(let a=0;a<l;++a){const e=o[a];t.Cartesian3.pack(e,i,s),s+=3}return i[s++]=e.granularity,i[s++]=e.loop?1:0,i[s++]=e.arcType,t.Ellipsoid.pack(e._ellipsoid,i,s),s+=t.Ellipsoid.packedLength,i[s++]=e._projectionIndex,i[s++]=e._scene3DOnly?1:0,i},R.unpack=function(e,i,r){a.Check.defined("array",e);let s=n.defaultValue(i,0);const o=e[s++],l=new Array(o);for(let a=0;a<o;a++)l[a]=t.Cartesian3.unpack(e,s),s+=3;const c=e[s++],u=1===e[s++],C=e[s++],d=t.Ellipsoid.unpack(e,s);s+=t.Ellipsoid.packedLength;const p=e[s++],h=1===e[s++];return n.defined(r)||(r=new R({positions:l})),r._positions=l,r.granularity=c,r.loop=u,r.arcType=C,r._ellipsoid=d,r._projectionIndex=p,r._scene3DOnly=h,r};const Z=new t.Cartesian3,$=new t.Cartesian3,J=new t.Cartesian3,Q=new t.Cartesian3,K=0,ee=-1;function te(e,a,n,r,s){const o=U(n,a,Q),l=W(e,a,o,Z),c=W(r,a,o,$);if(i.CesiumMath.equalsEpsilon(t.Cartesian3.dot(l,c),ee,i.CesiumMath.EPSILON5))return s=t.Cartesian3.cross(o,l,s),s=t.Cartesian3.normalize(s,s),s;s=t.Cartesian3.add(c,l,s),s=t.Cartesian3.normalize(s,s);const u=t.Cartesian3.cross(o,s,J);return t.Cartesian3.dot(c,u)<K&&(s=t.Cartesian3.negate(s,s)),s}const ae=d.Plane.fromPointNormal(t.Cartesian3.ZERO,t.Cartesian3.UNIT_Y),ne=new t.Cartesian3,ie=new t.Cartesian3,re=new t.Cartesian3,se=new t.Cartesian3,oe=new t.Cartesian3,le=new t.Cartesian3,ce=new t.Cartographic,ue=new t.Cartographic,Ce=new t.Cartographic;R.createGeometry=function(e){const a=!e._scene3DOnly;let o=e.loop;const c=e._ellipsoid,u=e.granularity,d=e.arcType,p=new S[e._projectionIndex](c),h=D,g=N;let f,m;const w=e._positions,y=w.length;let T,E,M,_;2===y&&(o=!1);const O=new l.EllipsoidRhumbLine(void 0,void 0,c);let b,A,k;const P=[w[0]];for(m=0;m<y-1;m++)T=w[m],E=w[m+1],b=C.IntersectionTests.lineSegmentPlane(T,E,ae,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||(e.arcType===r.ArcType.GEODESIC?P.push(t.Cartesian3.clone(b)):e.arcType===r.ArcType.RHUMB&&(k=c.cartesianToCartographic(b,ce).longitude,M=c.cartesianToCartographic(T,ce),_=c.cartesianToCartographic(E,ue),O.setEndPoints(M,_),A=O.findIntersectionWithLongitude(k,Ce),b=c.cartographicToCartesian(A,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||P.push(t.Cartesian3.clone(b)))),P.push(E);o&&(T=w[y-1],E=w[0],b=C.IntersectionTests.lineSegmentPlane(T,E,ae,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||(e.arcType===r.ArcType.GEODESIC?P.push(t.Cartesian3.clone(b)):e.arcType===r.ArcType.RHUMB&&(k=c.cartesianToCartographic(b,ce).longitude,M=c.cartesianToCartographic(T,ce),_=c.cartesianToCartographic(E,ue),O.setEndPoints(M,_),A=O.findIntersectionWithLongitude(k,Ce),b=c.cartographicToCartesian(A,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||P.push(t.Cartesian3.clone(b)))));let L=P.length,x=new Array(L);for(m=0;m<L;m++){const e=t.Cartographic.fromCartesian(P[m],c);e.height=0,x[m]=e}if(x=s.arrayRemoveDuplicates(x,t.Cartographic.equalsEpsilon),L=x.length,L<2)return;const I=[],R=[],v=[],H=[];let z=ne,j=ie,G=re,V=se,Y=oe;const F=x[0],U=x[1],W=x[L-1];for(z=X(c,W,h,z),V=X(c,U,h,V),j=X(c,F,h,j),G=X(c,F,g,G),Y=o?te(z,j,G,V,Y):B(F,U,g,c,Y),t.Cartesian3.pack(Y,R,0),t.Cartesian3.pack(j,v,0),t.Cartesian3.pack(G,H,0),I.push(F.latitude),I.push(F.longitude),q(F,U,h,g,u,d,c,R,v,H,I),m=1;m<L-1;++m){z=t.Cartesian3.clone(j,z),j=t.Cartesian3.clone(V,j);const e=x[m];X(c,e,g,G),X(c,x[m+1],h,V),te(z,j,G,V,Y),f=R.length,t.Cartesian3.pack(Y,R,f),t.Cartesian3.pack(j,v,f),t.Cartesian3.pack(G,H,f),I.push(e.latitude),I.push(e.longitude),q(x[m],x[m+1],h,g,u,d,c,R,v,H,I)}const Z=x[L-1],$=x[L-2];if(j=X(c,Z,h,j),G=X(c,Z,g,G),o){const e=x[0];z=X(c,$,h,z),V=X(c,e,h,V),Y=te(z,j,G,V,Y)}else Y=B($,Z,g,c,Y);if(f=R.length,t.Cartesian3.pack(Y,R,f),t.Cartesian3.pack(j,v,f),t.Cartesian3.pack(G,H,f),I.push(Z.latitude),I.push(Z.longitude),o){for(q(Z,F,h,g,u,d,c,R,v,H,I),f=R.length,m=0;m<3;++m)R[f+m]=R[m],v[f+m]=v[m],H[f+m]=H[m];I.push(F.latitude),I.push(F.longitude)}return it(o,p,v,H,R,I,a)};const de=new t.Cartesian3,pe=new t.Matrix3,he=new e.Quaternion;function ge(a,n,r,s){const o=U(r,n,de),l=t.Cartesian3.dot(o,a);if(l>x||l<I){const n=U(s,r,Q),o=l<I?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,he),u=t.Matrix3.fromQuaternion(c,pe);return t.Matrix3.multiplyByVector(u,a,a),!0}return!1}const fe=new t.Cartographic,me=new t.Cartesian3,we=new t.Cartesian3;function ye(e,a,n,r,s){const o=t.Cartographic.toCartesian(a,e._ellipsoid,me);let l=t.Cartesian3.add(o,n,we),c=!1;const u=e._ellipsoid;let C=u.cartesianToCartographic(l,fe);Math.abs(a.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=t.Cartesian3.subtract(o,n,we),C=u.cartesianToCartographic(l,fe)),C.height=0;const d=e.project(C,s);return s=t.Cartesian3.subtract(d,r,s),s.z=0,s=t.Cartesian3.normalize(s,s),c&&t.Cartesian3.negate(s,s),s}const Te=new t.Cartesian3,Ee=new t.Cartesian3;function Me(e,a,n,i,r,s){const o=t.Cartesian3.subtract(a,e,Te);t.Cartesian3.normalize(o,o);const l=n-D;let c=t.Cartesian3.multiplyByScalar(o,l,Ee);t.Cartesian3.add(e,c,r);const u=i-N;c=t.Cartesian3.multiplyByScalar(o,u,Ee),t.Cartesian3.add(a,c,s)}const _e=new t.Cartesian3;function Oe(e,a){const n=d.Plane.getPointDistance(ae,e),r=d.Plane.getPointDistance(ae,a);let s=_e;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=U(a,e,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=U(e,a,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(a,s,a))}function be(e,t){const a=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const n=i.CesiumMath.sign(t.longitude);return e.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const a=i.CesiumMath.sign(e.longitude);return t.longitude=a*(n-i.CesiumMath.EPSILON11),2}return 0}const Ae=new t.Cartographic,ke=new t.Cartographic,Pe=new t.Cartesian3,Se=new t.Cartesian3,Le=new t.Cartesian3,xe=new t.Cartesian3,Ie=new t.Cartesian3,De=new t.Cartesian3,Ne=[Ae,ke],Re=new t.Rectangle,ve=new t.Cartesian3,He=new t.Cartesian3,ze=new t.Cartesian3,Be=new t.Cartesian3,je=new t.Cartesian3,Ge=new t.Cartesian3,Ve=new t.Cartesian3,Ye=new t.Cartesian3,qe=new t.Cartesian3,Fe=new t.Cartesian3,Xe=new t.Cartesian3,Ue=new t.Cartesian3,We=new t.Cartesian3,Ze=new t.Cartesian3,$e=new c.EncodedCartesian3,Je=new c.EncodedCartesian3,Qe=new t.Cartesian3,Ke=new t.Cartesian3,et=new t.Cartesian3,tt=[new e.BoundingSphere,new e.BoundingSphere],at=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],nt=at.length;function it(a,n,r,s,o,l,C){let d,p;const h=n._ellipsoid,g=r.length/3-1,f=8*g,m=4*f,w=36*g,y=f>65535?new Uint32Array(w):new Uint16Array(w),T=new Float64Array(3*f),E=new Float32Array(m),M=new Float32Array(m),_=new Float32Array(m),O=new Float32Array(m),b=new Float32Array(m);let A,P,S,L;C&&(A=new Float32Array(m),P=new Float32Array(m),S=new Float32Array(m),L=new Float32Array(2*f));const I=l.length/2;let D=0;const N=Ae;N.height=0;const R=ke;R.height=0;let v=Pe,H=Se;if(C)for(p=0,d=1;d<I;d++)N.latitude=l[p],N.longitude=l[p+1],R.latitude=l[p+2],R.longitude=l[p+3],v=n.project(N,v),H=n.project(R,H),D+=t.Cartesian3.distance(v,H),p+=2;const z=s.length/3;H=t.Cartesian3.unpack(s,0,H);let B,j=0;for(p=3,d=1;d<z;d++)v=t.Cartesian3.clone(H,v),H=t.Cartesian3.unpack(s,p,H),j+=t.Cartesian3.distance(v,H),p+=3;p=3;let G=0,V=0,Y=0,q=0,F=!1,X=t.Cartesian3.unpack(r,0,xe),W=t.Cartesian3.unpack(s,0,Se),Z=t.Cartesian3.unpack(o,0,De);if(a){const e=t.Cartesian3.unpack(r,r.length-6,Le);ge(Z,e,X,W)&&(Z=t.Cartesian3.negate(Z,Z))}let $=0,J=0,Q=0;for(d=0;d<g;d++){const e=t.Cartesian3.clone(X,Le),a=t.Cartesian3.clone(W,Pe);let u,d,g,f,m=t.Cartesian3.clone(Z,Ie);if(F&&(m=t.Cartesian3.negate(m,m)),X=t.Cartesian3.unpack(r,p,xe),W=t.Cartesian3.unpack(s,p,Se),Z=t.Cartesian3.unpack(o,p,De),F=ge(Z,e,X,W),N.latitude=l[G],N.longitude=l[G+1],R.latitude=l[G+2],R.longitude=l[G+3],C){const e=be(N,R);u=n.project(N,je),d=n.project(R,Ge);const a=U(d,u,Qe);a.y=Math.abs(a.y),g=Ve,f=Ye,0===e||t.Cartesian3.dot(a,t.Cartesian3.UNIT_Y)>x?(g=ye(n,N,m,u,Ve),f=ye(n,R,Z,d,Ye)):1===e?(f=ye(n,R,Z,d,Ye),g.x=0,g.y=i.CesiumMath.sign(N.longitude-Math.abs(R.longitude)),g.z=0):(g=ye(n,N,m,u,Ve),f.x=0,f.y=i.CesiumMath.sign(N.longitude-R.longitude),f.z=0)}const w=t.Cartesian3.distance(a,W),y=c.EncodedCartesian3.fromCartesian(e,$e),I=t.Cartesian3.subtract(X,e,qe),v=t.Cartesian3.normalize(I,Ue);let H=t.Cartesian3.subtract(a,e,Fe);H=t.Cartesian3.normalize(H,H);let z=t.Cartesian3.cross(v,H,Ue);z=t.Cartesian3.normalize(z,z);let K=t.Cartesian3.cross(H,m,We);K=t.Cartesian3.normalize(K,K);let ee=t.Cartesian3.subtract(W,X,Xe);ee=t.Cartesian3.normalize(ee,ee);let te=t.Cartesian3.cross(Z,ee,Ze);te=t.Cartesian3.normalize(te,te);const ae=w/j,ne=$/j;let ie,re,se,oe=0,le=0,ce=0;if(C){oe=t.Cartesian3.distance(u,d),ie=c.EncodedCartesian3.fromCartesian(u,Je),re=t.Cartesian3.subtract(d,u,Qe),se=t.Cartesian3.normalize(re,Ke);const e=se.x;se.x=se.y,se.y=-e,le=oe/D,ce=J/D}for(B=0;B<8;B++){const e=q+4*B,a=V+2*B,n=e+3,i=B<4?1:-1,r=2===B||3===B||6===B||7===B?1:-1;t.Cartesian3.pack(y.high,E,e),E[n]=I.x,t.Cartesian3.pack(y.low,M,e),M[n]=I.y,t.Cartesian3.pack(K,_,e),_[n]=I.z,t.Cartesian3.pack(te,O,e),O[n]=ae*i,t.Cartesian3.pack(z,b,e);let s=ne*r;0===s&&r<0&&(s=9),b[n]=s,C&&(A[e]=ie.high.x,A[e+1]=ie.high.y,A[e+2]=ie.low.x,A[e+3]=ie.low.y,S[e]=-g.y,S[e+1]=g.x,S[e+2]=f.y,S[e+3]=-f.x,P[e]=re.x,P[e+1]=re.y,P[e+2]=se.x,P[e+3]=se.y,L[a]=le*i,s=ce*r,0===s&&r<0&&(s=9),L[a+1]=s)}const ue=ze,Ce=Be,de=ve,pe=He,he=t.Rectangle.fromCartographicArray(Ne,Re),fe=k.getMinimumMaximumHeights(he,h),me=fe.minimumTerrainHeight,we=fe.maximumTerrainHeight;Q+=me,Q+=we,Me(e,a,me,we,ue,de),Me(X,W,me,we,Ce,pe);let Te=t.Cartesian3.multiplyByScalar(z,i.CesiumMath.EPSILON5,et);t.Cartesian3.add(ue,Te,ue),t.Cartesian3.add(Ce,Te,Ce),t.Cartesian3.add(de,Te,de),t.Cartesian3.add(pe,Te,pe),Oe(ue,Ce),Oe(de,pe),t.Cartesian3.pack(ue,T,Y),t.Cartesian3.pack(Ce,T,Y+3),t.Cartesian3.pack(pe,T,Y+6),t.Cartesian3.pack(de,T,Y+9),Te=t.Cartesian3.multiplyByScalar(z,-2*i.CesiumMath.EPSILON5,et),t.Cartesian3.add(ue,Te,ue),t.Cartesian3.add(Ce,Te,Ce),t.Cartesian3.add(de,Te,de),t.Cartesian3.add(pe,Te,pe),Oe(ue,Ce),Oe(de,pe),t.Cartesian3.pack(ue,T,Y+12),t.Cartesian3.pack(Ce,T,Y+15),t.Cartesian3.pack(pe,T,Y+18),t.Cartesian3.pack(de,T,Y+21),G+=2,p+=3,V+=16,Y+=24,q+=32,$+=w,J+=oe}p=0;let K=0;for(d=0;d<g;d++){for(B=0;B<nt;B++)y[p+B]=at[B]+K;K+=8,p+=nt}const ee=tt;e.BoundingSphere.fromVertices(r,t.Cartesian3.ZERO,3,ee[0]),e.BoundingSphere.fromVertices(s,t.Cartesian3.ZERO,3,ee[1]);const te=e.BoundingSphere.fromBoundingSpheres(ee);te.radius+=Q/(2*g);const ae={position:new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:T}),startHiAndForwardOffsetX:rt(E),startLoAndForwardOffsetY:rt(M),startNormalAndForwardOffsetZ:rt(_),endNormalAndTextureCoordinateNormalizationX:rt(O),rightNormalAndTextureCoordinateNormalizationY:rt(b)};return C&&(ae.startHiLo2D=rt(A),ae.offsetAndRight2D=rt(P),ae.startEndNormals2D=rt(S),ae.texcoordNormalization2D=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:L})),new u.Geometry({attributes:ae,indices:y,boundingSphere:te})}function rt(e){return new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}function st(e,t){return k.initialize().then((function(){return n.defined(t)&&(e=R.unpack(e,t)),R.createGeometry(e)}))}return R._projectNormal=ye,st}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96"],(function(e,t,n,r,a,o,i,c,m,u,p){"use strict";function s(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);const n=e.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}s.packedLength=c.VertexFormat.packedLength,s.pack=function(t,n,a){return r.Check.typeOf.object("value",t),r.Check.defined("array",n),a=e.defaultValue(a,0),c.VertexFormat.pack(t._vertexFormat,n,a),n};const y=new c.VertexFormat,f={vertexFormat:y};s.unpack=function(t,n,a){r.Check.defined("array",t),n=e.defaultValue(n,0);const o=c.VertexFormat.unpack(t,n,y);return e.defined(a)?(a._vertexFormat=c.VertexFormat.clone(o,a._vertexFormat),a):new s(f)};const l=new n.Cartesian3(-.5,-.5,0),d=new n.Cartesian3(.5,.5,0);function A(t,n){return e.defined(n)&&(t=s.unpack(t,n)),s.createGeometry(t)}return s.createGeometry=function(e){const r=e._vertexFormat,c=new i.GeometryAttributes;let m,u;if(r.position){if(u=new Float64Array(12),u[0]=l.x,u[1]=l.y,u[2]=0,u[3]=d.x,u[4]=l.y,u[5]=0,u[6]=d.x,u[7]=d.y,u[8]=0,u[9]=l.x,u[10]=d.y,u[11]=0,c.position=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),r.normal){const e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,c.normal=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.st){const e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,c.st=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e})}if(r.tangent){const e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,c.tangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.bitangent){const e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,c.bitangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}m=new Uint16Array(6),m[0]=0,m[1]=1,m[2]=2,m[3]=0,m[4]=2,m[5]=3}return new o.Geometry({attributes:c,indices:m,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},A}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96"],(function(e,t,n,r,a,i,o,c,u,d){"use strict";function s(){this._workerName="createPlaneOutlineGeometry"}s.packedLength=0,s.pack=function(e,t){return r.Check.defined("value",e),r.Check.defined("array",t),t},s.unpack=function(t,n,a){return r.Check.defined("array",t),e.defined(a)?a:new s};const f=new n.Cartesian3(-.5,-.5,0),y=new n.Cartesian3(.5,.5,0);function m(t,n){return e.defined(n)&&(t=s.unpack(t,n)),s.createGeometry(t)}return s.createGeometry=function(){const e=new o.GeometryAttributes,r=new Uint16Array(8),c=new Float64Array(12);return c[0]=f.x,c[1]=f.y,c[2]=f.z,c[3]=y.x,c[4]=f.y,c[5]=f.z,c[6]=y.x,c[7]=y.y,c[8]=f.z,c[9]=f.x,c[10]=y.y,c[11]=f.z,e.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),r[0]=0,r[1]=1,r[2]=1,r[3]=2,r[4]=2,r[5]=3,r[6]=3,r[7]=0,new i.Geometry({attributes:e,indices:r,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},m}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./EllipsoidGeodesic-dc94f381","./EllipsoidTangentPlane-53e32153","./GeometryAttribute-a441ff32","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonGeometryLibrary-5dd81ed2","./PolygonPipeline-113e3161","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./arrayRemoveDuplicates-06991c15","./EllipsoidRhumbLine-daebc75b","./GeometryAttributes-7df9bef6"],(function(e,t,o,r,i,n,a,s,l,c,u,p,d,y,g,m,h,f,b,_,C,P,x,T,w,A,I,E){"use strict";const v=new t.Cartographic,G=new t.Cartographic;function O(e,t,o,r){const i=r.cartesianToCartographic(e,v),n=i.height,a=r.cartesianToCartographic(t,G);a.height=n,r.cartographicToCartesian(a,t);const s=r.cartesianToCartographic(o,G);s.height=n-100,r.cartographicToCartesian(s,o)}const H=new r.BoundingRectangle,D=new t.Cartesian3,V=new t.Cartesian3,L=new t.Cartesian3,N=new t.Cartesian3,F=new t.Cartesian3,R=new t.Cartesian3;let M=new t.Cartesian3,k=new t.Cartesian3,S=new t.Cartesian3;const B=new t.Cartesian2,z=new t.Cartesian2,U=new t.Cartesian3,W=new i.Quaternion,Y=new t.Matrix3,j=new t.Matrix3;function Q(o){const r=o.vertexFormat,n=o.geometry,s=o.shadowVolume,l=n.attributes.position.values,u=e.defined(n.attributes.st)?n.attributes.st.values:void 0;let d=l.length;const y=o.wall,g=o.top||y,m=o.bottom||y;if(r.st||r.normal||r.tangent||r.bitangent||s){const p=o.boundingRectangle,h=o.tangentPlane,f=o.ellipsoid,b=o.stRotation,_=o.perPositionHeight,C=B;C.x=p.x,C.y=p.y;const P=r.st?new Float32Array(d/3*2):void 0;let x;r.normal&&(x=_&&g&&!y?n.attributes.normal.values:new Float32Array(d));const T=r.tangent?new Float32Array(d):void 0,w=r.bitangent?new Float32Array(d):void 0,A=s?new Float32Array(d):void 0;let I=0,E=0,v=V,G=L,H=N,Q=!0,q=Y,K=j;if(0!==b){let e=i.Quaternion.fromAxisAngle(h._plane.normal,b,W);q=t.Matrix3.fromQuaternion(e,q),e=i.Quaternion.fromAxisAngle(h._plane.normal,-b,W),K=t.Matrix3.fromQuaternion(e,K)}else q=t.Matrix3.clone(t.Matrix3.IDENTITY,q),K=t.Matrix3.clone(t.Matrix3.IDENTITY,K);let Z=0,J=0;g&&m&&(Z=d/2,J=d/3,d/=2);for(let i=0;i<d;i+=3){const n=t.Cartesian3.fromArray(l,i,U);if(r.st&&!e.defined(u)){let e=t.Matrix3.multiplyByVector(q,n,D);e=f.scaleToGeodeticSurface(e,e);const o=h.projectPointOntoPlane(e,z);t.Cartesian2.subtract(o,C,o);const r=a.CesiumMath.clamp(o.x/p.width,0,1),i=a.CesiumMath.clamp(o.y/p.height,0,1);m&&(P[I+J]=r,P[I+1+J]=i),g&&(P[I]=r,P[I+1]=i),I+=2}if(r.normal||r.tangent||r.bitangent||s){const e=E+1,c=E+2;if(y){if(i+3<d){const e=t.Cartesian3.fromArray(l,i+3,F);if(Q){const o=t.Cartesian3.fromArray(l,i+d,R);_&&O(n,e,o,f),t.Cartesian3.subtract(e,n,e),t.Cartesian3.subtract(o,n,o),v=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,v),v),Q=!1}t.Cartesian3.equalsEpsilon(e,n,a.CesiumMath.EPSILON10)&&(Q=!0)}(r.tangent||r.bitangent)&&(H=f.geodeticSurfaceNormal(n,H),r.tangent&&(G=t.Cartesian3.normalize(t.Cartesian3.cross(H,v,G),G)))}else v=f.geodeticSurfaceNormal(n,v),(r.tangent||r.bitangent)&&(_&&(M=t.Cartesian3.fromArray(x,E,M),k=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,k),k=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,k,k),k),r.bitangent&&(S=t.Cartesian3.normalize(t.Cartesian3.cross(M,k,S),S))),G=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,v,G),G=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,G,G),G),r.bitangent&&(H=t.Cartesian3.normalize(t.Cartesian3.cross(v,G,H),H)));r.normal&&(o.wall?(x[E+Z]=v.x,x[e+Z]=v.y,x[c+Z]=v.z):m&&(x[E+Z]=-v.x,x[e+Z]=-v.y,x[c+Z]=-v.z),(g&&!_||y)&&(x[E]=v.x,x[e]=v.y,x[c]=v.z)),s&&(y&&(v=f.geodeticSurfaceNormal(n,v)),A[E+Z]=-v.x,A[e+Z]=-v.y,A[c+Z]=-v.z),r.tangent&&(o.wall?(T[E+Z]=G.x,T[e+Z]=G.y,T[c+Z]=G.z):m&&(T[E+Z]=-G.x,T[e+Z]=-G.y,T[c+Z]=-G.z),g&&(_?(T[E]=k.x,T[e]=k.y,T[c]=k.z):(T[E]=G.x,T[e]=G.y,T[c]=G.z))),r.bitangent&&(m&&(w[E+Z]=H.x,w[e+Z]=H.y,w[c+Z]=H.z),g&&(_?(w[E]=S.x,w[e]=S.y,w[c]=S.z):(w[E]=H.x,w[e]=H.y,w[c]=H.z))),E+=3}}r.st&&!e.defined(u)&&(n.attributes.st=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:P})),r.normal&&(n.attributes.normal=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x})),r.tangent&&(n.attributes.tangent=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),r.bitangent&&(n.attributes.bitangent=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),s&&(n.attributes.extrudeDirection=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A}))}if(o.extrude&&e.defined(o.offsetAttribute)){const e=l.length/3;let t=new Uint8Array(e);if(o.offsetAttribute===p.GeometryOffsetAttribute.TOP)g&&m||y?t=t.fill(1,0,e/2):g&&(t=t.fill(1));else{const e=o.offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}n.attributes.applyOffset=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return n}const q=new t.Cartographic,K=new t.Cartographic,Z={westOverIDL:0,eastOverIDL:0};let J=new s.EllipsoidGeodesic;function X(r,i,n,l,c){if(c=e.defaultValue(c,new t.Rectangle),!e.defined(r)||r.length<3)return c.west=0,c.north=0,c.south=0,c.east=0,c;if(n===o.ArcType.RHUMB)return t.Rectangle.fromCartesianArray(r,i,c);J.ellipsoid.equals(i)||(J=new s.EllipsoidGeodesic(void 0,void 0,i)),c.west=Number.POSITIVE_INFINITY,c.east=Number.NEGATIVE_INFINITY,c.south=Number.POSITIVE_INFINITY,c.north=Number.NEGATIVE_INFINITY,Z.westOverIDL=Number.POSITIVE_INFINITY,Z.eastOverIDL=Number.NEGATIVE_INFINITY;const u=1/a.CesiumMath.chordLength(l,i.maximumRadius),p=r.length;let d,y=i.cartesianToCartographic(r[0],K),g=q;for(let e=1;e<p;e++)d=g,g=y,y=i.cartesianToCartographic(r[e],d),J.setEndPoints(g,y),ee(J,u,c,Z);return d=g,g=y,y=i.cartesianToCartographic(r[0],d),J.setEndPoints(g,y),ee(J,u,c,Z),c.east-c.west>Z.eastOverIDL-Z.westOverIDL&&(c.west=Z.westOverIDL,c.east=Z.eastOverIDL,c.east>a.CesiumMath.PI&&(c.east=c.east-a.CesiumMath.TWO_PI),c.west>a.CesiumMath.PI&&(c.west=c.west-a.CesiumMath.TWO_PI)),c}const $=new t.Cartographic;function ee(e,t,o,r){const i=e.surfaceDistance,n=Math.ceil(i*t),s=n>0?i/(n-1):Number.POSITIVE_INFINITY;let l=0;for(let c=0;c<n;c++){const t=e.interpolateUsingSurfaceDistance(l,$);l+=s;const i=t.longitude,n=t.latitude;o.west=Math.min(o.west,i),o.east=Math.max(o.east,i),o.south=Math.min(o.south,n),o.north=Math.max(o.north,n);const c=i>=0?i:i+a.CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,c),r.eastOverIDL=Math.max(r.eastOverIDL,c)}}const te=[];function oe(t,o,r,i,n,a,s,c,p,d){const h={walls:[]};let f;if(s||c){const n=g.PolygonGeometryLibrary.createGeometryFromPositions(t,o,r,i,a,p,d),l=n.attributes.position.values,m=n.indices;let b,_;if(s&&c){const t=l.concat(l);b=t.length/3,_=y.IndexDatatype.createTypedArray(b,2*m.length),_.set(m);const o=m.length,i=b/2;for(f=0;f<o;f+=3){const e=_[f]+i,t=_[f+1]+i,r=_[f+2]+i;_[f+o]=r,_[f+1+o]=t,_[f+2+o]=e}if(n.attributes.position.values=t,a&&p.normal){const e=n.attributes.normal.values;n.attributes.normal.values=new Float32Array(t.length),n.attributes.normal.values.set(e)}if(p.st&&e.defined(r)){const e=n.attributes.st.values;n.attributes.st.values=new Float32Array(2*b),n.attributes.st.values=e.concat(e)}n.indices=_}else if(c){for(b=l.length/3,_=y.IndexDatatype.createTypedArray(b,m.length),f=0;f<m.length;f+=3)_[f]=m[f+2],_[f+1]=m[f+1],_[f+2]=m[f];n.indices=_}h.topAndBottom=new u.GeometryInstance({geometry:n})}let b=n.outerRing,_=l.EllipsoidTangentPlane.fromPoints(b,t),C=_.projectPointsOntoPlane(b,te),P=m.PolygonPipeline.computeWindingOrder2D(C);P===m.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());let x=g.PolygonGeometryLibrary.computeWallGeometry(b,r,t,i,a,d);h.walls.push(new u.GeometryInstance({geometry:x}));const T=n.holes;for(f=0;f<T.length;f++){let e=T[f];_=l.EllipsoidTangentPlane.fromPoints(e,t),C=_.projectPointsOntoPlane(e,te),P=m.PolygonPipeline.computeWindingOrder2D(C),P===m.WindingOrder.COUNTER_CLOCKWISE&&(e=e.slice().reverse()),x=g.PolygonGeometryLibrary.computeWallGeometry(e,r,t,i,a,d),h.walls.push(new u.GeometryInstance({geometry:x}))}return h}function re(r){if(n.Check.typeOf.object("options",r),n.Check.typeOf.object("options.polygonHierarchy",r.polygonHierarchy),e.defined(r.perPositionHeight)&&r.perPositionHeight&&e.defined(r.height))throw new n.DeveloperError("Cannot use both options.perPositionHeight and options.height");if(e.defined(r.arcType)&&r.arcType!==o.ArcType.GEODESIC&&r.arcType!==o.ArcType.RHUMB)throw new n.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const i=r.polygonHierarchy,s=e.defaultValue(r.vertexFormat,h.VertexFormat.DEFAULT),l=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),c=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(r.stRotation,0),p=r.textureCoordinates,d=e.defaultValue(r.perPositionHeight,!1),y=d&&e.defined(r.extrudedHeight);let m=e.defaultValue(r.height,0),f=e.defaultValue(r.extrudedHeight,m);if(!y){const e=Math.max(m,f);f=Math.min(m,f),m=e}this._vertexFormat=h.VertexFormat.clone(s),this._ellipsoid=t.Ellipsoid.clone(l),this._granularity=c,this._stRotation=u,this._height=m,this._extrudedHeight=f,this._closeTop=e.defaultValue(r.closeTop,!0),this._closeBottom=e.defaultValue(r.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=d,this._perPositionHeightExtrude=y,this._shadowVolume=e.defaultValue(r.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=r.offsetAttribute,this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=p,this.packedLength=g.PolygonGeometryLibrary.computeHierarchyPackedLength(i,t.Cartesian3)+t.Ellipsoid.packedLength+h.VertexFormat.packedLength+(p?g.PolygonGeometryLibrary.computeHierarchyPackedLength(p,t.Cartesian2):1)+12}re.fromPositions=function(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT),n.Check.defined("options.positions",t.positions);const o={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new re(o)},re.pack=function(o,r,i){return n.Check.typeOf.object("value",o),n.Check.defined("array",r),i=e.defaultValue(i,0),i=g.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,r,i,t.Cartesian3),t.Ellipsoid.pack(o._ellipsoid,r,i),i+=t.Ellipsoid.packedLength,h.VertexFormat.pack(o._vertexFormat,r,i),i+=h.VertexFormat.packedLength,r[i++]=o._height,r[i++]=o._extrudedHeight,r[i++]=o._granularity,r[i++]=o._stRotation,r[i++]=o._perPositionHeightExtrude?1:0,r[i++]=o._perPositionHeight?1:0,r[i++]=o._closeTop?1:0,r[i++]=o._closeBottom?1:0,r[i++]=o._shadowVolume?1:0,r[i++]=e.defaultValue(o._offsetAttribute,-1),r[i++]=o._arcType,e.defined(o._textureCoordinates)?i=g.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,r,i,t.Cartesian2):r[i++]=-1,r[i++]=o.packedLength,r};const ie=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),ne=new h.VertexFormat,ae={polygonHierarchy:{}};function se(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const o=e._ellipsoid,r=e._polygonHierarchy.positions,i=e.rectangle;return c.Geometry._textureCoordinateRotationPoints(r,t,o,i)}function le(o,r){return e.defined(r)&&(o=re.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),re.createGeometry(o)}return re.unpack=function(o,r,i){n.Check.defined("array",o),r=e.defaultValue(r,0);const a=g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian3);r=a.startingIndex,delete a.startingIndex;const s=t.Ellipsoid.unpack(o,r,ie);r+=t.Ellipsoid.packedLength;const l=h.VertexFormat.unpack(o,r,ne);r+=h.VertexFormat.packedLength;const c=o[r++],u=o[r++],p=o[r++],d=o[r++],y=1===o[r++],m=1===o[r++],f=1===o[r++],b=1===o[r++],_=1===o[r++],C=o[r++],P=o[r++],x=-1===o[r]?void 0:g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian2);e.defined(x)?(r=x.startingIndex,delete x.startingIndex):r++;const T=o[r++];return e.defined(i)||(i=new re(ae)),i._polygonHierarchy=a,i._ellipsoid=t.Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=h.VertexFormat.clone(l,i._vertexFormat),i._height=c,i._extrudedHeight=u,i._granularity=p,i._stRotation=d,i._perPositionHeightExtrude=y,i._perPositionHeight=m,i._closeTop=f,i._closeBottom=b,i._shadowVolume=_,i._offsetAttribute=-1===C?void 0:C,i._arcType=P,i._textureCoordinates=x,i.packedLength=T,i},re.computeRectangle=function(r,i){n.Check.typeOf.object("options",r),n.Check.typeOf.object("options.polygonHierarchy",r.polygonHierarchy);const s=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(r.arcType,o.ArcType.GEODESIC);if(l!==o.ArcType.GEODESIC&&l!==o.ArcType.RHUMB)throw new n.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const c=r.polygonHierarchy,u=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84);return X(c.positions,u,l,s,i)},re.createGeometry=function(t){const o=t._vertexFormat,r=t._ellipsoid,n=t._granularity,s=t._stRotation,h=t._polygonHierarchy,f=t._perPositionHeight,b=t._closeTop,_=t._closeBottom,C=t._arcType,P=t._textureCoordinates,x=e.defined(P);let T=h.positions;if(T.length<3)return;const w=l.EllipsoidTangentPlane.fromPoints(T,r),A=g.PolygonGeometryLibrary.polygonsFromHierarchy(h,x,w.projectPointsOntoPlane.bind(w),!f,r),I=A.hierarchy,E=A.polygons,v=function(e){return e},G=x?g.PolygonGeometryLibrary.polygonsFromHierarchy(P,!0,v,!1).polygons:void 0;if(0===I.length)return;T=I[0].outerRing;const O=g.PolygonGeometryLibrary.computeBoundingRectangle(w.plane.normal,w.projectPointOntoPlane.bind(w),T,s,H),D=[],V=t._height,L=t._extrudedHeight,N=t._perPositionHeightExtrude||!a.CesiumMath.equalsEpsilon(V,L,0,a.CesiumMath.EPSILON2),F={perPositionHeight:f,vertexFormat:o,geometry:void 0,tangentPlane:w,boundingRectangle:O,ellipsoid:r,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:C};let R;if(N)for(F.extrude=!0,F.top=b,F.bottom=_,F.shadowVolume=t._shadowVolume,F.offsetAttribute=t._offsetAttribute,R=0;R<E.length;R++){const e=oe(r,E[R],x?G[R]:void 0,n,I[R],f,b,_,o,C);let t;b&&_?(t=e.topAndBottom,F.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,L,r,f)):b?(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,V,r,!f),F.geometry=t.geometry):_&&(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,L,r,!0),F.geometry=t.geometry),(b||_)&&(F.wall=!1,t.geometry=Q(F),D.push(t));const i=e.walls;F.wall=!0;for(let o=0;o<i.length;o++){const e=i[o];F.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,V,L,r,f),e.geometry=Q(F),D.push(e)}}else for(R=0;R<E.length;R++){const i=new u.GeometryInstance({geometry:g.PolygonGeometryLibrary.createGeometryFromPositions(r,E[R],x?G[R]:void 0,n,f,o,C)});if(i.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(i.geometry.attributes.position.values,V,r,!f),F.geometry=i.geometry,i.geometry=Q(F),e.defined(t._offsetAttribute)){const e=i.geometry.attributes.position.values.length,o=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(o);i.geometry.attributes.applyOffset=new c.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}D.push(i)}const M=d.GeometryPipeline.combineInstances(D)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=y.IndexDatatype.createTypedArray(M.attributes.position.values.length/3,M.indices);const k=M.attributes,S=i.BoundingSphere.fromVertices(k.position.values);return o.position||delete k.position,new c.Geometry({attributes:k,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S,offsetAttribute:t._offsetAttribute})},re.createShadowVolume=function(e,t,o){const r=e._granularity,i=e._ellipsoid,n=t(r,i),a=o(r,i);return new re({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:h.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(re.prototype,{rectangle:{get:function(){if(!e.defined(this._rectangle)){const e=this._polygonHierarchy.positions;this._rectangle=X(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=se(this)),this._textureCoordinateRotationPoints}}}),le}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./EllipsoidTangentPlane-53e32153","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonGeometryLibrary-5dd81ed2","./PolygonPipeline-113e3161","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./arrayRemoveDuplicates-06991c15","./EllipsoidRhumbLine-daebc75b"],(function(e,t,i,o,r,n,a,s,l,y,p,c,u,d,f,g,h,m,b,P,E,A,_,G,T){"use strict";const H=[],L=[];function C(e,t,o,r,p){const c=a.EllipsoidTangentPlane.fromPoints(t,e),g=c.projectPointsOntoPlane(t,H),h=f.PolygonPipeline.computeWindingOrder2D(g);let m,b;h===f.WindingOrder.CLOCKWISE&&(g.reverse(),t=t.slice().reverse());let P=t.length,E=0;if(r)for(m=new Float64Array(2*P*3),b=0;b<P;b++){const e=t[b],i=t[(b+1)%P];m[E++]=e.x,m[E++]=e.y,m[E++]=e.z,m[E++]=i.x,m[E++]=i.y,m[E++]=i.z}else{let r=0;if(p===i.ArcType.GEODESIC)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%P],o);else if(p===i.ArcType.RHUMB)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%P],o);for(m=new Float64Array(3*r),b=0;b<P;b++){let r;p===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%P],o,L):p===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%P],o,L));const n=r.length;for(let e=0;e<n;++e)m[E++]=r[e]}}P=m.length/3;const A=2*P,_=u.IndexDatatype.createTypedArray(P,A);for(E=0,b=0;b<P-1;b++)_[E++]=b,_[E++]=b+1;return _[E++]=P-1,_[E++]=0,new y.GeometryInstance({geometry:new s.Geometry({attributes:new l.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})}),indices:_,primitiveType:s.PrimitiveType.LINES})})}function v(e,t,o,r,p){const c=a.EllipsoidTangentPlane.fromPoints(t,e),g=c.projectPointsOntoPlane(t,H),h=f.PolygonPipeline.computeWindingOrder2D(g);let m,b;h===f.WindingOrder.CLOCKWISE&&(g.reverse(),t=t.slice().reverse());let P=t.length;const E=new Array(P);let A=0;if(r)for(m=new Float64Array(2*P*3*2),b=0;b<P;++b){E[b]=A/3;const e=t[b],i=t[(b+1)%P];m[A++]=e.x,m[A++]=e.y,m[A++]=e.z,m[A++]=i.x,m[A++]=i.y,m[A++]=i.z}else{let r=0;if(p===i.ArcType.GEODESIC)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%P],o);else if(p===i.ArcType.RHUMB)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%P],o);for(m=new Float64Array(3*r*2),b=0;b<P;++b){let r;E[b]=A/3,p===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%P],o,L):p===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%P],o,L));const n=r.length;for(let e=0;e<n;++e)m[A++]=r[e]}}P=m.length/6;const _=E.length,G=2*(2*P+_),T=u.IndexDatatype.createTypedArray(P+_,G);for(A=0,b=0;b<P;++b)T[A++]=b,T[A++]=(b+1)%P,T[A++]=b+P,T[A++]=(b+1)%P+P;for(b=0;b<_;b++){const e=E[b];T[A++]=e,T[A++]=e+P}return new y.GeometryInstance({geometry:new s.Geometry({attributes:new l.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})}),indices:T,primitiveType:s.PrimitiveType.LINES})})}function O(o){if(r.Check.typeOf.object("options",o),r.Check.typeOf.object("options.polygonHierarchy",o.polygonHierarchy),o.perPositionHeight&&e.defined(o.height))throw new r.DeveloperError("Cannot use both options.perPositionHeight and options.height");if(e.defined(o.arcType)&&o.arcType!==i.ArcType.GEODESIC&&o.arcType!==i.ArcType.RHUMB)throw new r.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const a=o.polygonHierarchy,s=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(o.granularity,n.CesiumMath.RADIANS_PER_DEGREE),y=e.defaultValue(o.perPositionHeight,!1),p=y&&e.defined(o.extrudedHeight),c=e.defaultValue(o.arcType,i.ArcType.GEODESIC);let u=e.defaultValue(o.height,0),f=e.defaultValue(o.extrudedHeight,u);if(!p){const e=Math.max(u,f);f=Math.min(u,f),u=e}this._ellipsoid=t.Ellipsoid.clone(s),this._granularity=l,this._height=u,this._extrudedHeight=f,this._arcType=c,this._polygonHierarchy=a,this._perPositionHeight=y,this._perPositionHeightExtrude=p,this._offsetAttribute=o.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=d.PolygonGeometryLibrary.computeHierarchyPackedLength(a,t.Cartesian3)+t.Ellipsoid.packedLength+8}O.pack=function(i,o,n){return r.Check.typeOf.object("value",i),r.Check.defined("array",o),n=e.defaultValue(n,0),n=d.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,o,n,t.Cartesian3),t.Ellipsoid.pack(i._ellipsoid,o,n),n+=t.Ellipsoid.packedLength,o[n++]=i._height,o[n++]=i._extrudedHeight,o[n++]=i._granularity,o[n++]=i._perPositionHeightExtrude?1:0,o[n++]=i._perPositionHeight?1:0,o[n++]=i._arcType,o[n++]=e.defaultValue(i._offsetAttribute,-1),o[n]=i.packedLength,o};const D=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),x={polygonHierarchy:{}};function I(i,o){return e.defined(o)&&(i=O.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),O.createGeometry(i)}return O.unpack=function(i,o,n){r.Check.defined("array",i),o=e.defaultValue(o,0);const a=d.PolygonGeometryLibrary.unpackPolygonHierarchy(i,o,t.Cartesian3);o=a.startingIndex,delete a.startingIndex;const s=t.Ellipsoid.unpack(i,o,D);o+=t.Ellipsoid.packedLength;const l=i[o++],y=i[o++],p=i[o++],c=1===i[o++],u=1===i[o++],f=i[o++],g=i[o++],h=i[o];return e.defined(n)||(n=new O(x)),n._polygonHierarchy=a,n._ellipsoid=t.Ellipsoid.clone(s,n._ellipsoid),n._height=l,n._extrudedHeight=y,n._granularity=p,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=-1===g?void 0:g,n.packedLength=h,n},O.fromPositions=function(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT),r.Check.defined("options.positions",t.positions);const i={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute};return new O(i)},O.createGeometry=function(t){const i=t._ellipsoid,r=t._granularity,a=t._polygonHierarchy,l=t._perPositionHeight,y=t._arcType,u=d.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(a,!l,i);if(0===u.length)return;let g;const h=[],m=n.CesiumMath.chordLength(r,i.maximumRadius),b=t._height,P=t._extrudedHeight,E=t._perPositionHeightExtrude||!n.CesiumMath.equalsEpsilon(b,P,0,n.CesiumMath.EPSILON2);let A,_;if(E)for(_=0;_<u.length;_++){if(g=v(i,u[_],m,l,y),g.geometry=d.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(g.geometry,b,P,i,l),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===p.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(A=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,i=i.fill(A)),g.geometry.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}h.push(g)}else for(_=0;_<u.length;_++){if(g=C(i,u[_],m,l,y),g.geometry.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(g.geometry.attributes.position.values,b,i,!l),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length;A=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(A);g.geometry.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}h.push(g)}const G=c.GeometryPipeline.combineInstances(h)[0],T=o.BoundingSphere.fromVertices(G.attributes.position.values);return new s.Geometry({attributes:G.attributes,indices:G.indices,primitiveType:G.primitiveType,boundingSphere:T,offsetAttribute:t._offsetAttribute})},I}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./arrayRemoveDuplicates-06991c15","./Transforms-3ac41eb6","./Color-305ce16b","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolylinePipeline-0e310844","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,t,o,r,n,i,a,l,s,c,p,d,u,f,y,m,h,C,g,w){"use strict";const E=[];function _(e,t,o,r,n){const a=E;let l;a.length=n;const s=o.red,c=o.green,p=o.blue,d=o.alpha,u=r.red,f=r.green,y=r.blue,m=r.alpha;if(i.Color.equals(o,r)){for(l=0;l<n;l++)a[l]=i.Color.clone(o);return a}const h=(u-s)/n,C=(f-c)/n,g=(y-p)/n,w=(m-d)/n;for(l=0;l<n;l++)a[l]=new i.Color(s+l*h,c+l*C,p+l*g,d+l*w);return a}function b(r){r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT);const n=r.positions,s=r.colors,c=e.defaultValue(r.width,1),p=e.defaultValue(r.colorsPerVertex,!1);if(!e.defined(n)||n.length<2)throw new l.DeveloperError("At least two positions are required.");if("number"!==typeof c)throw new l.DeveloperError("width must be a number");if(e.defined(s)&&(p&&s.length<n.length||!p&&s.length<n.length-1))throw new l.DeveloperError("colors has an invalid length.");this._positions=n,this._colors=s,this._width=c,this._colorsPerVertex=p,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(r.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";let d=1+n.length*t.Cartesian3.packedLength;d+=e.defined(s)?1+s.length*i.Color.packedLength:1,this.packedLength=d+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}b.pack=function(o,r,n){if(!e.defined(o))throw new l.DeveloperError("value is required");if(!e.defined(r))throw new l.DeveloperError("array is required");let a;n=e.defaultValue(n,0);const s=o._positions;let c=s.length;for(r[n++]=c,a=0;a<c;++a,n+=t.Cartesian3.packedLength)t.Cartesian3.pack(s[a],r,n);const p=o._colors;for(c=e.defined(p)?p.length:0,r[n++]=c,a=0;a<c;++a,n+=i.Color.packedLength)i.Color.pack(p[a],r,n);return t.Ellipsoid.pack(o._ellipsoid,r,n),n+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,r,n),n+=u.VertexFormat.packedLength,r[n++]=o._width,r[n++]=o._colorsPerVertex?1:0,r[n++]=o._arcType,r[n]=o._granularity,r};const A=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),P=new u.VertexFormat,v={positions:void 0,colors:void 0,ellipsoid:A,vertexFormat:P,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};b.unpack=function(o,r,n){if(!e.defined(o))throw new l.DeveloperError("array is required");let a;r=e.defaultValue(r,0);let s=o[r++];const c=new Array(s);for(a=0;a<s;++a,r+=t.Cartesian3.packedLength)c[a]=t.Cartesian3.unpack(o,r);s=o[r++];const p=s>0?new Array(s):void 0;for(a=0;a<s;++a,r+=i.Color.packedLength)p[a]=i.Color.unpack(o,r);const d=t.Ellipsoid.unpack(o,r,A);r+=t.Ellipsoid.packedLength;const f=u.VertexFormat.unpack(o,r,P);r+=u.VertexFormat.packedLength;const y=o[r++],m=1===o[r++],h=o[r++],C=o[r];return e.defined(n)?(n._positions=c,n._colors=p,n._ellipsoid=t.Ellipsoid.clone(d,n._ellipsoid),n._vertexFormat=u.VertexFormat.clone(f,n._vertexFormat),n._width=y,n._colorsPerVertex=m,n._arcType=h,n._granularity=C,n):(v.positions=c,v.colors=p,v.width=y,v.colorsPerVertex=m,v.arcType=h,v.granularity=C,new b(v))};const D=new t.Cartesian3,x=new t.Cartesian3,T=new t.Cartesian3,k=new t.Cartesian3;function V(o,r){return e.defined(r)&&(o=b.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),b.createGeometry(o)}return b.createGeometry=function(l){const u=l._width,f=l._vertexFormat;let y=l._colors;const m=l._colorsPerVertex,h=l._arcType,C=l._granularity,g=l._ellipsoid;let w,b,A;const P=[];let v=r.arrayRemoveDuplicates(l._positions,t.Cartesian3.equalsEpsilon,!1,P);if(e.defined(y)&&P.length>0){let e=0,t=P[0];y=y.filter((function(o,r){let n=!1;return n=m?r===t||0===r&&1===t:r+1===t,!n||(e++,t=P[e],!1)}))}let V=v.length;if(V<2||u<=0)return;if(h===o.ArcType.GEODESIC||h===o.ArcType.RHUMB){let t,r;h===o.ArcType.GEODESIC?(t=a.CesiumMath.chordLength(C,g.maximumRadius),r=d.PolylinePipeline.numberOfPoints):(t=C,r=d.PolylinePipeline.numberOfPointsRhumbLine);const n=d.PolylinePipeline.extractHeights(v,g);if(e.defined(y)){let e=1;for(w=0;w<V-1;++w)e+=r(v[w],v[w+1],t);const o=new Array(e);let n=0;for(w=0;w<V-1;++w){const a=v[w],l=v[w+1],s=y[w],c=r(a,l,t);if(m&&w<e){const e=y[w+1],t=_(a,l,s,e,c),r=t.length;for(b=0;b<r;++b)o[n++]=t[b]}else for(b=0;b<c;++b)o[n++]=i.Color.clone(s)}o[n]=i.Color.clone(y[y.length-1]),y=o,E.length=0}v=h===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:v,minDistance:t,ellipsoid:g,height:n}):d.PolylinePipeline.generateCartesianRhumbArc({positions:v,granularity:t,ellipsoid:g,height:n})}V=v.length;const L=4*V-4,F=new Float64Array(3*L),G=new Float64Array(3*L),O=new Float64Array(3*L),R=new Float32Array(2*L),I=f.st?new Float32Array(2*L):void 0,S=e.defined(y)?new Uint8Array(4*L):void 0;let B,U=0,N=0,q=0,M=0;for(b=0;b<V;++b){let o,r;0===b?(B=D,t.Cartesian3.subtract(v[0],v[1],B),t.Cartesian3.add(v[0],B,B)):B=v[b-1],t.Cartesian3.clone(B,T),t.Cartesian3.clone(v[b],x),b===V-1?(B=D,t.Cartesian3.subtract(v[V-1],v[V-2],B),t.Cartesian3.add(v[V-1],B,B)):B=v[b+1],t.Cartesian3.clone(B,k),e.defined(S)&&(o=0===b||m?y[b]:y[b-1],b!==V-1&&(r=y[b]));const n=0===b?2:0,a=b===V-1?2:4;for(A=n;A<a;++A){t.Cartesian3.pack(x,F,U),t.Cartesian3.pack(T,G,U),t.Cartesian3.pack(k,O,U),U+=3;const n=A-2<0?-1:1;if(R[N++]=A%2*2-1,R[N++]=n*u,f.st&&(I[q++]=b/(V-1),I[q++]=Math.max(R[N-2],0)),e.defined(S)){const e=A<2?o:r;S[M++]=i.Color.floatToByte(e.red),S[M++]=i.Color.floatToByte(e.green),S[M++]=i.Color.floatToByte(e.blue),S[M++]=i.Color.floatToByte(e.alpha)}}}const H=new c.GeometryAttributes;H.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F}),H.prevPosition=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),H.nextPosition=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),H.expandAndWidth=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:R}),f.st&&(H.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I})),e.defined(S)&&(H.color=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));const W=p.IndexDatatype.createTypedArray(L,6*V-6);let Y=0,j=0;const z=V-1;for(b=0;b<z;++b)W[j++]=Y,W[j++]=Y+2,W[j++]=Y+1,W[j++]=Y+1,W[j++]=Y+2,W[j++]=Y+3,Y+=4;return new s.Geometry({attributes:H,indices:W,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:n.BoundingSphere.fromPoints(v),geometryType:s.GeometryType.POLYLINES})},V}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./arrayRemoveDuplicates-06991c15","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./PolylineVolumeGeometryLibrary-5ddfb558","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidTangentPlane-53e32153","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./PolylinePipeline-0e310844","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea"],(function(e,t,n,o,i,r,a,l,s,p,c,d,u,m,y,g,f,h,b,E,P,_,v,k,V,L){"use strict";function w(e,t,n,o){const l=new p.GeometryAttributes;o.position&&(l.position=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const m=t.length,y=e.length/3,g=(y-2*m)/(2*m),f=u.PolygonPipeline.triangulate(t),h=(g-1)*m*6+2*f.length,b=d.IndexDatatype.createTypedArray(y,h);let E,P,_,v,k,V;const L=2*m;let w=0;for(E=0;E<g-1;E++){for(P=0;P<m-1;P++)_=2*P+E*m*2,V=_+L,v=_+1,k=v+L,b[w++]=v,b[w++]=_,b[w++]=k,b[w++]=k,b[w++]=_,b[w++]=V;_=2*m-2+E*m*2,v=_+1,k=v+L,V=_+L,b[w++]=v,b[w++]=_,b[w++]=k,b[w++]=k,b[w++]=_,b[w++]=V}if(o.st||o.tangent||o.bitangent){const e=new Float32Array(2*y),o=1/(g-1),i=1/n.height,a=n.height/2;let p,c,d=0;for(E=0;E<g;E++){for(p=E*o,c=i*(t[0].y+a),e[d++]=p,e[d++]=c,P=1;P<m;P++)c=i*(t[P].y+a),e[d++]=p,e[d++]=c,e[d++]=p,e[d++]=c;c=i*(t[0].y+a),e[d++]=p,e[d++]=c}for(P=0;P<m;P++)p=0,c=i*(t[P].y+a),e[d++]=p,e[d++]=c;for(P=0;P<m;P++)p=(g-1)*o,c=i*(t[P].y+a),e[d++]=p,e[d++]=c;l.st=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const x=y-2*m;for(E=0;E<f.length;E+=3){const e=f[E]+x,t=f[E+1]+x,n=f[E+2]+x;b[w++]=e,b[w++]=t,b[w++]=n,b[w++]=n+m,b[w++]=t+m,b[w++]=e+m}let C=new s.Geometry({attributes:l,indices:b,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(C=c.GeometryPipeline.computeNormal(C)),o.tangent||o.bitangent){try{C=c.GeometryPipeline.computeTangentAndBitangent(C)}catch(D){a.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(C.attributes.tangent=void 0),o.bitangent||(C.attributes.bitangent=void 0),o.st||(C.attributes.st=void 0)}return C}function x(n){n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT);const o=n.polylinePositions,i=n.shapePositions;if(!e.defined(o))throw new l.DeveloperError("options.polylinePositions is required.");if(!e.defined(i))throw new l.DeveloperError("options.shapePositions is required.");this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,a.CornerType.ROUNDED),this._vertexFormat=m.VertexFormat.clone(e.defaultValue(n.vertexFormat,m.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let s=1+o.length*t.Cartesian3.packedLength;s+=1+i.length*t.Cartesian2.packedLength,this.packedLength=s+t.Ellipsoid.packedLength+m.VertexFormat.packedLength+2}x.pack=function(n,o,i){if(!e.defined(n))throw new l.DeveloperError("value is required");if(!e.defined(o))throw new l.DeveloperError("array is required");let r;i=e.defaultValue(i,0);const a=n._positions;let s=a.length;for(o[i++]=s,r=0;r<s;++r,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(a[r],o,i);const p=n._shape;for(s=p.length,o[i++]=s,r=0;r<s;++r,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(p[r],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,m.VertexFormat.pack(n._vertexFormat,o,i),i+=m.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D=new m.VertexFormat,F={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,vertexFormat:D,cornerType:void 0,granularity:void 0};x.unpack=function(n,o,i){if(!e.defined(n))throw new l.DeveloperError("array is required");let r;o=e.defaultValue(o,0);let a=n[o++];const s=new Array(a);for(r=0;r<a;++r,o+=t.Cartesian3.packedLength)s[r]=t.Cartesian3.unpack(n,o);a=n[o++];const p=new Array(a);for(r=0;r<a;++r,o+=t.Cartesian2.packedLength)p[r]=t.Cartesian2.unpack(n,o);const c=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;const d=m.VertexFormat.unpack(n,o,D);o+=m.VertexFormat.packedLength;const u=n[o++],y=n[o];return e.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=m.VertexFormat.clone(d,i._vertexFormat),i._cornerType=u,i._granularity=y,i):(F.polylinePositions=s,F.shapePositions=p,F.cornerType=u,F.granularity=y,new x(F))};const A=new o.BoundingRectangle;function T(n,o){return e.defined(o)&&(n=x.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),x.createGeometry(n)}return x.createGeometry=function(e){const i=e._positions,r=n.arrayRemoveDuplicates(i,t.Cartesian3.equalsEpsilon);let l=e._shape;if(l=a.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(l),r.length<2||l.length<3)return;u.PolygonPipeline.computeWindingOrder2D(l)===u.WindingOrder.CLOCKWISE&&l.reverse();const s=o.BoundingRectangle.fromPoints(l,A),p=a.PolylineVolumeGeometryLibrary.computePositions(r,l,s,e,!0);return w(p,l,s,e._vertexFormat)},T}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./arrayRemoveDuplicates-06991c15","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./PolylineVolumeGeometryLibrary-5ddfb558","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidTangentPlane-53e32153","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./PolylinePipeline-0e310844","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b"],(function(e,i,n,t,o,r,a,l,s,p,d,c,u,y,f,h,g,m,E,P,_,b){"use strict";function k(e,i){const n=new p.GeometryAttributes;n.position=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});const t=i.length,a=n.position.values.length/3,l=e.length/3,c=l/t,u=d.IndexDatatype.createTypedArray(a,2*t*(c+1));let y,f,h=0;y=0;let g=y*t;for(f=0;f<t-1;f++)u[h++]=f+g,u[h++]=f+g+1;for(u[h++]=t-1+g,u[h++]=g,y=c-1,g=y*t,f=0;f<t-1;f++)u[h++]=f+g,u[h++]=f+g+1;for(u[h++]=t-1+g,u[h++]=g,y=0;y<c-1;y++){const e=t*y,i=e+t;for(f=0;f<t;f++)u[h++]=f+e,u[h++]=f+i}const m=new s.Geometry({attributes:n,indices:d.IndexDatatype.createTypedArray(a,u),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES});return m}function D(n){n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT);const t=n.polylinePositions,o=n.shapePositions;if(!e.defined(t))throw new l.DeveloperError("options.polylinePositions is required.");if(!e.defined(o))throw new l.DeveloperError("options.shapePositions is required.");this._positions=t,this._shape=o,this._ellipsoid=i.Ellipsoid.clone(e.defaultValue(n.ellipsoid,i.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,a.CornerType.ROUNDED),this._granularity=e.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let s=1+t.length*i.Cartesian3.packedLength;s+=1+o.length*i.Cartesian2.packedLength,this.packedLength=s+i.Ellipsoid.packedLength+2}D.pack=function(n,t,o){if(!e.defined(n))throw new l.DeveloperError("value is required");if(!e.defined(t))throw new l.DeveloperError("array is required");let r;o=e.defaultValue(o,0);const a=n._positions;let s=a.length;for(t[o++]=s,r=0;r<s;++r,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(a[r],t,o);const p=n._shape;for(s=p.length,t[o++]=s,r=0;r<s;++r,o+=i.Cartesian2.packedLength)i.Cartesian2.pack(p[r],t,o);return i.Ellipsoid.pack(n._ellipsoid,t,o),o+=i.Ellipsoid.packedLength,t[o++]=n._cornerType,t[o]=n._granularity,t};const v=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),C={polylinePositions:void 0,shapePositions:void 0,ellipsoid:v,height:void 0,cornerType:void 0,granularity:void 0};D.unpack=function(n,t,o){if(!e.defined(n))throw new l.DeveloperError("array is required");let r;t=e.defaultValue(t,0);let a=n[t++];const s=new Array(a);for(r=0;r<a;++r,t+=i.Cartesian3.packedLength)s[r]=i.Cartesian3.unpack(n,t);a=n[t++];const p=new Array(a);for(r=0;r<a;++r,t+=i.Cartesian2.packedLength)p[r]=i.Cartesian2.unpack(n,t);const d=i.Ellipsoid.unpack(n,t,v);t+=i.Ellipsoid.packedLength;const c=n[t++],u=n[t];return e.defined(o)?(o._positions=s,o._shape=p,o._ellipsoid=i.Ellipsoid.clone(d,o._ellipsoid),o._cornerType=c,o._granularity=u,o):(C.polylinePositions=s,C.shapePositions=p,C.cornerType=c,C.granularity=u,new D(C))};const w=new t.BoundingRectangle;function L(n,t){return e.defined(t)&&(n=D.unpack(n,t)),n._ellipsoid=i.Ellipsoid.clone(n._ellipsoid),D.createGeometry(n)}return D.createGeometry=function(e){const o=e._positions,r=n.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon);let l=e._shape;if(l=a.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(l),r.length<2||l.length<3)return;c.PolygonPipeline.computeWindingOrder2D(l)===c.WindingOrder.CLOCKWISE&&l.reverse();const s=t.BoundingRectangle.fromPoints(l,w),p=a.PolylineVolumeGeometryLibrary.computePositions(r,l,s,e,!1);return k(p,l)},L}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./RectangleGeometryLibrary-1cc211f1","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./EllipsoidRhumbLine-daebc75b"],(function(t,e,n,a,o,r,i,s,l,c,u,m,p,d,g,y,f,h,b,_,A,w){"use strict";const x=new e.Cartesian3,C=new e.Cartesian3,v=new e.Cartesian3,R=new e.Cartesian3,E=new e.Rectangle,G=new e.Cartesian2,F=new n.BoundingSphere,P=new n.BoundingSphere;function V(t,e){const n=new r.Geometry({attributes:new i.GeometryAttributes,primitiveType:r.PrimitiveType.TRIANGLES});return n.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}function D(t,n,a,o){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let c=0;const u=R,m=v;let p=C;if(n.normal||n.tangent||n.bitangent)for(let d=0;d<r;d+=3){const r=e.Cartesian3.fromArray(t,d,x),g=c+1,y=c+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,u),u)),n.normal&&(i[c]=p.x,i[g]=p.y,i[y]=p.z),n.tangent&&(s[c]=m.x,s[g]=m.y,s[y]=m.z),n.bitangent&&(l[c]=u.x,l[g]=u.y,l[y]=u.z),c+=3}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}const L=new e.Cartesian3,M=new e.Cartesian3;function O(t,n,a){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let c=0,u=0,m=0,p=!0,d=R,g=v,y=C;if(n.normal||n.tangent||n.bitangent)for(let f=0;f<r;f+=6){const h=e.Cartesian3.fromArray(t,f,x),b=e.Cartesian3.fromArray(t,(f+6)%r,L);if(p){const n=e.Cartesian3.fromArray(t,(f+3)%r,M);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,o.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(d=a.geodeticSurfaceNormal(h,d),n.tangent&&(g=e.Cartesian3.normalize(e.Cartesian3.cross(d,y,g),g))),n.normal&&(i[c++]=y.x,i[c++]=y.y,i[c++]=y.z,i[c++]=y.x,i[c++]=y.y,i[c++]=y.z),n.tangent&&(s[u++]=g.x,s[u++]=g.y,s[u++]=g.z,s[u++]=g.x,s[u++]=g.y,s[u++]=g.z),n.bitangent&&(l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=d.x,l[m++]=d.y,l[m++]=d.z)}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}function T(t,e){const n=t._vertexFormat,a=t._ellipsoid,i=e.height,s=e.width,l=e.northCap,c=e.southCap;let m=0,d=i,g=i,y=0;l&&(m=1,g-=1,y+=1),c&&(d-=1,g-=1,y+=1),y+=s*g;const f=n.position?new Float64Array(3*y):void 0,h=n.st?new Float32Array(2*y):void 0;let b=0,_=0;const A=x,w=G;let C=Number.MAX_VALUE,v=Number.MAX_VALUE,R=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let o=m;o<d;++o)for(let t=0;t<s;++t)p.RectangleGeometryLibrary.computePosition(e,a,n.st,o,t,A,w),f[b++]=A.x,f[b++]=A.y,f[b++]=A.z,n.st&&(h[_++]=w.x,h[_++]=w.y,C=Math.min(C,w.x),v=Math.min(v,w.y),R=Math.max(R,w.x),E=Math.max(E,w.y));if(l&&(p.RectangleGeometryLibrary.computePosition(e,a,n.st,0,0,A,w),f[b++]=A.x,f[b++]=A.y,f[b++]=A.z,n.st&&(h[_++]=w.x,h[_++]=w.y,C=w.x,v=w.y,R=w.x,E=w.y)),c&&(p.RectangleGeometryLibrary.computePosition(e,a,n.st,i-1,0,A,w),f[b++]=A.x,f[b++]=A.y,f[b]=A.z,n.st&&(h[_++]=w.x,h[_]=w.y,C=Math.min(C,w.x),v=Math.min(v,w.y),R=Math.max(R,w.x),E=Math.max(E,w.y))),n.st&&(C<0||v<0||R>1||E>1))for(let o=0;o<h.length;o+=2)h[o]=(h[o]-C)/(R-C),h[o+1]=(h[o+1]-v)/(E-v);const F=D(f,n,a,e.tangentRotationMatrix);let P=6*(s-1)*(g-1);l&&(P+=3*(s-1)),c&&(P+=3*(s-1));const V=u.IndexDatatype.createTypedArray(y,P);let L,M=0,O=0;for(L=0;L<g-1;++L){for(let t=0;t<s-1;++t){const t=M,e=t+s,n=e+1,a=t+1;V[O++]=t,V[O++]=e,V[O++]=a,V[O++]=a,V[O++]=e,V[O++]=n,++M}++M}if(l||c){let t=y-1;const e=y-1;let n,a;if(l&&c&&(t=y-2),M=0,l)for(L=0;L<s-1;L++)n=M,a=n+1,V[O++]=t,V[O++]=n,V[O++]=a,++M;if(c)for(M=(g-1)*s,L=0;L<s-1;L++)n=M,a=n+1,V[O++]=n,V[O++]=e,V[O++]=a,++M}return F.indices=V,n.st&&(F.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:h})),F}function N(t,e,n,a,o){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}function k(t,e,n,a){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}const S=new d.VertexFormat;function I(n,a){const i=n._shadowVolume,p=n._offsetAttribute,g=n._vertexFormat,y=n._extrudedHeight,f=n._surfaceHeight,h=n._ellipsoid,b=a.height,_=a.width;let A;if(i){const t=d.VertexFormat.clone(g,S);t.normal=!0,n._vertexFormat=t}const w=T(n,a);i&&(n._vertexFormat=g);let x=m.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,f,h,!1);x=new Float64Array(x);let C=x.length;const v=2*C,R=new Float64Array(v);R.set(x);const E=m.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,y,h);R.set(E,C),w.attributes.position.values=R;const G=g.normal?new Float32Array(v):void 0,F=g.tangent?new Float32Array(v):void 0,P=g.bitangent?new Float32Array(v):void 0,V=g.st?new Float32Array(v/3*2):void 0;let D,I,H;if(g.normal){for(I=w.attributes.normal.values,G.set(I),A=0;A<C;A++)I[A]=-I[A];G.set(I,C),w.attributes.normal.values=G}if(i){I=w.attributes.normal.values,g.normal||(w.attributes.normal=void 0);const t=new Float32Array(v);for(A=0;A<C;A++)I[A]=-I[A];t.set(I,C),w.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}const z=t.defined(p);if(z){const t=C/3*2;let e=new Uint8Array(t);p===l.GeometryOffsetAttribute.TOP?e=e.fill(1,0,t/2):(H=p===l.GeometryOffsetAttribute.NONE?0:1,e=e.fill(H)),w.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(g.tangent){const t=w.attributes.tangent.values;for(F.set(t),A=0;A<C;A++)t[A]=-t[A];F.set(t,C),w.attributes.tangent.values=F}if(g.bitangent){const t=w.attributes.bitangent.values;P.set(t),P.set(t,C),w.attributes.bitangent.values=P}g.st&&(D=w.attributes.st.values,V.set(D),V.set(D,C/3*2),w.attributes.st.values=V);const B=w.indices,U=B.length,q=C/3,Y=u.IndexDatatype.createTypedArray(v/3,2*U);for(Y.set(B),A=0;A<U;A+=3)Y[A+U]=B[A+2]+q,Y[A+1+U]=B[A+1]+q,Y[A+2+U]=B[A]+q;w.indices=Y;const j=a.northCap,X=a.southCap;let Q=b,W=2,J=0,Z=4,K=4;j&&(W-=1,Q-=1,J+=1,Z-=2,K-=1),X&&(W-=1,Q-=1,J+=1,Z-=2,K-=1),J+=W*_+2*Q-Z;const $=2*(J+K);let tt=new Float64Array(3*$);const et=i?new Float32Array(3*$):void 0;let nt=z?new Uint8Array($):void 0,at=g.st?new Float32Array(2*$):void 0;const ot=p===l.GeometryOffsetAttribute.TOP;z&&!ot&&(H=p===l.GeometryOffsetAttribute.ALL?1:0,nt=nt.fill(H));let rt=0,it=0,st=0,lt=0;const ct=_*Q;let ut;for(A=0;A<ct;A+=_)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);if(X){const t=j?ct+1:ct;for(ut=3*t,A=0;A<2;A++)tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*t,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1)}else for(A=ct-_;A<ct;A++)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);for(A=ct-1;A>0;A-=_)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);if(j){const t=ct;for(ut=3*t,A=0;A<2;A++)tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*t,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1)}else for(A=_-1;A>=0;A--)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);let mt=O(tt,g,h);g.st&&(mt.attributes.st=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:at})),i&&(mt.attributes.extrudeDirection=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:et})),z&&(mt.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:nt}));const pt=u.IndexDatatype.createTypedArray($,6*J);let dt,gt,yt,ft;C=tt.length/3;let ht=0;for(A=0;A<C-1;A+=2){dt=A,ft=(dt+2)%C;const t=e.Cartesian3.fromArray(tt,3*dt,L),n=e.Cartesian3.fromArray(tt,3*ft,M);e.Cartesian3.equalsEpsilon(t,n,o.CesiumMath.EPSILON10)||(gt=(dt+1)%C,yt=(gt+2)%C,pt[ht++]=dt,pt[ht++]=gt,pt[ht++]=ft,pt[ht++]=ft,pt[ht++]=gt,pt[ht++]=yt)}return mt.indices=pt,mt=c.GeometryPipeline.combineInstances([new s.GeometryInstance({geometry:w}),new s.GeometryInstance({geometry:mt})]),mt[0]}const H=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3],z=new e.Cartographic,B=new e.Cartographic;function U(t,n,a,o,r){if(0===a)return e.Rectangle.clone(t,r);const i=p.RectangleGeometryLibrary.computeOptions(t,n,a,0,E,z),s=i.height,l=i.width,c=H;return p.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,c[0]),p.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,c[1]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,c[2]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,c[3]),e.Rectangle.fromCartesianArray(c,o,r)}function q(n){n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT);const r=n.rectangle;if(a.Check.typeOf.object("rectangle",r),e.Rectangle.validate(r),r.north<r.south)throw new a.DeveloperError("options.rectangle.north must be greater than or equal to options.rectangle.south");const i=t.defaultValue(n.height,0),s=t.defaultValue(n.extrudedHeight,i);this._rectangle=e.Rectangle.clone(r),this._granularity=t.defaultValue(n.granularity,o.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(i,s),this._rotation=t.defaultValue(n.rotation,0),this._stRotation=t.defaultValue(n.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(n.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(i,s),this._shadowVolume=t.defaultValue(n.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=n.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}q.packedLength=e.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,q.pack=function(n,o,r){return a.Check.typeOf.object("value",n),a.Check.defined("array",o),r=t.defaultValue(r,0),e.Rectangle.pack(n._rectangle,o,r),r+=e.Rectangle.packedLength,e.Ellipsoid.pack(n._ellipsoid,o,r),r+=e.Ellipsoid.packedLength,d.VertexFormat.pack(n._vertexFormat,o,r),r+=d.VertexFormat.packedLength,o[r++]=n._granularity,o[r++]=n._surfaceHeight,o[r++]=n._rotation,o[r++]=n._stRotation,o[r++]=n._extrudedHeight,o[r++]=n._shadowVolume?1:0,o[r]=t.defaultValue(n._offsetAttribute,-1),o};const Y=new e.Rectangle,j=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),X={rectangle:Y,ellipsoid:j,vertexFormat:S,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};q.unpack=function(n,o,r){a.Check.defined("array",n),o=t.defaultValue(o,0);const i=e.Rectangle.unpack(n,o,Y);o+=e.Rectangle.packedLength;const s=e.Ellipsoid.unpack(n,o,j);o+=e.Ellipsoid.packedLength;const l=d.VertexFormat.unpack(n,o,S);o+=d.VertexFormat.packedLength;const c=n[o++],u=n[o++],m=n[o++],p=n[o++],g=n[o++],y=1===n[o++],f=n[o];return t.defined(r)?(r._rectangle=e.Rectangle.clone(i,r._rectangle),r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(l,r._vertexFormat),r._granularity=c,r._surfaceHeight=u,r._rotation=m,r._stRotation=p,r._extrudedHeight=g,r._shadowVolume=y,r._offsetAttribute=-1===f?void 0:f,r):(X.granularity=c,X.height=u,X.rotation=m,X.stRotation=p,X.extrudedHeight=g,X.shadowVolume=y,X.offsetAttribute=-1===f?void 0:f,new q(X))},q.computeRectangle=function(n,r){n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT);const i=n.rectangle;if(a.Check.typeOf.object("rectangle",i),e.Rectangle.validate(i),i.north<i.south)throw new a.DeveloperError("options.rectangle.north must be greater than or equal to options.rectangle.south");const s=t.defaultValue(n.granularity,o.CesiumMath.RADIANS_PER_DEGREE),l=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84),c=t.defaultValue(n.rotation,0);return U(i,s,c,l,r)};const Q=new e.Matrix3,W=new n.Quaternion,J=new e.Cartographic;q.createGeometry=function(a){if(o.CesiumMath.equalsEpsilon(a._rectangle.north,a._rectangle.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(a._rectangle.east,a._rectangle.west,o.CesiumMath.EPSILON10))return;let i=a._rectangle;const s=a._ellipsoid,c=a._rotation,u=a._stRotation,d=a._vertexFormat,g=p.RectangleGeometryLibrary.computeOptions(i,a._granularity,c,u,E,z,B),y=Q;if(0!==u||0!==c){const t=e.Rectangle.center(i,J),a=s.geodeticSurfaceNormalCartographic(t,L);n.Quaternion.fromAxisAngle(a,-u,W),e.Matrix3.fromQuaternion(W,y)}else e.Matrix3.clone(e.Matrix3.IDENTITY,y);const f=a._surfaceHeight,h=a._extrudedHeight,b=!o.CesiumMath.equalsEpsilon(f,h,0,o.CesiumMath.EPSILON2);let _,A;if(g.lonScalar=1/a._rectangle.width,g.latScalar=1/a._rectangle.height,g.tangentRotationMatrix=y,i=a._rectangle,b){_=I(a,g);const t=n.BoundingSphere.fromRectangle3D(i,s,f,P),e=n.BoundingSphere.fromRectangle3D(i,s,h,F);A=n.BoundingSphere.union(t,e)}else{if(_=T(a,g),_.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,f,s,!1),t.defined(a._offsetAttribute)){const t=_.attributes.position.values.length,e=a._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(e);_.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}A=n.BoundingSphere.fromRectangle3D(i,s,f)}return d.position||delete _.attributes.position,new r.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:A,offsetAttribute:a._offsetAttribute})},q.createShadowVolume=function(t,e,n){const a=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);return new q({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};const Z=new e.Rectangle,K=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],$=new e.Matrix2,tt=new e.Cartographic;function et(t){if(0===t._stRotation)return[0,0,0,1,1,0];const n=e.Rectangle.clone(t._rectangle,Z),a=t._granularity,o=t._ellipsoid,r=t._rotation-t._stRotation,i=U(n,a,r,o,Z),s=K;s[0].x=i.west,s[0].y=i.south,s[1].x=i.west,s[1].y=i.north,s[2].x=i.east,s[2].y=i.south;const l=t.rectangle,c=e.Matrix2.fromRotation(t._stRotation,$),u=e.Rectangle.center(l,tt);for(let y=0;y<3;++y){const t=s[y];t.x-=u.longitude,t.y-=u.latitude,e.Matrix2.multiplyByVector(c,t,t),t.x+=u.longitude,t.y+=u.latitude,t.x=(t.x-l.west)/l.width,t.y=(t.y-l.south)/l.height}const m=s[0],p=s[1],d=s[2],g=new Array(6);return e.Cartesian2.pack(m,g),e.Cartesian2.pack(p,g,2),e.Cartesian2.pack(d,g,4),g}function nt(n,a){return t.defined(a)&&(n=q.unpack(n,a)),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),n._rectangle=e.Rectangle.clone(n._rectangle),q.createGeometry(n)}return Object.defineProperties(q.prototype,{rectangle:{get:function(){return t.defined(this._rotatedRectangle)||(this._rotatedRectangle=U(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=et(this)),this._textureCoordinateRotationPoints}}}),nt}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./RectangleGeometryLibrary-1cc211f1","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidRhumbLine-daebc75b"],(function(e,t,i,o,n,r,a,l,s,u,c,d,p,f,g){"use strict";const h=new i.BoundingSphere,y=new i.BoundingSphere,m=new t.Cartesian3,b=new t.Rectangle;function _(e,t){const i=e._ellipsoid,n=t.height,l=t.width,u=t.northCap,d=t.southCap;let p=n,f=2,g=0,h=4;u&&(f-=1,p-=1,g+=1,h-=2),d&&(f-=1,p-=1,g+=1,h-=2),g+=f*l+2*p-h;const y=new Float64Array(3*g);let b,_=0,E=0;const A=m;if(u)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,0,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;else for(b=0;b<l;b++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=l-1,E=1;E<n;E++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;if(E=n-1,!d)for(b=l-2;b>=0;b--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=0,E=n-2;E>0;E--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;const w=y.length/3*2,G=s.IndexDatatype.createTypedArray(y.length/3,w);let v=0;for(let o=0;o<y.length/3-1;o++)G[v++]=o,G[v++]=o+1;G[v++]=y.length/3-1,G[v++]=0;const R=new r.Geometry({attributes:new a.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});return R.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),R.indices=G,R}function E(e,t){const i=e._surfaceHeight,o=e._extrudedHeight,n=e._ellipsoid,r=o,a=i,l=_(e,t),c=t.height,d=t.width,p=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,n,!1);let f=p.length;const g=new Float64Array(2*f);g.set(p);const h=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,n);g.set(h,f),l.attributes.position.values=g;const y=t.northCap,m=t.southCap;let b=4;y&&(b-=1),m&&(b-=1);const E=2*(g.length/3+b),A=s.IndexDatatype.createTypedArray(g.length/3,E);f=g.length/6;let w,G=0;for(let s=0;s<f-1;s++)A[G++]=s,A[G++]=s+1,A[G++]=s+f,A[G++]=s+f+1;if(A[G++]=f-1,A[G++]=0,A[G++]=f+f-1,A[G++]=f,A[G++]=0,A[G++]=f,y)w=c-1;else{const e=d-1;A[G++]=e,A[G++]=e+f,w=d+c-2}if(A[G++]=w,A[G++]=w+f,!m){const e=d+w-1;A[G++]=e,A[G]=e+f}return l.indices=A,l}function A(i){i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT);const r=i.rectangle,a=e.defaultValue(i.granularity,o.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84),s=e.defaultValue(i.rotation,0);if(!e.defined(r))throw new n.DeveloperError("rectangle is required.");if(t.Rectangle.validate(r),r.north<r.south)throw new n.DeveloperError("options.rectangle.north must be greater than options.rectangle.south");const u=e.defaultValue(i.height,0),c=e.defaultValue(i.extrudedHeight,u);this._rectangle=t.Rectangle.clone(r),this._granularity=a,this._ellipsoid=l,this._surfaceHeight=Math.max(u,c),this._rotation=s,this._extrudedHeight=Math.min(u,c),this._offsetAttribute=i.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}A.packedLength=t.Rectangle.packedLength+t.Ellipsoid.packedLength+5,A.pack=function(i,o,r){if(!e.defined(i))throw new n.DeveloperError("value is required");if(!e.defined(o))throw new n.DeveloperError("array is required");return r=e.defaultValue(r,0),t.Rectangle.pack(i._rectangle,o,r),r+=t.Rectangle.packedLength,t.Ellipsoid.pack(i._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=i._granularity,o[r++]=i._surfaceHeight,o[r++]=i._rotation,o[r++]=i._extrudedHeight,o[r]=e.defaultValue(i._offsetAttribute,-1),o};const w=new t.Rectangle,G=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),v={rectangle:w,ellipsoid:G,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};A.unpack=function(i,o,r){if(!e.defined(i))throw new n.DeveloperError("array is required");o=e.defaultValue(o,0);const a=t.Rectangle.unpack(i,o,w);o+=t.Rectangle.packedLength;const l=t.Ellipsoid.unpack(i,o,G);o+=t.Ellipsoid.packedLength;const s=i[o++],u=i[o++],c=i[o++],d=i[o++],p=i[o];return e.defined(r)?(r._rectangle=t.Rectangle.clone(a,r._rectangle),r._ellipsoid=t.Ellipsoid.clone(l,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=d,r._offsetAttribute=-1===p?void 0:p,r):(v.granularity=s,v.height=u,v.rotation=c,v.extrudedHeight=d,v.offsetAttribute=-1===p?void 0:p,new A(v))};const R=new t.Cartographic;function P(i,o){return e.defined(o)&&(i=A.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),i._rectangle=t.Rectangle.clone(i._rectangle),A.createGeometry(i)}return A.createGeometry=function(t){const n=t._rectangle,a=t._ellipsoid,s=c.RectangleGeometryLibrary.computeOptions(n,t._granularity,t._rotation,0,b,R);let d,p;if(o.CesiumMath.equalsEpsilon(n.north,n.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(n.east,n.west,o.CesiumMath.EPSILON10))return;const f=t._surfaceHeight,g=t._extrudedHeight,m=!o.CesiumMath.equalsEpsilon(f,g,0,o.CesiumMath.EPSILON2);let A;if(m){if(d=E(t,s),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===l.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(A=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,i=i.fill(A)),d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}const u=i.BoundingSphere.fromRectangle3D(n,a,f,y),c=i.BoundingSphere.fromRectangle3D(n,a,g,h);p=i.BoundingSphere.union(u,c)}else{if(d=_(t,s),d.attributes.position.values=u.PolygonPipeline.scaleToGeodeticHeight(d.attributes.position.values,f,a,!1),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length;A=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;const i=new Uint8Array(e/3).fill(A);d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}p=i.BoundingSphere.fromRectangle3D(n,a,f)}return new r.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:p,offsetAttribute:t._offsetAttribute})},P}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./Transforms-3ac41eb6","./Color-305ce16b","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolylinePipeline-0e310844","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,o,t,r,l,n,i,a,s,c,d,p,f,u,y,h,C,g){"use strict";function m(e,o,t,r,n,i,a){const s=d.PolylinePipeline.numberOfPoints(e,o,n);let c;const p=t.red,f=t.green,u=t.blue,y=t.alpha,h=r.red,C=r.green,g=r.blue,m=r.alpha;if(l.Color.equals(t,r)){for(c=0;c<s;c++)i[a++]=l.Color.floatToByte(p),i[a++]=l.Color.floatToByte(f),i[a++]=l.Color.floatToByte(u),i[a++]=l.Color.floatToByte(y);return a}const T=(h-p)/s,b=(C-f)/s,E=(g-u)/s,_=(m-y)/s;let P=a;for(c=0;c<s;c++)i[P++]=l.Color.floatToByte(p+c*T),i[P++]=l.Color.floatToByte(f+c*b),i[P++]=l.Color.floatToByte(u+c*E),i[P++]=l.Color.floatToByte(y+c*_);return P}function T(r){r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT);const a=r.positions,s=r.colors,c=e.defaultValue(r.colorsPerVertex,!1);if(!e.defined(a)||a.length<2)throw new i.DeveloperError("At least two positions are required.");if(e.defined(s)&&(c&&s.length<a.length||!c&&s.length<a.length-1))throw new i.DeveloperError("colors has an invalid length.");this._positions=a,this._colors=s,this._colorsPerVertex=c,this._arcType=e.defaultValue(r.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(r.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let d=1+a.length*o.Cartesian3.packedLength;d+=e.defined(s)?1+s.length*l.Color.packedLength:1,this.packedLength=d+o.Ellipsoid.packedLength+3}T.pack=function(t,r,n){if(!e.defined(t))throw new i.DeveloperError("value is required");if(!e.defined(r))throw new i.DeveloperError("array is required");let a;n=e.defaultValue(n,0);const s=t._positions;let c=s.length;for(r[n++]=c,a=0;a<c;++a,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(s[a],r,n);const d=t._colors;for(c=e.defined(d)?d.length:0,r[n++]=c,a=0;a<c;++a,n+=l.Color.packedLength)l.Color.pack(d[a],r,n);return o.Ellipsoid.pack(t._ellipsoid,r,n),n+=o.Ellipsoid.packedLength,r[n++]=t._colorsPerVertex?1:0,r[n++]=t._arcType,r[n]=t._granularity,r},T.unpack=function(t,r,n){if(!e.defined(t))throw new i.DeveloperError("array is required");let a;r=e.defaultValue(r,0);let s=t[r++];const c=new Array(s);for(a=0;a<s;++a,r+=o.Cartesian3.packedLength)c[a]=o.Cartesian3.unpack(t,r);s=t[r++];const d=s>0?new Array(s):void 0;for(a=0;a<s;++a,r+=l.Color.packedLength)d[a]=l.Color.unpack(t,r);const p=o.Ellipsoid.unpack(t,r);r+=o.Ellipsoid.packedLength;const f=1===t[r++],u=t[r++],y=t[r];return e.defined(n)?(n._positions=c,n._colors=d,n._ellipsoid=p,n._colorsPerVertex=f,n._arcType=u,n._granularity=y,n):new T({positions:c,colors:d,ellipsoid:p,colorsPerVertex:f,arcType:u,granularity:y})};const b=new Array(2),E=new Array(2),_={positions:b,height:E,ellipsoid:void 0,minDistance:void 0,granularity:void 0};function P(t,r){return e.defined(r)&&(t=T.unpack(t,r)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}return T.createGeometry=function(i){const p=i._positions,f=i._colors,u=i._colorsPerVertex,y=i._arcType,h=i._granularity,C=i._ellipsoid,g=n.CesiumMath.chordLength(h,C.maximumRadius),T=e.defined(f)&&!u;let P;const A=p.length;let B,w,k,D,G=0;if(y===t.ArcType.GEODESIC||y===t.ArcType.RHUMB){let o,r,i;y===t.ArcType.GEODESIC?(o=n.CesiumMath.chordLength(h,C.maximumRadius),r=d.PolylinePipeline.numberOfPoints,i=d.PolylinePipeline.generateArc):(o=h,r=d.PolylinePipeline.numberOfPointsRhumbLine,i=d.PolylinePipeline.generateRhumbArc);const a=d.PolylinePipeline.extractHeights(p,C),s=_;if(y===t.ArcType.GEODESIC?s.minDistance=g:s.granularity=h,s.ellipsoid=C,T){let t=0;for(P=0;P<A-1;P++)t+=r(p[P],p[P+1],o)+1;B=new Float64Array(3*t),k=new Uint8Array(4*t),s.positions=b,s.height=E;let n=0;for(P=0;P<A-1;++P){b[0]=p[P],b[1]=p[P+1],E[0]=a[P],E[1]=a[P+1];const o=i(s);if(e.defined(f)){const e=o.length/3;D=f[P];for(let o=0;o<e;++o)k[n++]=l.Color.floatToByte(D.red),k[n++]=l.Color.floatToByte(D.green),k[n++]=l.Color.floatToByte(D.blue),k[n++]=l.Color.floatToByte(D.alpha)}B.set(o,G),G+=o.length}}else if(s.positions=p,s.height=a,B=new Float64Array(i(s)),e.defined(f)){for(k=new Uint8Array(B.length/3*4),P=0;P<A-1;++P){const e=p[P],o=p[P+1],t=f[P],r=f[P+1];G=m(e,o,t,r,g,k,G)}const e=f[A-1];k[G++]=l.Color.floatToByte(e.red),k[G++]=l.Color.floatToByte(e.green),k[G++]=l.Color.floatToByte(e.blue),k[G++]=l.Color.floatToByte(e.alpha)}}else{w=T?2*A-2:A,B=new Float64Array(3*w),k=e.defined(f)?new Uint8Array(4*w):void 0;let t=0,r=0;for(P=0;P<A;++P){const n=p[P];if(T&&P>0&&(o.Cartesian3.pack(n,B,t),t+=3,D=f[P-1],k[r++]=l.Color.floatToByte(D.red),k[r++]=l.Color.floatToByte(D.green),k[r++]=l.Color.floatToByte(D.blue),k[r++]=l.Color.floatToByte(D.alpha)),T&&P===A-1)break;o.Cartesian3.pack(n,B,t),t+=3,e.defined(f)&&(D=f[P],k[r++]=l.Color.floatToByte(D.red),k[r++]=l.Color.floatToByte(D.green),k[r++]=l.Color.floatToByte(D.blue),k[r++]=l.Color.floatToByte(D.alpha))}}const L=new s.GeometryAttributes;L.position=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),e.defined(f)&&(L.color=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:k,normalize:!0})),w=B.length/3;const v=2*(w-1),V=c.IndexDatatype.createTypedArray(w,v);let x=0;for(P=0;P<w-1;++P)V[x++]=P,V[x++]=P+1;return new a.Geometry({attributes:L,indices:V,primitiveType:a.PrimitiveType.LINES,boundingSphere:r.BoundingSphere.fromPoints(p)})},P}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./EllipsoidGeometry-2a0ae467","./VertexFormat-e46f29d6","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96","./Transforms-3ac41eb6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785"],(function(e,t,i,r,o,a,n,s,c,d,l,m,u,p){"use strict";function f(i){const o=e.defaultValue(i.radius,1),a=new t.Cartesian3(o,o,o),n={radii:a,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r.EllipsoidGeometry(n),this._workerName="createSphereGeometry"}f.packedLength=r.EllipsoidGeometry.packedLength,f.pack=function(e,t,o){return i.Check.typeOf.object("value",e),r.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,o)};const y=new r.EllipsoidGeometry,G={radius:void 0,radii:new t.Cartesian3,vertexFormat:new o.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};function k(t,i){return e.defined(i)&&(t=f.unpack(t,i)),f.createGeometry(t)}return f.unpack=function(i,a,n){const s=r.EllipsoidGeometry.unpack(i,a,y);return G.vertexFormat=o.VertexFormat.clone(s._vertexFormat,G.vertexFormat),G.stackPartitions=s._stackPartitions,G.slicePartitions=s._slicePartitions,e.defined(n)?(t.Cartesian3.clone(s._radii,G.radii),n._ellipsoidGeometry=new r.EllipsoidGeometry(G),n):(G.radius=s._radii.x,new f(G))},f.createGeometry=function(e){return r.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},k}));
\ No newline at end of file
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./EllipsoidOutlineGeometry-8e1632db","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96","./Transforms-3ac41eb6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785"],(function(e,i,t,n,o,r,s,a,c,d,l,u,m){"use strict";function p(t){const o=e.defaultValue(t.radius,1),r=new i.Cartesian3(o,o,o),s={radii:r,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(s),this._workerName="createSphereOutlineGeometry"}p.packedLength=n.EllipsoidOutlineGeometry.packedLength,p.pack=function(e,i,o){return t.Check.typeOf.object("value",e),n.EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,i,o)};const f=new n.EllipsoidOutlineGeometry,y={radius:void 0,radii:new i.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};function G(i,t){return e.defined(t)&&(i=p.unpack(i,t)),p.createGeometry(i)}return p.unpack=function(t,o,r){const s=n.EllipsoidOutlineGeometry.unpack(t,o,f);return y.stackPartitions=s._stackPartitions,y.slicePartitions=s._slicePartitions,y.subdivisions=s._subdivisions,e.defined(r)?(i.Cartesian3.clone(s._radii,y.radii),r._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(y),r):(y.radius=s._radii.x,new p(y))},p.createGeometry=function(e){return n.EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},G}));
\ No newline at end of file
define(["./defaultValue-94c3e563"],(function(e){"use strict";function r(r){let t;const n=r.name,s=r.message;t=e.defined(n)&&e.defined(s)?`${n}: ${s}`:r.toString();const a=r.stack;return e.defined(a)&&(t+=`\n${a}`),t}function t(e,r,t){let n;try{return n=e(r,t),n}catch(s){return Promise.reject(s)}}function n(n){let s;return function(a){const i=a.data,o=[],c={id:i.id,result:void 0,error:void 0};return Promise.resolve(t(n,i.parameters,o)).then((function(e){c.result=e})).catch((function(e){e instanceof Error?c.error={name:e.name,message:e.message,stack:e.stack}:c.error=e})).finally((function(){e.defined(s)||(s=e.defaultValue(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(o.length=0);try{s(c,o)}catch(t){c.result=void 0,c.error=`postMessage failed with error: ${r(t)}\n with responseMessage: ${JSON.stringify(c)}`,s(c)}}))}}return n}));
\ No newline at end of file
define(["./AttributeCompression-4d18cc04","./Matrix2-fc7e9822","./combine-761d9c3f","./IndexDatatype-db156785","./ComponentDatatype-4a60b8d6","./createTaskProcessorWorker","./RuntimeError-c581ca93","./defaultValue-94c3e563","./WebGLConstants-7dccdc96"],(function(t,e,a,s,n,r,i,o,c){"use strict";const d=32767,l=Math.cos(n.CesiumMath.toRadians(150)),f=new e.Cartographic,u=new e.Cartesian3;function h(t,a,s,r,i,o,c){const l=t.length,h=new Float64Array(3*l);for(let C=0;C<l;++C){const l=t[C],p=a[C],m=s[C],b=n.CesiumMath.lerp(r.west,r.east,l/d),A=n.CesiumMath.lerp(r.south,r.north,p/d),w=n.CesiumMath.lerp(i,o,m/d),g=e.Cartographic.fromRadians(b,A,w,f),y=c.cartographicToCartesian(g,u);e.Cartesian3.pack(y,h,3*C)}return h}function C(t){const e=t.length,a=new Uint32Array(e+1);let s=0;for(let n=0;n<e;++n)a[n]=s,s+=t[n];return a[e]=s,a}const p=new e.Cartographic,m=new e.Cartographic;function b(t,a,s,n){const r=n.length,i=t.length,o=new Uint8Array(i),c=p,d=m;let l=0;for(let u=0;u<r;u++){const s=n[u];let r=s;for(let n=1;n<s;n++){const s=l+n,i=s-1;d.longitude=t[s],d.latitude=a[s],c.longitude=t[i],c.latitude=a[i],e.Cartographic.equals(d,c)&&(r--,o[i]=1)}n[u]=r,l+=s}let f=0;for(let e=0;e<i;e++)1!==o[e]&&(t[f]=t[e],a[f]=a[e],s[f]=s[e],f++)}function A(t){const e=8*t,a=3*e,n=4*e;this.startEllipsoidNormals=new Float32Array(a),this.endEllipsoidNormals=new Float32Array(a),this.startPositionAndHeights=new Float32Array(n),this.startFaceNormalAndVertexCornerIds=new Float32Array(n),this.endPositionAndHeights=new Float32Array(n),this.endFaceNormalAndHalfWidths=new Float32Array(n),this.vertexBatchIds=new Uint16Array(e),this.indices=s.IndexDatatype.createTypedArray(e,36*t),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}const w=new e.Cartesian3,g=new e.Cartesian3;function y(t,a,s,n,r){const i=e.Cartesian3.subtract(s,a,g);let o=e.Cartesian3.subtract(a,t,w);return e.Cartesian3.normalize(i,i),e.Cartesian3.normalize(o,o),e.Cartesian3.dot(i,o)<l&&(o=e.Cartesian3.multiplyByScalar(o,-1,w)),e.Cartesian3.add(i,o,r),e.Cartesian3.equals(r,e.Cartesian3.ZERO)&&(r=e.Cartesian3.subtract(t,a)),e.Cartesian3.cross(r,n,r),e.Cartesian3.cross(n,r,r),e.Cartesian3.normalize(r,r),r}const N=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],k=N.length,I=new e.Cartesian3,x=new e.Cartesian3,E=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3;A.prototype.addVolume=function(t,a,s,n,r,i,o,c,d,l){let f=e.Cartesian3.add(a,d,I);const u=l.geodeticSurfaceNormal(f,x);f=e.Cartesian3.add(s,d,I);const h=l.geodeticSurfaceNormal(f,F),C=y(t,a,s,u,E),p=y(n,s,a,h,H),m=this.startEllipsoidNormals,b=this.endEllipsoidNormals,A=this.startPositionAndHeights,w=this.startFaceNormalAndVertexCornerIds,g=this.endPositionAndHeights,v=this.endFaceNormalAndHalfWidths,O=this.vertexBatchIds;let P,D=this.batchIdOffset,S=this.vec3Offset,M=this.vec4Offset;for(P=0;P<8;P++)e.Cartesian3.pack(u,m,S),e.Cartesian3.pack(h,b,S),e.Cartesian3.pack(a,A,M),A[M+3]=r,e.Cartesian3.pack(s,g,M),g[M+3]=i,e.Cartesian3.pack(C,w,M),w[M+3]=P,e.Cartesian3.pack(p,v,M),v[M+3]=o,O[D++]=c,S+=3,M+=4;this.batchIdOffset=D,this.vec3Offset=S,this.vec4Offset=M;const R=this.indices,U=this.volumeStartIndex,B=this.indexOffset;for(P=0;P<k;P++)R[B+P]=N[P]+U;this.volumeStartIndex+=8,this.indexOffset+=k};const v=new e.Rectangle,O=new e.Ellipsoid,P=new e.Cartesian3,D=new e.Cartesian3,S=new e.Cartesian3,M=new e.Cartesian3,R=new e.Cartesian3;function U(r,i){const o=new Uint16Array(r.positions),c=new Uint16Array(r.widths),l=new Uint32Array(r.counts),f=new Uint16Array(r.batchIds),u=v,p=O,m=P,w=new Float64Array(r.packedBuffer);let g=0;const y=w[g++],N=w[g++];let k;e.Rectangle.unpack(w,g,u),g+=e.Rectangle.packedLength,e.Ellipsoid.unpack(w,g,p),g+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(w,g,m);let I=o.length/3;const x=o.subarray(0,I),E=o.subarray(I,2*I),F=o.subarray(2*I,3*I);t.AttributeCompression.zigZagDeltaDecode(x,E,F),b(x,E,F,l);const H=l.length;let U=0;for(k=0;k<H;k++){const t=l[k];U+=t-1}const B=new A(U),V=h(x,E,F,u,y,N,p);I=x.length;const T=new Float32Array(3*I);for(k=0;k<I;++k)T[3*k]=V[3*k]-m.x,T[3*k+1]=V[3*k+1]-m.y,T[3*k+2]=V[3*k+2]-m.z;let W=0,z=0;for(k=0;k<H;k++){const t=l[k]-1,a=.5*c[k],s=f[k],r=W;for(let i=0;i<t;i++){const o=e.Cartesian3.unpack(T,W,S),c=e.Cartesian3.unpack(T,W+3,M);let l=F[z],f=F[z+1];l=n.CesiumMath.lerp(y,N,l/d),f=n.CesiumMath.lerp(y,N,f/d),z++;let u=D,h=R;if(0===i){const a=r+3*t,s=e.Cartesian3.unpack(T,a,D);if(e.Cartesian3.equals(s,o))e.Cartesian3.unpack(T,a-3,u);else{const t=e.Cartesian3.subtract(o,c,D);u=e.Cartesian3.add(t,o,D)}}else e.Cartesian3.unpack(T,W-3,u);if(i===t-1){const t=e.Cartesian3.unpack(T,r,R);if(e.Cartesian3.equals(t,c))e.Cartesian3.unpack(T,r+3,h);else{const t=e.Cartesian3.subtract(c,o,R);h=e.Cartesian3.add(t,c,R)}}else e.Cartesian3.unpack(T,W+6,h);B.addVolume(u,o,c,h,l,f,a,s,m,p),W+=3}W+=3,z++}const q=B.indices;i.push(B.startEllipsoidNormals.buffer),i.push(B.endEllipsoidNormals.buffer),i.push(B.startPositionAndHeights.buffer),i.push(B.startFaceNormalAndVertexCornerIds.buffer),i.push(B.endPositionAndHeights.buffer),i.push(B.endFaceNormalAndHalfWidths.buffer),i.push(B.vertexBatchIds.buffer),i.push(q.buffer);let L={indexDatatype:2===q.BYTES_PER_ELEMENT?s.IndexDatatype.UNSIGNED_SHORT:s.IndexDatatype.UNSIGNED_INT,startEllipsoidNormals:B.startEllipsoidNormals.buffer,endEllipsoidNormals:B.endEllipsoidNormals.buffer,startPositionAndHeights:B.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:B.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:B.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:B.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:B.vertexBatchIds.buffer,indices:q.buffer};if(r.keepDecodedPositions){const t=C(l);i.push(V.buffer,t.buffer),L=a.combine(L,{decodedPositions:V.buffer,decodedPositionOffsets:t.buffer})}return L}var B=r(U);return B}));
\ No newline at end of file
define(["./Transforms-3ac41eb6","./BoxGeometry-9a897756","./Matrix2-fc7e9822","./Color-305ce16b","./CylinderGeometry-31990f10","./defaultValue-94c3e563","./EllipsoidGeometry-2a0ae467","./IndexDatatype-db156785","./createTaskProcessorWorker","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./VertexFormat-e46f29d6","./CylinderGeometryLibrary-7b029c87"],(function(e,t,n,r,a,i,o,s,c,d,l,f,u,h,p,b,y,x,g){"use strict";function m(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const C=new n.Cartesian3,I=n.Matrix4.packedLength+n.Cartesian3.packedLength,k=n.Matrix4.packedLength+2,M=n.Matrix4.packedLength+n.Cartesian3.packedLength,B=n.Cartesian3.packedLength+1,w={modelMatrix:new n.Matrix4,boundingVolume:new e.BoundingSphere};function A(e,t){let r=t*I;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),w}function O(e,t){let r=t*k;const a=e[r++],i=e[r++],o=n.Cartesian3.fromElements(a,a,i,C),s=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(s,o,s);const c=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,c.center),c.radius=Math.sqrt(2),w}function v(e,t){let r=t*M;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,w}function L(e,t){let r=t*B;const a=e[r++],i=n.Cartesian3.unpack(e,r,C),o=n.Matrix4.fromTranslation(i,w.modelMatrix);n.Matrix4.multiplyByUniformScale(o,a,o);const s=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,w}const E=new n.Cartesian3;function U(t,a,o,s,c){if(!i.defined(a))return;const d=o.length,l=s.attributes.position.values,f=s.indices,u=t.positions,h=t.vertexBatchIds,p=t.indices,b=t.batchIds,y=t.batchTableColors,x=t.batchedIndices,g=t.indexOffsets,C=t.indexCounts,I=t.boundingVolumes,k=t.modelMatrix,M=t.center;let B=t.positionOffset,w=t.batchIdIndex,A=t.indexOffset;const O=t.batchedIndicesOffset;for(let i=0;i<d;++i){const t=c(a,i),s=t.modelMatrix;n.Matrix4.multiply(k,s,s);const d=o[i],v=l.length;for(let e=0;e<v;e+=3){const t=n.Cartesian3.unpack(l,e,E);n.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,M,t),n.Cartesian3.pack(t,u,3*B+e),h[w++]=d}const L=f.length;for(let e=0;e<L;++e)p[A+e]=f[e]+B;const U=i+O;x[U]=new m({offset:A,count:L,color:r.Color.fromRgba(y[d]),batchIds:[d]}),b[U]=d,g[U]=A,C[U]=L,I[U]=e.BoundingSphere.transform(t.boundingVolume,s),B+=v/3,A+=L}t.positionOffset=B,t.batchIdIndex=w,t.indexOffset=A,t.batchedIndicesOffset+=d}const G=new n.Cartesian3,S=new n.Matrix4;function V(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,G),r+=n.Cartesian3.packedLength,n.Matrix4.unpack(t,r,S)}function T(e){const t=e.length;let n=0;for(let a=0;a<t;++a)n+=r.Color.packedLength+3+e[a].batchIds.length;return n}function F(t,n,a){const i=a.length,o=2+i*e.BoundingSphere.packedLength+1+T(n),s=new Float64Array(o);let c=0;s[c++]=t,s[c++]=i;for(let r=0;r<i;++r)e.BoundingSphere.pack(a[r],s,c),c+=e.BoundingSphere.packedLength;const d=n.length;s[c++]=d;for(let e=0;e<d;++e){const t=n[e];r.Color.pack(t.color,s,c),c+=r.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const a=t.batchIds,i=a.length;s[c++]=i;for(let e=0;e<i;++e)s[c++]=a[e]}return s}function R(e,n){const r=i.defined(e.boxes)?new Float32Array(e.boxes):void 0,c=i.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,d=i.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,l=i.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,f=i.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,u=i.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,h=i.defined(e.spheres)?new Float32Array(e.spheres):void 0,p=i.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,b=i.defined(r)?c.length:0,y=i.defined(d)?l.length:0,x=i.defined(f)?u.length:0,g=i.defined(h)?p.length:0,m=t.BoxGeometry.getUnitBox(),C=a.CylinderGeometry.getUnitCylinder(),I=o.EllipsoidGeometry.getUnitEllipsoid(),k=m.attributes.position.values,M=C.attributes.position.values,B=I.attributes.position.values;let w=k.length*b;w+=M.length*y,w+=B.length*(x+g);const E=m.indices,T=C.indices,R=I.indices;let Z=E.length*b;Z+=T.length*y,Z+=R.length*(x+g);const D=new Float32Array(w),P=new Uint16Array(w/3),_=s.IndexDatatype.createTypedArray(w/3,Z),q=b+y+x+g,W=new Uint16Array(q),j=new Array(q),H=new Uint32Array(q),N=new Uint32Array(q),Y=new Array(q);V(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:D,vertexBatchIds:P,indices:_,batchIds:W,batchedIndices:j,indexOffsets:H,indexCounts:N,boundingVolumes:Y,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:S,center:G};U(z,r,c,m,A),U(z,d,l,C,O),U(z,f,u,I,v),U(z,h,p,I,L);const J=F(_.BYTES_PER_ELEMENT,j,Y);return n.push(D.buffer,P.buffer,_.buffer),n.push(W.buffer,H.buffer,N.buffer),n.push(J.buffer),{positions:D.buffer,vertexBatchIds:P.buffer,indices:_.buffer,indexOffsets:H.buffer,indexCounts:N.buffer,batchIds:W.buffer,packedBuffer:J.buffer}}var Z=c(R);return Z}));
\ No newline at end of file
define(["./AttributeCompression-4d18cc04","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./createTaskProcessorWorker","./RuntimeError-c581ca93","./defaultValue-94c3e563","./WebGLConstants-7dccdc96"],(function(e,t,a,r,n,o,i){"use strict";const s=32767,c=new t.Cartographic,u=new t.Cartesian3,p=new t.Rectangle,l=new t.Ellipsoid,d={min:void 0,max:void 0};function f(e){e=new Float64Array(e);let a=0;d.min=e[a++],d.max=e[a++],t.Rectangle.unpack(e,a,p),a+=t.Rectangle.packedLength,t.Ellipsoid.unpack(e,a,l)}function m(r,n){const o=new Uint16Array(r.positions);f(r.packedBuffer);const i=p,m=l,h=d.min,C=d.max,g=o.length/3,b=o.subarray(0,g),w=o.subarray(g,2*g),k=o.subarray(2*g,3*g);e.AttributeCompression.zigZagDeltaDecode(b,w,k);const y=new Float64Array(o.length);for(let e=0;e<g;++e){const r=b[e],n=w[e],o=k[e],p=a.CesiumMath.lerp(i.west,i.east,r/s),l=a.CesiumMath.lerp(i.south,i.north,n/s),d=a.CesiumMath.lerp(h,C,o/s),f=t.Cartographic.fromRadians(p,l,d,c),g=m.cartographicToCartesian(f,u);t.Cartesian3.pack(g,y,3*e)}return n.push(y.buffer),{positions:y.buffer}}var h=r(m);return h}));
\ No newline at end of file
define(["./AttributeCompression-4d18cc04","./Matrix2-fc7e9822","./Color-305ce16b","./defaultValue-94c3e563","./IndexDatatype-db156785","./ComponentDatatype-4a60b8d6","./OrientedBoundingBox-1e0d2855","./createTaskProcessorWorker","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidTangentPlane-53e32153","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,t,n,a,r,o,s,i,c,d,f,l,u,h,g,p,b){"use strict";const m=new t.Cartesian3,y=new t.Ellipsoid,C=new t.Rectangle,I={min:void 0,max:void 0,indexBytesPerElement:void 0};function x(e){const n=new Float64Array(e);let a=0;I.indexBytesPerElement=n[a++],I.min=n[a++],I.max=n[a++],t.Cartesian3.unpack(n,a,m),a+=t.Cartesian3.packedLength,t.Ellipsoid.unpack(n,a,y),a+=t.Ellipsoid.packedLength,t.Rectangle.unpack(n,a,C)}function w(e){const t=e.length;let a=0;for(let r=0;r<t;++r)a+=n.Color.packedLength+3+e[r].batchIds.length;return a}function A(e,t,a){const r=t.length,o=2+r*s.OrientedBoundingBox.packedLength+1+w(a),i=new Float64Array(o);let c=0;i[c++]=e,i[c++]=r;for(let n=0;n<r;++n)s.OrientedBoundingBox.pack(t[n],i,c),c+=s.OrientedBoundingBox.packedLength;const d=a.length;i[c++]=d;for(let s=0;s<d;++s){const e=a[s];n.Color.pack(e.color,i,c),c+=n.Color.packedLength,i[c++]=e.offset,i[c++]=e.count;const t=e.batchIds,r=t.length;i[c++]=r;for(let n=0;n<r;++n)i[c++]=t[n]}return i}const E=32767,N=new t.Cartesian3,T=new t.Cartesian3,B=new t.Cartesian3,k=new t.Cartesian3,L=new t.Cartesian3,O=new t.Cartographic,U=new t.Rectangle;function P(i,c){let d;x(i.packedBuffer);const f=I.indexBytesPerElement;d=2===f?new Uint16Array(i.indices):new Uint32Array(i.indices);const l=new Uint16Array(i.positions),u=new Uint32Array(i.counts),h=new Uint32Array(i.indexCounts),g=new Uint32Array(i.batchIds),p=new Uint32Array(i.batchTableColors),b=new Array(u.length),w=m,P=y;let F=C;const S=I.min,D=I.max;let R,_,M,G=i.minimumHeights,V=i.maximumHeights;a.defined(G)&&a.defined(V)&&(G=new Float32Array(G),V=new Float32Array(V));const Y=l.length/2,v=l.subarray(0,Y),H=l.subarray(Y,2*Y);e.AttributeCompression.zigZagDeltaDecode(v,H);const W=new Float64Array(3*Y);for(R=0;R<Y;++R){const e=v[R],n=H[R],a=o.CesiumMath.lerp(F.west,F.east,e/E),r=o.CesiumMath.lerp(F.south,F.north,n/E),s=t.Cartographic.fromRadians(a,r,0,O),i=P.cartographicToCartesian(s,N);t.Cartesian3.pack(i,W,3*R)}const j=u.length,z=new Array(j),Z=new Array(j);let q=0,J=0;for(R=0;R<j;++R)z[R]=q,Z[R]=J,q+=u[R],J+=h[R];const K=new Float32Array(3*Y*2),Q=new Uint16Array(2*Y),X=new Uint32Array(Z.length),$=new Uint32Array(h.length);let ee=[];const te={};for(R=0;R<j;++R)M=p[R],a.defined(te[M])?(te[M].positionLength+=u[R],te[M].indexLength+=h[R],te[M].batchIds.push(R)):te[M]={positionLength:u[R],indexLength:h[R],offset:0,indexOffset:0,batchIds:[R]};let ne,ae=0,re=0;for(M in te)if(te.hasOwnProperty(M)){ne=te[M],ne.offset=ae,ne.indexOffset=re;const e=2*ne.positionLength,t=2*ne.indexLength+6*ne.positionLength;ae+=e,re+=t,ne.indexLength=t}const oe=[];for(M in te)te.hasOwnProperty(M)&&(ne=te[M],oe.push({color:n.Color.fromRgba(parseInt(M)),offset:ne.indexOffset,count:ne.indexLength,batchIds:ne.batchIds}));for(R=0;R<j;++R){M=p[R],ne=te[M];const e=ne.offset;let n=3*e,r=e;const o=z[R],i=u[R],c=g[R];let f=S,l=D;a.defined(G)&&a.defined(V)&&(f=G[R],l=V[R]);let m=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(_=0;_<i;++_){const e=t.Cartesian3.unpack(W,3*o+3*_,N);P.scaleToGeodeticSurface(e,e);const a=P.cartesianToCartographic(e,O),s=a.latitude,i=a.longitude;m=Math.min(s,m),y=Math.max(s,y),C=Math.min(i,C),I=Math.max(i,I);const d=P.geodeticSurfaceNormal(e,T);let u=t.Cartesian3.multiplyByScalar(d,f,B);const h=t.Cartesian3.add(e,u,k);u=t.Cartesian3.multiplyByScalar(d,l,u);const g=t.Cartesian3.add(e,u,L);t.Cartesian3.subtract(g,w,g),t.Cartesian3.subtract(h,w,h),t.Cartesian3.pack(g,K,n),t.Cartesian3.pack(h,K,n+3),Q[r]=c,Q[r+1]=c,n+=6,r+=2}F=U,F.west=C,F.east=I,F.south=m,F.north=y,b[R]=s.OrientedBoundingBox.fromRectangle(F,S,D,P);let x=ne.indexOffset;const A=Z[R],E=h[R];for(X[R]=x,_=0;_<E;_+=3){const t=d[A+_]-o,n=d[A+_+1]-o,a=d[A+_+2]-o;ee[x++]=2*t+e,ee[x++]=2*n+e,ee[x++]=2*a+e,ee[x++]=2*a+1+e,ee[x++]=2*n+1+e,ee[x++]=2*t+1+e}for(_=0;_<i;++_){const t=_,n=(_+1)%i;ee[x++]=2*t+1+e,ee[x++]=2*n+e,ee[x++]=2*t+e,ee[x++]=2*t+1+e,ee[x++]=2*n+1+e,ee[x++]=2*n+e}ne.offset+=2*i,ne.indexOffset=x,$[R]=x-X[R]}ee=r.IndexDatatype.createTypedArray(K.length/3,ee);const se=oe.length;for(let e=0;e<se;++e){const t=oe[e].batchIds;let n=0;const a=t.length;for(let e=0;e<a;++e)n+=$[t[e]];oe[e].count=n}const ie=2===ee.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,ce=A(ie,b,oe);return c.push(K.buffer,ee.buffer,X.buffer,$.buffer,Q.buffer,ce.buffer),{positions:K.buffer,indices:ee.buffer,indexOffsets:X.buffer,indexCounts:$.buffer,batchIds:Q.buffer,packedBuffer:ce.buffer}}var F=i(P);return F}));
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment