qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/WallGeometryLibrary-2f7aa61...

2 lines
2.0 KiB
JavaScript
Raw Normal View History

2023-12-17 15:30:40 +08:00
define(["exports","./arrayRemoveDuplicates-cea3b206","./Cartesian3-e0307675","./Cartesian2-bd414876","./defaultValue-81eec7ed","./Math-e73894ab","./PolylinePipeline-0e56eeb9"],(function(e,t,i,n,o,r,a){"use strict";const s={};function l(e,t){return r.CesiumMath.equalsEpsilon(e.latitude,t.latitude,r.CesiumMath.EPSILON10)&&r.CesiumMath.equalsEpsilon(e.longitude,t.longitude,r.CesiumMath.EPSILON10)}const h=new n.Cartographic,c=new n.Cartographic;const g=new Array(2),u=new Array(2),p={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};s.computePositions=function(e,s,d,y,m,P){const f=function(e,r,a,s){const g=(r=t.arrayRemoveDuplicates(r,i.Cartesian3.equalsEpsilon)).length;if(g<2)return;const u=o.defined(s),p=o.defined(a),d=new Array(g),y=new Array(g),m=new Array(g),P=r[0];d[0]=P;const f=e.cartesianToCartographic(P,h);p&&(f.height=a[0]),y[0]=f.height,m[0]=u?s[0]:0;let C=y[0]===m[0],A=1;for(let t=1;t<g;++t){const i=r[t],o=e.cartesianToCartographic(i,c);p&&(o.height=a[t]),C=C&&0===o.height,l(f,o)?f.height<o.height&&(y[A-1]=o.height):(d[A]=i,y[A]=o.height,m[A]=u?s[t]:0,C=C&&y[A]===m[A],n.Cartographic.clone(o,f),++A)}return C||A<2?void 0:(d.length=A,y.length=A,m.length=A,{positions:d,topHeights:y,bottomHeights:m})}(e,s,d,y);if(!o.defined(f))return;s=f.positions,d=f.topHeights,y=f.bottomHeights;const C=s.length,A=C-2;let w,b;const v=r.CesiumMath.chordLength(m,e.maximumRadius),M=p;if(M.minDistance=v,M.ellipsoid=e,P){let e,t=0;for(e=0;e<C-1;e++)t+=a.PolylinePipeline.numberOfPoints(s[e],s[e+1],v)+1;w=new Float64Array(3*t),b=new Float64Array(3*t);const i=g,n=u;M.positions=i,M.height=n;let o=0;for(e=0;e<C-1;e++){i[0]=s[e],i[1]=s[e+1],n[0]=d[e],n[1]=d[e+1];const t=a.PolylinePipeline.generateArc(M);w.set(t,o),n[0]=y[e],n[1]=y[e+1],b.set(a.PolylinePipeline.generateArc(M),o),o+=t.length}}else M.positions=s,M.height=d,w=new Float64Array(a.PolylinePipeline.generateArc(M)),M.height=y,b=new Float64Array(a.PolylinePipeline.generateArc(M));return{bottomPositions:b,topPositions:w,numCorners:A}},e.WallGeometryLibrary=s}));