Newer
Older
smartwell_front_dz / XLJCYJ / mars3d-cesium / Workers / createGroundPolylineGeometry.js
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.120.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-Q3OGYXB5.js";import{a as Z}from"./chunk-O3XIRCSZ.js";import{a as _t}from"./chunk-VMUA7QRT.js";import{a as Oe}from"./chunk-SKCOSGUV.js";import{a as Le}from"./chunk-W3YQL44J.js";import{a as te}from"./chunk-2YTOGJWB.js";import{b as Qt}from"./chunk-ZZPAAKFL.js";import{a as jt}from"./chunk-A2J5OJ74.js";import{c as Ce,d as zt}from"./chunk-VT3S74KG.js";import{a as bt,d as G}from"./chunk-JYT7LKWQ.js";import{d as xe,e as Ne,f as Kt,h as U}from"./chunk-DPXXHKCX.js";import{a as Bt}from"./chunk-UTQP35IH.js";import{a as t,b as u,c as Pt,d as z,e as vt}from"./chunk-S74IVKSO.js";import{a as p}from"./chunk-XQPFZTAL.js";import"./chunk-CYX2VK56.js";import"./chunk-A5LGJSYE.js";import{a as O}from"./chunk-CDFKIAC5.js";import{a as St,b as et}from"./chunk-DRUYFASX.js";import{e as g}from"./chunk-A4U73JJE.js";function rt(t){t=O(t,O.EMPTY_OBJECT),this._ellipsoid=O(t.ellipsoid,z.default),this._rectangle=O(t.rectangle,U.MAX_VALUE),this._projection=new bt(this._ellipsoid),this._numberOfLevelZeroTilesX=O(t.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=O(t.numberOfLevelZeroTilesY,1)}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),rt.prototype.getNumberOfXTilesAtLevel=function(t){return this._numberOfLevelZeroTilesX<<t},rt.prototype.getNumberOfYTilesAtLevel=function(t){return this._numberOfLevelZeroTilesY<<t},rt.prototype.rectangleToNativeRectangle=function(t,e){et.defined("rectangle",t);let n=p.toDegrees(t.west),r=p.toDegrees(t.south),i=p.toDegrees(t.east),a=p.toDegrees(t.north);return g(e)?(e.west=n,e.south=r,e.east=i,e.north=a,e):new U(n,r,i,a)},rt.prototype.tileXYToNativeRectangle=function(t,e,n,r){let i=this.tileXYToRectangle(t,e,n,r);return i.west=p.toDegrees(i.west),i.south=p.toDegrees(i.south),i.east=p.toDegrees(i.east),i.north=p.toDegrees(i.north),i},rt.prototype.tileXYToRectangle=function(t,e,n,r){let i=this._rectangle,a=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),l=i.width/a,s=t*l+i.west,u=(t+1)*l+i.west,c=i.height/o,p=i.north-e*c,h=i.north-(e+1)*c;return g(r)||(r=new U(s,h,u,p)),r.west=s,r.south=h,r.east=u,r.north=p,r},rt.prototype.positionToTileXY=function(t,e,n){let r=this._rectangle;if(!U.contains(r,t))return;let i=this.getNumberOfXTilesAtLevel(e),a=this.getNumberOfYTilesAtLevel(e),o=r.width/i,l=r.height/a,s=t.longitude;r.east<r.west&&(s+=p.TWO_PI);let u=(s-r.west)/o|0;u>=i&&(u=i-1);let c=(r.north-t.latitude)/l|0;return c>=a&&(c=a-1),g(n)?(n.x=u,n.y=c,n):new Pt(u,c)};var De=rt,Ie=new t,He=new t,ke=new u,ee=new t,hn=new t,ye=new G,pn=new De,Lt=[new u,new u,new u,new u],Ot=new Pt,w={};function Ae(t){u.fromRadians(t.east,t.north,0,Lt[0]),u.fromRadians(t.west,t.north,0,Lt[1]),u.fromRadians(t.east,t.south,0,Lt[2]),u.fromRadians(t.west,t.south,0,Lt[3]);let e,n=0,r=0,i=0,a=0,o=w._terrainHeightsMaxLevel;for(e=0;e<=o;++e){let t=!1;for(let n=0;n<4;++n){let r=Lt[n];if(pn.positionToTileXY(r,e,Ot),0===n)i=Ot.x,a=Ot.y;else if(i!==Ot.x||a!==Ot.y){t=!0;break}}if(t)break;n=i,r=a}if(0!==e)return{x:n,y:r,level:e>o?o:e-1}}w.initialize=function(){let t=w._initPromise;return g(t)||(t=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then((function(t){w._terrainHeights=t})),w._initPromise=t),t},w.getMinimumMaximumHeights=function(e,n){if(et.defined("rectangle",e),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");n=O(n,z.default);let r=Ae(e),i=w._defaultMinTerrainHeight,a=w._defaultMaxTerrainHeight;if(g(r)){let o=`${r.level}-${r.x}-${r.y}`,l=w._terrainHeights[o];g(l)&&(i=l[0],a=l[1]),n.cartographicToCartesian(U.northeast(e,ke),Ie),n.cartographicToCartesian(U.southwest(e,ke),He),t.midpoint(He,Ie,ee);let s=n.scaleToGeodeticSurface(ee,hn);if(g(s)){let e=t.distance(ee,s);i=Math.min(i,-e)}else i=w._defaultMinTerrainHeight}return i=Math.max(w._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:a}},w.getBoundingSphere=function(t,e){if(et.defined("rectangle",t),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");e=O(e,z.default);let n=Ae(t),r=w._defaultMaxTerrainHeight;if(g(n)){let t=`${n.level}-${n.x}-${n.y}`,e=w._terrainHeights[t];g(e)&&(r=e[1])}let i=G.fromRectangle3D(t,e,0);return G.fromRectangle3D(t,e,r,ye),G.union(i,ye,i)},w._terrainHeightsMaxLevel=6,w._defaultMaxTerrainHeight=9e3,w._defaultMinTerrainHeight=-1e5,w._terrainHeights=void 0,w._initPromise=void 0,Object.defineProperties(w,{initialized:{get:function(){return g(w._terrainHeights)}}});var Xt=w,le=[bt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function ct(t){t=O(t,O.EMPTY_OBJECT);let e=t.positions;if(!g(e)||e.length<2)throw new St("At least two positions are required.");if(g(t.arcType)&&t.arcType!==Z.GEODESIC&&t.arcType!==Z.RHUMB)throw new St("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=O(t.width,1),this._positions=e,this.granularity=O(t.granularity,9999),this.loop=O(t.loop,!1),this.arcType=O(t.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+z.packedLength+1+1}}}),ct.setProjectionAndEllipsoid=function(t,e){let n=0;for(let r=0;r<dn;r++)if(e instanceof le[r]){n=r;break}t._projectionIndex=n,t._ellipsoid=e.ellipsoid};var fn=new t,Re=new t,Pe=new t;function se(e,n,r,i,a){let o=P(i,e,0,fn),l=P(i,e,r,Re),s=P(i,n,0,Pe),u=nt(l,o,Re),c=nt(s,o,Pe);return t.cross(c,u,a),t.normalize(a,a)}var mn=new u,gn=new t,un=new t,wn=new t;function ne(e,n,r,i,a,o,l,s,u,c,p){if(0===a)return;let h;o===Z.GEODESIC?h=new Oe(e,n,l):o===Z.RHUMB&&(h=new te(e,n,l));let g=h.surfaceDistance;if(g<a)return;let d=se(e,n,i,l,wn),f=Math.ceil(g/a),w=g/f,m=w,O=f-1,y=s.length;for(let T=0;T<O;T++){let e=h.interpolateUsingSurfaceDistance(m,mn),n=P(l,e,r,gn),a=P(l,e,i,un);t.pack(d,s,y),t.pack(n,u,y),t.pack(a,c,y),p.push(e.latitude),p.push(e.longitude),y+=3,m+=w}}var oe=new u;function P(t,e,n,r){return u.clone(e,oe),oe.height=n,u.toCartesian(oe,t,r)}function nt(e,n,r){return t.subtract(e,n,r),t.normalize(r,r),r}function be(e,n,r,i){return i=nt(e,n,i),i=t.cross(i,r,i),i=t.normalize(i,i),i=t.cross(r,i,i),i}ct.pack=function(e,n,r){et.typeOf.object("value",e),et.defined("array",n);let i=O(r,0),a=e._positions,o=a.length;n[i++]=o;for(let l=0;l<o;++l){let e=a[l];t.pack(e,n,i),i+=3}return n[i++]=e.granularity,n[i++]=e.loop?1:0,n[i++]=e.arcType,z.pack(e._ellipsoid,n,i),i+=z.packedLength,n[i++]=e._projectionIndex,n[i++]=e._scene3DOnly?1:0,n},ct.unpack=function(e,n,r){et.defined("array",e);let i=O(n,0),a=e[i++],o=new Array(a);for(let g=0;g<a;g++)o[g]=t.unpack(e,i),i+=3;let l=e[i++],s=1===e[i++],u=e[i++],c=z.unpack(e,i);i+=z.packedLength;let p=e[i++],h=1===e[i++];return g(r)||(r=new ct({positions:o})),r._positions=o,r.granularity=l,r.loop=s,r.arcType=u,r._ellipsoid=c,r._projectionIndex=p,r._scene3DOnly=h,r};var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(e,n,r,i,a){let o=nt(r,n,en),l=be(e,n,o,Sn),s=be(i,n,o,Tn);if(p.equalsEpsilon(t.dot(l,s),Nn,p.EPSILON5))return a=t.cross(o,l,a),a=t.normalize(a,a),a;a=t.add(s,l,a),a=t.normalize(a,a);let u=t.cross(o,a,En);return t.dot(s,u)<xn&&(a=t.negate(a,a)),a}var Gt=jt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,On=new t,Dn=new t,Yt=new t,Ft=new u,ve=new u,Be=new u;ct.createGeometry=function(e){let n,r,i=!e._scene3DOnly,a=e.loop,o=e._ellipsoid,l=e.granularity,s=e.arcType,c=new le[e._projectionIndex](o),h=Qe,d=tn,f=e._positions,w=f.length;2===w&&(a=!1);let m,O,y,T,_,k,E,L=new te(void 0,void 0,o),A=[f[0]];for(r=0;r<w-1;r++)m=f[r],O=f[r+1],_=Qt.lineSegmentPlane(m,O,Gt,Yt),g(_)&&!t.equalsEpsilon(_,m,p.EPSILON7)&&!t.equalsEpsilon(_,O,p.EPSILON7)&&(e.arcType===Z.GEODESIC?A.push(t.clone(_)):e.arcType===Z.RHUMB&&(E=o.cartesianToCartographic(_,Ft).longitude,y=o.cartesianToCartographic(m,Ft),T=o.cartesianToCartographic(O,ve),L.setEndPoints(y,T),k=L.findIntersectionWithLongitude(E,Be),_=o.cartographicToCartesian(k,Yt),g(_)&&!t.equalsEpsilon(_,m,p.EPSILON7)&&!t.equalsEpsilon(_,O,p.EPSILON7)&&A.push(t.clone(_)))),A.push(O);a&&(m=f[w-1],O=f[0],_=Qt.lineSegmentPlane(m,O,Gt,Yt),g(_)&&!t.equalsEpsilon(_,m,p.EPSILON7)&&!t.equalsEpsilon(_,O,p.EPSILON7)&&(e.arcType===Z.GEODESIC?A.push(t.clone(_)):e.arcType===Z.RHUMB&&(E=o.cartesianToCartographic(_,Ft).longitude,y=o.cartesianToCartographic(m,Ft),T=o.cartesianToCartographic(O,ve),L.setEndPoints(y,T),k=L.findIntersectionWithLongitude(E,Be),_=o.cartographicToCartesian(k,Yt),g(_)&&!t.equalsEpsilon(_,m,p.EPSILON7)&&!t.equalsEpsilon(_,O,p.EPSILON7)&&A.push(t.clone(_)))));let S=A.length,b=new Array(S);for(r=0;r<S;r++){let t=u.fromCartesian(A[r],o);t.height=0,b[r]=t}if(b=Le(b,u.equalsEpsilon),S=b.length,S<2)return;let v=[],I=[],j=[],z=[],D=Cn,x=_n,N=Ln,H=On,M=Dn,C=b[0],G=b[1],U=b[S-1];for(D=P(o,U,h,D),H=P(o,G,h,H),x=P(o,C,h,x),N=P(o,C,d,N),M=a?ie(D,x,N,H,M):se(C,G,d,o,M),t.pack(M,I,0),t.pack(x,j,0),t.pack(N,z,0),v.push(C.latitude),v.push(C.longitude),ne(C,G,h,d,l,s,o,I,j,z,v),r=1;r<S-1;++r){D=t.clone(x,D),x=t.clone(H,x);let e=b[r];P(o,e,d,N),P(o,b[r+1],h,H),ie(D,x,N,H,M),n=I.length,t.pack(M,I,n),t.pack(x,j,n),t.pack(N,z,n),v.push(e.latitude),v.push(e.longitude),ne(b[r],b[r+1],h,d,l,s,o,I,j,z,v)}let Y=b[S-1],R=b[S-2];if(x=P(o,Y,h,x),N=P(o,Y,d,N),a){let t=b[0];D=P(o,R,h,D),H=P(o,t,h,H),M=ie(D,x,N,H,M)}else M=se(R,Y,d,o,M);if(n=I.length,t.pack(M,I,n),t.pack(x,j,n),t.pack(N,z,n),v.push(Y.latitude),v.push(Y.longitude),a){for(ne(Y,C,h,d,l,s,o,I,j,z,v),n=I.length,r=0;r<3;++r)I[n+r]=I[r],j[n+r]=j[r],z[n+r]=z[r];v.push(C.latitude),v.push(C.longitude)}return Qn(a,c,j,z,I,v,i)};var In=new t,Hn=new vt,kn=new Kt;function ze(e,n,r,i){let a=nt(r,n,In),o=t.dot(a,e);if(o>Ke||o<Me){let t=nt(i,r,en),n=o<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,a=Kt.fromAxisAngle(t,n,kn),l=vt.fromQuaternion(a,Hn);return vt.multiplyByVector(l,e,e),!0}return!1}var je=new u,yn=new t,Xe=new t;function Dt(e,n,r,i,a){let o=u.toCartesian(n,e._ellipsoid,yn),l=t.add(o,r,Xe),s=!1,c=e._ellipsoid,h=c.cartesianToCartographic(l,je);Math.abs(n.longitude-h.longitude)>p.PI_OVER_TWO&&(s=!0,l=t.subtract(o,r,Xe),h=c.cartesianToCartographic(l,je)),h.height=0;let g=e.project(h,a);return a=t.subtract(g,i,a),a.z=0,a=t.normalize(a,a),s&&t.negate(a,a),a}var An=new t,Ye=new t;function Fe(e,n,r,i,a,o){let l=t.subtract(n,e,An);t.normalize(l,l);let s=r-Qe,u=t.multiplyByScalar(l,s,Ye);t.add(e,u,a);let c=i-tn;u=t.multiplyByScalar(l,c,Ye),t.add(n,u,o)}var Mn=new t;function Ut(e,n){let r=jt.getPointDistance(Gt,e),i=jt.getPointDistance(Gt,n),a=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(a=nt(n,e,a),t.multiplyByScalar(a,p.EPSILON2,a),t.add(e,a,e)):p.equalsEpsilon(i,0,p.EPSILON2)&&(a=nt(e,n,a),t.multiplyByScalar(a,p.EPSILON2,a),t.add(n,a,n))}function Rn(t,e){let n=Math.abs(t.longitude),r=Math.abs(e.longitude);if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let r=p.sign(e.longitude);return t.longitude=r*(n-p.EPSILON11),1}if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let n=p.sign(t.longitude);return e.longitude=n*(r-p.EPSILON11),2}return 0}var nn=new u,on=new u,Ue=new t,re=new t,Ge=new t,qe=new t,Pn=new t,We=new t,bn=[nn,on],vn=new U,Bn=new t,zn=new t,jn=new t,Xn=new t,Yn=new t,Fn=new t,ae=new t,ce=new t,Un=new t,Gn=new t,qn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new _t,$n=new _t,Ve=new t,Jn=new t,$e=new t,Kn=[new G,new G],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(e,n,r,i,a,o,l){let s,u,c,h,g,d,f=n._ellipsoid,w=r.length/3-1,m=8*w,O=4*m,y=36*w,T=m>65535?new Uint32Array(y):new Uint16Array(y),_=new Float64Array(3*m),k=new Float32Array(O),P=new Float32Array(O),E=new Float32Array(O),L=new Float32Array(O),A=new Float32Array(O);l&&(c=new Float32Array(O),h=new Float32Array(O),g=new Float32Array(O),d=new Float32Array(2*m));let S=o.length/2,b=0,v=nn;v.height=0;let I=on;I.height=0;let j=Ue,z=re;if(l)for(u=0,s=1;s<S;s++)v.latitude=o[u],v.longitude=o[u+1],I.latitude=o[u+2],I.longitude=o[u+3],j=n.project(v,j),z=n.project(I,z),b+=t.distance(j,z),u+=2;let D=i.length/3;z=t.unpack(i,0,z);let x,N=0;for(u=3,s=1;s<D;s++)j=t.clone(z,j),z=t.unpack(i,u,z),N+=t.distance(j,z),u+=3;u=3;let H=0,M=0,C=0,Y=0,R=!1,X=t.unpack(r,0,qe),F=t.unpack(i,0,re),Z=t.unpack(a,0,We);if(e){let e=t.unpack(r,r.length-6,Ge);ze(Z,e,X,F)&&(Z=t.negate(Z,Z))}let B=0,q=0,V=0;for(s=0;s<w;s++){let e,s,w,m,O=t.clone(X,Ge),y=t.clone(F,Ue),T=t.clone(Z,Pn);if(R&&(T=t.negate(T,T)),X=t.unpack(r,u,qe),F=t.unpack(i,u,re),Z=t.unpack(a,u,We),R=ze(Z,O,X,F),v.latitude=o[H],v.longitude=o[H+1],I.latitude=o[H+2],I.longitude=o[H+3],l){let r=Rn(v,I);e=n.project(v,Yn),s=n.project(I,Fn);let i=nt(s,e,Ve);i.y=Math.abs(i.y),w=ae,m=ce,0===r||t.dot(i,t.UNIT_Y)>Ke?(w=Dt(n,v,T,e,ae),m=Dt(n,I,Z,s,ce)):1===r?(m=Dt(n,I,Z,s,ce),w.x=0,w.y=p.sign(v.longitude-Math.abs(I.longitude)),w.z=0):(w=Dt(n,v,T,e,ae),m.x=0,m.y=p.sign(v.longitude-I.longitude),m.z=0)}let S=t.distance(y,F),j=_t.fromCartesian(O,Vn),z=t.subtract(X,O,Un),D=t.normalize(z,Ze),G=t.subtract(y,O,Gn);G=t.normalize(G,G);let J=t.cross(D,G,Ze);J=t.normalize(J,J);let K=t.cross(G,T,Wn);K=t.normalize(K,K);let Q=t.subtract(F,X,qn);Q=t.normalize(Q,Q);let W=t.cross(Z,Q,Zn);W=t.normalize(W,W);let $,tt,et,rt=S/N,it=B/N,at=0,ot=0,lt=0;if(l){at=t.distance(e,s),$=_t.fromCartesian(e,$n),tt=t.subtract(s,e,Ve),et=t.normalize(tt,Jn);let n=et.x;et.x=et.y,et.y=-n,ot=at/b,lt=q/b}for(x=0;x<8;x++){let e=Y+4*x,n=M+2*x,r=e+3,i=x<4?1:-1,a=2===x||3===x||6===x||7===x?1:-1;t.pack(j.high,k,e),k[r]=z.x,t.pack(j.low,P,e),P[r]=z.y,t.pack(K,E,e),E[r]=z.z,t.pack(W,L,e),L[r]=rt*i,t.pack(J,A,e);let o=it*a;0===o&&a<0&&(o=9),A[r]=o,l&&(c[e]=$.high.x,c[e+1]=$.high.y,c[e+2]=$.low.x,c[e+3]=$.low.y,g[e]=-w.y,g[e+1]=w.x,g[e+2]=m.y,g[e+3]=-m.x,h[e]=tt.x,h[e+1]=tt.y,h[e+2]=et.x,h[e+3]=et.y,d[n]=ot*i,o=lt*a,0===o&&a<0&&(o=9),d[n+1]=o)}let st=jn,ut=Xn,ct=Bn,pt=zn,ht=U.fromCartographicArray(bn,vn),gt=Xt.getMinimumMaximumHeights(ht,f),dt=gt.minimumTerrainHeight,ft=gt.maximumTerrainHeight;V+=Math.abs(dt),V+=Math.abs(ft),Fe(O,y,dt,ft,st,ct),Fe(X,F,dt,ft,ut,pt);let wt=t.multiplyByScalar(J,p.EPSILON5,$e);t.add(st,wt,st),t.add(ut,wt,ut),t.add(ct,wt,ct),t.add(pt,wt,pt),Ut(st,ut),Ut(ct,pt),t.pack(st,_,C),t.pack(ut,_,C+3),t.pack(pt,_,C+6),t.pack(ct,_,C+9),wt=t.multiplyByScalar(J,-2*p.EPSILON5,$e),t.add(st,wt,st),t.add(ut,wt,ut),t.add(ct,wt,ct),t.add(pt,wt,pt),Ut(st,ut),Ut(ct,pt),t.pack(st,_,C+12),t.pack(ut,_,C+15),t.pack(pt,_,C+18),t.pack(ct,_,C+21),H+=2,u+=3,M+=16,C+=24,Y+=32,B+=S,q+=at}u=0;let J=0;for(s=0;s<w;s++){for(x=0;x<Je;x++)T[u+x]=rn[x]+J;J+=8,u+=Je}let K=Kn;G.fromVertices(r,t.ZERO,3,K[0]),G.fromVertices(i,t.ZERO,3,K[1]);let Q=G.fromBoundingSpheres(K);Q.radius+=V/(2*w);let W={position:new zt({componentDatatype:Bt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:_}),startHiAndForwardOffsetX:at(k),startLoAndForwardOffsetY:at(P),startNormalAndForwardOffsetZ:at(E),endNormalAndTextureCoordinateNormalizationX:at(L),rightNormalAndTextureCoordinateNormalizationY:at(A)};return l&&(W.startHiLo2D=at(c),W.offsetAndRight2D=at(h),W.startEndNormals2D=at(g),W.texcoordNormalization2D=new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:2,normalize:!1,values:d})),new Ce({attributes:W,indices:T,boundingSphere:Q})}function at(t){return new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:4,normalize:!1,values:t})}ct._projectNormal=Dt;var he=ct;function to(t,e){return Xt.initialize().then((function(){return g(e)&&(t=he.unpack(t,e)),he.createGeometry(t)}))}var ti=to;export{ti as default};