| 1 |
- define(["./when-b60132fc","./Cartesian2-47311507","./arrayRemoveDuplicates-d2f048c5","./BoundingRectangle-c09cdb4c","./buildModuleUrl-57a32107","./Cartographic-3309dd0d","./ComponentDatatype-c140a87d","./PolylineVolumeGeometryLibrary-2ac63485","./Check-7b2a090c","./GeometryAttribute-c42d25b7","./GeometryAttributes-252e9929","./GeometryPipeline-6d9322f0","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolygonPipeline-805ba13c","./VertexFormat-6446fca0","./Matrix4-cde86d0e","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./EllipsoidTangentPlane-ceab6aaa","./IntersectionTests-5e35c2ab","./Plane-ca0357f4","./PolylinePipeline-4ec7a59e","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./FeatureDetection-c3b71206","./AttributeCompression-90851096","./EncodedCartesian3-f1396b05","./earcut-2.2.1-20c8012f"],(function(e,t,a,n,i,r,o,l,s,p,c,u,d,m,y,g,h,f,v,b,C,P,E,_,k,L,V,F,A,G){"use strict";function T(a){var n=(a=e.defaultValue(a,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=a.shapePositions;this._positions=n,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(a.cornerType,l.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(e.defaultValue(a.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(a.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry",this.enuCenter=e.defaultValue(a.enuCenter,r.Cartesian3.ZERO);var o=1+n.length*r.Cartesian3.packedLength;o+=1+i.length*t.Cartesian2.packedLength+r.Cartesian3.packedLength,this.packedLength=o+t.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}T.pack=function(a,n,i){var o;i=e.defaultValue(i,0);var l=a._positions,s=l.length;for(n[i++]=s,o=0;o<s;++o,i+=r.Cartesian3.packedLength)r.Cartesian3.pack(l[o],n,i);var p=a._shape;for(s=p.length,n[i++]=s,o=0;o<s;++o,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(p[o],n,i);return t.Ellipsoid.pack(a._ellipsoid,n,i),i+=t.Ellipsoid.packedLength,g.VertexFormat.pack(a._vertexFormat,n,i),i+=g.VertexFormat.packedLength,n[i++]=a._cornerType,n[i++]=a._granularity,r.Cartesian3.pack(a.enuCenter,n,i),n};var x=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D=new g.VertexFormat,w={polylinePositions:void 0,shapePositions:void 0,ellipsoid:x,vertexFormat:D,cornerType:void 0,granularity:void 0,enuCenter:void 0};T.unpack=function(a,n,i){var o;n=e.defaultValue(n,0);var l=a[n++],s=new Array(l);for(o=0;o<l;++o,n+=r.Cartesian3.packedLength)s[o]=r.Cartesian3.unpack(a,n);l=a[n++];var p=new Array(l);for(o=0;o<l;++o,n+=t.Cartesian2.packedLength)p[o]=t.Cartesian2.unpack(a,n);var c=t.Ellipsoid.unpack(a,n,x);n+=t.Ellipsoid.packedLength;var u=g.VertexFormat.unpack(a,n,D);n+=g.VertexFormat.packedLength;var d,m=a[n++],y=a[n++];return d=r.Cartesian3.unpack(a,n),e.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=g.VertexFormat.clone(u,i._vertexFormat),i._cornerType=m,i._granularity=y,i.enuCenter=d,i):(w.polylinePositions=s,w.shapePositions=p,w.cornerType=m,w.granularity=y,w.enuCenter=d,new T(w))};var R=new n.BoundingRectangle;return T.createGeometry=function(t){for(var s=t._positions,m=a.arrayRemoveDuplicates(s,r.Cartesian3.equalsEpsilon),g=m.length,h=new Array(g),f=0;f<g;f++)h[f]=r.Cartesian3.clone(m[f]);var v=t._shape;if(v=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(v),!(m.length<2||v.length<3)){y.PolygonPipeline.computeWindingOrder2D(v)===y.WindingOrder.CLOCKWISE&&v.reverse();var b=n.BoundingRectangle.fromPoints(v,R),C={};if(C.combinedPositions=l.PolylineVolumeGeometryLibrary.computePositions(h,v,b,t,!0),!r.Cartesian3.equals(t.enuCenter,r.Cartesian3.ZERO)){var P=new Array(g);for(f=0;f<g;f++)P[f]=r.Cartesian3.clone(m[f]);C.combinedLocalPositions=l.PolylineVolumeGeometryLibrary.computeLocalPositions(P,v,b,t,!0,t.enuCenter)}return function(t,a,n,r){var l=t.combinedPositions,s=t.combinedLocalPositions,m=new c.GeometryAttributes;r.position&&(m.position=new p.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l}));var g,h,f,v,b,C,P=a.length,E=l.length/3,_=(E-2*P)/(2*P),k=y.PolygonPipeline.triangulate(a),L=(_-1)*P*6+2*k.length,V=d.IndexDatatype.createTypedArray(E,L),F=2*P,A=0;for(g=0;g<_-1;g++){for(h=0;h<P-1;h++)C=(f=2*h+g*P*2)+F,b=(v=f+1)+F,V[A++]=v,V[A++]=f,V[A++]=b,V[A++]=b,V[A++]=f,V[A++]=C;b=(v=1+(f=2*P-2+g*P*2))+F,C=f+F,V[A++]=v,V[A++]=f,V[A++]=b,V[A++]=b,V[A++]=f,V[A++]=C}if(r.st||r.tangent||r.bitangent){var G,T,x=new Float32Array(2*E),D=1/(_-1),w=1/n.height,R=n.height/2,O=0;for(g=0;g<_;g++){for(G=g*D,T=w*(a[0].y+R),x[O++]=G,x[O++]=T,h=1;h<P;h++)T=w*(a[h].y+R),x[O++]=G,x[O++]=T,x[O++]=G,x[O++]=T;T=w*(a[0].y+R),x[O++]=G,x[O++]=T}for(h=0;h<P;h++)G=0,T=w*(a[h].y+R),x[O++]=G,x[O++]=T;for(h=0;h<P;h++)G=(_-1)*D,T=w*(a[h].y+R),x[O++]=G,x[O++]=T;m.st=new p.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(x)})}var S=E-2*P;for(g=0;g<k.length;g+=3){var B=k[g]+S,I=k[g+1]+S,N=k[g+2]+S;V[A++]=B,V[A++]=I,V[A++]=N,V[A++]=N+P,V[A++]=I+P,V[A++]=B+P}var U=new p.Geometry({attributes:m,indices:V,boundingSphere:i.BoundingSphere.fromVertices(l),primitiveType:i.PrimitiveType.TRIANGLES});if(r.normal&&(U=u.GeometryPipeline.computeNormal(U)),r.tangent||r.bitangent){try{U=u.GeometryPipeline.computeTangentAndBitangent(U)}catch(e){i.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}r.tangent||(U.attributes.tangent=void 0),r.bitangent||(U.attributes.bitangent=void 0),r.st||(U.attributes.st=void 0)}return e.defined(s)&&(U.attributes.position.values=s,U.attributes.position.componentDatatype=o.ComponentDatatype.FLOAT),U}(C,v,b,t._vertexFormat)}},function(a,n){return e.defined(n)&&(a=T.unpack(a,n)),a._ellipsoid=t.Ellipsoid.clone(a._ellipsoid),T.createGeometry(a)}}));
|