UNPKG

mars3d-cesium

Version:

CesiumJS是一个JavaScript库,用于在web浏览器中无需插件创建3D地球仪和2D地图,mars3d-cesium是mars3d团队修改版本的CesiumJS。

27 lines (25 loc) 16.6 kB
/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.142.1 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as _e}from"./chunk-4ETAQ37B.js";import{a as W}from"./chunk-GJZHYIBC.js";import{a as Nt}from"./chunk-5JDT4VMQ.js";import{a as De}from"./chunk-KXVHCEY2.js";import{a as Le}from"./chunk-7Z4ZLIOW.js";import{a as Qt}from"./chunk-AMW3SAPD.js";import{b as Kt}from"./chunk-P52G42H4.js";import{a as zt}from"./chunk-XIOENNW3.js";import{c as Ce,d as Bt}from"./chunk-RSFJBA3I.js";import{a as Rt,c as U}from"./chunk-7N2AJIJC.js";import"./chunk-PGY3OEVW.js";import{f as xe,g as Ne,h as Jt,j as Y}from"./chunk-C3JKZBS5.js";import"./chunk-3TSBNXE7.js";import{a as vt}from"./chunk-5RMHOCKK.js";import"./chunk-TXZVEXHN.js";import"./chunk-G7RN6XT4.js";import{a as w,b as Mt,c as B}from"./chunk-LQ243OAE.js";import{a as t,b as Pt,c as bt}from"./chunk-EPSEO3NS.js";import{a as p}from"./chunk-O6FXZBDO.js";import{a as ut,b as tt}from"./chunk-TKI7JJEW.js";import{f as u}from"./chunk-VSASJODR.js";var te=class{constructor(o){o=o??bt.EMPTY_OBJECT,this._ellipsoid=o.ellipsoid??B.default,this._rectangle=o.rectangle??Y.MAX_VALUE,this._projection=new Rt(this._ellipsoid),this._numberOfLevelZeroTilesX=o.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=o.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(o){return this._numberOfLevelZeroTilesX<<o}getNumberOfYTilesAtLevel(o){return this._numberOfLevelZeroTilesY<<o}rectangleToNativeRectangle(o,r){tt.defined("rectangle",o);let e=p.toDegrees(o.west),i=p.toDegrees(o.south),a=p.toDegrees(o.east),c=p.toDegrees(o.north);return u(r)?(r.west=e,r.south=i,r.east=a,r.north=c,r):new Y(e,i,a,c)}tileXYToNativeRectangle(o,r,e,i){let a=this.tileXYToRectangle(o,r,e,i);return a.west=p.toDegrees(a.west),a.south=p.toDegrees(a.south),a.east=p.toDegrees(a.east),a.north=p.toDegrees(a.north),a}tileXYToRectangle(o,r,e,i){let a=this._rectangle,c=this.getNumberOfXTilesAtLevel(e),l=this.getNumberOfYTilesAtLevel(e),s=a.width/c,d=o*s+a.west,h=(o+1)*s+a.west,f=a.height/l,T=a.north-r*f,D=a.north-(r+1)*f;return u(i)||(i=new Y(d,D,h,T)),i.west=d,i.south=D,i.east=h,i.north=T,i}positionToTileXY(o,r,e){let i=this._rectangle;if(!Y.contains(i,o))return;let a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=i.width/a,s=i.height/c,d=o.longitude;i.east<i.west&&(d+=p.TWO_PI);let h=(d-i.west)/l|0;h>=a&&(h=a-1);let f=(i.north-o.latitude)/s|0;return f>=c&&(f=c-1),u(e)?(e.x=h,e.y=f,e):new Mt(h,f)}},Oe=te;var Ie=new t,He=new t,ke=new w,ee=new t,hn=new t,ye=new U,pn=new Oe,Ct=[new w,new w,new w,new w],_t=new Mt,S={};S.initialize=function(){let n=S._initPromise;return u(n)||(n=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(o){S._terrainHeights=o}),S._initPromise=n),n};S.getMinimumMaximumHeights=function(n,o){if(tt.defined("rectangle",n),!u(S._terrainHeights))throw new ut("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=o??B.default;let r=Ae(n),e=S._defaultMinTerrainHeight,i=S._defaultMaxTerrainHeight;if(u(r)){let a=`${r.level}-${r.x}-${r.y}`,c=S._terrainHeights[a];u(c)&&(e=c[0],i=c[1]),o.cartographicToCartesian(Y.northeast(n,ke),Ie),o.cartographicToCartesian(Y.southwest(n,ke),He),t.midpoint(He,Ie,ee);let l=o.scaleToGeodeticSurface(ee,hn);if(u(l)){let s=t.distance(ee,l);e=Math.min(e,-s)}else e=S._defaultMinTerrainHeight}return e=Math.max(S._defaultMinTerrainHeight,e),{minimumTerrainHeight:e,maximumTerrainHeight:i}};S.getBoundingSphere=function(n,o){if(tt.defined("rectangle",n),!u(S._terrainHeights))throw new ut("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=o??B.default;let r=Ae(n),e=S._defaultMaxTerrainHeight;if(u(r)){let a=`${r.level}-${r.x}-${r.y}`,c=S._terrainHeights[a];u(c)&&(e=c[1])}let i=U.fromRectangle3D(n,o,0);return U.fromRectangle3D(n,o,e,ye),U.union(i,ye,i)};function Ae(n){w.fromRadians(n.east,n.north,0,Ct[0]),w.fromRadians(n.west,n.north,0,Ct[1]),w.fromRadians(n.east,n.south,0,Ct[2]),w.fromRadians(n.west,n.south,0,Ct[3]);let o=0,r=0,e=0,i=0,a=S._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let d=Ct[s];if(pn.positionToTileXY(d,c,_t),s===0)e=_t.x,i=_t.y;else if(e!==_t.x||i!==_t.y){l=!0;break}}if(l)break;o=e,r=i}if(c!==0)return{x:o,y:r,level:c>a?a:c-1}}S._terrainHeightsMaxLevel=6;S._defaultMaxTerrainHeight=9e3;S._defaultMinTerrainHeight=-1e5;S._terrainHeights=void 0;S._initPromise=void 0;Object.defineProperties(S,{initialized:{get:function(){return u(S._terrainHeights)}}});var jt=S;var le=[Rt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function rt(n){n=n??bt.EMPTY_OBJECT;let o=n.positions;if(!u(o)||o.length<2)throw new ut("At least two positions are required.");if(u(n.arcType)&&n.arcType!==W.GEODESIC&&n.arcType!==W.RHUMB)throw new ut("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=n.width??1,this._positions=o,this.granularity=n.granularity??9999,this.loop=n.loop??!1,this.arcType=n.arcType??W.GEODESIC,this._ellipsoid=B.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(rt.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+B.packedLength+1+1}}});rt.setProjectionAndEllipsoid=function(n,o){let r=0;for(let e=0;e<dn;e++)if(o instanceof le[e]){r=e;break}n._projectionIndex=r,n._ellipsoid=o.ellipsoid};var mn=new t,Re=new t,Pe=new t;function se(n,o,r,e,i){let a=R(e,n,0,mn),c=R(e,n,r,Re),l=R(e,o,0,Pe),s=et(c,a,Re),d=et(l,a,Pe);return t.cross(d,s,i),t.normalize(i,i)}var fn=new w,gn=new t,un=new t,wn=new t;function ne(n,o,r,e,i,a,c,l,s,d,h){if(i===0)return;let f;a===W.GEODESIC?f=new De(n,o,c):a===W.RHUMB&&(f=new Qt(n,o,c));let T=f.surfaceDistance;if(T<i)return;let D=se(n,o,e,c,wn),O=Math.ceil(T/i),I=T/O,z=I,q=O-1,m=l.length;for(let j=0;j<q;j++){let b=f.interpolateUsingSurfaceDistance(z,fn),y=R(c,b,r,gn),H=R(c,b,e,un);t.pack(D,l,m),t.pack(y,s,m),t.pack(H,d,m),h.push(b.latitude),h.push(b.longitude),m+=3,z+=I}}var oe=new w;function R(n,o,r,e){return w.clone(o,oe),oe.height=r,w.toCartesian(oe,n,e)}rt.pack=function(n,o,r){tt.typeOf.object("value",n),tt.defined("array",o);let e=r??0,i=n._positions,a=i.length;o[e++]=a;for(let c=0;c<a;++c){let l=i[c];t.pack(l,o,e),e+=3}return o[e++]=n.granularity,o[e++]=n.loop?1:0,o[e++]=n.arcType,B.pack(n._ellipsoid,o,e),e+=B.packedLength,o[e++]=n._projectionIndex,o[e++]=n._scene3DOnly?1:0,o};rt.unpack=function(n,o,r){tt.defined("array",n);let e=o??0,i=n[e++],a=new Array(i);for(let T=0;T<i;T++)a[T]=t.unpack(n,e),e+=3;let c=n[e++],l=n[e++]===1,s=n[e++],d=B.unpack(n,e);e+=B.packedLength;let h=n[e++],f=n[e++]===1;return u(r)||(r=new rt({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=f,r};function et(n,o,r){return t.subtract(n,o,r),t.normalize(r,r),r}function be(n,o,r,e){return e=et(n,o,e),e=t.cross(e,r,e),e=t.normalize(e,e),e=t.cross(r,e,e),e}var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(n,o,r,e,i){let a=et(r,o,en),c=be(n,o,a,Sn),l=be(e,o,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return i=t.cross(a,c,i),i=t.normalize(i,i),i;i=t.add(l,c,i),i=t.normalize(i,i);let s=t.cross(a,i,En);return t.dot(l,s)<xn&&(i=t.negate(i,i)),i}var Ut=zt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,Dn=new t,On=new t,Ft=new t,Xt=new w,ve=new w,Be=new w;rt.createGeometry=function(n){let o=!n._scene3DOnly,r=n.loop,e=n._ellipsoid,i=n.granularity,a=n.arcType,c=new le[n._projectionIndex](e),l=Qe,s=tn,d,h,f=n._positions,T=f.length;T===2&&(r=!1);let D,O,I,z,q=new Qt(void 0,void 0,e),m,j,b,y=[f[0]];for(h=0;h<T-1;h++)D=f[h],O=f[h+1],m=Kt.lineSegmentPlane(D,O,Ut,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&(n.arcType===W.GEODESIC?y.push(t.clone(m)):n.arcType===W.RHUMB&&(b=e.cartesianToCartographic(m,Xt).longitude,I=e.cartesianToCartographic(D,Xt),z=e.cartesianToCartographic(O,ve),q.setEndPoints(I,z),j=q.findIntersectionWithLongitude(b,Be),m=e.cartographicToCartesian(j,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&y.push(t.clone(m)))),y.push(O);r&&(D=f[T-1],O=f[0],m=Kt.lineSegmentPlane(D,O,Ut,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&(n.arcType===W.GEODESIC?y.push(t.clone(m)):n.arcType===W.RHUMB&&(b=e.cartesianToCartographic(m,Xt).longitude,I=e.cartesianToCartographic(D,Xt),z=e.cartesianToCartographic(O,ve),q.setEndPoints(I,z),j=q.findIntersectionWithLongitude(b,Be),m=e.cartographicToCartesian(j,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&y.push(t.clone(m)))));let H=y.length,C=new Array(H);for(h=0;h<H;h++){let X=w.fromCartesian(y[h],e);X.height=0,C[h]=X}if(C=Le(C,w.equalsEpsilon),H=C.length,H<2)return;let k=[],P=[],v=[],x=[],N=Cn,L=_n,_=Ln,F=Dn,A=On,g=C[0],Z=C[1],Dt=C[H-1];for(N=R(e,Dt,l,N),F=R(e,Z,l,F),L=R(e,g,l,L),_=R(e,g,s,_),r?A=ie(N,L,_,F,A):A=se(g,Z,s,e,A),t.pack(A,P,0),t.pack(L,v,0),t.pack(_,x,0),k.push(g.latitude),k.push(g.longitude),ne(g,Z,l,s,i,a,e,P,v,x,k),h=1;h<H-1;++h){N=t.clone(L,N),L=t.clone(F,L);let X=C[h];R(e,X,s,_),R(e,C[h+1],l,F),ie(N,L,_,F,A),d=P.length,t.pack(A,P,d),t.pack(L,v,d),t.pack(_,x,d),k.push(X.latitude),k.push(X.longitude),ne(C[h],C[h+1],l,s,i,a,e,P,v,x,k)}let M=C[H-1],wt=C[H-2];if(L=R(e,M,l,L),_=R(e,M,s,_),r){let X=C[0];N=R(e,wt,l,N),F=R(e,X,l,F),A=ie(N,L,_,F,A)}else A=se(wt,M,s,e,A);if(d=P.length,t.pack(A,P,d),t.pack(L,v,d),t.pack(_,x,d),k.push(M.latitude),k.push(M.longitude),r){for(ne(M,g,l,s,i,a,e,P,v,x,k),d=P.length,h=0;h<3;++h)P[d+h]=P[h],v[d+h]=v[h],x[d+h]=x[h];k.push(g.latitude),k.push(g.longitude)}return Qn(r,c,v,x,P,k,o)};var In=new t,Hn=new Pt,kn=new Jt;function ze(n,o,r,e){let i=et(r,o,In),a=t.dot(i,n);if(a>Ke||a<Me){let c=et(e,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Jt.fromAxisAngle(c,l,kn),d=Pt.fromQuaternion(s,Hn);return Pt.multiplyByVector(d,n,n),!0}return!1}var je=new w,yn=new t,Fe=new t;function Lt(n,o,r,e,i){let a=w.toCartesian(o,n._ellipsoid,yn),c=t.add(a,r,Fe),l=!1,s=n._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(o.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Fe),d=s.cartesianToCartographic(c,je)),d.height=0;let h=n.project(d,i);return i=t.subtract(h,e,i),i.z=0,i=t.normalize(i,i),l&&t.negate(i,i),i}var An=new t,Xe=new t;function Ye(n,o,r,e,i,a){let c=t.subtract(o,n,An);t.normalize(c,c);let l=r-Qe,s=t.multiplyByScalar(c,l,Xe);t.add(n,s,i);let d=e-tn;s=t.multiplyByScalar(c,d,Xe),t.add(o,s,a)}var Mn=new t;function Yt(n,o){let r=zt.getPointDistance(Ut,n),e=zt.getPointDistance(Ut,o),i=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(i=et(o,n,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(n,i,n)):p.equalsEpsilon(e,0,p.EPSILON2)&&(i=et(n,o,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(o,i,o))}function Rn(n,o){let r=Math.abs(n.longitude),e=Math.abs(o.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let i=p.sign(o.longitude);return n.longitude=i*(r-p.EPSILON11),1}else if(p.equalsEpsilon(e,p.PI,p.EPSILON11)){let i=p.sign(n.longitude);return o.longitude=i*(e-p.EPSILON11),2}return 0}var nn=new w,on=new w,Ue=new t,re=new t,qe=new t,Ge=new t,Pn=new t,We=new t,bn=[nn,on],vn=new Y,Bn=new t,zn=new t,jn=new t,Fn=new t,Xn=new t,Yn=new t,ae=new t,ce=new t,Un=new t,qn=new t,Gn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new Nt,$n=new Nt,Ve=new t,Jn=new t,$e=new t,Kn=[new U,new U],rn=[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],Je=rn.length;function Qn(n,o,r,e,i,a,c){let l,s,d=o._ellipsoid,h=r.length/3-1,f=h*8,T=f*4,D=h*36,O=f>65535?new Uint32Array(D):new Uint16Array(D),I=new Float64Array(f*3),z=new Float32Array(T),q=new Float32Array(T),m=new Float32Array(T),j=new Float32Array(T),b=new Float32Array(T),y,H,C,k;c&&(y=new Float32Array(T),H=new Float32Array(T),C=new Float32Array(T),k=new Float32Array(f*2));let P=a.length/2,v=0,x=nn;x.height=0;let N=on;N.height=0;let L=Ue,_=re;if(c)for(s=0,l=1;l<P;l++)x.latitude=a[s],x.longitude=a[s+1],N.latitude=a[s+2],N.longitude=a[s+3],L=o.project(x,L),_=o.project(N,_),v+=t.distance(L,_),s+=2;let F=e.length/3;_=t.unpack(e,0,_);let A=0;for(s=3,l=1;l<F;l++)L=t.clone(_,L),_=t.unpack(e,s,_),A+=t.distance(L,_),s+=3;let g;s=3;let Z=0,Dt=0,M=0,wt=0,X=!1,at=t.unpack(r,0,Ge),ct=t.unpack(e,0,re),G=t.unpack(i,0,We);if(n){let st=t.unpack(r,r.length-6,qe);ze(G,st,at,ct)&&(G=t.negate(G,G))}let pe=0,de=0,qt=0;for(l=0;l<h;l++){let st=t.clone(at,qe),Wt=t.clone(ct,Ue),dt=t.clone(G,Pn);X&&(dt=t.negate(dt,dt)),at=t.unpack(r,s,Ge),ct=t.unpack(e,s,re),G=t.unpack(i,s,We),X=ze(G,st,at,ct),x.latitude=a[Z],x.longitude=a[Z+1],N.latitude=a[Z+2],N.longitude=a[Z+3];let lt,mt,nt,ot;if(c){let E=Rn(x,N);lt=o.project(x,Xn),mt=o.project(N,Yn);let gt=et(mt,lt,Ve);gt.y=Math.abs(gt.y),nt=ae,ot=ce,E===0||t.dot(gt,t.UNIT_Y)>Ke?(nt=Lt(o,x,dt,lt,ae),ot=Lt(o,N,G,mt,ce)):E===1?(ot=Lt(o,N,G,mt,ce),nt.x=0,nt.y=p.sign(x.longitude-Math.abs(N.longitude)),nt.z=0):(nt=Lt(o,x,dt,lt,ae),ot.x=0,ot.y=p.sign(x.longitude-N.longitude),ot.z=0)}let ge=t.distance(Wt,ct),ue=Nt.fromCartesian(st,Vn),Ot=t.subtract(at,st,Un),an=t.normalize(Ot,Ze),Tt=t.subtract(Wt,st,qn);Tt=t.normalize(Tt,Tt);let ft=t.cross(an,Tt,Ze);ft=t.normalize(ft,ft);let It=t.cross(Tt,dt,Wn);It=t.normalize(It,It);let Ht=t.subtract(ct,at,Gn);Ht=t.normalize(Ht,Ht);let kt=t.cross(G,Ht,Zn);kt=t.normalize(kt,kt);let cn=ge/A,sn=pe/A,Zt=0,Et,yt,ht,we=0,Se=0;if(c){Zt=t.distance(lt,mt),Et=Nt.fromCartesian(lt,$n),yt=t.subtract(mt,lt,Ve),ht=t.normalize(yt,Jn);let E=ht.x;ht.x=ht.y,ht.y=-E,we=Zt/v,Se=de/v}for(g=0;g<8;g++){let E=wt+g*4,gt=Dt+g*2,xt=E+3,Ee=g<4?1:-1,At=g===2||g===3||g===6||g===7?1:-1;t.pack(ue.high,z,E),z[xt]=Ot.x,t.pack(ue.low,q,E),q[xt]=Ot.y,t.pack(It,m,E),m[xt]=Ot.z,t.pack(kt,j,E),j[xt]=cn*Ee,t.pack(ft,b,E);let pt=sn*At;pt===0&&At<0&&(pt=9),b[xt]=pt,c&&(y[E]=Et.high.x,y[E+1]=Et.high.y,y[E+2]=Et.low.x,y[E+3]=Et.low.y,C[E]=-nt.y,C[E+1]=nt.x,C[E+2]=ot.y,C[E+3]=-ot.x,H[E]=yt.x,H[E+1]=yt.y,H[E+2]=ht.x,H[E+3]=ht.y,k[gt]=we*Ee,pt=Se*At,pt===0&&At<0&&(pt=9),k[gt+1]=pt)}let V=jn,$=Fn,J=Bn,K=zn,ln=Y.fromCartographicArray(bn,vn),Te=jt.getMinimumMaximumHeights(ln,d),Vt=Te.minimumTerrainHeight,$t=Te.maximumTerrainHeight;qt+=Math.abs(Vt),qt+=Math.abs($t),Ye(st,Wt,Vt,$t,V,J),Ye(at,ct,Vt,$t,$,K);let Q=t.multiplyByScalar(ft,p.EPSILON5,$e);t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Yt(V,$),Yt(J,K),t.pack(V,I,M),t.pack($,I,M+3),t.pack(K,I,M+6),t.pack(J,I,M+9),Q=t.multiplyByScalar(ft,-2*p.EPSILON5,$e),t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Yt(V,$),Yt(J,K),t.pack(V,I,M+12),t.pack($,I,M+15),t.pack(K,I,M+18),t.pack(J,I,M+21),Z+=2,s+=3,Dt+=16,M+=24,wt+=32,pe+=ge,de+=Zt}s=0;let me=0;for(l=0;l<h;l++){for(g=0;g<Je;g++)O[s+g]=rn[g]+me;me+=8,s+=Je}let Gt=Kn;U.fromVertices(r,t.ZERO,3,Gt[0]),U.fromVertices(e,t.ZERO,3,Gt[1]);let fe=U.fromBoundingSpheres(Gt);fe.radius+=qt/(h*2);let St={position:new Bt({componentDatatype:vt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:it(z),startLoAndForwardOffsetY:it(q),startNormalAndForwardOffsetZ:it(m),endNormalAndTextureCoordinateNormalizationX:it(j),rightNormalAndTextureCoordinateNormalizationY:it(b)};return c&&(St.startHiLo2D=it(y),St.offsetAndRight2D=it(H),St.startEndNormals2D=it(C),St.texcoordNormalization2D=new Bt({componentDatatype:vt.FLOAT,componentsPerAttribute:2,normalize:!1,values:k})),new Ce({attributes:St,indices:O,boundingSphere:fe})}function it(n){return new Bt({componentDatatype:vt.FLOAT,componentsPerAttribute:4,normalize:!1,values:n})}rt._projectNormal=Lt;var he=rt;function to(n,o){return jt.initialize().then(function(){return u(o)&&(n=he.unpack(n,o)),he.createGeometry(n)})}var Qo=to;export{Qo as default};