Agriculture-front-end/public/Cesium/Workers/createCorridorGeometry.js
2023-09-11 21:56:39 +08:00

2 lines
17 KiB
JavaScript

define(["./arrayFill-4513d7ad","./arrayRemoveDuplicates-d2f048c5","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Check-7b2a090c","./ComponentDatatype-c140a87d","./PolylineVolumeGeometryLibrary-3333255c","./CorridorGeometryLibrary-63feb55c","./when-b60132fc","./Cartesian2-47311507","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./GeometryOffsetAttribute-fbeb6f1a","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolygonPipeline-f49953b9","./PrimitiveType-39acab88","./VertexFormat-6446fca0","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./EllipsoidTangentPlane-b2b18d75","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206","./PolylinePipeline-971d8853","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./earcut-2.2.1-20c8012f"],(function(t,e,r,a,i,o,n,s,l,d,u,m,y,f,c,p,h,g,b,C,v,A,_,w,T,G,E,V,F,L,P){"use strict";var x=new a.Cartesian3,N=new a.Cartesian3,D=new a.Cartesian3,M=new a.Cartesian3,O=new a.Cartesian3,I=new a.Cartesian3,S=new a.Cartesian3,R=new a.Cartesian3;function k(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function H(t,e,r,i,o,n){var l=t.normals,d=t.tangents,u=t.bitangents,m=a.Cartesian3.normalize(a.Cartesian3.cross(r,e,S),S);n.normal&&s.CorridorGeometryLibrary.addAttribute(l,e,i,o),n.tangent&&s.CorridorGeometryLibrary.addAttribute(d,m,i,o),n.bitangent&&s.CorridorGeometryLibrary.addAttribute(u,r,i,o)}function z(t,e,r){var i,n,d,y=t.positions,p=t.corners,h=t.endPositions,g=t.lefts,b=t.normals,C=new m.GeometryAttributes,v=0,A=0,_=0;for(n=0;n<y.length;n+=2)v+=d=y[n].length-3,_+=2*d,A+=y[n+1].length-3;for(v+=3,A+=3,n=0;n<p.length;n++){i=p[n];var w=p[n].leftPositions;l.defined(w)?(v+=d=w.length,_+=d):(A+=d=p[n].rightPositions.length,_+=d)}var T,G=l.defined(h);G&&(v+=T=h[0].length-3,A+=T,_+=6*(T/=3));var E,V,F,L,P,O,k=v+A,z=new Float64Array(k),U={normals:e.normal?new Float32Array(k):void 0,tangents:e.tangent?new Float32Array(k):void 0,bitangents:e.bitangent?new Float32Array(k):void 0},B=0,Y=k-1,W=x,q=N,J=T/2,j=f.IndexDatatype.createTypedArray(k/3,_),K=0;if(G){O=D,P=M;var Q=h[0];for(W=a.Cartesian3.fromArray(b,0,W),q=a.Cartesian3.fromArray(g,0,q),n=0;n<J;n++)O=a.Cartesian3.fromArray(Q,3*(J-1-n),O),P=a.Cartesian3.fromArray(Q,3*(J+n),P),s.CorridorGeometryLibrary.addAttribute(z,P,B),s.CorridorGeometryLibrary.addAttribute(z,O,void 0,Y),H(U,W,q,B,Y,e),L=(V=B/3)+1,F=(E=(Y-2)/3)-1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3}var X,Z,$=0,tt=0,et=y[$++],rt=y[$++];for(z.set(et,B),z.set(rt,Y-rt.length+1),q=a.Cartesian3.fromArray(g,tt,q),d=rt.length-3,n=0;n<d;n+=3)X=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(et,n,S),S),Z=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(rt,d-n,R),R),H(U,W=a.Cartesian3.normalize(a.Cartesian3.add(X,Z,W),W),q,B,Y,e),L=(V=B/3)+1,F=(E=(Y-2)/3)-1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3;for(X=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(et,d,S),S),Z=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(rt,d,R),R),W=a.Cartesian3.normalize(a.Cartesian3.add(X,Z,W),W),tt+=3,n=0;n<p.length;n++){var at,it,ot,nt=(i=p[n]).leftPositions,st=i.rightPositions,lt=I,dt=D,ut=M;if(W=a.Cartesian3.fromArray(b,tt,W),l.defined(nt)){for(H(U,W,q,void 0,Y,e),Y-=3,it=L,ot=F,at=0;at<nt.length/3;at++)lt=a.Cartesian3.fromArray(nt,3*at,lt),j[K++]=it,j[K++]=ot-at-1,j[K++]=ot-at,s.CorridorGeometryLibrary.addAttribute(z,lt,void 0,Y),dt=a.Cartesian3.fromArray(z,3*(ot-at-1),dt),ut=a.Cartesian3.fromArray(z,3*it,ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.subtract(dt,ut,q),q),void 0,Y,e),Y-=3;lt=a.Cartesian3.fromArray(z,3*it,lt),dt=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*ot,dt),lt,dt),ut=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*(ot-at),ut),lt,ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.add(dt,ut,q),q),B,void 0,e),B+=3}else{for(H(U,W,q,B,void 0,e),B+=3,it=F,ot=L,at=0;at<st.length/3;at++)lt=a.Cartesian3.fromArray(st,3*at,lt),j[K++]=it,j[K++]=ot+at,j[K++]=ot+at+1,s.CorridorGeometryLibrary.addAttribute(z,lt,B),dt=a.Cartesian3.fromArray(z,3*it,dt),ut=a.Cartesian3.fromArray(z,3*(ot+at),ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.subtract(dt,ut,q),q),B,void 0,e),B+=3;lt=a.Cartesian3.fromArray(z,3*it,lt),dt=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*(ot+at),dt),lt,dt),ut=a.Cartesian3.subtract(a.Cartesian3.fromArray(z,3*ot,ut),lt,ut),H(U,W,q=a.Cartesian3.normalize(a.Cartesian3.negate(a.Cartesian3.add(ut,dt,q),q),q),void 0,Y,e),Y-=3}for(et=y[$++],rt=y[$++],et.splice(0,3),rt.splice(rt.length-3,3),z.set(et,B),z.set(rt,Y-rt.length+1),d=rt.length-3,tt+=3,q=a.Cartesian3.fromArray(g,tt,q),at=0;at<rt.length;at+=3)X=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(et,at,S),S),Z=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(rt,d-at,R),R),H(U,W=a.Cartesian3.normalize(a.Cartesian3.add(X,Z,W),W),q,B,Y,e),V=(L=B/3)-1,E=(F=(Y-2)/3)+1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3;B-=3,Y+=3}if(H(U,W=a.Cartesian3.fromArray(b,b.length-3,W),q,B,Y,e),G){B+=3,Y-=3,O=D,P=M;var mt=h[1];for(n=0;n<J;n++)O=a.Cartesian3.fromArray(mt,3*(T-n-1),O),P=a.Cartesian3.fromArray(mt,3*n,P),s.CorridorGeometryLibrary.addAttribute(z,O,void 0,Y),s.CorridorGeometryLibrary.addAttribute(z,P,B),H(U,W,q,B,Y,e),V=(L=B/3)-1,E=(F=(Y-2)/3)+1,j[K++]=E,j[K++]=V,j[K++]=F,j[K++]=F,j[K++]=V,j[K++]=L,B+=3,Y-=3}if(C.position=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:z}),e.st){var yt,ft,ct=new Float32Array(k/3*2),pt=0;if(G){v/=3,A/=3;var ht,gt=Math.PI/(T+1);ft=1/(v-T+1),yt=1/(A-T+1);var bt=T/2;for(n=bt+1;n<T+1;n++)ht=c.CesiumMath.PI_OVER_TWO+gt*n,ct[pt++]=yt*(1+Math.cos(ht)),ct[pt++]=.5*(1+Math.sin(ht));for(n=1;n<A-T+1;n++)ct[pt++]=n*yt,ct[pt++]=0;for(n=T;n>bt;n--)ht=c.CesiumMath.PI_OVER_TWO-n*gt,ct[pt++]=1-yt*(1+Math.cos(ht)),ct[pt++]=.5*(1+Math.sin(ht));for(n=bt;n>0;n--)ht=c.CesiumMath.PI_OVER_TWO-gt*n,ct[pt++]=1-ft*(1+Math.cos(ht)),ct[pt++]=.5*(1+Math.sin(ht));for(n=v-T;n>0;n--)ct[pt++]=n*ft,ct[pt++]=1;for(n=1;n<bt+1;n++)ht=c.CesiumMath.PI_OVER_TWO+gt*n,ct[pt++]=ft*(1+Math.cos(ht)),ct[pt++]=.5*(1+Math.sin(ht))}else{for(ft=1/((v/=3)-1),yt=1/((A/=3)-1),n=0;n<A;n++)ct[pt++]=n*yt,ct[pt++]=0;for(n=v;n>0;n--)ct[pt++]=(n-1)*ft,ct[pt++]=1}C.st=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:ct})}return e.normal&&(C.normal=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:U.normals})),e.tangent&&(C.tangent=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:U.tangents})),e.bitangent&&(C.bitangent=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:U.bitangents})),{attributes:C,indices:j}}function U(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(var a=3;a<t.length;a+=3){var i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function B(e,r){var i=new g.VertexFormat({position:r.position,normal:r.normal||r.bitangent||e.shadowVolume,tangent:r.tangent,bitangent:r.normal||r.bitangent,st:r.st}),n=e.ellipsoid,d=z(s.CorridorGeometryLibrary.computePositions(e),i,n),m=e.height,c=e.extrudedHeight,h=d.attributes,b=d.indices,C=h.position.values,v=C.length,A=new Float64Array(6*v),_=new Float64Array(v);_.set(C);var w,T=new Float64Array(4*v);T=U(C=p.PolygonPipeline.scaleToGeodeticHeight(C,m,n),0,T),T=U(_=p.PolygonPipeline.scaleToGeodeticHeight(_,c,n),2*v,T),A.set(C),A.set(_,v),A.set(T,2*v),h.position.values=A,h=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;var r,i,o=t.position.values;(e.normal||e.bitangent)&&(r=t.normal.values,i=t.bitangent.values);var n,l=t.position.values.length/18,d=3*l,u=2*l,m=2*d;if(e.normal||e.bitangent||e.tangent){var y=e.normal?new Float32Array(6*d):void 0,f=e.tangent?new Float32Array(6*d):void 0,c=e.bitangent?new Float32Array(6*d):void 0,p=x,h=N,g=D,b=M,C=O,v=I,A=m;for(n=0;n<d;n+=3){var _=A+m;p=a.Cartesian3.fromArray(o,n,p),h=a.Cartesian3.fromArray(o,n+d,h),g=a.Cartesian3.fromArray(o,(n+3)%d,g),h=a.Cartesian3.subtract(h,p,h),g=a.Cartesian3.subtract(g,p,g),b=a.Cartesian3.normalize(a.Cartesian3.cross(h,g,b),b),e.normal&&(s.CorridorGeometryLibrary.addAttribute(y,b,_),s.CorridorGeometryLibrary.addAttribute(y,b,_+3),s.CorridorGeometryLibrary.addAttribute(y,b,A),s.CorridorGeometryLibrary.addAttribute(y,b,A+3)),(e.tangent||e.bitangent)&&(v=a.Cartesian3.fromArray(r,n,v),e.bitangent&&(s.CorridorGeometryLibrary.addAttribute(c,v,_),s.CorridorGeometryLibrary.addAttribute(c,v,_+3),s.CorridorGeometryLibrary.addAttribute(c,v,A),s.CorridorGeometryLibrary.addAttribute(c,v,A+3)),e.tangent&&(C=a.Cartesian3.normalize(a.Cartesian3.cross(v,b,C),C),s.CorridorGeometryLibrary.addAttribute(f,C,_),s.CorridorGeometryLibrary.addAttribute(f,C,_+3),s.CorridorGeometryLibrary.addAttribute(f,C,A),s.CorridorGeometryLibrary.addAttribute(f,C,A+3))),A+=6}if(e.normal){for(y.set(r),n=0;n<d;n+=3)y[n+d]=-r[n],y[n+d+1]=-r[n+1],y[n+d+2]=-r[n+2];t.normal.values=y}else t.normal=void 0;if(e.bitangent?(c.set(i),c.set(i,d),t.bitangent.values=c):t.bitangent=void 0,e.tangent){var w=t.tangent.values;f.set(w),f.set(w,d),t.tangent.values=f}}if(e.st){var T=t.st.values,G=new Float32Array(6*u);G.set(T),G.set(T,u);for(var E=2*u,V=0;V<2;V++){for(G[E++]=T[0],G[E++]=T[1],n=2;n<u;n+=2){var F=T[n],L=T[n+1];G[E++]=F,G[E++]=L,G[E++]=F,G[E++]=L}G[E++]=T[0],G[E++]=T[1]}t.st.values=G}return t}(h,r);var G=v/3;if(e.shadowVolume){var E=h.normal.values;v=E.length;var V=new Float32Array(6*v);for(w=0;w<v;w++)E[w]=-E[w];V.set(E,v),V=U(E,4*v,V),h.extrudeDirection=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V}),r.normal||(h.normal=void 0)}if(l.defined(e.offsetAttribute)){var F=new Uint8Array(6*G);if(e.offsetAttribute===y.GeometryOffsetAttribute.TOP)F=t.arrayFill(F,1,0,G),F=t.arrayFill(F,1,2*G,4*G);else{var L=e.offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1;F=t.arrayFill(F,L)}h.applyOffset=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}var P=b.length,S=G+G,R=f.IndexDatatype.createTypedArray(A.length/3,2*P+3*S);R.set(b);var k,H,B,Y,W=P;for(w=0;w<P;w+=3){var q=b[w],J=b[w+1],j=b[w+2];R[W++]=j+G,R[W++]=J+G,R[W++]=q+G}for(w=0;w<S;w+=2)B=(k=w+S)+1,Y=(H=k+S)+1,R[W++]=k,R[W++]=H,R[W++]=B,R[W++]=B,R[W++]=H,R[W++]=Y;return{attributes:h,indices:R}}var Y=new a.Cartesian3,W=new a.Cartesian3,q=new a.Cartographic;function J(t,e,r,i,o,n){var s=a.Cartesian3.subtract(e,t,Y);a.Cartesian3.normalize(s,s);var l=r.geodeticSurfaceNormal(t,W),d=a.Cartesian3.cross(s,l,Y);a.Cartesian3.multiplyByScalar(d,i,d);var u=o.latitude,m=o.longitude,y=n.latitude,f=n.longitude;a.Cartesian3.add(t,d,W),r.cartesianToCartographic(W,q);var c=q.latitude,p=q.longitude;u=Math.min(u,c),m=Math.min(m,p),y=Math.max(y,c),f=Math.max(f,p),a.Cartesian3.subtract(t,d,W),r.cartesianToCartographic(W,q),c=q.latitude,p=q.longitude,u=Math.min(u,c),m=Math.min(m,p),y=Math.max(y,c),f=Math.max(f,p),o.latitude=u,o.longitude=m,n.latitude=y,n.longitude=f}var j=new a.Cartesian3,K=new a.Cartesian3,Q=new a.Cartographic,X=new a.Cartographic;function Z(t,r,i,o,s){t=k(t,r);var u=e.arrayRemoveDuplicates(t,a.Cartesian3.equalsEpsilon),m=u.length;if(m<2||i<=0)return new d.Rectangle;var y,f,c=.5*i;if(Q.latitude=Number.POSITIVE_INFINITY,Q.longitude=Number.POSITIVE_INFINITY,X.latitude=Number.NEGATIVE_INFINITY,X.longitude=Number.NEGATIVE_INFINITY,o===n.CornerType.ROUNDED){var p=u[0];a.Cartesian3.subtract(p,u[1],j),a.Cartesian3.normalize(j,j),a.Cartesian3.multiplyByScalar(j,c,j),a.Cartesian3.add(p,j,K),r.cartesianToCartographic(K,q),y=q.latitude,f=q.longitude,Q.latitude=Math.min(Q.latitude,y),Q.longitude=Math.min(Q.longitude,f),X.latitude=Math.max(X.latitude,y),X.longitude=Math.max(X.longitude,f)}for(var h=0;h<m-1;++h)J(u[h],u[h+1],r,c,Q,X);var g=u[m-1];a.Cartesian3.subtract(g,u[m-2],j),a.Cartesian3.normalize(j,j),a.Cartesian3.multiplyByScalar(j,c,j),a.Cartesian3.add(g,j,K),J(g,K,r,c,Q,X),o===n.CornerType.ROUNDED&&(r.cartesianToCartographic(K,q),y=q.latitude,f=q.longitude,Q.latitude=Math.min(Q.latitude,y),Q.longitude=Math.min(Q.longitude,f),X.latitude=Math.max(X.latitude,y),X.longitude=Math.max(X.longitude,f));var b=l.defined(s)?s:new d.Rectangle;return b.north=X.latitude,b.south=Q.latitude,b.east=X.longitude,b.west=Q.longitude,b}function $(t){var e=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,r=t.width,i=l.defaultValue(t.height,0),o=l.defaultValue(t.extrudedHeight,i);this._positions=e,this._ellipsoid=d.Ellipsoid.clone(l.defaultValue(t.ellipsoid,d.Ellipsoid.WGS84)),this._vertexFormat=g.VertexFormat.clone(l.defaultValue(t.vertexFormat,g.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=l.defaultValue(t.cornerType,n.CornerType.ROUNDED),this._granularity=l.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=l.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*a.Cartesian3.packedLength+d.Ellipsoid.packedLength+g.VertexFormat.packedLength+7}$.pack=function(t,e,r){r=l.defaultValue(r,0);var i=t._positions,o=i.length;e[r++]=o;for(var n=0;n<o;++n,r+=a.Cartesian3.packedLength)a.Cartesian3.pack(i[n],e,r);return d.Ellipsoid.pack(t._ellipsoid,e,r),r+=d.Ellipsoid.packedLength,g.VertexFormat.pack(t._vertexFormat,e,r),r+=g.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=l.defaultValue(t._offsetAttribute,-1),e};var tt=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),et=new g.VertexFormat,rt={positions:void 0,ellipsoid:tt,vertexFormat:et,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return $.unpack=function(t,e,r){e=l.defaultValue(e,0);for(var i=t[e++],o=new Array(i),n=0;n<i;++n,e+=a.Cartesian3.packedLength)o[n]=a.Cartesian3.unpack(t,e);var s=d.Ellipsoid.unpack(t,e,tt);e+=d.Ellipsoid.packedLength;var u=g.VertexFormat.unpack(t,e,et);e+=g.VertexFormat.packedLength;var m=t[e++],y=t[e++],f=t[e++],c=t[e++],p=t[e++],h=1===t[e++],b=t[e];return l.defined(r)?(r._positions=o,r._ellipsoid=d.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=g.VertexFormat.clone(u,r._vertexFormat),r._width=m,r._height=y,r._extrudedHeight=f,r._cornerType=c,r._granularity=p,r._shadowVolume=h,r._offsetAttribute=-1===b?void 0:b,r):(rt.positions=o,rt.width=m,rt.height=y,rt.extrudedHeight=f,rt.cornerType=c,rt.granularity=p,rt.shadowVolume=h,rt.offsetAttribute=-1===b?void 0:b,new $(rt))},$.computeRectangle=function(t,e){var r=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,a=t.width;return Z(r,l.defaultValue(t.ellipsoid,d.Ellipsoid.WGS84),a,l.defaultValue(t.cornerType,n.CornerType.ROUNDED),e)},$.createGeometry=function(i){var n=i._positions,d=i._width,m=i._ellipsoid;n=k(n,m);var f=e.arrayRemoveDuplicates(n,a.Cartesian3.equalsEpsilon);if(!(f.length<2||d<=0)){var g,b=i._height,C=i._extrudedHeight,v=!c.CesiumMath.equalsEpsilon(b,C,0,c.CesiumMath.EPSILON2),A=i._vertexFormat,_={ellipsoid:m,positions:f,width:d,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};if(v)_.height=b,_.extrudedHeight=C,_.shadowVolume=i._shadowVolume,_.offsetAttribute=i._offsetAttribute,g=B(_,A);else if((g=z(s.CorridorGeometryLibrary.computePositions(_),A,m)).attributes.position.values=p.PolygonPipeline.scaleToGeodeticHeight(g.attributes.position.values,b,m),l.defined(i._offsetAttribute)){var w=i._offsetAttribute===y.GeometryOffsetAttribute.NONE?0:1,T=g.attributes.position.values.length,G=new Uint8Array(T/3);t.arrayFill(G,w),g.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:G})}var E=g.attributes,V=r.BoundingSphere.fromVertices(E.position.values,void 0,3);return A.position||(g.attributes.position.values=void 0),new u.Geometry({attributes:E,indices:g.indices,primitiveType:h.PrimitiveType.TRIANGLES,boundingSphere:V,offsetAttribute:i._offsetAttribute})}},$.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new $({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:g.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties($.prototype,{rectangle:{get:function(){return l.defined(this._rectangle)||(this._rectangle=Z(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return l.defined(e)&&(t=$.unpack(t,e)),t._ellipsoid=d.Ellipsoid.clone(t._ellipsoid),$.createGeometry(t)}}));