/* 2020-9-22 15:23:25 | 版权所有 军懋国兴  */
define(["exports","./when-cbf8cd21","./Math-69007a69","./Cartesian2-43e3a3be","./arrayRemoveDuplicates-d96adeb6","./PolylinePipeline-be169602"],function(e,f,A,C,w,b){"use strict";var i={};var M=new C.Cartographic,E=new C.Cartographic;function F(e,i,t,a){var r=(i=w.arrayRemoveDuplicates(i,C.Cartesian3.equalsEpsilon)).length;if(!(r<2)){var n=f.defined(a),o=f.defined(t),l=new Array(r),s=new Array(r),h=new Array(r),g=i[0];l[0]=g;var p=e.cartesianToCartographic(g,M);o&&(p.height=t[0]),s[0]=p.height,h[0]=n?a[0]:0;for(var u,c,d=s[0]===h[0],v=1,y=1;y<r;++y){var m=i[y],P=e.cartesianToCartographic(m,E);o&&(P.height=t[y]),d=d&&0===P.height,u=p,c=P,A.CesiumMath.equalsEpsilon(u.latitude,c.latitude,A.CesiumMath.EPSILON10)&&A.CesiumMath.equalsEpsilon(u.longitude,c.longitude,A.CesiumMath.EPSILON10)?p.height<P.height&&(s[v-1]=P.height):(l[v]=m,s[v]=P.height,h[v]=n?a[y]:0,d=d&&s[v]===h[v],C.Cartographic.clone(P,p),++v)}if(!(d||v<2))return l.length=v,s.length=v,h.length=v,{positions:l,topHeights:s,bottomHeights:h}}}var H=new Array(2),L=new Array(2),q={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};i.computePositions=function(e,i,t,a,r,n){var o=F(e,i,t,a);if(f.defined(o)){i=o.positions,t=o.topHeights,a=o.bottomHeights;var l,s,h=i.length,g=h-2,p=A.CesiumMath.chordLength(r,e.maximumRadius),u=q;if(u.minDistance=p,u.ellipsoid=e,n){for(var c=0,d=0;d<h-1;d++)c+=b.PolylinePipeline.numberOfPoints(i[d],i[d+1],p)+1;l=new Float64Array(3*c),s=new Float64Array(3*c);var v=H,y=L;u.positions=v,u.height=y;var m=0;for(d=0;d<h-1;d++){v[0]=i[d],v[1]=i[d+1],y[0]=t[d],y[1]=t[d+1];var P=b.PolylinePipeline.generateArc(u);l.set(P,m),y[0]=a[d],y[1]=a[d+1],s.set(b.PolylinePipeline.generateArc(u),m),m+=P.length}}else u.positions=i,u.height=t,l=new Float64Array(b.PolylinePipeline.generateArc(u)),u.height=a,s=new Float64Array(b.PolylinePipeline.generateArc(u));return{bottomPositions:s,topPositions:l,numCorners:g}}},e.WallGeometryLibrary=i});