/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.128 * * 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 wt}from"./chunk-LSAQZ7SS.js";import{a as C}from"./chunk-TUKY3Z5P.js";import{a as kt}from"./chunk-CFEBEP3P.js";import{a as Ct}from"./chunk-MEQTML24.js";import{b as dt,c as _t,d as N}from"./chunk-D2WGDEJE.js";import{d as ht}from"./chunk-LS5UR5C2.js";import{a as M}from"./chunk-MCJA36VG.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-KLDIEE7M.js";import{a as E}from"./chunk-BF7B4FIR.js";import{a as g}from"./chunk-IQDUXDOM.js";import{e as v}from"./chunk-GDY26PU3.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t0&&(H=!0,S+=u-1),A0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t=nt&&t