Newer
Older
smartwell_front_dz / smartwell / mars3d-cesium / Workers / WallGeometryLibrary-f709492a.js
wangxitong on 11 Sep 2023 2 KB first commit
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.96.6
 *
 * 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.
 */
define(["exports","./arrayRemoveDuplicates-ca6f0282","./Matrix2-4706dd70","./defaultValue-028a8a27","./ComponentDatatype-438cad2a","./PolylinePipeline-52ab0181"],(function(e,t,i,n,o,r){"use strict";const a={};function s(e,t){return o.CesiumMath.equalsEpsilon(e.latitude,t.latitude,o.CesiumMath.EPSILON10)&&o.CesiumMath.equalsEpsilon(e.longitude,t.longitude,o.CesiumMath.EPSILON10)}const l=new i.Cartographic,h=new i.Cartographic;function c(e,o,r,a){o=t.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon);const c=o.length;if(c<2)return;const g=n.defined(a),u=n.defined(r),p=new Array(c),d=new Array(c),y=new Array(c),m=o[0];p[0]=m;const P=e.cartesianToCartographic(m,l);u&&(P.height=r[0]),d[0]=P.height,y[0]=g?a[0]:0;const f=d[0],A=y[0];let C=f===A,w=1;for(let t=1;t<c;++t){const n=o[t],l=e.cartesianToCartographic(n,h);u&&(l.height=r[t]),C=C&&0===l.height,s(P,l)?P.height<l.height&&(d[w-1]=l.height):(p[w]=n,d[w]=l.height,y[w]=g?a[t]:0,C=C&&d[w]===y[w],i.Cartographic.clone(l,P),++w)}return C||w<2?void 0:(p.length=w,d.length=w,y.length=w,{positions:p,topHeights:d,bottomHeights:y})}const g=new Array(2),u=new Array(2),p={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};a.computePositions=function(e,t,i,a,s,l){const h=c(e,t,i,a);if(!n.defined(h))return;t=h.positions,i=h.topHeights,a=h.bottomHeights;const d=t.length,y=d-2;let m,P;const f=o.CesiumMath.chordLength(s,e.maximumRadius),A=p;if(A.minDistance=f,A.ellipsoid=e,l){let e,n=0;for(e=0;e<d-1;e++)n+=r.PolylinePipeline.numberOfPoints(t[e],t[e+1],f)+1;m=new Float64Array(3*n),P=new Float64Array(3*n);const o=g,s=u;A.positions=o,A.height=s;let l=0;for(e=0;e<d-1;e++){o[0]=t[e],o[1]=t[e+1],s[0]=i[e],s[1]=i[e+1];const n=r.PolylinePipeline.generateArc(A);m.set(n,l),s[0]=a[e],s[1]=a[e+1],P.set(r.PolylinePipeline.generateArc(A),l),l+=n.length}}else A.positions=t,A.height=i,m=new Float64Array(r.PolylinePipeline.generateArc(A)),A.height=a,P=new Float64Array(r.PolylinePipeline.generateArc(A));return{bottomPositions:P,topPositions:m,numCorners:y}},e.WallGeometryLibrary=a}));