@vcmap/ui 5.0.0-rc.6 → 5.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +3 -0
  2. package/config/aerowest.config.json +2 -1
  3. package/config/base.config.json +7 -7
  4. package/dist/assets/cesium/Workers/{AttributeCompression-27507afe.js → AttributeCompression-80665726.js} +1 -1
  5. package/dist/assets/cesium/Workers/{AxisAlignedBoundingBox-7565c1e8.js → AxisAlignedBoundingBox-a655a4bc.js} +1 -1
  6. package/dist/assets/cesium/Workers/{BoundingRectangle-9d707275.js → BoundingRectangle-c3b79029.js} +1 -1
  7. package/dist/assets/cesium/Workers/{BoxGeometry-fb31d3b5.js → BoxGeometry-f8f9c981.js} +1 -1
  8. package/dist/assets/cesium/Workers/{Color-56bb5728.js → Color-de06a177.js} +1 -1
  9. package/dist/assets/cesium/Workers/{CoplanarPolygonGeometryLibrary-72143c19.js → CoplanarPolygonGeometryLibrary-48cdc26d.js} +1 -1
  10. package/dist/assets/cesium/Workers/{CorridorGeometryLibrary-7bae1712.js → CorridorGeometryLibrary-ddc027d3.js} +1 -1
  11. package/dist/assets/cesium/Workers/{CylinderGeometry-331891fe.js → CylinderGeometry-82a8cbe6.js} +1 -1
  12. package/dist/assets/cesium/Workers/{EllipseGeometry-5e3f67b6.js → EllipseGeometry-32d55454.js} +1 -1
  13. package/dist/assets/cesium/Workers/{EllipseGeometryLibrary-dbc15162.js → EllipseGeometryLibrary-b2ae188a.js} +1 -1
  14. package/dist/assets/cesium/Workers/{EllipseOutlineGeometry-21191fce.js → EllipseOutlineGeometry-f05a5a27.js} +1 -1
  15. package/dist/assets/cesium/Workers/{EllipsoidGeodesic-cc3bace8.js → EllipsoidGeodesic-19e75e11.js} +1 -1
  16. package/dist/assets/cesium/Workers/{EllipsoidGeometry-8bfa24a9.js → EllipsoidGeometry-7c99fc81.js} +1 -1
  17. package/dist/assets/cesium/Workers/{EllipsoidOutlineGeometry-48d9c023.js → EllipsoidOutlineGeometry-21c243df.js} +1 -1
  18. package/dist/assets/cesium/Workers/{EllipsoidRhumbLine-125a8b72.js → EllipsoidRhumbLine-6145377b.js} +1 -1
  19. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +1 -0
  20. package/dist/assets/cesium/Workers/{EncodedCartesian3-96fdc0ef.js → EncodedCartesian3-d9f5c4a4.js} +1 -1
  21. package/dist/assets/cesium/Workers/{FrustumGeometry-9ab86004.js → FrustumGeometry-17776af8.js} +1 -1
  22. package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +1 -0
  23. package/dist/assets/cesium/Workers/{GeometryInstance-13e4ff38.js → GeometryInstance-4fbf16ba.js} +1 -1
  24. package/dist/assets/cesium/Workers/{GeometryPipeline-e0eb4567.js → GeometryPipeline-309fad76.js} +1 -1
  25. package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +1 -0
  26. package/dist/assets/cesium/Workers/{Matrix2-37e55508.js → Matrix2-47e98d76.js} +0 -0
  27. package/dist/assets/cesium/Workers/{OrientedBoundingBox-e9c07538.js → OrientedBoundingBox-fcb5b750.js} +1 -1
  28. package/dist/assets/cesium/Workers/{Plane-6ee42cab.js → Plane-3f01019d.js} +1 -1
  29. package/dist/assets/cesium/Workers/{PolygonGeometryLibrary-b408c688.js → PolygonGeometryLibrary-0b29eb16.js} +1 -1
  30. package/dist/assets/cesium/Workers/{PolygonPipeline-7b8e4643.js → PolygonPipeline-a934c4dd.js} +1 -1
  31. package/dist/assets/cesium/Workers/{PolylinePipeline-6757400c.js → PolylinePipeline-8095c9bc.js} +1 -1
  32. package/dist/assets/cesium/Workers/{PolylineVolumeGeometryLibrary-eb972210.js → PolylineVolumeGeometryLibrary-67d12fff.js} +1 -1
  33. package/dist/assets/cesium/Workers/{PrimitivePipeline-f244975e.js → PrimitivePipeline-980e44c5.js} +1 -1
  34. package/dist/assets/cesium/Workers/{RectangleGeometryLibrary-1bd6152a.js → RectangleGeometryLibrary-621c6de8.js} +1 -1
  35. package/dist/assets/cesium/Workers/{TerrainEncoding-5a21a97f.js → TerrainEncoding-f96552d5.js} +1 -1
  36. package/dist/assets/cesium/Workers/{Transforms-eb5c1a84.js → Transforms-c8cb8f43.js} +3 -3
  37. package/dist/assets/cesium/Workers/{WallGeometryLibrary-a6b6a368.js → WallGeometryLibrary-c03d8479.js} +1 -1
  38. package/dist/assets/cesium/Workers/{WebMercatorProjection-2839e524.js → WebMercatorProjection-79b3214e.js} +1 -1
  39. package/dist/assets/cesium/Workers/combineGeometry.js +1 -1
  40. package/dist/assets/cesium/Workers/createBoxGeometry.js +1 -1
  41. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +1 -1
  42. package/dist/assets/cesium/Workers/createCircleGeometry.js +1 -1
  43. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +1 -1
  44. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +1 -1
  45. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
  46. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1 -1
  47. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +1 -1
  48. package/dist/assets/cesium/Workers/createCylinderGeometry.js +1 -1
  49. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +1 -1
  50. package/dist/assets/cesium/Workers/createEllipseGeometry.js +1 -1
  51. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +1 -1
  52. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +1 -1
  53. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +1 -1
  54. package/dist/assets/cesium/Workers/createFrustumGeometry.js +1 -1
  55. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +1 -1
  56. package/dist/assets/cesium/Workers/createGeometry.js +1 -1
  57. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1 -1
  58. package/dist/assets/cesium/Workers/createPlaneGeometry.js +1 -1
  59. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +1 -1
  60. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1 -1
  61. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +1 -1
  62. package/dist/assets/cesium/Workers/createPolylineGeometry.js +1 -1
  63. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +1 -1
  64. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
  65. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1 -1
  66. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +1 -1
  67. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +1 -1
  68. package/dist/assets/cesium/Workers/createSphereGeometry.js +1 -1
  69. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +1 -1
  70. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +1 -1
  71. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +1 -1
  72. package/dist/assets/cesium/Workers/createVectorTilePoints.js +1 -1
  73. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +1 -1
  74. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +1 -1
  75. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
  76. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +1 -1
  77. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
  78. package/dist/assets/cesium/Workers/createWallGeometry.js +1 -1
  79. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +1 -1
  80. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -1
  81. package/dist/assets/{cesium.fba8ca.js → cesium.2a963a.js} +955 -968
  82. package/dist/assets/cesium.js +1 -1
  83. package/dist/assets/core.ba64c8.js +4 -0
  84. package/dist/assets/core.js +1 -1
  85. package/dist/assets/{index.6a83278e.js → index.83d29643.js} +1 -1
  86. package/dist/assets/{ol.abea3a.js → ol.5c9201.js} +0 -0
  87. package/dist/assets/ol.js +1 -1
  88. package/dist/assets/ui.c4abb7.css +1 -0
  89. package/dist/assets/ui.c4abb7.js +39 -0
  90. package/dist/assets/ui.js +1 -1
  91. package/dist/assets/uicomponents.5e36c1.css +1 -0
  92. package/dist/assets/uicomponents.5e36c1.js +32 -0
  93. package/dist/assets/uicomponents.js +1 -1
  94. package/dist/assets/{vue-composition-api.7051d7.js → vue-composition-api.ff8a0e.js} +1 -1
  95. package/dist/assets/vue-composition-api.js +2 -2
  96. package/dist/assets/{vue.9fd7f6.js → vue.f0d3bf.js} +0 -0
  97. package/dist/assets/vue.js +1 -1
  98. package/dist/assets/{vuetify.33dafc.css → vuetify.69b350.css} +1 -1
  99. package/dist/assets/{vuetify.33dafc.js → vuetify.69b350.js} +1 -1
  100. package/dist/assets/vuetify.js +2 -2
  101. package/dist/index.html +1 -1
  102. package/package.json +4 -4
  103. package/src/actions/actionHelper.js +39 -0
  104. package/src/application/Navbar.vue +32 -3
  105. package/src/application/VcsApp.vue +3 -1
  106. package/src/application/VcsMap.vue +1 -20
  107. package/src/manager/buttonManager.js +2 -1
  108. package/src/manager/window/WindowComponent.vue +27 -20
  109. package/src/manager/window/WindowComponentHeader.vue +13 -6
  110. package/src/navigation/mapNavigation.vue +26 -1
  111. package/src/navigation/overviewMap.js +616 -0
  112. package/src/navigation/overviewMapClickedInteraction.js +38 -0
  113. package/src/vcsUiApp.js +14 -0
  114. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-678e34e4.js +0 -1
  115. package/dist/assets/cesium/Workers/GeometryAttribute-3915ea0b.js +0 -1
  116. package/dist/assets/cesium/Workers/IntersectionTests-ac2459de.js +0 -1
  117. package/dist/assets/core.d5ed0f.js +0 -4
  118. package/dist/assets/ui.ad1ec9.css +0 -1
  119. package/dist/assets/ui.ad1ec9.js +0 -39
  120. package/dist/assets/uicomponents.161461.css +0 -1
  121. package/dist/assets/uicomponents.161461.js +0 -31
@@ -1 +1 @@
1
- define(["exports","./Transforms-eb5c1a84","./Matrix2-37e55508","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./GeometryAttribute-3915ea0b","./GeometryAttributes-32b29525","./Plane-6ee42cab","./VertexFormat-a0b706b0"],(function(t,e,a,n,i,r,o,s,f,u){"use strict";function l(t){this.planes=r.defaultValue(t,[])}const c=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,c[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,c[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,c[2]);const h=new a.Cartesian3,p=new a.Cartesian3,d=new f.Plane(new a.Cartesian3(1,0,0),0);function m(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._orthographicMatrix=new a.Matrix4}function C(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}l.fromBoundingSphere=function(t,e){r.defined(e)||(e=new l);const n=c.length,i=e.planes;i.length=2*n;const o=t.center,s=t.radius;let f=0;for(let t=0;t<n;++t){const e=c[t];let n=i[f],u=i[f+1];r.defined(n)||(n=i[f]=new a.Cartesian4),r.defined(u)||(u=i[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(e,-s,h),a.Cartesian3.add(o,h,h),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,h),a.Cartesian3.multiplyByScalar(e,s,h),a.Cartesian3.add(o,h,h),u.x=-e.x,u.y=-e.y,u.z=-e.z,u.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,p),h),f+=2}return e},l.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(f.Plane.fromCartesian4(a[i],d));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},l.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===l.MASK_OUTSIDE||a===l.MASK_INSIDE)return a;let n=l.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(f.Plane.fromCartesian4(i[r],d));if(s===e.Intersect.OUTSIDE)return l.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},l.MASK_OUTSIDE=4294967295,l.MASK_INSIDE=0,l.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){return C(this),this._orthographicMatrix}}});const _=new a.Cartesian3,y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3;function x(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new m,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function v(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function M(t){const e=t.top,n=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&n===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=n,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(r,i,n,e,o,s,t._perspectiveMatrix),t._infinitePerspective=a.Matrix4.computeInfinitePerspectiveOffCenter(r,i,n,e,o,t._infinitePerspective))}m.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,_);a.Cartesian3.normalize(h,h);const p=y;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=g;a.Cartesian3.multiplyByScalar(h,u,d),a.Cartesian3.add(p,d,d);let m=i[0];return r.defined(m)||(m=i[0]=new a.Cartesian4),m.x=h.x,m.y=h.y,m.z=h.z,m.w=-a.Cartesian3.dot(h,d),a.Cartesian3.multiplyByScalar(h,f,d),a.Cartesian3.add(p,d,d),m=i[1],r.defined(m)||(m=i[1]=new a.Cartesian4),m.x=-h.x,m.y=-h.y,m.z=-h.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,w),d),a.Cartesian3.multiplyByScalar(n,s,d),a.Cartesian3.add(p,d,d),m=i[2],r.defined(m)||(m=i[2]=new a.Cartesian4),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-a.Cartesian3.dot(n,d),a.Cartesian3.multiplyByScalar(n,o,d),a.Cartesian3.add(p,d,d),m=i[3],r.defined(m)||(m=i[3]=new a.Cartesian4),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(n,w),d),m=i[4],r.defined(m)||(m=i[4]=new a.Cartesian4),m.x=e.x,m.y=e.y,m.z=e.z,m.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d),m=i[5],r.defined(m)||(m=i[5]=new a.Cartesian4),m.x=-e.x,m.y=-e.y,m.z=-e.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,w),d),this._cullingVolume},m.prototype.getPixelDimensions=function(t,e,a,n,i){C(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},m.prototype.clone=function(t){return r.defined(t)||(t=new m),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},m.prototype.equals=function(t){return r.defined(t)&&t instanceof m&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},m.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof m&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},x.packedLength=4,x.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},x.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new x),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return v(this),this._offCenterFrustum.projectionMatrix}}}),x.prototype.computeCullingVolume=function(t,e,a){return v(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},x.prototype.getPixelDimensions=function(t,e,a,n,i){return v(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},x.prototype.clone=function(t){return r.defined(t)||(t=new x),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},x.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},x.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return M(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return M(this),this._infinitePerspective}}});const V=new a.Cartesian3,F=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3;function P(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function z(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,V),p=F;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(h,u,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.normalize(m,m),a.Cartesian3.cross(m,n,m),a.Cartesian3.normalize(m,m);let C=i[0];return r.defined(C)||(C=i[0]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(n,m,m),a.Cartesian3.normalize(m,m),C=i[1],r.defined(C)||(C=i[1]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,s,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(h,m,m),a.Cartesian3.normalize(m,m),C=i[2],r.defined(C)||(C=i[2]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,o,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(m,h,m),a.Cartesian3.normalize(m,m),C=i[3],r.defined(C)||(C=i[3]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),C=i[4],r.defined(C)||(C=i[4]=new a.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,p),a.Cartesian3.negate(e,m),C=i[5],r.defined(C)||(C=i[5]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,d),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){M(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},P.packedLength=6,P.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},P.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new P),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(P.prototype,{projectionMatrix:{get:function(){return z(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return z(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return z(this),this._fovy}},sseDenominator:{get:function(){return z(this),this._sseDenominator}}}),P.prototype.computeCullingVolume=function(t,e,a){return z(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},P.prototype.getPixelDimensions=function(t,e,a,n,i){return z(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},P.prototype.clone=function(t){return r.defined(t)||(t=new P),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},P.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},P.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function R(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let l,c;n instanceof P?(l=0,c=P.packedLength):n instanceof x&&(l=1,c=x.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+u.VertexFormat.packedLength}R.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,0===o?(P.pack(s,n,i),i+=P.packedLength):(x.pack(s,n,i),i+=x.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,n,i),n[i+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const S=new P,T=new x,k=new e.Quaternion,A=new a.Cartesian3,D=new u.VertexFormat;function I(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}R.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;0===o?(s=P.unpack(t,n,S),n+=P.packedLength):(s=x.unpack(t,n,T),n+=x.packedLength);const f=a.Cartesian3.unpack(t,n,A);n+=a.Cartesian3.packedLength;const l=e.Quaternion.unpack(t,n,k);n+=e.Quaternion.packedLength;const c=u.VertexFormat.unpack(t,n,D),h=1===t[n+=u.VertexFormat.packedLength];if(!r.defined(i))return new R({frustum:s,origin:f,orientation:l,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(l,i._orientation),i._vertexFormat=u.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const q=new a.Matrix3,B=new a.Matrix4,L=new a.Matrix4,N=new a.Cartesian3,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new Array(3),J=new Array(4);J[0]=new a.Cartesian4(-1,-1,1,1),J[1]=new a.Cartesian4(1,-1,1,1),J[2]=new a.Cartesian4(1,1,1,1),J[3]=new a.Cartesian4(-1,1,1,1);const W=new Array(4);for(let t=0;t<4;++t)W[t]=new a.Cartesian4;R._computeNearFarPlanes=function(t,e,n,i,o,s,f,u){const l=a.Matrix3.fromQuaternion(e,q);let c=r.defaultValue(s,N),h=r.defaultValue(f,G),p=r.defaultValue(u,j);c=a.Matrix3.getColumn(l,0,c),h=a.Matrix3.getColumn(l,1,h),p=a.Matrix3.getColumn(l,2,p),a.Cartesian3.normalize(c,c),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.negate(c,c);const d=a.Matrix4.computeView(t,p,h,c,B);let m,C;if(0===n){const t=i.projectionMatrix,e=a.Matrix4.multiply(t,d,L);C=a.Matrix4.inverse(e,L)}else m=a.Matrix4.inverseTransformation(d,L);r.defined(C)?(Y[0]=i.near,Y[1]=i.far):(Y[0]=0,Y[1]=i.near,Y[2]=i.far);for(let e=0;e<2;++e)for(let n=0;n<4;++n){let s=a.Cartesian4.clone(J[n],W[n]);if(r.defined(C)){s=a.Matrix4.multiplyByVector(C,s,s);const n=1/s.w;a.Cartesian3.multiplyByScalar(s,n,s),a.Cartesian3.subtract(s,t,s),a.Cartesian3.normalize(s,s);const i=a.Cartesian3.dot(p,s);a.Cartesian3.multiplyByScalar(s,Y[e]/i,s),a.Cartesian3.add(s,t,s)}else{r.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum);const t=Y[e],n=Y[e+1];s.x=.5*(s.x*(i.right-i.left)+i.left+i.right),s.y=.5*(s.y*(i.top-i.bottom)+i.bottom+i.top),s.z=.5*(s.z*(t-n)-t-n),s.w=1,a.Matrix4.multiplyByVector(m,s,s)}o[12*e+3*n]=s.x,o[12*e+3*n+1]=s.y,o[12*e+3*n+2]=s.z}},R.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);R._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=N,u=G,l=j,d=a.Cartesian3.negate(f,U),_=a.Cartesian3.negate(u,Q),y=a.Cartesian3.negate(l,K);m=0,c&&(I(m,t,e,n,s,y,f,u),m+=12),I(m,t,e,n,s,l,d,u),m+=12,I(m,t,e,n,s,d,y,u),m+=12,I(m,t,e,n,s,_,y,d),m+=12,I(m,t,e,n,s,f,l,u),m+=12,I(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=R,t.OrthographicFrustum=x,t.PerspectiveFrustum=P}));
1
+ define(["exports","./Transforms-c8cb8f43","./Matrix2-47e98d76","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./Plane-3f01019d","./VertexFormat-a0b706b0"],(function(t,e,a,n,i,r,o,s,f,u){"use strict";function l(t){this.planes=r.defaultValue(t,[])}const c=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,c[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,c[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,c[2]);const h=new a.Cartesian3,p=new a.Cartesian3,d=new f.Plane(new a.Cartesian3(1,0,0),0);function m(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._orthographicMatrix=new a.Matrix4}function C(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}l.fromBoundingSphere=function(t,e){r.defined(e)||(e=new l);const n=c.length,i=e.planes;i.length=2*n;const o=t.center,s=t.radius;let f=0;for(let t=0;t<n;++t){const e=c[t];let n=i[f],u=i[f+1];r.defined(n)||(n=i[f]=new a.Cartesian4),r.defined(u)||(u=i[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(e,-s,h),a.Cartesian3.add(o,h,h),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,h),a.Cartesian3.multiplyByScalar(e,s,h),a.Cartesian3.add(o,h,h),u.x=-e.x,u.y=-e.y,u.z=-e.z,u.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,p),h),f+=2}return e},l.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(f.Plane.fromCartesian4(a[i],d));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},l.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===l.MASK_OUTSIDE||a===l.MASK_INSIDE)return a;let n=l.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(f.Plane.fromCartesian4(i[r],d));if(s===e.Intersect.OUTSIDE)return l.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},l.MASK_OUTSIDE=4294967295,l.MASK_INSIDE=0,l.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){return C(this),this._orthographicMatrix}}});const _=new a.Cartesian3,y=new a.Cartesian3,g=new a.Cartesian3,w=new a.Cartesian3;function x(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new m,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far}function v(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function b(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function M(t){const e=t.top,n=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&n===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=n,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(r,i,n,e,o,s,t._perspectiveMatrix),t._infinitePerspective=a.Matrix4.computeInfinitePerspectiveOffCenter(r,i,n,e,o,t._infinitePerspective))}m.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,_);a.Cartesian3.normalize(h,h);const p=y;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=g;a.Cartesian3.multiplyByScalar(h,u,d),a.Cartesian3.add(p,d,d);let m=i[0];return r.defined(m)||(m=i[0]=new a.Cartesian4),m.x=h.x,m.y=h.y,m.z=h.z,m.w=-a.Cartesian3.dot(h,d),a.Cartesian3.multiplyByScalar(h,f,d),a.Cartesian3.add(p,d,d),m=i[1],r.defined(m)||(m=i[1]=new a.Cartesian4),m.x=-h.x,m.y=-h.y,m.z=-h.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,w),d),a.Cartesian3.multiplyByScalar(n,s,d),a.Cartesian3.add(p,d,d),m=i[2],r.defined(m)||(m=i[2]=new a.Cartesian4),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-a.Cartesian3.dot(n,d),a.Cartesian3.multiplyByScalar(n,o,d),a.Cartesian3.add(p,d,d),m=i[3],r.defined(m)||(m=i[3]=new a.Cartesian4),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(n,w),d),m=i[4],r.defined(m)||(m=i[4]=new a.Cartesian4),m.x=e.x,m.y=e.y,m.z=e.z,m.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d),m=i[5],r.defined(m)||(m=i[5]=new a.Cartesian4),m.x=-e.x,m.y=-e.y,m.z=-e.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,w),d),this._cullingVolume},m.prototype.getPixelDimensions=function(t,e,a,n,i){C(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},m.prototype.clone=function(t){return r.defined(t)||(t=new m),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},m.prototype.equals=function(t){return r.defined(t)&&t instanceof m&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},m.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof m&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},x.packedLength=4,x.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},x.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new x),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return v(this),this._offCenterFrustum.projectionMatrix}}}),x.prototype.computeCullingVolume=function(t,e,a){return v(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},x.prototype.getPixelDimensions=function(t,e,a,n,i){return v(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},x.prototype.clone=function(t){return r.defined(t)||(t=new x),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},x.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},x.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof x)&&(v(this),v(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){return M(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return M(this),this._infinitePerspective}}});const V=new a.Cartesian3,F=new a.Cartesian3,E=new a.Cartesian3,O=new a.Cartesian3;function P(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new b,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=r.defaultValue(t.near,1),this._near=this.near,this.far=r.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=r.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=r.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function z(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}b.prototype.computeCullingVolume=function(t,e,n){const i=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,V),p=F;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=E;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=O;a.Cartesian3.multiplyByScalar(h,u,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.normalize(m,m),a.Cartesian3.cross(m,n,m),a.Cartesian3.normalize(m,m);let C=i[0];return r.defined(C)||(C=i[0]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(n,m,m),a.Cartesian3.normalize(m,m),C=i[1],r.defined(C)||(C=i[1]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,s,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(h,m,m),a.Cartesian3.normalize(m,m),C=i[2],r.defined(C)||(C=i[2]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,o,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(m,h,m),a.Cartesian3.normalize(m,m),C=i[3],r.defined(C)||(C=i[3]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),C=i[4],r.defined(C)||(C=i[4]=new a.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,p),a.Cartesian3.negate(e,m),C=i[5],r.defined(C)||(C=i[5]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,d),this._cullingVolume},b.prototype.getPixelDimensions=function(t,e,a,n,i){M(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},b.prototype.clone=function(t){return r.defined(t)||(t=new b),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},b.prototype.equals=function(t){return r.defined(t)&&t instanceof b&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},b.prototype.equalsEpsilon=function(t,e,a){return t===this||r.defined(t)&&t instanceof b&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},P.packedLength=6,P.pack=function(t,e,a){return a=r.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},P.unpack=function(t,e,a){return e=r.defaultValue(e,0),r.defined(a)||(a=new P),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(P.prototype,{projectionMatrix:{get:function(){return z(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return z(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return z(this),this._fovy}},sseDenominator:{get:function(){return z(this),this._sseDenominator}}}),P.prototype.computeCullingVolume=function(t,e,a){return z(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},P.prototype.getPixelDimensions=function(t,e,a,n,i){return z(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},P.prototype.clone=function(t){return r.defined(t)||(t=new P),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},P.prototype.equals=function(t){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},P.prototype.equalsEpsilon=function(t,e,a){return!!(r.defined(t)&&t instanceof P)&&(z(this),z(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function R(t){const n=t.frustum,i=t.orientation,o=t.origin,s=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),f=r.defaultValue(t._drawNearPlane,!0);let l,c;n instanceof P?(l=0,c=P.packedLength):n instanceof x&&(l=1,c=x.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+u.VertexFormat.packedLength}R.pack=function(t,n,i){i=r.defaultValue(i,0);const o=t._frustumType,s=t._frustum;return n[i++]=o,0===o?(P.pack(s,n,i),i+=P.packedLength):(x.pack(s,n,i),i+=x.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,n,i),n[i+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const S=new P,T=new x,k=new e.Quaternion,A=new a.Cartesian3,D=new u.VertexFormat;function I(t,e,a,n,i,o,s,f){const u=t/3*2;for(let i=0;i<4;++i)r.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),r.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),r.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}R.unpack=function(t,n,i){n=r.defaultValue(n,0);const o=t[n++];let s;0===o?(s=P.unpack(t,n,S),n+=P.packedLength):(s=x.unpack(t,n,T),n+=x.packedLength);const f=a.Cartesian3.unpack(t,n,A);n+=a.Cartesian3.packedLength;const l=e.Quaternion.unpack(t,n,k);n+=e.Quaternion.packedLength;const c=u.VertexFormat.unpack(t,n,D),h=1===t[n+=u.VertexFormat.packedLength];if(!r.defined(i))return new R({frustum:s,origin:f,orientation:l,vertexFormat:c,_drawNearPlane:h});const p=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=o,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(l,i._orientation),i._vertexFormat=u.VertexFormat.clone(c,i._vertexFormat),i._drawNearPlane=h,i};const q=new a.Matrix3,B=new a.Matrix4,L=new a.Matrix4,N=new a.Cartesian3,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new Array(3),J=new Array(4);J[0]=new a.Cartesian4(-1,-1,1,1),J[1]=new a.Cartesian4(1,-1,1,1),J[2]=new a.Cartesian4(1,1,1,1),J[3]=new a.Cartesian4(-1,1,1,1);const W=new Array(4);for(let t=0;t<4;++t)W[t]=new a.Cartesian4;R._computeNearFarPlanes=function(t,e,n,i,o,s,f,u){const l=a.Matrix3.fromQuaternion(e,q);let c=r.defaultValue(s,N),h=r.defaultValue(f,G),p=r.defaultValue(u,j);c=a.Matrix3.getColumn(l,0,c),h=a.Matrix3.getColumn(l,1,h),p=a.Matrix3.getColumn(l,2,p),a.Cartesian3.normalize(c,c),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.negate(c,c);const d=a.Matrix4.computeView(t,p,h,c,B);let m,C;if(0===n){const t=i.projectionMatrix,e=a.Matrix4.multiply(t,d,L);C=a.Matrix4.inverse(e,L)}else m=a.Matrix4.inverseTransformation(d,L);r.defined(C)?(Y[0]=i.near,Y[1]=i.far):(Y[0]=0,Y[1]=i.near,Y[2]=i.far);for(let e=0;e<2;++e)for(let n=0;n<4;++n){let s=a.Cartesian4.clone(J[n],W[n]);if(r.defined(C)){s=a.Matrix4.multiplyByVector(C,s,s);const n=1/s.w;a.Cartesian3.multiplyByScalar(s,n,s),a.Cartesian3.subtract(s,t,s),a.Cartesian3.normalize(s,s);const i=a.Cartesian3.dot(p,s);a.Cartesian3.multiplyByScalar(s,Y[e]/i,s),a.Cartesian3.add(s,t,s)}else{r.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum);const t=Y[e],n=Y[e+1];s.x=.5*(s.x*(i.right-i.left)+i.left+i.right),s.y=.5*(s.y*(i.top-i.bottom)+i.bottom+i.top),s.z=.5*(s.z*(t-n)-t-n),s.w=1,a.Matrix4.multiplyByVector(m,s,s)}o[12*e+3*n]=s.x,o[12*e+3*n+1]=s.y,o[12*e+3*n+2]=s.z}},R.createGeometry=function(t){const n=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);R._computeNearFarPlanes(u,l,n,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(r.defined(h.normal)||r.defined(h.tangent)||r.defined(h.bitangent)||r.defined(h.st)){const t=r.defined(h.normal)?new Float32Array(12*p):void 0,e=r.defined(h.tangent)?new Float32Array(12*p):void 0,n=r.defined(h.bitangent)?new Float32Array(12*p):void 0,s=r.defined(h.st)?new Float32Array(8*p):void 0,f=N,u=G,l=j,d=a.Cartesian3.negate(f,U),_=a.Cartesian3.negate(u,Q),y=a.Cartesian3.negate(l,K);m=0,c&&(I(m,t,e,n,s,y,f,u),m+=12),I(m,t,e,n,s,l,d,u),m+=12,I(m,t,e,n,s,d,y,u),m+=12,I(m,t,e,n,s,_,y,d),m+=12,I(m,t,e,n,s,f,l,u),m+=12,I(m,t,e,n,s,u,l,d),r.defined(t)&&(C.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),r.defined(e)&&(C.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),r.defined(n)&&(C.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),r.defined(s)&&(C.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new o.Geometry({attributes:C,indices:_,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=R,t.OrthographicFrustum=x,t.PerspectiveFrustum=P}));
@@ -0,0 +1 @@
1
+ define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./WebGLConstants-508b9636","./Transforms-c8cb8f43"],(function(t,e,n,a,r,i){"use strict";var o=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const s={POINTS:r.WebGLConstants.POINTS,LINES:r.WebGLConstants.LINES,LINE_LOOP:r.WebGLConstants.LINE_LOOP,LINE_STRIP:r.WebGLConstants.LINE_STRIP,TRIANGLES:r.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:r.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:r.WebGLConstants.TRIANGLE_FAN,isLines:function(t){return t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP},isTriangles:function(t){return t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN},validate:function(t){return t===s.POINTS||t===s.LINES||t===s.LINE_LOOP||t===s.LINE_STRIP||t===s.TRIANGLES||t===s.TRIANGLE_STRIP||t===s.TRIANGLE_FAN}};var u=Object.freeze(s);function I(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,u.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,o.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}I.computeNumberOfVertices=function(t){let e=-1;for(const n in t.attributes)if(t.attributes.hasOwnProperty(n)&&a.defined(t.attributes[n])&&a.defined(t.attributes[n].values)){const a=t.attributes[n];e=a.values.length/a.componentsPerAttribute}return e};const N=new e.Cartographic,c=new e.Cartesian3,T=new e.Matrix4,l=[new e.Cartographic,new e.Cartographic,new e.Cartographic],L=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],f=new e.Cartesian3,m=new i.Quaternion,p=new e.Matrix4,y=new e.Matrix2;I._textureCoordinateRotationPoints=function(t,n,a,r){let o;const s=e.Rectangle.center(r,N),u=e.Cartographic.toCartesian(s,a,c),I=i.Transforms.eastNorthUpToFixedFrame(u,a,T),b=e.Matrix4.inverse(I,T),C=L,h=l;h[0].longitude=r.west,h[0].latitude=r.south,h[1].longitude=r.west,h[1].latitude=r.north,h[2].longitude=r.east,h[2].latitude=r.south;let A=f;for(o=0;o<3;o++)e.Cartographic.toCartesian(h[o],a,A),A=e.Matrix4.multiplyByPointAsVector(b,A,A),C[o].x=A.x,C[o].y=A.y;const d=i.Quaternion.fromAxisAngle(e.Cartesian3.UNIT_Z,-n,m),x=e.Matrix3.fromQuaternion(d,p),S=t.length;let P=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(o=0;o<S;o++)A=e.Matrix4.multiplyByPointAsVector(b,t[o],A),A=e.Matrix3.multiplyByVector(x,A,A),P=Math.min(P,A.x),G=Math.min(G,A.y),R=Math.max(R,A.x),_=Math.max(_,A.y);const O=e.Matrix2.fromRotation(n,y),g=E;g[0].x=P,g[0].y=G,g[1].x=P,g[1].y=_,g[2].x=R,g[2].y=G;const w=C[0],V=C[2].x-w.x,M=C[1].y-w.y;for(o=0;o<3;o++){const t=g[o];e.Matrix2.multiplyByVector(O,t,t),t.x=(t.x-w.x)/V,t.y=(t.y-w.y)/M}const v=g[0],F=g[1],W=g[2],Y=new Array(6);return e.Cartesian2.pack(v,Y),e.Cartesian2.pack(F,Y,2),e.Cartesian2.pack(W,Y,4),Y},t.Geometry=I,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=o,t.PrimitiveType=u}));
@@ -1 +1 @@
1
- define(["exports","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Matrix2-37e55508"],(function(e,t,i,r){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}}));
1
+ define(["exports","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Matrix2-47e98d76"],(function(e,t,i,r){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}}));
@@ -1 +1 @@
1
- define(["exports","./AttributeCompression-27507afe","./Matrix2-37e55508","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19","./Transforms-eb5c1a84","./EncodedCartesian3-96fdc0ef","./GeometryAttribute-3915ea0b","./IndexDatatype-f1dcdf35","./IntersectionTests-ac2459de","./Plane-6ee42cab"],(function(e,t,n,i,r,a,s,o,u,c,l,p){"use strict";const d=new n.Cartesian3,f=new n.Cartesian3,y=new n.Cartesian3;const m={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};m.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let f;for(f=0;f<u;f++)d[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let y=0;for(;c<p;)d[t[c]].vertexTriangles.push(y),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(y),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(y),++d[t[c+2]].numLiveTriangles,++y,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(f=0;f<x;f++)P[f]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(y=g.vertexTriangles[e],!P[y]){P[y]=!0,c=y+y+y;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};const C={};function h(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function v(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function b(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}C.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case u.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=c.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)h(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case u.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=c.IndexDatatype.createTypedArray(t,n);h(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)h(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case u.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=c.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)h(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=u.PrimitiveType.LINES}return e},C.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,c=i.length,l=new Float64Array(2*c);let p,d=0;for(let e=0;e<c;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+o[e]*n,l[d++]=i[e+1]+o[e+1]*n,l[d++]=i[e+2]+o[e+2]*n;const f=e.boundingSphere;return r.defined(f)&&(p=new s.BoundingSphere(f.center,f.radius+n)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:u.PrimitiveType.LINES,boundingSphere:p})},C.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},C.reorderForPreVertexCache=function(e){const t=u.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const s=n,o=s.length,u=c.IndexDatatype.createTypedArray(t,o);let l,p=0,d=0,f=0;for(;p<o;)l=i[s[p]],-1!==l?u[d]=l:(l=s[p],i[l]=f,u[d]=f,++f),++p,++d;e.indices=u;const y=e.attributes;for(const e in y)if(y.hasOwnProperty(e)&&r.defined(y[e])&&r.defined(y[e].values)){const n=y[e],r=n.values;let s=0;const o=n.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(n.componentDatatype,f*o);for(;s<t;){const e=i[s];if(-1!==e)for(let t=0;t<o;t++)u[o*e+t]=r[o*s+t];++s}n.values=u}}return e},C.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=m.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},C.fitToUnsignedShortIndices=function(e){const t=[],n=u.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=v(e.attributes);const c=e.indices,l=c.length;let p;e.primitiveType===u.PrimitiveType.TRIANGLES?p=3:e.primitiveType===u.PrimitiveType.LINES?p=2:e.primitiveType===u.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=c[d+t];let u=n[a];r.defined(u)||(u=s++,n[a]=u,b(o,e.attributes,a)),i.push(u)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const g=new n.Cartesian3,A=new n.Cartographic;C.projectTo2D=function(e,t,i,o,c){const l=e.attributes[t],p=(c=r.defined(c)?c:new s.GeographicProjection).ellipsoid,d=l.values,f=new Float64Array(d.length);let y=0;for(let e=0;e<d.length;e+=3){const t=n.Cartesian3.fromArray(d,e,g),i=p.cartesianToCartographic(t,A),r=c.project(i,g);f[y++]=r.x,f[y++]=r.y,f[y++]=r.z}return e.attributes[i]=l,e.attributes[o]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};const T={high:0,low:0};C.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],s=r.values,c=s.length,l=new Float32Array(c),p=new Float32Array(c);for(let e=0;e<c;++e)o.EncodedCartesian3.encode(s[e],T),l[e]=T.high,p[e]=T.low;const d=r.componentsPerAttribute;return e.attributes[n]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let x=new n.Cartesian3;function P(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix4.multiplyByPoint(e,x,x),n.Cartesian3.pack(x,i,t)}}function w(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix3.multiplyByVector(e,x,x),x=n.Cartesian3.normalize(x,x),n.Cartesian3.pack(x,i,t)}}const S=new n.Matrix4,I=new n.Matrix3;C.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;P(t,i.position),P(t,i.prevPosition),P(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,S),n.Matrix4.transpose(S,S),n.Matrix4.getMatrix3(S,I),w(I,i.normal),w(I,i.tangent),w(I,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const O=new n.Cartesian3;function E(e,t){const i=e.length;let o,l,p,d;e[0].modelMatrix;const f=r.defined(e[0][t].indices),y=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},s=e[0][t].attributes;let o;for(o in s)if(s.hasOwnProperty(o)&&r.defined(s[o])&&r.defined(s[o].values)){const c=s[o];let l=c.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[o];if(!r.defined(n)||c.componentDatatype!==n.componentDatatype||c.componentsPerAttribute!==n.componentsPerAttribute||c.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[o]=new u.GeometryAttribute({componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:a.ComponentDatatype.createTypedArray(c.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(o in m)if(m.hasOwnProperty(o))for(C=m[o].values,d=0,l=0;l<i;++l)for(h=e[l][t].attributes[o].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(f){let n=0;for(l=0;l<i;++l)n+=e[l][t].indices.length;const r=u.Geometry.computeNumberOfVertices(new u.Geometry({attributes:m,primitiveType:u.PrimitiveType.POINTS})),a=c.IndexDatatype.createTypedArray(r,n);let s=0,o=0;for(l=0;l<i;++l){const n=e[l][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=u.Geometry.computeNumberOfVertices(e[l][t])}b=a}let g,A=new n.Cartesian3,T=0;for(l=0;l<i;++l){if(g=e[l][t].boundingSphere,!r.defined(g)){A=void 0;break}n.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(n.Cartesian3.divideByScalar(A,i,A),l=0;l<i;++l){g=e[l][t].boundingSphere;const i=n.Cartesian3.magnitude(n.Cartesian3.subtract(g.center,A,O))+g.radius;i>T&&(T=i)}return new u.Geometry({attributes:m,indices:b,primitiveType:y,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}C.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(E(t,"geometry")),n.length>0&&(a.push(E(n,"westHemisphereGeometry")),a.push(E(n,"eastHemisphereGeometry"))),a};const N=new n.Cartesian3,L=new n.Cartesian3,z=new n.Cartesian3,D=new n.Cartesian3;C.computeNormal=function(e){const t=e.indices,i=e.attributes,r=i.position.values,s=i.position.values.length/3,o=t.length,c=new Array(s),l=new Array(o/3),p=new Array(o);let d;for(d=0;d<s;d++)c[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<o;d+=3){const e=t[d],i=t[d+1],a=t[d+2],s=3*e,o=3*i,u=3*a;L.x=r[s],L.y=r[s+1],L.z=r[s+2],z.x=r[o],z.y=r[o+1],z.z=r[o+2],D.x=r[u],D.y=r[u+1],D.z=r[u+2],c[e].count++,c[i].count++,c[a].count++,n.Cartesian3.subtract(z,L,z),n.Cartesian3.subtract(D,L,D),l[f]=n.Cartesian3.cross(z,D,new n.Cartesian3),f++}let y,m=0;for(d=0;d<s;d++)c[d].indexOffset+=m,m+=c[d].count;for(f=0,d=0;d<o;d+=3){y=c[t[d]];let e=y.indexOffset+y.currentCount;p[e]=f,y.currentCount++,y=c[t[d+1]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,y=c[t[d+2]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,f++}const C=new Float32Array(3*s);for(d=0;d<s;d++){const e=3*d;if(y=c[d],n.Cartesian3.clone(n.Cartesian3.ZERO,N),y.count>0){for(f=0;f<y.count;f++)n.Cartesian3.add(N,l[p[y.indexOffset+f]],N);n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&n.Cartesian3.clone(l[p[y.indexOffset]],N)}n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&(N.z=1),n.Cartesian3.normalize(N,N),C[e]=N.x,C[e+1]=N.y,C[e+2]=N.z}return e.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const M=new n.Cartesian3,G=new n.Cartesian3,R=new n.Cartesian3;C.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,s=e.attributes.st.values,o=e.attributes.position.values.length/3,c=t.length,l=new Array(3*o);let p,d,f,y;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<c;p+=3){const e=t[p],n=t[p+1],r=t[p+2];d=3*e,f=3*n,y=3*r;const a=2*e,o=2*n,u=2*r,c=i[d],m=i[d+1],C=i[d+2],h=s[a],v=s[a+1],b=s[o+1]-v,g=s[u+1]-v,A=1/((s[o]-h)*g-(s[u]-h)*b),T=(g*(i[f]-c)-b*(i[y]-c))*A,x=(g*(i[f+1]-m)-b*(i[y+1]-m))*A,P=(g*(i[f+2]-C)-b*(i[y+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P}const m=new Float32Array(3*o),C=new Float32Array(3*o);for(p=0;p<o;p++){d=3*p,f=d+1,y=d+2;const e=n.Cartesian3.fromArray(r,d,M),t=n.Cartesian3.fromArray(l,d,R),i=n.Cartesian3.dot(e,t);n.Cartesian3.multiplyByScalar(e,i,G),n.Cartesian3.normalize(n.Cartesian3.subtract(t,G,t),t),m[d]=t.x,m[f]=t.y,m[y]=t.z,n.Cartesian3.normalize(n.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[f]=t.y,C[y]=t.z}return e.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const V=new n.Cartesian2,F=new n.Cartesian3,B=new n.Cartesian3,_=new n.Cartesian3;let k=new n.Cartesian2;function q(e){switch(e.primitiveType){case u.PrimitiveType.TRIANGLE_FAN:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case u.PrimitiveType.LINE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINE_LOOP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function U(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}C.compressVertices=function(e){const i=e.attributes.extrudeDirection;let s,o;if(r.defined(i)){const r=i.values;o=r.length/3;const c=new Float32Array(2*o);let l=0;for(s=0;s<o;++s)n.Cartesian3.fromArray(r,3*s,F),n.Cartesian3.equals(F,n.Cartesian3.ZERO)?l+=2:(k=t.AttributeCompression.octEncodeInRange(F,65535,k),c[l++]=k.x,c[l++]=k.y);return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}),delete e.attributes.extrudeDirection,e}const c=e.attributes.normal,l=e.attributes.st,p=r.defined(c),d=r.defined(l);if(!p&&!d)return e;const f=e.attributes.tangent,y=e.attributes.bitangent,m=r.defined(f),C=r.defined(y);let h,v,b,g;p&&(h=c.values),d&&(v=l.values),m&&(b=f.values),C&&(g=y.values);o=(p?h.length:v.length)/(p?3:2);let A=o,T=d&&p?2:1;T+=m||C?1:0,A*=T;const x=new Float32Array(A);let P=0;for(s=0;s<o;++s){d&&(n.Cartesian2.fromArray(v,2*s,V),x[P++]=t.AttributeCompression.compressTextureCoordinates(V));const e=3*s;p&&r.defined(b)&&r.defined(g)?(n.Cartesian3.fromArray(h,e,F),n.Cartesian3.fromArray(b,e,B),n.Cartesian3.fromArray(g,e,_),t.AttributeCompression.octPack(F,B,_,V),x[P++]=V.x,x[P++]=V.y):(p&&(n.Cartesian3.fromArray(h,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),m&&(n.Cartesian3.fromArray(b,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),C&&(n.Cartesian3.fromArray(g,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)))}return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:T,values:x}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};const Y=new n.Cartesian3;function Z(e,t,i,r){n.Cartesian3.add(e,n.Cartesian3.multiplyByScalar(n.Cartesian3.subtract(t,e,Y),e.y/(e.y-t.y),Y),i),n.Cartesian3.clone(i,r),U(i,!0),U(r,!1)}const H=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,j=new n.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return U(e,e.y<0),U(t,t.y<0),void U(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;U(e,u),U(t,u),U(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=J.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(Z(e,t,H,X),Z(e,n,W,j),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(Z(t,n,H,X),Z(t,e,W,j),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(Z(n,e,H,X),Z(n,t,W,j),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(Z(n,e,H,X),Z(n,t,W,j),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Z(t,n,H,X),Z(t,e,W,j),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Z(e,t,H,X),Z(e,n,W,j),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=J.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=H,c[4]=W,c[5]=X,c[6]=j,c.length=7),J}function Q(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=a.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=u.Geometry.computeNumberOfVertices(e);return e.indices=c.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function $(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new u.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=Q(t,i),n=Q(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function te(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const f=e.fromArray(c,a*t,n),y=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(y,u.y,y),e.multiplyByScalar(m,u.z,m);const C=e.add(f,y,f);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const ne=te(n.Cartesian4,4),ie=te(n.Cartesian3,3),re=te(n.Cartesian2,2),ae=new n.Cartesian3,se=new n.Cartesian3,oe=new n.Cartesian3,ue=new n.Cartesian3;function ce(e,t,i,s,o,u,c,l,p,m,C,h,v,b,g,A){if(!(r.defined(u)||r.defined(c)||r.defined(l)||r.defined(p)||r.defined(m)||0!==b))return;const T=function(e,t,i,s,o){let u,c,l,p,m,C,h,v;if(r.defined(o)||(o=new n.Cartesian3),r.defined(t.z)){if(n.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian3.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian3.subtract(i,t,d),c=n.Cartesian3.subtract(s,t,f),l=n.Cartesian3.subtract(e,t,y),p=n.Cartesian3.dot(u,u),m=n.Cartesian3.dot(u,c),C=n.Cartesian3.dot(u,l),h=n.Cartesian3.dot(c,c),v=n.Cartesian3.dot(c,l)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian2.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian2.subtract(i,t,d),c=n.Cartesian2.subtract(s,t,f),l=n.Cartesian2.subtract(e,t,y),p=n.Cartesian2.dot(u,u),m=n.Cartesian2.dot(u,c),C=n.Cartesian2.dot(u,l),h=n.Cartesian2.dot(c,c),v=n.Cartesian2.dot(c,l)}o.y=h*C-m*v,o.z=p*v-m*C;const b=p*h-m*m;if(0!==b)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}(s,n.Cartesian3.fromArray(o,3*e,ae),n.Cartesian3.fromArray(o,3*t,se),n.Cartesian3.fromArray(o,3*i,oe),ue);if(r.defined(T)){if(r.defined(u)&&ie(e,t,i,T,u,h.normal.values,A,!0),r.defined(m)){const r=n.Cartesian3.fromArray(m,3*e,ae),a=n.Cartesian3.fromArray(m,3*t,se),s=n.Cartesian3.fromArray(m,3*i,oe);let o;n.Cartesian3.multiplyByScalar(r,T.x,r),n.Cartesian3.multiplyByScalar(a,T.y,a),n.Cartesian3.multiplyByScalar(s,T.z,s),n.Cartesian3.equals(r,n.Cartesian3.ZERO)&&n.Cartesian3.equals(a,n.Cartesian3.ZERO)&&n.Cartesian3.equals(s,n.Cartesian3.ZERO)?(o=ae,o.x=0,o.y=0,o.z=0):(o=n.Cartesian3.add(r,a,r),n.Cartesian3.add(o,s,o),n.Cartesian3.normalize(o,o)),n.Cartesian3.pack(o,h.extrudeDirection.values,3*A)}if(r.defined(C)&&function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0}(e,t,i,T,C,h.applyOffset.values,A),r.defined(c)&&ie(e,t,i,T,c,h.tangent.values,A,!0),r.defined(l)&&ie(e,t,i,T,l,h.bitangent.values,A,!0),r.defined(p)&&re(e,t,i,T,p,h.st.values,A),b>0)for(let n=0;n<b;n++){const r=v[n];le(e,t,i,T,A,g[r],h[r])}}}function le(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:ne(e,t,n,i,u,c,r,!1);break;case 3:ie(e,t,n,i,u,c,r,!1);break;case 2:re(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function pe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const de={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){const t=e.geometry,i=t.attributes,a=i.position.values,s=r.defined(i.normal)?i.normal.values:void 0,o=r.defined(i.bitangent)?i.bitangent.values:void 0,u=r.defined(i.tangent)?i.tangent.values:void 0,c=r.defined(i.st)?i.st.values:void 0,l=r.defined(i.extrudeDirection)?i.extrudeDirection.values:void 0,p=r.defined(i.applyOffset)?i.applyOffset.values:void 0,d=t.indices,f=[];for(const e in i)i.hasOwnProperty(e)&&!de[e]&&r.defined(i[e])&&f.push(e);const y=f.length,m=$(t),C=$(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=n.Cartesian3.fromArray(a,3*e),S=n.Cartesian3.fromArray(a,3*t),I=n.Cartesian3.fromArray(a,3*P);const O=K(w,S,I);if(r.defined(O)&&O.positions.length>3){const n=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=n[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,w<3?A+w:-1,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,A,w),ce(e,t,P,w,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+1,S),ce(e,t,P,S,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+2,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}ee(e,C,m)}const ye=p.Plane.fromPointNormal(n.Cartesian3.ZERO,n.Cartesian3.UNIT_Y),me=new n.Cartesian3,Ce=new n.Cartesian3;function he(e,t,i,s,o,u,c){if(!r.defined(c))return;const l=n.Cartesian3.fromArray(s,3*e,ae);n.Cartesian3.equalsEpsilon(l,i,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function ve(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=r.defined(i.applyOffset)?i.applyOffset.values:void 0,u=t.indices,c=$(t),p=$(t);let d;const f=u.length,y=[];y.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<y.length;++d)y[d]=-1,m[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],i=n.Cartesian3.fromArray(s,3*e,ae),f=n.Cartesian3.fromArray(s,3*t,se);let C;Math.abs(i.y)<a.CesiumMath.EPSILON6&&(i.y<0?i.y=-a.CesiumMath.EPSILON6:i.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=p.attributes,A=p.indices,T=y;const x=l.IntersectionTests.lineSegmentPlane(i,f,ye,oe);if(r.defined(x)){const r=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,me);i.y<0&&(n.Cartesian3.negate(r,r),h=p.attributes,v=p.indices,b=y,g=c.attributes,A=c.indices,T=m);const l=n.Cartesian3.add(x,r,Ce);C=pe(h,v,b,u,d,i),he(e,t,i,s,C,h,o),C=pe(h,v,b,u,-1,l),he(e,t,l,s,C,h,o),n.Cartesian3.negate(r,r),n.Cartesian3.add(x,r,l),C=pe(g,A,T,u,-1,l),he(e,t,l,s,C,g,o),C=pe(g,A,T,u,d+1,f),he(e,t,f,s,C,g,o)}else{let n,r,a;i.y<0?(n=p.attributes,r=p.indices,a=y):(n=c.attributes,r=c.indices,a=m),C=pe(n,r,a,u,d,i),he(e,t,i,s,C,n,o),C=pe(n,r,a,u,d+1,f),he(e,t,f,s,C,n,o)}}ee(e,p,c)}const be=new n.Cartesian2,ge=new n.Cartesian2,Ae=new n.Cartesian3,Te=new n.Cartesian3,xe=new n.Cartesian3,Pe=new n.Cartesian3,we=new n.Cartesian3,Se=new n.Cartesian3,Ie=new n.Cartesian4;function Oe(e){const t=e.attributes,i=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=i.length;for(let e=0;e<s;e+=3){const t=n.Cartesian3.unpack(i,e,Ae);if(t.x>0)continue;const o=n.Cartesian3.unpack(r,e,Te);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=i[e-3],r[e+1]=i[e-2],r[e+2]=i[e-1]):n.Cartesian3.pack(t,r,e));const u=n.Cartesian3.unpack(a,e,xe);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=i[e+3],a[e+1]=i[e+4],a[e+2]=i[e+5]):n.Cartesian3.pack(t,a,e))}}const Ee=5*a.CesiumMath.EPSILON9,Ne=a.CesiumMath.EPSILON6;C.splitLongitude=function(e){const t=e.geometry,i=t.boundingSphere;if(r.defined(i)){if(i.center.x-i.radius>0||s.BoundingSphere.intersectPlane(i,p.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){case u.GeometryType.POLYLINES:!function(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=i.prevPosition.values,u=i.nextPosition.values,c=i.expandAndWidth.values,p=r.defined(i.st)?i.st.values:void 0,d=r.defined(i.color)?i.color.values:void 0,f=$(t),y=$(t);let m,C,h,v=!1;const b=s.length/3;for(m=0;m<b;m+=4){const e=m,t=m+2,i=n.Cartesian3.fromArray(s,3*e,Ae),b=n.Cartesian3.fromArray(s,3*t,Te);if(Math.abs(i.y)<Ne)for(i.y=Ne*(b.y<0?-1:1),s[3*m+1]=i.y,s[3*(m+1)+1]=i.y,C=3*e;C<3*e+12;C+=3)o[C]=s[3*m],o[C+1]=s[3*m+1],o[C+2]=s[3*m+2];if(Math.abs(b.y)<Ne)for(b.y=Ne*(i.y<0?-1:1),s[3*(m+2)+1]=b.y,s[3*(m+3)+1]=b.y,C=3*e;C<3*e+12;C+=3)u[C]=s[3*(m+2)],u[C+1]=s[3*(m+2)+1],u[C+2]=s[3*(m+2)+2];let g=f.attributes,A=f.indices,T=y.attributes,x=y.indices;const P=l.IntersectionTests.lineSegmentPlane(i,b,ye,Pe);if(r.defined(P)){v=!0;const s=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,Ee,we);i.y<0&&(n.Cartesian3.negate(s,s),g=y.attributes,A=y.indices,T=f.attributes,x=f.indices);const l=n.Cartesian3.add(P,s,Se);g.position.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.position.values.push(l.x,l.y,l.z),g.position.values.push(l.x,l.y,l.z),g.prevPosition.values.push(o[3*e],o[3*e+1],o[3*e+2]),g.prevPosition.values.push(o[3*e+3],o[3*e+4],o[3*e+5]),g.prevPosition.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),n.Cartesian3.negate(s,s),n.Cartesian3.add(P,s,l),T.position.values.push(l.x,l.y,l.z),T.position.values.push(l.x,l.y,l.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const w=n.Cartesian2.fromArray(c,2*e,be),S=Math.abs(w.y);g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S),T.expandAndWidth.values.push(-1,S,1,S),T.expandAndWidth.values.push(-1,-S,1,-S);let I=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(P,i,xe));if(I/=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(b,i,xe)),r.defined(d)){const i=n.Cartesian4.fromArray(d,4*e,Ie),r=n.Cartesian4.fromArray(d,4*t,Ie),s=a.CesiumMath.lerp(i.x,r.x,I),o=a.CesiumMath.lerp(i.y,r.y,I),u=a.CesiumMath.lerp(i.z,r.z,I),c=a.CesiumMath.lerp(i.w,r.w,I);for(C=4*e;C<4*e+8;++C)g.color.values.push(d[C]);for(g.color.values.push(s,o,u,c),g.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),C=4*t;C<4*t+8;++C)T.color.values.push(d[C])}if(r.defined(p)){const i=n.Cartesian2.fromArray(p,2*e,be),r=n.Cartesian2.fromArray(p,2*(m+3),ge),s=a.CesiumMath.lerp(i.x,r.x,I);for(C=2*e;C<2*e+4;++C)g.st.values.push(p[C]);for(g.st.values.push(s,i.y),g.st.values.push(s,r.y),T.st.values.push(s,i.y),T.st.values.push(s,r.y),C=2*t;C<2*t+4;++C)T.st.values.push(p[C])}h=g.position.values.length/3-4,A.push(h,h+2,h+1),A.push(h+1,h+2,h+3),h=T.position.values.length/3-4,x.push(h,h+2,h+1),x.push(h+1,h+2,h+3)}else{let e,t;for(i.y<0?(e=y.attributes,t=y.indices):(e=f.attributes,t=f.indices),e.position.values.push(i.x,i.y,i.z),e.position.values.push(i.x,i.y,i.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),C=3*m;C<3*m+12;++C)e.prevPosition.values.push(o[C]),e.nextPosition.values.push(u[C]);for(C=2*m;C<2*m+8;++C)e.expandAndWidth.values.push(c[C]),r.defined(p)&&e.st.values.push(p[C]);if(r.defined(d))for(C=4*m;C<4*m+16;++C)e.color.values.push(d[C]);h=e.position.values.length/3-4,t.push(h,h+2,h+1),t.push(h+1,h+2,h+3)}}v&&(Oe(y),Oe(f)),ee(e,y,f)}(e);break;case u.GeometryType.TRIANGLES:fe(e);break;case u.GeometryType.LINES:ve(e)}else q(t),t.primitiveType===u.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===u.PrimitiveType.LINES&&ve(e);return e},e.GeometryPipeline=C}));
1
+ define(["exports","./AttributeCompression-80665726","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19","./Transforms-c8cb8f43","./EncodedCartesian3-d9f5c4a4","./GeometryAttribute-89a520b9","./IndexDatatype-f1dcdf35","./IntersectionTests-58aa8f80","./Plane-3f01019d"],(function(e,t,n,i,r,a,s,o,u,c,l,p){"use strict";const d=new n.Cartesian3,f=new n.Cartesian3,y=new n.Cartesian3;const m={calculateACMR:function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=r.defaultValue(e.cacheSize,24),a=t.length;if(!r.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=i+1;for(let e=0;e<a;++e)o-s[t[e]]>i&&(s[t[e]]=o,++o);return(o-i+1)/(a/3)}};m.tipsify=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=r.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(r.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let f;for(f=0;f<u;f++)d[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let y=0;for(;c<p;)d[t[c]].vertexTriangles.push(y),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(y),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(y),++d[t[c+2]].numLiveTriangles,++y,c+=3;let m=0,C=i+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(f=0;f<x;f++)P[f]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(y=g.vertexTriangles[e],!P[y]){P[y]=!0,c=y+y+y;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>i&&(b.timeStamp=C,++C),++c}m=s(0,i,h,d,C,v,u)}return T};const C={};function h(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function v(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&r.defined(e[n])&&r.defined(e[n].values)){const i=e[n];t[n]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function b(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&r.defined(t[i])&&r.defined(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}C.toWireframe=function(e){const t=e.indices;if(r.defined(t)){switch(e.primitiveType){case u.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=c.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)h(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case u.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=c.IndexDatatype.createTypedArray(t,n);h(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)h(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case u.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=c.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)h(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=u.PrimitiveType.LINES}return e},C.createLineSegmentsForVectors=function(e,t,n){t=r.defaultValue(t,"normal"),n=r.defaultValue(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,c=i.length,l=new Float64Array(2*c);let p,d=0;for(let e=0;e<c;e+=3)l[d++]=i[e],l[d++]=i[e+1],l[d++]=i[e+2],l[d++]=i[e]+o[e]*n,l[d++]=i[e+1]+o[e+1]*n,l[d++]=i[e+2]+o[e+2]*n;const f=e.boundingSphere;return r.defined(f)&&(p=new s.BoundingSphere(f.center,f.radius+n)),new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:u.PrimitiveType.LINES,boundingSphere:p})},C.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];r.defined(n[e])&&(i[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!r.defined(i[e])&&(i[e]=s++);return i},C.reorderForPreVertexCache=function(e){const t=u.Geometry.computeNumberOfVertices(e),n=e.indices;if(r.defined(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const s=n,o=s.length,u=c.IndexDatatype.createTypedArray(t,o);let l,p=0,d=0,f=0;for(;p<o;)l=i[s[p]],-1!==l?u[d]=l:(l=s[p],i[l]=f,u[d]=f,++f),++p,++d;e.indices=u;const y=e.attributes;for(const e in y)if(y.hasOwnProperty(e)&&r.defined(y[e])&&r.defined(y[e].values)){const n=y[e],r=n.values;let s=0;const o=n.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(n.componentDatatype,f*o);for(;s<t;){const e=i[s];if(-1!==e)for(let t=0;t<o;t++)u[o*e+t]=r[o*s+t];++s}n.values=u}}return e},C.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&r.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=m.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},C.fitToUnsignedShortIndices=function(e){const t=[],n=u.Geometry.computeNumberOfVertices(e);if(r.defined(e.indices)&&n>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],i=[],s=0,o=v(e.attributes);const c=e.indices,l=c.length;let p;e.primitiveType===u.PrimitiveType.TRIANGLES?p=3:e.primitiveType===u.PrimitiveType.LINES?p=2:e.primitiveType===u.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const a=c[d+t];let u=n[a];r.defined(u)||(u=s++,n[a]=u,b(o,e.attributes,a)),i.push(u)}s+p>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new u.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const g=new n.Cartesian3,A=new n.Cartographic;C.projectTo2D=function(e,t,i,o,c){const l=e.attributes[t],p=(c=r.defined(c)?c:new s.GeographicProjection).ellipsoid,d=l.values,f=new Float64Array(d.length);let y=0;for(let e=0;e<d.length;e+=3){const t=n.Cartesian3.fromArray(d,e,g),i=p.cartesianToCartographic(t,A),r=c.project(i,g);f[y++]=r.x,f[y++]=r.y,f[y++]=r.z}return e.attributes[i]=l,e.attributes[o]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};const T={high:0,low:0};C.encodeAttribute=function(e,t,n,i){const r=e.attributes[t],s=r.values,c=s.length,l=new Float32Array(c),p=new Float32Array(c);for(let e=0;e<c;++e)o.EncodedCartesian3.encode(s[e],T),l[e]=T.high,p[e]=T.low;const d=r.componentsPerAttribute;return e.attributes[n]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let x=new n.Cartesian3;function P(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix4.multiplyByPoint(e,x,x),n.Cartesian3.pack(x,i,t)}}function w(e,t){if(r.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix3.multiplyByVector(e,x,x),x=n.Cartesian3.normalize(x,x),n.Cartesian3.pack(x,i,t)}}const S=new n.Matrix4,I=new n.Matrix3;C.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const i=e.geometry.attributes;P(t,i.position),P(t,i.prevPosition),P(t,i.nextPosition),(r.defined(i.normal)||r.defined(i.tangent)||r.defined(i.bitangent))&&(n.Matrix4.inverse(t,S),n.Matrix4.transpose(S,S),n.Matrix4.getMatrix3(S,I),w(I,i.normal),w(I,i.tangent),w(I,i.bitangent));const a=e.geometry.boundingSphere;return r.defined(a)&&(e.geometry.boundingSphere=s.BoundingSphere.transform(a,t,a)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const O=new n.Cartesian3;function E(e,t){const i=e.length;let o,l,p,d;e[0].modelMatrix;const f=r.defined(e[0][t].indices),y=e[0][t].primitiveType,m=function(e,t){const n=e.length,i={},s=e[0][t].attributes;let o;for(o in s)if(s.hasOwnProperty(o)&&r.defined(s[o])&&r.defined(s[o].values)){const c=s[o];let l=c.values.length,p=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[o];if(!r.defined(n)||c.componentDatatype!==n.componentDatatype||c.componentsPerAttribute!==n.componentsPerAttribute||c.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(i[o]=new u.GeometryAttribute({componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:a.ComponentDatatype.createTypedArray(c.componentDatatype,l)}))}return i}(e,t);let C,h,v,b;for(o in m)if(m.hasOwnProperty(o))for(C=m[o].values,d=0,l=0;l<i;++l)for(h=e[l][t].attributes[o].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(f){let n=0;for(l=0;l<i;++l)n+=e[l][t].indices.length;const r=u.Geometry.computeNumberOfVertices(new u.Geometry({attributes:m,primitiveType:u.PrimitiveType.POINTS})),a=c.IndexDatatype.createTypedArray(r,n);let s=0,o=0;for(l=0;l<i;++l){const n=e[l][t].indices,i=n.length;for(d=0;d<i;++d)a[s++]=o+n[d];o+=u.Geometry.computeNumberOfVertices(e[l][t])}b=a}let g,A=new n.Cartesian3,T=0;for(l=0;l<i;++l){if(g=e[l][t].boundingSphere,!r.defined(g)){A=void 0;break}n.Cartesian3.add(g.center,A,A)}if(r.defined(A))for(n.Cartesian3.divideByScalar(A,i,A),l=0;l<i;++l){g=e[l][t].boundingSphere;const i=n.Cartesian3.magnitude(n.Cartesian3.subtract(g.center,A,O))+g.radius;i>T&&(T=i)}return new u.Geometry({attributes:m,indices:b,primitiveType:y,boundingSphere:r.defined(A)?new s.BoundingSphere(A,T):void 0})}C.combineInstances=function(e){const t=[],n=[],i=e.length;for(let a=0;a<i;++a){const i=e[a];r.defined(i.geometry)?t.push(i):r.defined(i.westHemisphereGeometry)&&r.defined(i.eastHemisphereGeometry)&&n.push(i)}const a=[];return t.length>0&&a.push(E(t,"geometry")),n.length>0&&(a.push(E(n,"westHemisphereGeometry")),a.push(E(n,"eastHemisphereGeometry"))),a};const N=new n.Cartesian3,L=new n.Cartesian3,z=new n.Cartesian3,D=new n.Cartesian3;C.computeNormal=function(e){const t=e.indices,i=e.attributes,r=i.position.values,s=i.position.values.length/3,o=t.length,c=new Array(s),l=new Array(o/3),p=new Array(o);let d;for(d=0;d<s;d++)c[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<o;d+=3){const e=t[d],i=t[d+1],a=t[d+2],s=3*e,o=3*i,u=3*a;L.x=r[s],L.y=r[s+1],L.z=r[s+2],z.x=r[o],z.y=r[o+1],z.z=r[o+2],D.x=r[u],D.y=r[u+1],D.z=r[u+2],c[e].count++,c[i].count++,c[a].count++,n.Cartesian3.subtract(z,L,z),n.Cartesian3.subtract(D,L,D),l[f]=n.Cartesian3.cross(z,D,new n.Cartesian3),f++}let y,m=0;for(d=0;d<s;d++)c[d].indexOffset+=m,m+=c[d].count;for(f=0,d=0;d<o;d+=3){y=c[t[d]];let e=y.indexOffset+y.currentCount;p[e]=f,y.currentCount++,y=c[t[d+1]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,y=c[t[d+2]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,f++}const C=new Float32Array(3*s);for(d=0;d<s;d++){const e=3*d;if(y=c[d],n.Cartesian3.clone(n.Cartesian3.ZERO,N),y.count>0){for(f=0;f<y.count;f++)n.Cartesian3.add(N,l[p[y.indexOffset+f]],N);n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&n.Cartesian3.clone(l[p[y.indexOffset]],N)}n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,a.CesiumMath.EPSILON10)&&(N.z=1),n.Cartesian3.normalize(N,N),C[e]=N.x,C[e+1]=N.y,C[e+2]=N.z}return e.attributes.normal=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const M=new n.Cartesian3,G=new n.Cartesian3,R=new n.Cartesian3;C.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,s=e.attributes.st.values,o=e.attributes.position.values.length/3,c=t.length,l=new Array(3*o);let p,d,f,y;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<c;p+=3){const e=t[p],n=t[p+1],r=t[p+2];d=3*e,f=3*n,y=3*r;const a=2*e,o=2*n,u=2*r,c=i[d],m=i[d+1],C=i[d+2],h=s[a],v=s[a+1],b=s[o+1]-v,g=s[u+1]-v,A=1/((s[o]-h)*g-(s[u]-h)*b),T=(g*(i[f]-c)-b*(i[y]-c))*A,x=(g*(i[f+1]-m)-b*(i[y+1]-m))*A,P=(g*(i[f+2]-C)-b*(i[y+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P}const m=new Float32Array(3*o),C=new Float32Array(3*o);for(p=0;p<o;p++){d=3*p,f=d+1,y=d+2;const e=n.Cartesian3.fromArray(r,d,M),t=n.Cartesian3.fromArray(l,d,R),i=n.Cartesian3.dot(e,t);n.Cartesian3.multiplyByScalar(e,i,G),n.Cartesian3.normalize(n.Cartesian3.subtract(t,G,t),t),m[d]=t.x,m[f]=t.y,m[y]=t.z,n.Cartesian3.normalize(n.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[f]=t.y,C[y]=t.z}return e.attributes.tangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const V=new n.Cartesian2,F=new n.Cartesian3,B=new n.Cartesian3,_=new n.Cartesian3;let k=new n.Cartesian2;function q(e){switch(e.primitiveType){case u.PrimitiveType.TRIANGLE_FAN:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=u.PrimitiveType.TRIANGLES,e}(e);case u.PrimitiveType.TRIANGLES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case u.PrimitiveType.LINE_STRIP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINE_LOOP:return function(e){const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=u.PrimitiveType.LINES,e}(e);case u.PrimitiveType.LINES:return function(e){if(r.defined(e.indices))return e;const t=u.Geometry.computeNumberOfVertices(e),n=c.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function U(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}C.compressVertices=function(e){const i=e.attributes.extrudeDirection;let s,o;if(r.defined(i)){const r=i.values;o=r.length/3;const c=new Float32Array(2*o);let l=0;for(s=0;s<o;++s)n.Cartesian3.fromArray(r,3*s,F),n.Cartesian3.equals(F,n.Cartesian3.ZERO)?l+=2:(k=t.AttributeCompression.octEncodeInRange(F,65535,k),c[l++]=k.x,c[l++]=k.y);return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}),delete e.attributes.extrudeDirection,e}const c=e.attributes.normal,l=e.attributes.st,p=r.defined(c),d=r.defined(l);if(!p&&!d)return e;const f=e.attributes.tangent,y=e.attributes.bitangent,m=r.defined(f),C=r.defined(y);let h,v,b,g;p&&(h=c.values),d&&(v=l.values),m&&(b=f.values),C&&(g=y.values);o=(p?h.length:v.length)/(p?3:2);let A=o,T=d&&p?2:1;T+=m||C?1:0,A*=T;const x=new Float32Array(A);let P=0;for(s=0;s<o;++s){d&&(n.Cartesian2.fromArray(v,2*s,V),x[P++]=t.AttributeCompression.compressTextureCoordinates(V));const e=3*s;p&&r.defined(b)&&r.defined(g)?(n.Cartesian3.fromArray(h,e,F),n.Cartesian3.fromArray(b,e,B),n.Cartesian3.fromArray(g,e,_),t.AttributeCompression.octPack(F,B,_,V),x[P++]=V.x,x[P++]=V.y):(p&&(n.Cartesian3.fromArray(h,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),m&&(n.Cartesian3.fromArray(b,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),C&&(n.Cartesian3.fromArray(g,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)))}return e.attributes.compressedAttributes=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:T,values:x}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};const Y=new n.Cartesian3;function Z(e,t,i,r){n.Cartesian3.add(e,n.Cartesian3.multiplyByScalar(n.Cartesian3.subtract(t,e,Y),e.y/(e.y-t.y),Y),i),n.Cartesian3.clone(i,r),U(i,!0),U(r,!1)}const H=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,j=new n.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return U(e,e.y<0),U(t,t.y<0),void U(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>r?i>s?a.CesiumMath.sign(e.y):a.CesiumMath.sign(n.y):r>s?a.CesiumMath.sign(t.y):a.CesiumMath.sign(n.y);const u=o<0;U(e,u),U(t,u),U(n,u)}(e,t,n);const i=e.y<0,r=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=r?1:0,o+=s?1:0;const u=J.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(Z(e,t,H,X),Z(e,n,W,j),u[0]=0,u[3]=1,u[4]=2,u[6]=1):r?(Z(t,n,H,X),Z(t,e,W,j),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(Z(n,e,H,X),Z(n,t,W,j),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?r?s||(Z(n,e,H,X),Z(n,t,W,j),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Z(t,n,H,X),Z(t,e,W,j),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Z(e,t,H,X),Z(e,n,W,j),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=J.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=H,c[4]=W,c[5]=X,c[6]=j,c.length=7),J}function Q(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&r.defined(n[e])&&r.defined(n[e].values)){const t=n[e];t.values=a.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const i=u.Geometry.computeNumberOfVertices(e);return e.indices=c.IndexDatatype.createTypedArray(i,e.indices),t&&(e.boundingSphere=s.BoundingSphere.fromVertices(n.position.values)),e}function $(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&r.defined(t[e])&&r.defined(t[e].values)){const i=t[e];n[e]=new u.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new u.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,n){const i=r.defined(e.geometry.boundingSphere);t=Q(t,i),n=Q(n,i),r.defined(n)&&!r.defined(t)?e.geometry=n:!r.defined(n)&&r.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function te(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const f=e.fromArray(c,a*t,n),y=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(y,u.y,y),e.multiplyByScalar(m,u.z,m);const C=e.add(f,y,f);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const ne=te(n.Cartesian4,4),ie=te(n.Cartesian3,3),re=te(n.Cartesian2,2),ae=new n.Cartesian3,se=new n.Cartesian3,oe=new n.Cartesian3,ue=new n.Cartesian3;function ce(e,t,i,s,o,u,c,l,p,m,C,h,v,b,g,A){if(!(r.defined(u)||r.defined(c)||r.defined(l)||r.defined(p)||r.defined(m)||0!==b))return;const T=function(e,t,i,s,o){let u,c,l,p,m,C,h,v;if(r.defined(o)||(o=new n.Cartesian3),r.defined(t.z)){if(n.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian3.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian3.subtract(i,t,d),c=n.Cartesian3.subtract(s,t,f),l=n.Cartesian3.subtract(e,t,y),p=n.Cartesian3.dot(u,u),m=n.Cartesian3.dot(u,c),C=n.Cartesian3.dot(u,l),h=n.Cartesian3.dot(c,c),v=n.Cartesian3.dot(c,l)}else{if(n.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian2.equalsEpsilon(e,i,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian2.subtract(i,t,d),c=n.Cartesian2.subtract(s,t,f),l=n.Cartesian2.subtract(e,t,y),p=n.Cartesian2.dot(u,u),m=n.Cartesian2.dot(u,c),C=n.Cartesian2.dot(u,l),h=n.Cartesian2.dot(c,c),v=n.Cartesian2.dot(c,l)}o.y=h*C-m*v,o.z=p*v-m*C;const b=p*h-m*m;if(0!==b)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}(s,n.Cartesian3.fromArray(o,3*e,ae),n.Cartesian3.fromArray(o,3*t,se),n.Cartesian3.fromArray(o,3*i,oe),ue);if(r.defined(T)){if(r.defined(u)&&ie(e,t,i,T,u,h.normal.values,A,!0),r.defined(m)){const r=n.Cartesian3.fromArray(m,3*e,ae),a=n.Cartesian3.fromArray(m,3*t,se),s=n.Cartesian3.fromArray(m,3*i,oe);let o;n.Cartesian3.multiplyByScalar(r,T.x,r),n.Cartesian3.multiplyByScalar(a,T.y,a),n.Cartesian3.multiplyByScalar(s,T.z,s),n.Cartesian3.equals(r,n.Cartesian3.ZERO)&&n.Cartesian3.equals(a,n.Cartesian3.ZERO)&&n.Cartesian3.equals(s,n.Cartesian3.ZERO)?(o=ae,o.x=0,o.y=0,o.z=0):(o=n.Cartesian3.add(r,a,r),n.Cartesian3.add(o,s,o),n.Cartesian3.normalize(o,o)),n.Cartesian3.pack(o,h.extrudeDirection.values,3*A)}if(r.defined(C)&&function(e,t,n,i,r,s,o){const u=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;s[o]=u+c+l>a.CesiumMath.EPSILON6?1:0}(e,t,i,T,C,h.applyOffset.values,A),r.defined(c)&&ie(e,t,i,T,c,h.tangent.values,A,!0),r.defined(l)&&ie(e,t,i,T,l,h.bitangent.values,A,!0),r.defined(p)&&re(e,t,i,T,p,h.st.values,A),b>0)for(let n=0;n<b;n++){const r=v[n];le(e,t,i,T,A,g[r],h[r])}}}function le(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:ne(e,t,n,i,u,c,r,!1);break;case 3:ie(e,t,n,i,u,c,r,!1);break;case 2:re(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function pe(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const de={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){const t=e.geometry,i=t.attributes,a=i.position.values,s=r.defined(i.normal)?i.normal.values:void 0,o=r.defined(i.bitangent)?i.bitangent.values:void 0,u=r.defined(i.tangent)?i.tangent.values:void 0,c=r.defined(i.st)?i.st.values:void 0,l=r.defined(i.extrudeDirection)?i.extrudeDirection.values:void 0,p=r.defined(i.applyOffset)?i.applyOffset.values:void 0,d=t.indices,f=[];for(const e in i)i.hasOwnProperty(e)&&!de[e]&&r.defined(i[e])&&f.push(e);const y=f.length,m=$(t),C=$(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=n.Cartesian3.fromArray(a,3*e),S=n.Cartesian3.fromArray(a,3*t),I=n.Cartesian3.fromArray(a,3*P);const O=K(w,S,I);if(r.defined(O)&&O.positions.length>3){const n=O.positions,r=O.indices,w=r.length;for(let S=0;S<w;++S){const w=r[S],I=n[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,w<3?A+w:-1,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}}else r.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=pe(h,v,b,d,A,w),ce(e,t,P,w,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+1,S),ce(e,t,P,S,a,s,u,o,c,l,p,h,f,y,i,g),g=pe(h,v,b,d,A+2,I),ce(e,t,P,I,a,s,u,o,c,l,p,h,f,y,i,g)}ee(e,C,m)}const ye=p.Plane.fromPointNormal(n.Cartesian3.ZERO,n.Cartesian3.UNIT_Y),me=new n.Cartesian3,Ce=new n.Cartesian3;function he(e,t,i,s,o,u,c){if(!r.defined(c))return;const l=n.Cartesian3.fromArray(s,3*e,ae);n.Cartesian3.equalsEpsilon(l,i,a.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function ve(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=r.defined(i.applyOffset)?i.applyOffset.values:void 0,u=t.indices,c=$(t),p=$(t);let d;const f=u.length,y=[];y.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<y.length;++d)y[d]=-1,m[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],i=n.Cartesian3.fromArray(s,3*e,ae),f=n.Cartesian3.fromArray(s,3*t,se);let C;Math.abs(i.y)<a.CesiumMath.EPSILON6&&(i.y<0?i.y=-a.CesiumMath.EPSILON6:i.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);let h=c.attributes,v=c.indices,b=m,g=p.attributes,A=p.indices,T=y;const x=l.IntersectionTests.lineSegmentPlane(i,f,ye,oe);if(r.defined(x)){const r=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,me);i.y<0&&(n.Cartesian3.negate(r,r),h=p.attributes,v=p.indices,b=y,g=c.attributes,A=c.indices,T=m);const l=n.Cartesian3.add(x,r,Ce);C=pe(h,v,b,u,d,i),he(e,t,i,s,C,h,o),C=pe(h,v,b,u,-1,l),he(e,t,l,s,C,h,o),n.Cartesian3.negate(r,r),n.Cartesian3.add(x,r,l),C=pe(g,A,T,u,-1,l),he(e,t,l,s,C,g,o),C=pe(g,A,T,u,d+1,f),he(e,t,f,s,C,g,o)}else{let n,r,a;i.y<0?(n=p.attributes,r=p.indices,a=y):(n=c.attributes,r=c.indices,a=m),C=pe(n,r,a,u,d,i),he(e,t,i,s,C,n,o),C=pe(n,r,a,u,d+1,f),he(e,t,f,s,C,n,o)}}ee(e,p,c)}const be=new n.Cartesian2,ge=new n.Cartesian2,Ae=new n.Cartesian3,Te=new n.Cartesian3,xe=new n.Cartesian3,Pe=new n.Cartesian3,we=new n.Cartesian3,Se=new n.Cartesian3,Ie=new n.Cartesian4;function Oe(e){const t=e.attributes,i=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=i.length;for(let e=0;e<s;e+=3){const t=n.Cartesian3.unpack(i,e,Ae);if(t.x>0)continue;const o=n.Cartesian3.unpack(r,e,Te);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=i[e-3],r[e+1]=i[e-2],r[e+2]=i[e-1]):n.Cartesian3.pack(t,r,e));const u=n.Cartesian3.unpack(a,e,xe);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=i[e+3],a[e+1]=i[e+4],a[e+2]=i[e+5]):n.Cartesian3.pack(t,a,e))}}const Ee=5*a.CesiumMath.EPSILON9,Ne=a.CesiumMath.EPSILON6;C.splitLongitude=function(e){const t=e.geometry,i=t.boundingSphere;if(r.defined(i)){if(i.center.x-i.radius>0||s.BoundingSphere.intersectPlane(i,p.Plane.ORIGIN_ZX_PLANE)!==s.Intersect.INTERSECTING)return e}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){case u.GeometryType.POLYLINES:!function(e){const t=e.geometry,i=t.attributes,s=i.position.values,o=i.prevPosition.values,u=i.nextPosition.values,c=i.expandAndWidth.values,p=r.defined(i.st)?i.st.values:void 0,d=r.defined(i.color)?i.color.values:void 0,f=$(t),y=$(t);let m,C,h,v=!1;const b=s.length/3;for(m=0;m<b;m+=4){const e=m,t=m+2,i=n.Cartesian3.fromArray(s,3*e,Ae),b=n.Cartesian3.fromArray(s,3*t,Te);if(Math.abs(i.y)<Ne)for(i.y=Ne*(b.y<0?-1:1),s[3*m+1]=i.y,s[3*(m+1)+1]=i.y,C=3*e;C<3*e+12;C+=3)o[C]=s[3*m],o[C+1]=s[3*m+1],o[C+2]=s[3*m+2];if(Math.abs(b.y)<Ne)for(b.y=Ne*(i.y<0?-1:1),s[3*(m+2)+1]=b.y,s[3*(m+3)+1]=b.y,C=3*e;C<3*e+12;C+=3)u[C]=s[3*(m+2)],u[C+1]=s[3*(m+2)+1],u[C+2]=s[3*(m+2)+2];let g=f.attributes,A=f.indices,T=y.attributes,x=y.indices;const P=l.IntersectionTests.lineSegmentPlane(i,b,ye,Pe);if(r.defined(P)){v=!0;const s=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,Ee,we);i.y<0&&(n.Cartesian3.negate(s,s),g=y.attributes,A=y.indices,T=f.attributes,x=f.indices);const l=n.Cartesian3.add(P,s,Se);g.position.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.position.values.push(l.x,l.y,l.z),g.position.values.push(l.x,l.y,l.z),g.prevPosition.values.push(o[3*e],o[3*e+1],o[3*e+2]),g.prevPosition.values.push(o[3*e+3],o[3*e+4],o[3*e+5]),g.prevPosition.values.push(i.x,i.y,i.z,i.x,i.y,i.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),g.nextPosition.values.push(l.x,l.y,l.z),n.Cartesian3.negate(s,s),n.Cartesian3.add(P,s,l),T.position.values.push(l.x,l.y,l.z),T.position.values.push(l.x,l.y,l.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.prevPosition.values.push(l.x,l.y,l.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const w=n.Cartesian2.fromArray(c,2*e,be),S=Math.abs(w.y);g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S),T.expandAndWidth.values.push(-1,S,1,S),T.expandAndWidth.values.push(-1,-S,1,-S);let I=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(P,i,xe));if(I/=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(b,i,xe)),r.defined(d)){const i=n.Cartesian4.fromArray(d,4*e,Ie),r=n.Cartesian4.fromArray(d,4*t,Ie),s=a.CesiumMath.lerp(i.x,r.x,I),o=a.CesiumMath.lerp(i.y,r.y,I),u=a.CesiumMath.lerp(i.z,r.z,I),c=a.CesiumMath.lerp(i.w,r.w,I);for(C=4*e;C<4*e+8;++C)g.color.values.push(d[C]);for(g.color.values.push(s,o,u,c),g.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),C=4*t;C<4*t+8;++C)T.color.values.push(d[C])}if(r.defined(p)){const i=n.Cartesian2.fromArray(p,2*e,be),r=n.Cartesian2.fromArray(p,2*(m+3),ge),s=a.CesiumMath.lerp(i.x,r.x,I);for(C=2*e;C<2*e+4;++C)g.st.values.push(p[C]);for(g.st.values.push(s,i.y),g.st.values.push(s,r.y),T.st.values.push(s,i.y),T.st.values.push(s,r.y),C=2*t;C<2*t+4;++C)T.st.values.push(p[C])}h=g.position.values.length/3-4,A.push(h,h+2,h+1),A.push(h+1,h+2,h+3),h=T.position.values.length/3-4,x.push(h,h+2,h+1),x.push(h+1,h+2,h+3)}else{let e,t;for(i.y<0?(e=y.attributes,t=y.indices):(e=f.attributes,t=f.indices),e.position.values.push(i.x,i.y,i.z),e.position.values.push(i.x,i.y,i.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),C=3*m;C<3*m+12;++C)e.prevPosition.values.push(o[C]),e.nextPosition.values.push(u[C]);for(C=2*m;C<2*m+8;++C)e.expandAndWidth.values.push(c[C]),r.defined(p)&&e.st.values.push(p[C]);if(r.defined(d))for(C=4*m;C<4*m+16;++C)e.color.values.push(d[C]);h=e.position.values.length/3-4,t.push(h,h+2,h+1),t.push(h+1,h+2,h+3)}}v&&(Oe(y),Oe(f)),ee(e,y,f)}(e);break;case u.GeometryType.TRIANGLES:fe(e);break;case u.GeometryType.LINES:ve(e)}else q(t),t.primitiveType===u.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===u.PrimitiveType.LINES&&ve(e);return e},e.GeometryPipeline=C}));
@@ -0,0 +1 @@
1
+ define(["exports","./Matrix2-47e98d76","./defaultValue-81eec7ed","./RuntimeError-8952249c","./Transforms-c8cb8f43","./ComponentDatatype-a15c9a19"],(function(t,n,e,a,i,r){"use strict";const s={};function o(t,n,e){const a=t+n;return r.CesiumMath.sign(t)!==r.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}s.computeDiscriminant=function(t,n,e){return n*n-4*t*e},s.computeRealRoots=function(t,n,e){let a;if(0===t)return 0===n?[]:[-e/n];if(0===n){if(0===e)return[0,0];const n=Math.abs(e),i=Math.abs(t);if(n<i&&n/i<r.CesiumMath.EPSILON14)return[0,0];if(n>i&&i/n<r.CesiumMath.EPSILON14)return[];if(a=-e/t,a<0)return[];const s=Math.sqrt(a);return[-s,s]}if(0===e)return a=-n/t,a<0?[a,0]:[0,a];const i=o(n*n,-(4*t*e),r.CesiumMath.EPSILON14);if(i<0)return[];const s=-.5*o(n,r.CesiumMath.sign(n)*Math.sqrt(i),r.CesiumMath.EPSILON14);return n>0?[s/t,e/s]:[e/s,s/t]};const c={};function u(t,n,e,a){const i=t,r=n/3,s=e/3,o=a,c=i*s,u=r*o,l=r*r,C=s*s,M=i*s-l,h=i*o-r*s,m=r*o-C,f=4*M*m-h*h;let d,g;if(f<0){let t,n,e;l*u>=c*C?(t=i,n=M,e=-2*r*M+i*h):(t=o,n=m,e=-o*h+2*s*m);const a=-(e<0?-1:1)*Math.abs(t)*Math.sqrt(-f);g=-e+a;const p=g/2,w=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),R=g===a?-w:-n/w;return d=n<=0?w+R:-e/(w*w+R*R+n),l*u>=c*C?[(d-r)/i]:[-o/(d+s)]}const p=M,w=-2*r*M+i*h,R=m,S=-o*h+2*s*m,O=Math.sqrt(f),x=Math.sqrt(3)/2;let y=Math.abs(Math.atan2(i*O,-w)/3);d=2*Math.sqrt(-p);let P=Math.cos(y);g=d*P;let N=d*(-P/2-x*Math.sin(y));const b=g+N>2*r?g-r:N-r,q=i,L=b/q;y=Math.abs(Math.atan2(o*O,-S)/3),d=2*Math.sqrt(-R),P=Math.cos(y),g=d*P,N=d*(-P/2-x*Math.sin(y));const I=-o,E=g+N<2*s?g+s:N+s,z=I/E,T=-b*E-q*I,v=(s*T-r*(b*I))/(-r*T+s*(q*E));return L<=v?L<=z?v<=z?[L,v,z]:[L,z,v]:[z,L,v]:L<=z?[v,L,z]:v<=z?[v,z,L]:[z,v,L]}c.computeDiscriminant=function(t,n,e,a){const i=n*n,r=e*e;return 18*t*n*e*a+i*r-27*(t*t)*(a*a)-4*(t*r*e+i*n*a)},c.computeRealRoots=function(t,n,e,a){let i,r;if(0===t)return s.computeRealRoots(n,e,a);if(0===n){if(0===e){if(0===a)return[0,0,0];r=-a/t;const n=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[n,n,n]}return 0===a?(i=s.computeRealRoots(t,0,e),0===i.Length?[0]:[i[0],0,i[1]]):u(t,0,e,a)}return 0===e?0===a?(r=-n/t,r<0?[r,0,0]:[0,0,r]):u(t,n,0,a):0===a?(i=s.computeRealRoots(t,n,e),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):u(t,n,e,a)};const l={};function C(t,n,e,a){const i=t*t,o=n-3*i/8,u=e-n*t/2+i*t/8,l=a-e*t/4+n*i/16-3*i*i/256,C=c.computeRealRoots(1,2*o,o*o-4*l,-u*u);if(C.length>0){const n=-t/4,e=C[C.length-1];if(Math.abs(e)<r.CesiumMath.EPSILON14){const t=s.computeRealRoots(1,o,l);if(2===t.length){const e=t[0],a=t[1];let i;if(e>=0&&a>=0){const t=Math.sqrt(e),i=Math.sqrt(a);return[n-i,n-t,n+t,n+i]}if(e>=0&&a<0)return i=Math.sqrt(e),[n-i,n+i];if(e<0&&a>=0)return i=Math.sqrt(a),[n-i,n+i]}return[]}if(e>0){const t=Math.sqrt(e),a=(o+e-u/t)/2,i=(o+e+u/t)/2,r=s.computeRealRoots(1,t,a),c=s.computeRealRoots(1,-t,i);return 0!==r.length?(r[0]+=n,r[1]+=n,0!==c.length?(c[0]+=n,c[1]+=n,r[1]<=c[0]?[r[0],r[1],c[0],c[1]]:c[1]<=r[0]?[c[0],c[1],r[0],r[1]]:r[0]>=c[0]&&r[1]<=c[1]?[c[0],r[0],r[1],c[1]]:c[0]>=r[0]&&c[1]<=r[1]?[r[0],c[0],c[1],r[1]]:r[0]>c[0]&&r[0]<c[1]?[c[0],r[0],c[1],r[1]]:[r[0],c[0],r[1],c[1]]):r):0!==c.length?(c[0]+=n,c[1]+=n,c):[]}}return[]}function M(t,n,e,a){const i=t*t,o=-2*n,u=e*t+n*n-4*a,l=i*a-e*n*t+e*e,C=c.computeRealRoots(1,o,u,l);if(C.length>0){const o=C[0],c=n-o,u=c*c,l=t/2,M=c/2,h=u-4*a,m=u+4*Math.abs(a),f=i-4*o,d=i+4*Math.abs(o);let g,p,w,R,S,O;if(o<0||h*d<f*m){const n=Math.sqrt(f);g=n/2,p=0===n?0:(t*M-e)/n}else{const n=Math.sqrt(h);g=0===n?0:(t*M-e)/n,p=n/2}0===l&&0===g?(w=0,R=0):r.CesiumMath.sign(l)===r.CesiumMath.sign(g)?(w=l+g,R=o/w):(R=l-g,w=o/R),0===M&&0===p?(S=0,O=0):r.CesiumMath.sign(M)===r.CesiumMath.sign(p)?(S=M+p,O=a/S):(O=M-p,S=a/O);const x=s.computeRealRoots(1,w,S),y=s.computeRealRoots(1,R,O);if(0!==x.length)return 0!==y.length?x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>y[0]&&x[0]<y[1]?[y[0],x[0],y[1],x[1]]:[x[0],y[0],x[1],y[1]]:x;if(0!==y.length)return y}return[]}function h(t,a){a=n.Cartesian3.clone(e.defaultValue(a,n.Cartesian3.ZERO)),n.Cartesian3.equals(a,n.Cartesian3.ZERO)||n.Cartesian3.normalize(a,a),this.origin=n.Cartesian3.clone(e.defaultValue(t,n.Cartesian3.ZERO)),this.direction=a}l.computeDiscriminant=function(t,n,e,a,i){const r=t*t,s=n*n,o=s*n,c=e*e,u=c*e,l=a*a,C=l*a,M=i*i;return s*c*l-4*o*C-4*t*u*l+18*t*n*e*C-27*r*l*l+256*(r*t)*(M*i)+i*(18*o*e*a-4*s*u+16*t*c*c-80*t*n*c*a-6*t*s*l+144*r*e*l)+M*(144*t*s*e-27*s*s-128*r*c-192*r*n*a)},l.computeRealRoots=function(t,n,e,a,i){if(Math.abs(t)<r.CesiumMath.EPSILON15)return c.computeRealRoots(n,e,a,i);const s=n/t,o=e/t,u=a/t,l=i/t;let h=s<0?1:0;switch(h+=o<0?h+1:h,h+=u<0?h+1:h,h+=l<0?h+1:h,h){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return C(s,o,u,l);case 1:case 2:case 5:case 8:case 11:return M(s,o,u,l);default:return}},h.clone=function(t,a){if(e.defined(t))return e.defined(a)?(a.origin=n.Cartesian3.clone(t.origin),a.direction=n.Cartesian3.clone(t.direction),a):new h(t.origin,t.direction)},h.getPoint=function(t,a,i){return e.defined(i)||(i=new n.Cartesian3),i=n.Cartesian3.multiplyByScalar(t.direction,a,i),n.Cartesian3.add(t.origin,i,i)};const m={rayPlane:function(t,a,i){e.defined(i)||(i=new n.Cartesian3);const s=t.origin,o=t.direction,c=a.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<r.CesiumMath.EPSILON15)return;const l=(-a.distance-n.Cartesian3.dot(c,s))/u;return l<0?void 0:(i=n.Cartesian3.multiplyByScalar(o,l,i),n.Cartesian3.add(s,i,i))}},f=new n.Cartesian3,d=new n.Cartesian3,g=new n.Cartesian3,p=new n.Cartesian3,w=new n.Cartesian3;m.rayTriangleParametric=function(t,a,i,s,o){o=e.defaultValue(o,!1);const c=t.origin,u=t.direction,l=n.Cartesian3.subtract(i,a,f),C=n.Cartesian3.subtract(s,a,d),M=n.Cartesian3.cross(u,C,g),h=n.Cartesian3.dot(l,M);let m,R,S,O,x;if(o){if(h<r.CesiumMath.EPSILON6)return;if(m=n.Cartesian3.subtract(c,a,p),S=n.Cartesian3.dot(m,M),S<0||S>h)return;if(R=n.Cartesian3.cross(m,l,w),O=n.Cartesian3.dot(u,R),O<0||S+O>h)return;x=n.Cartesian3.dot(C,R)/h}else{if(Math.abs(h)<r.CesiumMath.EPSILON6)return;const t=1/h;if(m=n.Cartesian3.subtract(c,a,p),S=n.Cartesian3.dot(m,M)*t,S<0||S>1)return;if(R=n.Cartesian3.cross(m,l,w),O=n.Cartesian3.dot(u,R)*t,O<0||S+O>1)return;x=n.Cartesian3.dot(C,R)*t}return x},m.rayTriangle=function(t,a,i,r,s,o){const c=m.rayTriangleParametric(t,a,i,r,s);if(e.defined(c)&&!(c<0))return e.defined(o)||(o=new n.Cartesian3),n.Cartesian3.multiplyByScalar(t.direction,c,o),n.Cartesian3.add(t.origin,o,o)};const R=new h;m.lineSegmentTriangle=function(t,a,i,r,s,o,c){const u=R;n.Cartesian3.clone(t,u.origin),n.Cartesian3.subtract(a,t,u.direction),n.Cartesian3.normalize(u.direction,u.direction);const l=m.rayTriangleParametric(u,i,r,s,o);if(!(!e.defined(l)||l<0||l>n.Cartesian3.distance(t,a)))return e.defined(c)||(c=new n.Cartesian3),n.Cartesian3.multiplyByScalar(u.direction,l,c),n.Cartesian3.add(u.origin,c,c)};const S={root0:0,root1:0};function O(t,a,r){e.defined(r)||(r=new i.Interval);const s=t.origin,o=t.direction,c=a.center,u=a.radius*a.radius,l=n.Cartesian3.subtract(s,c,g),C=function(t,n,e,a){const i=n*n-4*t*e;if(i<0)return;if(i>0){const e=1/(2*t),r=Math.sqrt(i),s=(-n+r)*e,o=(-n-r)*e;return s<o?(a.root0=s,a.root1=o):(a.root0=o,a.root1=s),a}const r=-n/(2*t);return 0!==r?(a.root0=a.root1=r,a):void 0}(n.Cartesian3.dot(o,o),2*n.Cartesian3.dot(o,l),n.Cartesian3.magnitudeSquared(l)-u,S);if(e.defined(C))return r.start=C.root0,r.stop=C.root1,r}m.raySphere=function(t,n,a){if(a=O(t,n,a),e.defined(a)&&!(a.stop<0))return a.start=Math.max(a.start,0),a};const x=new h;m.lineSegmentSphere=function(t,a,i,r){const s=x;n.Cartesian3.clone(t,s.origin);const o=n.Cartesian3.subtract(a,t,s.direction),c=n.Cartesian3.magnitude(o);if(n.Cartesian3.normalize(o,o),r=O(s,i,r),!(!e.defined(r)||r.stop<0||r.start>c))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,c),r};const y=new n.Cartesian3,P=new n.Cartesian3;function N(t,n,e){const a=t+n;return r.CesiumMath.sign(t)!==r.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}m.rayEllipsoid=function(t,e){const a=e.oneOverRadii,r=n.Cartesian3.multiplyComponents(a,t.origin,y),s=n.Cartesian3.multiplyComponents(a,t.direction,P),o=n.Cartesian3.magnitudeSquared(r),c=n.Cartesian3.dot(r,s);let u,l,C,M,h;if(o>1){if(c>=0)return;const t=c*c;if(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,t<C)return;if(t>C){M=c*c-C,h=-c+Math.sqrt(M);const t=h/l,n=u/h;return t<n?new i.Interval(t,n):{start:n,stop:t}}const e=Math.sqrt(u/l);return new i.Interval(e,e)}return o<1?(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,M=c*c-C,h=-c+Math.sqrt(M),new i.Interval(0,h/l)):c<0?(l=n.Cartesian3.magnitudeSquared(s),new i.Interval(0,-c/l)):void 0};const b=new n.Cartesian3,q=new n.Cartesian3,L=new n.Cartesian3,I=new n.Cartesian3,E=new n.Cartesian3,z=new n.Matrix3,T=new n.Matrix3,v=new n.Matrix3,U=new n.Matrix3,W=new n.Matrix3,B=new n.Matrix3,V=new n.Matrix3,Z=new n.Cartesian3,D=new n.Cartesian3,A=new n.Cartographic;m.grazingAltitudeLocation=function(t,a){const i=t.origin,o=t.direction;if(!n.Cartesian3.equals(i,n.Cartesian3.ZERO)){const t=a.geodeticSurfaceNormal(i,b);if(n.Cartesian3.dot(o,t)>=0)return i}const c=e.defined(this.rayEllipsoid(t,a)),u=a.transformPositionToScaledSpace(o,b),C=n.Cartesian3.normalize(u,u),M=n.Cartesian3.mostOrthogonalAxis(u,I),h=n.Cartesian3.normalize(n.Cartesian3.cross(M,C,q),q),m=n.Cartesian3.normalize(n.Cartesian3.cross(C,h,L),L),f=z;f[0]=C.x,f[1]=C.y,f[2]=C.z,f[3]=h.x,f[4]=h.y,f[5]=h.z,f[6]=m.x,f[7]=m.y,f[8]=m.z;const d=n.Matrix3.transpose(f,T),g=n.Matrix3.fromScale(a.radii,v),p=n.Matrix3.fromScale(a.oneOverRadii,U),w=W;w[0]=0,w[1]=-o.z,w[2]=o.y,w[3]=o.z,w[4]=0,w[5]=-o.x,w[6]=-o.y,w[7]=o.x,w[8]=0;const R=n.Matrix3.multiply(n.Matrix3.multiply(d,p,B),w,B),S=n.Matrix3.multiply(n.Matrix3.multiply(R,g,V),f,V),O=n.Matrix3.multiplyByVector(R,i,E),x=function(t,e,a,i,o){const c=i*i,u=o*o,C=(t[n.Matrix3.COLUMN1ROW1]-t[n.Matrix3.COLUMN2ROW2])*u,M=o*(i*N(t[n.Matrix3.COLUMN1ROW0],t[n.Matrix3.COLUMN0ROW1],r.CesiumMath.EPSILON15)+e.y),h=t[n.Matrix3.COLUMN0ROW0]*c+t[n.Matrix3.COLUMN2ROW2]*u+i*e.x+a,m=u*N(t[n.Matrix3.COLUMN2ROW1],t[n.Matrix3.COLUMN1ROW2],r.CesiumMath.EPSILON15),f=o*(i*N(t[n.Matrix3.COLUMN2ROW0],t[n.Matrix3.COLUMN0ROW2])+e.z);let d;const g=[];if(0===f&&0===m){if(d=s.computeRealRoots(C,M,h),0===d.length)return g;const t=d[0],e=Math.sqrt(Math.max(1-t*t,0));if(g.push(new n.Cartesian3(i,o*t,o*-e)),g.push(new n.Cartesian3(i,o*t,o*e)),2===d.length){const t=d[1],e=Math.sqrt(Math.max(1-t*t,0));g.push(new n.Cartesian3(i,o*t,o*-e)),g.push(new n.Cartesian3(i,o*t,o*e))}return g}const p=f*f,w=m*m,R=f*m,S=C*C+w,O=2*(M*C+R),x=2*h*C+M*M-w+p,y=2*(h*M-R),P=h*h-p;if(0===S&&0===O&&0===x&&0===y)return g;d=l.computeRealRoots(S,O,x,y,P);const b=d.length;if(0===b)return g;for(let t=0;t<b;++t){const e=d[t],a=e*e,s=Math.max(1-a,0),c=Math.sqrt(s);let u;u=r.CesiumMath.sign(C)===r.CesiumMath.sign(h)?N(C*a+h,M*e,r.CesiumMath.EPSILON12):r.CesiumMath.sign(h)===r.CesiumMath.sign(M*e)?N(C*a,M*e+h,r.CesiumMath.EPSILON12):N(C*a+M*e,h,r.CesiumMath.EPSILON12);const l=u*N(m*e,f,r.CesiumMath.EPSILON15);l<0?g.push(new n.Cartesian3(i,o*e,o*c)):l>0?g.push(new n.Cartesian3(i,o*e,o*-c)):0!==c?(g.push(new n.Cartesian3(i,o*e,o*-c)),g.push(new n.Cartesian3(i,o*e,o*c)),++t):g.push(new n.Cartesian3(i,o*e,o*c))}return g}(S,n.Cartesian3.negate(O,b),0,0,1);let y,P;const F=x.length;if(F>0){let t=n.Cartesian3.clone(n.Cartesian3.ZERO,D),e=Number.NEGATIVE_INFINITY;for(let a=0;a<F;++a){y=n.Matrix3.multiplyByVector(g,n.Matrix3.multiplyByVector(f,x[a],Z),Z);const r=n.Cartesian3.normalize(n.Cartesian3.subtract(y,i,I),I),s=n.Cartesian3.dot(r,o);s>e&&(e=s,t=n.Cartesian3.clone(y,t))}const s=a.cartesianToCartographic(t,A);return e=r.CesiumMath.clamp(e,0,1),P=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,i,I))*Math.sqrt(1-e*e),P=c?-P:P,s.height=P,a.cartographicToCartesian(s,new n.Cartesian3)}};const F=new n.Cartesian3;m.lineSegmentPlane=function(t,a,i,s){e.defined(s)||(s=new n.Cartesian3);const o=n.Cartesian3.subtract(a,t,F),c=i.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<r.CesiumMath.EPSILON6)return;const l=n.Cartesian3.dot(c,t),C=-(i.distance+l)/u;return C<0||C>1?void 0:(n.Cartesian3.multiplyByScalar(o,C,s),n.Cartesian3.add(t,s,s),s)},m.trianglePlaneIntersection=function(t,e,a,i){const r=i.normal,s=i.distance,o=n.Cartesian3.dot(r,t)+s<0,c=n.Cartesian3.dot(r,e)+s<0,u=n.Cartesian3.dot(r,a)+s<0;let l,C,M=0;if(M+=o?1:0,M+=c?1:0,M+=u?1:0,1!==M&&2!==M||(l=new n.Cartesian3,C=new n.Cartesian3),1===M){if(o)return m.lineSegmentPlane(t,e,i,l),m.lineSegmentPlane(t,a,i,C),{positions:[t,e,a,l,C],indices:[0,3,4,1,2,4,1,4,3]};if(c)return m.lineSegmentPlane(e,a,i,l),m.lineSegmentPlane(e,t,i,C),{positions:[t,e,a,l,C],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(a,t,i,l),m.lineSegmentPlane(a,e,i,C),{positions:[t,e,a,l,C],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===M){if(!o)return m.lineSegmentPlane(e,t,i,l),m.lineSegmentPlane(a,t,i,C),{positions:[t,e,a,l,C],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return m.lineSegmentPlane(a,e,i,l),m.lineSegmentPlane(t,e,i,C),{positions:[t,e,a,l,C],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,a,i,l),m.lineSegmentPlane(e,a,i,C),{positions:[t,e,a,l,C],indices:[0,1,4,0,4,3,2,3,4]}}},t.IntersectionTests=m,t.Ray=h}));
@@ -1 +1 @@
1
- define(["exports","./Transforms-eb5c1a84","./Matrix2-37e55508","./RuntimeError-8952249c","./defaultValue-81eec7ed","./EllipsoidTangentPlane-678e34e4","./ComponentDatatype-a15c9a19","./Plane-6ee42cab"],(function(a,t,e,n,r,i,s,o){"use strict";function c(a,t){this.center=e.Cartesian3.clone(r.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=e.Matrix3.clone(r.defaultValue(t,e.Matrix3.ZERO))}c.packedLength=e.Cartesian3.packedLength+e.Matrix3.packedLength,c.pack=function(a,t,n){return n=r.defaultValue(n,0),e.Cartesian3.pack(a.center,t,n),e.Matrix3.pack(a.halfAxes,t,n+e.Cartesian3.packedLength),t},c.unpack=function(a,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new c),e.Cartesian3.unpack(a,t,n.center),e.Matrix3.unpack(a,t+e.Cartesian3.packedLength,n.halfAxes),n};const C=new e.Cartesian3,u=new e.Cartesian3,l=new e.Cartesian3,d=new e.Cartesian3,h=new e.Cartesian3,x=new e.Cartesian3,m=new e.Matrix3,M={unitary:new e.Matrix3,diagonal:new e.Matrix3};c.fromPoints=function(a,t){if(r.defined(t)||(t=new c),!r.defined(a)||0===a.length)return t.halfAxes=e.Matrix3.ZERO,t.center=e.Cartesian3.ZERO,t;let n;const i=a.length,s=e.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)e.Cartesian3.add(s,a[n],s);const o=1/i;e.Cartesian3.multiplyByScalar(s,o,s);let f,p=0,w=0,g=0,y=0,b=0,N=0;for(n=0;n<i;n++)f=e.Cartesian3.subtract(a[n],s,u),p+=f.x*f.x,w+=f.x*f.y,g+=f.x*f.z,y+=f.y*f.y,b+=f.y*f.z,N+=f.z*f.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=e.Matrix3.computeEigenDecomposition(T,M),A=e.Matrix3.clone(O.unitary,t.halfAxes);let P=e.Matrix3.getColumn(A,0,d),I=e.Matrix3.getColumn(A,1,h),R=e.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(n=0;n<i;n++)f=a[n],E=Math.max(e.Cartesian3.dot(P,f),E),S=Math.max(e.Cartesian3.dot(I,f),S),U=Math.max(e.Cartesian3.dot(R,f),U),L=Math.min(e.Cartesian3.dot(P,f),L),z=Math.min(e.Cartesian3.dot(I,f),z),B=Math.min(e.Cartesian3.dot(R,f),B);P=e.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=e.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=e.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=e.Cartesian3.add(P,I,t.center);e.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,e.Cartesian3.multiplyByScalar(_,.5,_),e.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const f=new e.Cartesian3,p=new e.Cartesian3;function w(a,t,n,i,s,o,C,u,l,d,h){r.defined(h)||(h=new c);const x=h.halfAxes;e.Matrix3.setColumn(x,0,t,x),e.Matrix3.setColumn(x,1,n,x),e.Matrix3.setColumn(x,2,i,x);let m=f;m.x=(s+o)/2,m.y=(C+u)/2,m.z=(l+d)/2;const M=p;M.x=(o-s)/2,M.y=(u-C)/2,M.z=(d-l)/2;const w=h.center;return m=e.Matrix3.multiplyByVector(x,m,m),e.Cartesian3.add(a,m,w),e.Matrix3.multiplyByScale(x,M,x),h}const g=new e.Cartographic,y=new e.Cartesian3,b=new e.Cartographic,N=new e.Cartographic,T=new e.Cartographic,O=new e.Cartographic,A=new e.Cartographic,P=new e.Cartesian3,I=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,S=new e.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new e.Cartesian3,k=new e.Cartesian3,W=new e.Cartesian3,D=new e.Cartesian3,X=new e.Cartesian2,q=new e.Cartesian3,j=new e.Cartesian3,Z=new e.Cartesian3,v=new o.Plane(e.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,t,n,c,C){let u,l,d,h,x,m,M;if(t=r.defaultValue(t,0),n=r.defaultValue(n,0),c=r.defaultValue(c,e.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),f=new i.EllipsoidTangentPlane(s,c);M=f.plane;const p=r.longitude,_=a.south<0&&a.north>0?0:r.latitude,k=e.Cartographic.fromRadians(p,a.north,n,b),W=e.Cartographic.fromRadians(a.west,a.north,n,N),D=e.Cartographic.fromRadians(a.west,_,n,T),X=e.Cartographic.fromRadians(a.west,a.south,n,O),q=e.Cartographic.fromRadians(p,a.south,n,A),j=c.cartographicToCartesian(k,P);let Z=c.cartographicToCartesian(W,I);const v=c.cartographicToCartesian(D,R);let Y=c.cartographicToCartesian(X,E);const G=c.cartographicToCartesian(q,S),F=f.projectPointToNearestOnPlane(j,U),H=f.projectPointToNearestOnPlane(Z,L),J=f.projectPointToNearestOnPlane(v,z),K=f.projectPointToNearestOnPlane(Y,B),Q=f.projectPointToNearestOnPlane(G,V);return u=Math.min(H.x,J.x,K.x),l=-u,h=Math.max(H.y,F.y),d=Math.min(K.y,Q.y),W.height=X.height=t,Z=c.cartographicToCartesian(W,I),Y=c.cartographicToCartesian(X,E),x=Math.min(o.Plane.getPointDistance(M,Z),o.Plane.getPointDistance(M,Y)),m=n,w(f.origin,f.xAxis,f.yAxis,f.zAxis,u,l,d,h,x,m,C)}const f=a.south>0,p=a.north<0,Y=f?a.south:p?a.north:0,G=e.Rectangle.center(a,g).longitude,F=e.Cartesian3.fromRadians(G,Y,n,c,_);F.z=0;const H=Math.abs(F.x)<s.CesiumMath.EPSILON10&&Math.abs(F.y)<s.CesiumMath.EPSILON10?e.Cartesian3.UNIT_X:e.Cartesian3.normalize(F,k),J=e.Cartesian3.UNIT_Z,K=e.Cartesian3.cross(H,J,W);M=o.Plane.fromPointNormal(F,H,v);const Q=e.Cartesian3.fromRadians(G+s.CesiumMath.PI_OVER_TWO,Y,n,c,D);l=e.Cartesian3.dot(o.Plane.projectPointOntoPlane(M,Q,X),K),u=-l,h=e.Cartesian3.fromRadians(0,a.north,p?t:n,c,q).z,d=e.Cartesian3.fromRadians(0,a.south,f?t:n,c,j).z;const $=e.Cartesian3.fromRadians(a.east,Y,n,c,Z);return x=o.Plane.getPointDistance(M,$),m=0,w(F,K,J,H,u,l,d,h,x,m,C)},c.fromTransformation=function(a,t){return r.defined(t)||(t=new c),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=e.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},c.clone=function(a,t){if(r.defined(a))return r.defined(t)?(e.Cartesian3.clone(a.center,t.center),e.Matrix3.clone(a.halfAxes,t.halfAxes),t):new c(a.center,a.halfAxes)},c.intersectPlane=function(a,n){const r=a.center,i=n.normal,s=a.halfAxes,o=i.x,c=i.y,C=i.z,u=Math.abs(o*s[e.Matrix3.COLUMN0ROW0]+c*s[e.Matrix3.COLUMN0ROW1]+C*s[e.Matrix3.COLUMN0ROW2])+Math.abs(o*s[e.Matrix3.COLUMN1ROW0]+c*s[e.Matrix3.COLUMN1ROW1]+C*s[e.Matrix3.COLUMN1ROW2])+Math.abs(o*s[e.Matrix3.COLUMN2ROW0]+c*s[e.Matrix3.COLUMN2ROW1]+C*s[e.Matrix3.COLUMN2ROW2]),l=e.Cartesian3.dot(i,r)+n.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new e.Cartesian3,G=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3,J=new e.Cartesian3,K=new e.Cartesian3;c.distanceSquaredTo=function(a,t){const n=e.Cartesian3.subtract(t,a.center,f),r=a.halfAxes;let i=e.Matrix3.getColumn(r,0,Y),o=e.Matrix3.getColumn(r,1,G),c=e.Matrix3.getColumn(r,2,F);const C=e.Cartesian3.magnitude(i),u=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(c);let d=!0,h=!0,x=!0;C>0?e.Cartesian3.divideByScalar(i,C,i):d=!1,u>0?e.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?e.Cartesian3.divideByScalar(c,l,c):x=!1;const m=!d+!h+!x;let M,p,w;if(1===m){let a=i;M=o,p=c,h?x||(a=c,p=i):(a=o,M=i),w=e.Cartesian3.cross(M,p,J),a===i?i=w:a===o?o=w:a===c&&(c=w)}else if(2===m){M=i,h?M=o:x&&(M=c);let a=e.Cartesian3.UNIT_Y;a.equalsEpsilon(M,s.CesiumMath.EPSILON3)&&(a=e.Cartesian3.UNIT_X),p=e.Cartesian3.cross(M,a,H),e.Cartesian3.normalize(p,p),w=e.Cartesian3.cross(M,p,J),e.Cartesian3.normalize(w,w),M===i?(o=p,c=w):M===o?(c=p,i=w):M===c&&(i=p,o=w)}else 3===m&&(i=e.Cartesian3.UNIT_X,o=e.Cartesian3.UNIT_Y,c=e.Cartesian3.UNIT_Z);const g=K;g.x=e.Cartesian3.dot(n,i),g.y=e.Cartesian3.dot(n,o),g.z=e.Cartesian3.dot(n,c);let y,b=0;return g.x<-C?(y=g.x+C,b+=y*y):g.x>C&&(y=g.x-C,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new e.Cartesian3,$=new e.Cartesian3;c.computePlaneDistances=function(a,n,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const C=a.center,u=a.halfAxes,l=e.Matrix3.getColumn(u,0,Y),d=e.Matrix3.getColumn(u,1,G),h=e.Matrix3.getColumn(u,2,F),x=e.Cartesian3.add(l,d,Q);e.Cartesian3.add(x,h,x),e.Cartesian3.add(x,C,x);const m=e.Cartesian3.subtract(x,n,$);let M=e.Cartesian3.dot(i,m);return o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),M=e.Cartesian3.dot(i,m),o=Math.min(M,o),c=Math.max(M,c),s.start=o,s.stop=c,s};const aa=new e.Cartesian3,ta=new e.Cartesian3,ea=new e.Cartesian3;c.computeCorners=function(a,t){r.defined(t)||(t=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3]);const n=a.center,i=a.halfAxes,s=e.Matrix3.getColumn(i,0,aa),o=e.Matrix3.getColumn(i,1,ta),c=e.Matrix3.getColumn(i,2,ea);return e.Cartesian3.clone(n,t[0]),e.Cartesian3.subtract(t[0],s,t[0]),e.Cartesian3.subtract(t[0],o,t[0]),e.Cartesian3.subtract(t[0],c,t[0]),e.Cartesian3.clone(n,t[1]),e.Cartesian3.subtract(t[1],s,t[1]),e.Cartesian3.subtract(t[1],o,t[1]),e.Cartesian3.add(t[1],c,t[1]),e.Cartesian3.clone(n,t[2]),e.Cartesian3.subtract(t[2],s,t[2]),e.Cartesian3.add(t[2],o,t[2]),e.Cartesian3.subtract(t[2],c,t[2]),e.Cartesian3.clone(n,t[3]),e.Cartesian3.subtract(t[3],s,t[3]),e.Cartesian3.add(t[3],o,t[3]),e.Cartesian3.add(t[3],c,t[3]),e.Cartesian3.clone(n,t[4]),e.Cartesian3.add(t[4],s,t[4]),e.Cartesian3.subtract(t[4],o,t[4]),e.Cartesian3.subtract(t[4],c,t[4]),e.Cartesian3.clone(n,t[5]),e.Cartesian3.add(t[5],s,t[5]),e.Cartesian3.subtract(t[5],o,t[5]),e.Cartesian3.add(t[5],c,t[5]),e.Cartesian3.clone(n,t[6]),e.Cartesian3.add(t[6],s,t[6]),e.Cartesian3.add(t[6],o,t[6]),e.Cartesian3.subtract(t[6],c,t[6]),e.Cartesian3.clone(n,t[7]),e.Cartesian3.add(t[7],s,t[7]),e.Cartesian3.add(t[7],o,t[7]),e.Cartesian3.add(t[7],c,t[7]),t};const na=new e.Matrix3;c.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const n=a.center,i=e.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(i,n,t)};const ra=new t.BoundingSphere;c.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},c.prototype.intersectPlane=function(a){return c.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){return c.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,t,e){return c.computePlaneDistances(this,a,t,e)},c.prototype.computeCorners=function(a){return c.computeCorners(this,a)},c.prototype.computeTransformation=function(a){return c.computeTransformation(this,a)},c.prototype.isOccluded=function(a){return c.isOccluded(this,a)},c.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&e.Cartesian3.equals(a.center,t.center)&&e.Matrix3.equals(a.halfAxes,t.halfAxes)},c.prototype.clone=function(a){return c.clone(this,a)},c.prototype.equals=function(a){return c.equals(this,a)},a.OrientedBoundingBox=c}));
1
+ define(["exports","./Transforms-c8cb8f43","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./EllipsoidTangentPlane-a01286f6","./ComponentDatatype-a15c9a19","./Plane-3f01019d"],(function(a,t,e,n,r,i,s,o){"use strict";function c(a,t){this.center=e.Cartesian3.clone(r.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=e.Matrix3.clone(r.defaultValue(t,e.Matrix3.ZERO))}c.packedLength=e.Cartesian3.packedLength+e.Matrix3.packedLength,c.pack=function(a,t,n){return n=r.defaultValue(n,0),e.Cartesian3.pack(a.center,t,n),e.Matrix3.pack(a.halfAxes,t,n+e.Cartesian3.packedLength),t},c.unpack=function(a,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new c),e.Cartesian3.unpack(a,t,n.center),e.Matrix3.unpack(a,t+e.Cartesian3.packedLength,n.halfAxes),n};const C=new e.Cartesian3,u=new e.Cartesian3,l=new e.Cartesian3,d=new e.Cartesian3,h=new e.Cartesian3,x=new e.Cartesian3,m=new e.Matrix3,f={unitary:new e.Matrix3,diagonal:new e.Matrix3};c.fromPoints=function(a,t){if(r.defined(t)||(t=new c),!r.defined(a)||0===a.length)return t.halfAxes=e.Matrix3.ZERO,t.center=e.Cartesian3.ZERO,t;let n;const i=a.length,s=e.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)e.Cartesian3.add(s,a[n],s);const o=1/i;e.Cartesian3.multiplyByScalar(s,o,s);let M,p=0,w=0,g=0,y=0,b=0,N=0;for(n=0;n<i;n++)M=e.Cartesian3.subtract(a[n],s,u),p+=M.x*M.x,w+=M.x*M.y,g+=M.x*M.z,y+=M.y*M.y,b+=M.y*M.z,N+=M.z*M.z;p*=o,w*=o,g*=o,y*=o,b*=o,N*=o;const T=m;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=e.Matrix3.computeEigenDecomposition(T,f),A=e.Matrix3.clone(O.unitary,t.halfAxes);let P=e.Matrix3.getColumn(A,0,d),I=e.Matrix3.getColumn(A,1,h),R=e.Matrix3.getColumn(A,2,x),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(n=0;n<i;n++)M=a[n],E=Math.max(e.Cartesian3.dot(P,M),E),S=Math.max(e.Cartesian3.dot(I,M),S),U=Math.max(e.Cartesian3.dot(R,M),U),L=Math.min(e.Cartesian3.dot(P,M),L),z=Math.min(e.Cartesian3.dot(I,M),z),B=Math.min(e.Cartesian3.dot(R,M),B);P=e.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=e.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=e.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=e.Cartesian3.add(P,I,t.center);e.Cartesian3.add(V,R,V);const _=l;return _.x=E-L,_.y=S-z,_.z=U-B,e.Cartesian3.multiplyByScalar(_,.5,_),e.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const M=new e.Cartesian3,p=new e.Cartesian3;function w(a,t,n,i,s,o,C,u,l,d,h){r.defined(h)||(h=new c);const x=h.halfAxes;e.Matrix3.setColumn(x,0,t,x),e.Matrix3.setColumn(x,1,n,x),e.Matrix3.setColumn(x,2,i,x);let m=M;m.x=(s+o)/2,m.y=(C+u)/2,m.z=(l+d)/2;const f=p;f.x=(o-s)/2,f.y=(u-C)/2,f.z=(d-l)/2;const w=h.center;return m=e.Matrix3.multiplyByVector(x,m,m),e.Cartesian3.add(a,m,w),e.Matrix3.multiplyByScale(x,f,x),h}const g=new e.Cartographic,y=new e.Cartesian3,b=new e.Cartographic,N=new e.Cartographic,T=new e.Cartographic,O=new e.Cartographic,A=new e.Cartographic,P=new e.Cartesian3,I=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,S=new e.Cartesian3,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian2,_=new e.Cartesian3,k=new e.Cartesian3,W=new e.Cartesian3,D=new e.Cartesian3,X=new e.Cartesian2,q=new e.Cartesian3,j=new e.Cartesian3,Z=new e.Cartesian3,v=new o.Plane(e.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,t,n,c,C){let u,l,d,h,x,m,f;if(t=r.defaultValue(t,0),n=r.defaultValue(n,0),c=r.defaultValue(c,e.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){const r=e.Rectangle.center(a,g),s=c.cartographicToCartesian(r,y),M=new i.EllipsoidTangentPlane(s,c);f=M.plane;const p=r.longitude,_=a.south<0&&a.north>0?0:r.latitude,k=e.Cartographic.fromRadians(p,a.north,n,b),W=e.Cartographic.fromRadians(a.west,a.north,n,N),D=e.Cartographic.fromRadians(a.west,_,n,T),X=e.Cartographic.fromRadians(a.west,a.south,n,O),q=e.Cartographic.fromRadians(p,a.south,n,A),j=c.cartographicToCartesian(k,P);let Z=c.cartographicToCartesian(W,I);const v=c.cartographicToCartesian(D,R);let Y=c.cartographicToCartesian(X,E);const G=c.cartographicToCartesian(q,S),F=M.projectPointToNearestOnPlane(j,U),H=M.projectPointToNearestOnPlane(Z,L),J=M.projectPointToNearestOnPlane(v,z),K=M.projectPointToNearestOnPlane(Y,B),Q=M.projectPointToNearestOnPlane(G,V);return u=Math.min(H.x,J.x,K.x),l=-u,h=Math.max(H.y,F.y),d=Math.min(K.y,Q.y),W.height=X.height=t,Z=c.cartographicToCartesian(W,I),Y=c.cartographicToCartesian(X,E),x=Math.min(o.Plane.getPointDistance(f,Z),o.Plane.getPointDistance(f,Y)),m=n,w(M.origin,M.xAxis,M.yAxis,M.zAxis,u,l,d,h,x,m,C)}const M=a.south>0,p=a.north<0,Y=M?a.south:p?a.north:0,G=e.Rectangle.center(a,g).longitude,F=e.Cartesian3.fromRadians(G,Y,n,c,_);F.z=0;const H=Math.abs(F.x)<s.CesiumMath.EPSILON10&&Math.abs(F.y)<s.CesiumMath.EPSILON10?e.Cartesian3.UNIT_X:e.Cartesian3.normalize(F,k),J=e.Cartesian3.UNIT_Z,K=e.Cartesian3.cross(H,J,W);f=o.Plane.fromPointNormal(F,H,v);const Q=e.Cartesian3.fromRadians(G+s.CesiumMath.PI_OVER_TWO,Y,n,c,D);l=e.Cartesian3.dot(o.Plane.projectPointOntoPlane(f,Q,X),K),u=-l,h=e.Cartesian3.fromRadians(0,a.north,p?t:n,c,q).z,d=e.Cartesian3.fromRadians(0,a.south,M?t:n,c,j).z;const $=e.Cartesian3.fromRadians(a.east,Y,n,c,Z);return x=o.Plane.getPointDistance(f,$),m=0,w(F,K,J,H,u,l,d,h,x,m,C)},c.fromTransformation=function(a,t){return r.defined(t)||(t=new c),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=e.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},c.clone=function(a,t){if(r.defined(a))return r.defined(t)?(e.Cartesian3.clone(a.center,t.center),e.Matrix3.clone(a.halfAxes,t.halfAxes),t):new c(a.center,a.halfAxes)},c.intersectPlane=function(a,n){const r=a.center,i=n.normal,s=a.halfAxes,o=i.x,c=i.y,C=i.z,u=Math.abs(o*s[e.Matrix3.COLUMN0ROW0]+c*s[e.Matrix3.COLUMN0ROW1]+C*s[e.Matrix3.COLUMN0ROW2])+Math.abs(o*s[e.Matrix3.COLUMN1ROW0]+c*s[e.Matrix3.COLUMN1ROW1]+C*s[e.Matrix3.COLUMN1ROW2])+Math.abs(o*s[e.Matrix3.COLUMN2ROW0]+c*s[e.Matrix3.COLUMN2ROW1]+C*s[e.Matrix3.COLUMN2ROW2]),l=e.Cartesian3.dot(i,r)+n.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const Y=new e.Cartesian3,G=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3,J=new e.Cartesian3,K=new e.Cartesian3;c.distanceSquaredTo=function(a,t){const n=e.Cartesian3.subtract(t,a.center,M),r=a.halfAxes;let i=e.Matrix3.getColumn(r,0,Y),o=e.Matrix3.getColumn(r,1,G),c=e.Matrix3.getColumn(r,2,F);const C=e.Cartesian3.magnitude(i),u=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(c);let d=!0,h=!0,x=!0;C>0?e.Cartesian3.divideByScalar(i,C,i):d=!1,u>0?e.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?e.Cartesian3.divideByScalar(c,l,c):x=!1;const m=!d+!h+!x;let f,p,w;if(1===m){let a=i;f=o,p=c,h?x||(a=c,p=i):(a=o,f=i),w=e.Cartesian3.cross(f,p,J),a===i?i=w:a===o?o=w:a===c&&(c=w)}else if(2===m){f=i,h?f=o:x&&(f=c);let a=e.Cartesian3.UNIT_Y;a.equalsEpsilon(f,s.CesiumMath.EPSILON3)&&(a=e.Cartesian3.UNIT_X),p=e.Cartesian3.cross(f,a,H),e.Cartesian3.normalize(p,p),w=e.Cartesian3.cross(f,p,J),e.Cartesian3.normalize(w,w),f===i?(o=p,c=w):f===o?(c=p,i=w):f===c&&(i=p,o=w)}else 3===m&&(i=e.Cartesian3.UNIT_X,o=e.Cartesian3.UNIT_Y,c=e.Cartesian3.UNIT_Z);const g=K;g.x=e.Cartesian3.dot(n,i),g.y=e.Cartesian3.dot(n,o),g.z=e.Cartesian3.dot(n,c);let y,b=0;return g.x<-C?(y=g.x+C,b+=y*y):g.x>C&&(y=g.x-C,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const Q=new e.Cartesian3,$=new e.Cartesian3;c.computePlaneDistances=function(a,n,i,s){r.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const C=a.center,u=a.halfAxes,l=e.Matrix3.getColumn(u,0,Y),d=e.Matrix3.getColumn(u,1,G),h=e.Matrix3.getColumn(u,2,F),x=e.Cartesian3.add(l,d,Q);e.Cartesian3.add(x,h,x),e.Cartesian3.add(x,C,x);const m=e.Cartesian3.subtract(x,n,$);let f=e.Cartesian3.dot(i,m);return o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,n,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),s.start=o,s.stop=c,s};const aa=new e.Cartesian3,ta=new e.Cartesian3,ea=new e.Cartesian3;c.computeCorners=function(a,t){r.defined(t)||(t=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3]);const n=a.center,i=a.halfAxes,s=e.Matrix3.getColumn(i,0,aa),o=e.Matrix3.getColumn(i,1,ta),c=e.Matrix3.getColumn(i,2,ea);return e.Cartesian3.clone(n,t[0]),e.Cartesian3.subtract(t[0],s,t[0]),e.Cartesian3.subtract(t[0],o,t[0]),e.Cartesian3.subtract(t[0],c,t[0]),e.Cartesian3.clone(n,t[1]),e.Cartesian3.subtract(t[1],s,t[1]),e.Cartesian3.subtract(t[1],o,t[1]),e.Cartesian3.add(t[1],c,t[1]),e.Cartesian3.clone(n,t[2]),e.Cartesian3.subtract(t[2],s,t[2]),e.Cartesian3.add(t[2],o,t[2]),e.Cartesian3.subtract(t[2],c,t[2]),e.Cartesian3.clone(n,t[3]),e.Cartesian3.subtract(t[3],s,t[3]),e.Cartesian3.add(t[3],o,t[3]),e.Cartesian3.add(t[3],c,t[3]),e.Cartesian3.clone(n,t[4]),e.Cartesian3.add(t[4],s,t[4]),e.Cartesian3.subtract(t[4],o,t[4]),e.Cartesian3.subtract(t[4],c,t[4]),e.Cartesian3.clone(n,t[5]),e.Cartesian3.add(t[5],s,t[5]),e.Cartesian3.subtract(t[5],o,t[5]),e.Cartesian3.add(t[5],c,t[5]),e.Cartesian3.clone(n,t[6]),e.Cartesian3.add(t[6],s,t[6]),e.Cartesian3.add(t[6],o,t[6]),e.Cartesian3.subtract(t[6],c,t[6]),e.Cartesian3.clone(n,t[7]),e.Cartesian3.add(t[7],s,t[7]),e.Cartesian3.add(t[7],o,t[7]),e.Cartesian3.add(t[7],c,t[7]),t};const na=new e.Matrix3;c.computeTransformation=function(a,t){r.defined(t)||(t=new e.Matrix4);const n=a.center,i=e.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);return e.Matrix4.fromRotationTranslation(i,n,t)};const ra=new t.BoundingSphere;c.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,ra);return!e.isBoundingSphereVisible(n)},c.prototype.intersectPlane=function(a){return c.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){return c.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,t,e){return c.computePlaneDistances(this,a,t,e)},c.prototype.computeCorners=function(a){return c.computeCorners(this,a)},c.prototype.computeTransformation=function(a){return c.computeTransformation(this,a)},c.prototype.isOccluded=function(a){return c.isOccluded(this,a)},c.equals=function(a,t){return a===t||r.defined(a)&&r.defined(t)&&e.Cartesian3.equals(a.center,t.center)&&e.Matrix3.equals(a.halfAxes,t.halfAxes)},c.prototype.clone=function(a){return c.clone(this,a)},c.prototype.equals=function(a){return c.equals(this,a)},a.OrientedBoundingBox=c}));
@@ -1 +1 @@
1
- define(["exports","./Matrix2-37e55508","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19"],(function(n,e,a,t,r){"use strict";function i(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}i.fromPointNormal=function(n,a,r){const s=-e.Cartesian3.dot(a,n);return t.defined(r)?(e.Cartesian3.clone(a,r.normal),r.distance=s,r):new i(a,s)};const s=new e.Cartesian3;i.fromCartesian4=function(n,a){const r=e.Cartesian3.fromCartesian4(n,s),o=n.w;return t.defined(a)?(e.Cartesian3.clone(r,a.normal),a.distance=o,a):new i(r,o)},i.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const o=new e.Cartesian3;i.projectPointOntoPlane=function(n,a,r){t.defined(r)||(r=new e.Cartesian3);const s=i.getPointDistance(n,a),c=e.Cartesian3.multiplyByScalar(n.normal,s,o);return e.Cartesian3.subtract(a,c,r)};const c=new e.Matrix4,l=new e.Cartesian4,C=new e.Cartesian3;i.transform=function(n,a,t){const r=n.normal,s=n.distance,o=e.Matrix4.inverseTranspose(a,c);let d=e.Cartesian4.fromElements(r.x,r.y,r.z,s,l);d=e.Matrix4.multiplyByVector(o,d,d);const u=e.Cartesian3.fromCartesian4(d,C);return d=e.Cartesian4.divideByScalar(d,e.Cartesian3.magnitude(u),d),i.fromCartesian4(d,t)},i.clone=function(n,a){return t.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new i(n.normal,n.distance)},i.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},i.ORIGIN_XY_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Y,0)),n.Plane=i}));
1
+ define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./defaultValue-81eec7ed","./ComponentDatatype-a15c9a19"],(function(n,e,a,t,r){"use strict";function i(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}i.fromPointNormal=function(n,a,r){const s=-e.Cartesian3.dot(a,n);return t.defined(r)?(e.Cartesian3.clone(a,r.normal),r.distance=s,r):new i(a,s)};const s=new e.Cartesian3;i.fromCartesian4=function(n,a){const r=e.Cartesian3.fromCartesian4(n,s),o=n.w;return t.defined(a)?(e.Cartesian3.clone(r,a.normal),a.distance=o,a):new i(r,o)},i.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const o=new e.Cartesian3;i.projectPointOntoPlane=function(n,a,r){t.defined(r)||(r=new e.Cartesian3);const s=i.getPointDistance(n,a),c=e.Cartesian3.multiplyByScalar(n.normal,s,o);return e.Cartesian3.subtract(a,c,r)};const c=new e.Matrix4,l=new e.Cartesian4,d=new e.Cartesian3;i.transform=function(n,a,t){const r=n.normal,s=n.distance,o=e.Matrix4.inverseTranspose(a,c);let C=e.Cartesian4.fromElements(r.x,r.y,r.z,s,l);C=e.Matrix4.multiplyByVector(o,C,C);const u=e.Cartesian3.fromCartesian4(C,d);return C=e.Cartesian4.divideByScalar(C,e.Cartesian3.magnitude(u),C),i.fromCartesian4(C,t)},i.clone=function(n,a){return t.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new i(n.normal,n.distance)},i.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},i.ORIGIN_XY_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(new i(e.Cartesian3.UNIT_Y,0)),n.Plane=i}));
@@ -1 +1 @@
1
- define(["exports","./ArcType-fc72c06c","./arrayRemoveDuplicates-dc2f4046","./Matrix2-37e55508","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./EllipsoidRhumbLine-125a8b72","./GeometryAttribute-3915ea0b","./GeometryAttributes-32b29525","./GeometryPipeline-e0eb4567","./IndexDatatype-f1dcdf35","./PolygonPipeline-7b8e4643","./Transforms-eb5c1a84"],(function(e,t,n,i,o,r,a,s,c,l,u,h,f){"use strict";function p(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(p.prototype,{length:{get:function(){return this._length}}}),p.prototype.enqueue=function(e){this._array.push(e),this._length++},p.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},p.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},p.prototype.contains=function(e){return-1!==this._array.indexOf(e)},p.prototype.clear=function(){this._array.length=this._offset=this._length=0},p.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const d={computeHierarchyPackedLength:function(e){let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(!r.defined(e))continue;t+=2;const o=e.positions,a=e.holes;if(r.defined(o)&&(t+=o.length*i.Cartesian3.packedLength),r.defined(a)){const e=a.length;for(let t=0;t<e;++t)n.push(a[t])}}return t},packPolygonHierarchy:function(e,t,n){const o=[e];for(;o.length>0;){const e=o.pop();if(!r.defined(e))continue;const a=e.positions,s=e.holes;if(t[n++]=r.defined(a)?a.length:0,t[n++]=r.defined(s)?s.length:0,r.defined(a)){const e=a.length;for(let o=0;o<e;++o,n+=3)i.Cartesian3.pack(a[o],t,n)}if(r.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t){const n=e[t++],o=e[t++],r=new Array(n),a=o>0?new Array(o):void 0;for(let o=0;o<n;++o,t+=i.Cartesian3.packedLength)r[o]=i.Cartesian3.unpack(e,t);for(let n=0;n<o;++n)a[n]=d.unpackPolygonHierarchy(e,t),t=a[n].startingIndex,delete a[n].startingIndex;return{positions:r,holes:a,startingIndex:t}}},y=new i.Cartesian3;function g(e,t,n,o){return i.Cartesian3.subtract(t,e,y),i.Cartesian3.multiplyByScalar(y,n/o,y),i.Cartesian3.add(e,y,y),[y.x,y.y,y.z]}d.subdivideLineCount=function(e,t,n){const r=i.Cartesian3.distance(e,t)/n,a=Math.max(0,Math.ceil(o.CesiumMath.log2(r)));return Math.pow(2,a)};const m=new i.Cartographic,C=new i.Cartographic,b=new i.Cartographic,T=new i.Cartesian3;d.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,m),s=e.cartesianToCartographic(n,C),c=new a.EllipsoidRhumbLine(r,s,e).surfaceDistance/i,l=Math.max(0,Math.ceil(o.CesiumMath.log2(c)));return Math.pow(2,l)},d.subdivideLine=function(e,t,n,o){const a=d.subdivideLineCount(e,t,n),s=i.Cartesian3.distance(e,t),c=s/a;r.defined(o)||(o=[]);const l=o;l.length=3*a;let u=0;for(let n=0;n<a;n++){const i=g(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},d.subdivideRhumbLine=function(e,t,n,i,s){const c=e.cartesianToCartographic(t,m),l=e.cartesianToCartographic(n,C),u=new a.EllipsoidRhumbLine(c,l,e),h=u.surfaceDistance/i,f=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),p=Math.pow(2,f),d=u.surfaceDistance/p;r.defined(s)||(s=[]);const y=s;y.length=3*p;let g=0;for(let t=0;t<p;t++){const n=u.interpolateUsingSurfaceDistance(t*d,b),i=e.cartographicToCartesian(n,T);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const w=new i.Cartesian3,I=new i.Cartesian3,x=new i.Cartesian3,v=new i.Cartesian3;d.scaleToGeodeticHeightExtruded=function(e,t,n,o,a){o=r.defaultValue(o,i.Ellipsoid.WGS84);const s=w;let c=I;const l=x;let u=v;if(r.defined(e)&&r.defined(e.attributes)&&r.defined(e.attributes.position)){const r=e.attributes.position.values,h=r.length/2;for(let e=0;e<h;e+=3)i.Cartesian3.fromArray(r,e,l),o.geodeticSurfaceNormal(l,s),u=o.scaleToGeodeticSurface(l,u),c=i.Cartesian3.multiplyByScalar(s,n,c),c=i.Cartesian3.add(u,c,c),r[e+h]=c.x,r[e+1+h]=c.y,r[e+2+h]=c.z,a&&(u=i.Cartesian3.clone(l,u)),c=i.Cartesian3.multiplyByScalar(s,t,c),c=i.Cartesian3.add(u,c,c),r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return e},d.polygonOutlinesFromHierarchy=function(e,t,o){const a=[],s=new p;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)o.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,i.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const f=e.holes?e.holes.length:0;for(c=0;c<f;c++){const h=e.holes[c];let f=h.positions;if(t)for(u=f.length,l=0;l<u;++l)o.scaleToGeodeticSurface(f[l],f[l]);if(f=n.arrayRemoveDuplicates(f,i.Cartesian3.equalsEpsilon,!0),f.length<3)continue;a.push(f);let p=0;for(r.defined(h.holes)&&(p=h.holes.length),l=0;l<p;l++)s.enqueue(h.holes[l])}a.push(h)}return a},d.polygonsFromHierarchy=function(e,t,o,a){const s=[],c=[],l=new p;for(l.enqueue(e);0!==l.length;){const e=l.dequeue();let u=e.positions;const f=e.holes;let p,d;if(o)for(d=u.length,p=0;p<d;p++)a.scaleToGeodeticSurface(u[p],u[p]);if(u=n.arrayRemoveDuplicates(u,i.Cartesian3.equalsEpsilon,!0),u.length<3)continue;let y=t(u);if(!r.defined(y))continue;const g=[];let m=h.PolygonPipeline.computeWindingOrder2D(y);m===h.WindingOrder.CLOCKWISE&&(y.reverse(),u=u.slice().reverse());let C=u.slice();const b=r.defined(f)?f.length:0,T=[];let w;for(p=0;p<b;p++){const e=f[p];let s=e.positions;if(o)for(d=s.length,w=0;w<d;++w)a.scaleToGeodeticSurface(s[w],s[w]);if(s=n.arrayRemoveDuplicates(s,i.Cartesian3.equalsEpsilon,!0),s.length<3)continue;const c=t(s);if(!r.defined(c))continue;m=h.PolygonPipeline.computeWindingOrder2D(c),m===h.WindingOrder.CLOCKWISE&&(c.reverse(),s=s.slice().reverse()),T.push(s),g.push(C.length),C=C.concat(s),y=y.concat(c);let u=0;for(r.defined(e.holes)&&(u=e.holes.length),w=0;w<u;w++)l.enqueue(e.holes[w])}s.push({outerRing:u,holes:T}),c.push({positions:C,positions2D:y,holes:g})}return{hierarchy:s,polygons:c}};const E=new i.Cartesian2,A=new i.Cartesian3,P=new f.Quaternion,_=new i.Matrix3;d.computeBoundingRectangle=function(e,t,n,o,a){const s=f.Quaternion.fromAxisAngle(e,o,P),c=i.Matrix3.fromQuaternion(s,_);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const o=i.Cartesian3.clone(n[e],A);i.Matrix3.multiplyByVector(c,o,o);const a=t(o,E);r.defined(a)&&(l=Math.min(l,a.x),u=Math.max(u,a.x),h=Math.min(h,a.y),p=Math.max(p,a.y))}return a.x=l,a.y=h,a.width=u-l,a.height=p-h,a},d.createGeometryFromPositions=function(e,n,i,r,a,c){let u=h.PolygonPipeline.triangulate(n.positions2D,n.holes);u.length<3&&(u=[0,1,2]);const f=n.positions;if(r){const e=f.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=f[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const i=new s.Geometry({attributes:{position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:u,primitiveType:s.PrimitiveType.TRIANGLES});return a.normal?l.GeometryPipeline.computeNormal(i):i}return c===t.ArcType.GEODESIC?h.PolygonPipeline.computeSubdivision(e,f,u,i):c===t.ArcType.RHUMB?h.PolygonPipeline.computeRhumbLineSubdivision(e,f,u,i):void 0};const G=[],L=new i.Cartesian3,M=new i.Cartesian3;d.computeWallGeometry=function(e,n,r,a,l){let h,f,p,y,g,m=e.length,C=0;if(a)for(f=3*m*2,h=new Array(2*f),p=0;p<m;p++)y=e[p],g=e[(p+1)%m],h[C]=h[C+f]=y.x,++C,h[C]=h[C+f]=y.y,++C,h[C]=h[C+f]=y.z,++C,h[C]=h[C+f]=g.x,++C,h[C]=h[C+f]=g.y,++C,h[C]=h[C+f]=g.z,++C;else{const i=o.CesiumMath.chordLength(r,n.maximumRadius);let a=0;if(l===t.ArcType.GEODESIC)for(p=0;p<m;p++)a+=d.subdivideLineCount(e[p],e[(p+1)%m],i);else if(l===t.ArcType.RHUMB)for(p=0;p<m;p++)a+=d.subdivideRhumbLineCount(n,e[p],e[(p+1)%m],i);for(f=3*(a+m),h=new Array(2*f),p=0;p<m;p++){let o;y=e[p],g=e[(p+1)%m],l===t.ArcType.GEODESIC?o=d.subdivideLine(y,g,i,G):l===t.ArcType.RHUMB&&(o=d.subdivideRhumbLine(n,y,g,i,G));const r=o.length;for(let e=0;e<r;++e,++C)h[C]=o[e],h[C+f]=o[e];h[C]=g.x,h[C+f]=g.x,++C,h[C]=g.y,h[C+f]=g.y,++C,h[C]=g.z,h[C+f]=g.z,++C}}m=h.length;const b=u.IndexDatatype.createTypedArray(m/3,m-6*e.length);let T=0;for(m/=6,p=0;p<m;p++){const e=p,t=e+1,n=e+m,r=n+1;y=i.Cartesian3.fromArray(h,3*e,L),g=i.Cartesian3.fromArray(h,3*t,M),i.Cartesian3.equalsEpsilon(y,g,o.CesiumMath.EPSILON10,o.CesiumMath.EPSILON10)||(b[T++]=e,b[T++]=n,b[T++]=t,b[T++]=t,b[T++]=n,b[T++]=r)}return new s.Geometry({attributes:new c.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h})}),indices:b,primitiveType:s.PrimitiveType.TRIANGLES})},e.PolygonGeometryLibrary=d}));
1
+ define(["exports","./ArcType-fc72c06c","./arrayRemoveDuplicates-dc2f4046","./Matrix2-47e98d76","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./EllipsoidRhumbLine-6145377b","./GeometryAttribute-89a520b9","./GeometryAttributes-32b29525","./GeometryPipeline-309fad76","./IndexDatatype-f1dcdf35","./PolygonPipeline-a934c4dd","./Transforms-c8cb8f43"],(function(e,t,n,i,o,r,a,s,c,l,u,h,f){"use strict";function p(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(p.prototype,{length:{get:function(){return this._length}}}),p.prototype.enqueue=function(e){this._array.push(e),this._length++},p.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},p.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},p.prototype.contains=function(e){return-1!==this._array.indexOf(e)},p.prototype.clear=function(){this._array.length=this._offset=this._length=0},p.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const d={computeHierarchyPackedLength:function(e){let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(!r.defined(e))continue;t+=2;const o=e.positions,a=e.holes;if(r.defined(o)&&(t+=o.length*i.Cartesian3.packedLength),r.defined(a)){const e=a.length;for(let t=0;t<e;++t)n.push(a[t])}}return t},packPolygonHierarchy:function(e,t,n){const o=[e];for(;o.length>0;){const e=o.pop();if(!r.defined(e))continue;const a=e.positions,s=e.holes;if(t[n++]=r.defined(a)?a.length:0,t[n++]=r.defined(s)?s.length:0,r.defined(a)){const e=a.length;for(let o=0;o<e;++o,n+=3)i.Cartesian3.pack(a[o],t,n)}if(r.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t){const n=e[t++],o=e[t++],r=new Array(n),a=o>0?new Array(o):void 0;for(let o=0;o<n;++o,t+=i.Cartesian3.packedLength)r[o]=i.Cartesian3.unpack(e,t);for(let n=0;n<o;++n)a[n]=d.unpackPolygonHierarchy(e,t),t=a[n].startingIndex,delete a[n].startingIndex;return{positions:r,holes:a,startingIndex:t}}},y=new i.Cartesian3;function g(e,t,n,o){return i.Cartesian3.subtract(t,e,y),i.Cartesian3.multiplyByScalar(y,n/o,y),i.Cartesian3.add(e,y,y),[y.x,y.y,y.z]}d.subdivideLineCount=function(e,t,n){const r=i.Cartesian3.distance(e,t)/n,a=Math.max(0,Math.ceil(o.CesiumMath.log2(r)));return Math.pow(2,a)};const m=new i.Cartographic,C=new i.Cartographic,b=new i.Cartographic,T=new i.Cartesian3;d.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,m),s=e.cartesianToCartographic(n,C),c=new a.EllipsoidRhumbLine(r,s,e).surfaceDistance/i,l=Math.max(0,Math.ceil(o.CesiumMath.log2(c)));return Math.pow(2,l)},d.subdivideLine=function(e,t,n,o){const a=d.subdivideLineCount(e,t,n),s=i.Cartesian3.distance(e,t),c=s/a;r.defined(o)||(o=[]);const l=o;l.length=3*a;let u=0;for(let n=0;n<a;n++){const i=g(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},d.subdivideRhumbLine=function(e,t,n,i,s){const c=e.cartesianToCartographic(t,m),l=e.cartesianToCartographic(n,C),u=new a.EllipsoidRhumbLine(c,l,e),h=u.surfaceDistance/i,f=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),p=Math.pow(2,f),d=u.surfaceDistance/p;r.defined(s)||(s=[]);const y=s;y.length=3*p;let g=0;for(let t=0;t<p;t++){const n=u.interpolateUsingSurfaceDistance(t*d,b),i=e.cartographicToCartesian(n,T);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const w=new i.Cartesian3,I=new i.Cartesian3,x=new i.Cartesian3,v=new i.Cartesian3;d.scaleToGeodeticHeightExtruded=function(e,t,n,o,a){o=r.defaultValue(o,i.Ellipsoid.WGS84);const s=w;let c=I;const l=x;let u=v;if(r.defined(e)&&r.defined(e.attributes)&&r.defined(e.attributes.position)){const r=e.attributes.position.values,h=r.length/2;for(let e=0;e<h;e+=3)i.Cartesian3.fromArray(r,e,l),o.geodeticSurfaceNormal(l,s),u=o.scaleToGeodeticSurface(l,u),c=i.Cartesian3.multiplyByScalar(s,n,c),c=i.Cartesian3.add(u,c,c),r[e+h]=c.x,r[e+1+h]=c.y,r[e+2+h]=c.z,a&&(u=i.Cartesian3.clone(l,u)),c=i.Cartesian3.multiplyByScalar(s,t,c),c=i.Cartesian3.add(u,c,c),r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return e},d.polygonOutlinesFromHierarchy=function(e,t,o){const a=[],s=new p;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)o.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,i.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const f=e.holes?e.holes.length:0;for(c=0;c<f;c++){const h=e.holes[c];let f=h.positions;if(t)for(u=f.length,l=0;l<u;++l)o.scaleToGeodeticSurface(f[l],f[l]);if(f=n.arrayRemoveDuplicates(f,i.Cartesian3.equalsEpsilon,!0),f.length<3)continue;a.push(f);let p=0;for(r.defined(h.holes)&&(p=h.holes.length),l=0;l<p;l++)s.enqueue(h.holes[l])}a.push(h)}return a},d.polygonsFromHierarchy=function(e,t,o,a){const s=[],c=[],l=new p;for(l.enqueue(e);0!==l.length;){const e=l.dequeue();let u=e.positions;const f=e.holes;let p,d;if(o)for(d=u.length,p=0;p<d;p++)a.scaleToGeodeticSurface(u[p],u[p]);if(u=n.arrayRemoveDuplicates(u,i.Cartesian3.equalsEpsilon,!0),u.length<3)continue;let y=t(u);if(!r.defined(y))continue;const g=[];let m=h.PolygonPipeline.computeWindingOrder2D(y);m===h.WindingOrder.CLOCKWISE&&(y.reverse(),u=u.slice().reverse());let C=u.slice();const b=r.defined(f)?f.length:0,T=[];let w;for(p=0;p<b;p++){const e=f[p];let s=e.positions;if(o)for(d=s.length,w=0;w<d;++w)a.scaleToGeodeticSurface(s[w],s[w]);if(s=n.arrayRemoveDuplicates(s,i.Cartesian3.equalsEpsilon,!0),s.length<3)continue;const c=t(s);if(!r.defined(c))continue;m=h.PolygonPipeline.computeWindingOrder2D(c),m===h.WindingOrder.CLOCKWISE&&(c.reverse(),s=s.slice().reverse()),T.push(s),g.push(C.length),C=C.concat(s),y=y.concat(c);let u=0;for(r.defined(e.holes)&&(u=e.holes.length),w=0;w<u;w++)l.enqueue(e.holes[w])}s.push({outerRing:u,holes:T}),c.push({positions:C,positions2D:y,holes:g})}return{hierarchy:s,polygons:c}};const E=new i.Cartesian2,A=new i.Cartesian3,P=new f.Quaternion,_=new i.Matrix3;d.computeBoundingRectangle=function(e,t,n,o,a){const s=f.Quaternion.fromAxisAngle(e,o,P),c=i.Matrix3.fromQuaternion(s,_);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const o=i.Cartesian3.clone(n[e],A);i.Matrix3.multiplyByVector(c,o,o);const a=t(o,E);r.defined(a)&&(l=Math.min(l,a.x),u=Math.max(u,a.x),h=Math.min(h,a.y),p=Math.max(p,a.y))}return a.x=l,a.y=h,a.width=u-l,a.height=p-h,a},d.createGeometryFromPositions=function(e,n,i,r,a,c){let u=h.PolygonPipeline.triangulate(n.positions2D,n.holes);u.length<3&&(u=[0,1,2]);const f=n.positions;if(r){const e=f.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=f[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const i=new s.Geometry({attributes:{position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:u,primitiveType:s.PrimitiveType.TRIANGLES});return a.normal?l.GeometryPipeline.computeNormal(i):i}return c===t.ArcType.GEODESIC?h.PolygonPipeline.computeSubdivision(e,f,u,i):c===t.ArcType.RHUMB?h.PolygonPipeline.computeRhumbLineSubdivision(e,f,u,i):void 0};const G=[],L=new i.Cartesian3,M=new i.Cartesian3;d.computeWallGeometry=function(e,n,r,a,l){let h,f,p,y,g,m=e.length,C=0;if(a)for(f=3*m*2,h=new Array(2*f),p=0;p<m;p++)y=e[p],g=e[(p+1)%m],h[C]=h[C+f]=y.x,++C,h[C]=h[C+f]=y.y,++C,h[C]=h[C+f]=y.z,++C,h[C]=h[C+f]=g.x,++C,h[C]=h[C+f]=g.y,++C,h[C]=h[C+f]=g.z,++C;else{const i=o.CesiumMath.chordLength(r,n.maximumRadius);let a=0;if(l===t.ArcType.GEODESIC)for(p=0;p<m;p++)a+=d.subdivideLineCount(e[p],e[(p+1)%m],i);else if(l===t.ArcType.RHUMB)for(p=0;p<m;p++)a+=d.subdivideRhumbLineCount(n,e[p],e[(p+1)%m],i);for(f=3*(a+m),h=new Array(2*f),p=0;p<m;p++){let o;y=e[p],g=e[(p+1)%m],l===t.ArcType.GEODESIC?o=d.subdivideLine(y,g,i,G):l===t.ArcType.RHUMB&&(o=d.subdivideRhumbLine(n,y,g,i,G));const r=o.length;for(let e=0;e<r;++e,++C)h[C]=o[e],h[C+f]=o[e];h[C]=g.x,h[C+f]=g.x,++C,h[C]=g.y,h[C+f]=g.y,++C,h[C]=g.z,h[C+f]=g.z,++C}}m=h.length;const b=u.IndexDatatype.createTypedArray(m/3,m-6*e.length);let T=0;for(m/=6,p=0;p<m;p++){const e=p,t=e+1,n=e+m,r=n+1;y=i.Cartesian3.fromArray(h,3*e,L),g=i.Cartesian3.fromArray(h,3*t,M),i.Cartesian3.equalsEpsilon(y,g,o.CesiumMath.EPSILON10,o.CesiumMath.EPSILON10)||(b[T++]=e,b[T++]=n,b[T++]=t,b[T++]=t,b[T++]=n,b[T++]=r)}return new s.Geometry({attributes:new c.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h})}),indices:b,primitiveType:s.PrimitiveType.TRIANGLES})},e.PolygonGeometryLibrary=d}));
@@ -1 +1 @@
1
- define(["exports","./Matrix2-37e55508","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./EllipsoidRhumbLine-125a8b72","./GeometryAttribute-3915ea0b","./WebGLConstants-508b9636"],(function(e,t,n,r,i,a,u,x){"use strict";var o=p,s=p;function p(e,t,n){n=n||2;var r,i,a,u,x,o,s,p=t&&t.length,f=p?t[0]*n:e.length,c=l(e,0,f,n,!0),v=[];if(!c||c.next===c.prev)return v;if(p&&(c=function(e,t,n,r){var i,a,u,x=[];for(i=0,a=t.length;i<a;i++)(u=l(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),x.push(b(u));for(x.sort(m),i=0;i<x.length;i++)n=h(n=C(x[i],n),n.next);return n}(e,t,c,n)),e.length>80*n){r=a=e[0],i=u=e[1];for(var d=n;d<f;d+=n)(x=e[d])<r&&(r=x),(o=e[d+1])<i&&(i=o),x>a&&(a=x),o>u&&(u=o);s=0!==(s=Math.max(a-r,u-i))?1/s:0}return y(c,v,n,r,i,s),v}function l(e,t,n,r,i){var a,u;if(i===W(e,t,n,r)>0)for(a=t;a<n;a+=r)u=G(a,e[a],e[a+1],u);else for(a=n-r;a>=t;a-=r)u=G(a,e[a],e[a+1],u);return u&&S(u,u.next)&&(O(u),u=u.next),u}function h(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!S(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(O(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,i,a,u){if(e){!u&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=w(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,u,x,o,s=1;do{for(n=e,e=null,a=null,u=0;n;){for(u++,r=n,x=0,t=0;t<s&&(x++,r=r.nextZ);t++);for(o=s;x>0||o>0&&r;)0!==x&&(0===o||!r||n.z<=r.z)?(i=n,n=n.nextZ,x--):(i=r,r=r.nextZ,o--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,s*=2}while(u>1)}(i)}(e,r,i,a);for(var x,o,s=e;e.prev!==e.next;)if(x=e.prev,o=e.next,a?c(e,r,i,a):f(e))t.push(x.i/n),t.push(e.i/n),t.push(o.i/n),O(e),e=o.next,s=o.next;else if((e=o)===s){u?1===u?y(e=v(h(e),t,n),t,n,r,i,a,2):2===u&&d(e,t,n,r,i,a):y(h(e),t,n,r,i,a,1);break}}}function f(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(E(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Z(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function c(e,t,n,r){var i=e.prev,a=e,u=e.next;if(Z(i,a,u)>=0)return!1;for(var x=i.x<a.x?i.x<u.x?i.x:u.x:a.x<u.x?a.x:u.x,o=i.y<a.y?i.y<u.y?i.y:u.y:a.y<u.y?a.y:u.y,s=i.x>a.x?i.x>u.x?i.x:u.x:a.x>u.x?a.x:u.x,p=i.y>a.y?i.y>u.y?i.y:u.y:a.y>u.y?a.y:u.y,l=w(x,o,t,n,r),h=w(s,p,t,n,r),y=e.prevZ,f=e.nextZ;y&&y.z>=l&&f&&f.z<=h;){if(y!==e.prev&&y!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,f!==e.prev&&f!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,f.x,f.y)&&Z(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;y&&y.z>=l;){if(y!==e.prev&&y!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,f.x,f.y)&&Z(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function v(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!S(i,a)&&A(i,r,r.next,a)&&L(i,a)&&L(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return h(r)}function d(e,t,n,r,i,a){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&M(u,x)){var o=D(u,x);return u=h(u,u.next),o=h(o,o.next),y(u,t,n,r,i,a),void y(o,t,n,r,i,a)}x=x.next}u=u.next}while(u!==e)}function m(e,t){return e.x-t.x}function C(e,t){var n=function(e,t){var n,r=t,i=e.x,a=e.y,u=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var x=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=i&&x>u){if(u=x,x===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===u)return n;var o,s=n,p=n.x,l=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=p&&i!==r.x&&E(a<l?i:u,a,p,l,a<l?u:i,a,r.x,r.y)&&(o=Math.abs(a-r.y)/(i-r.x),L(r,e)&&(o<h||o===h&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,h=o)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=D(n,e),i=h(n,n.next);return h(r,r.next),t===n?i:t}function g(e,t){return Z(e.prev,e,t.prev)<0&&Z(t.next,e,e.next)<0}function w(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function b(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function E(e,t,n,r,i,a,u,x){return(i-u)*(t-x)-(e-u)*(a-x)>=0&&(e-u)*(r-x)-(n-u)*(t-x)>=0&&(n-u)*(a-x)-(i-u)*(r-x)>=0}function M(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(L(e,t)&&L(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Z(e.prev,e,t.prev)||Z(e,t.prev,t))||S(e,t)&&Z(e.prev,e,e.next)>0&&Z(t.prev,t,t.next)>0)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var i=R(Z(e,t,n)),a=R(Z(e,t,r)),u=R(Z(n,r,e)),x=R(Z(n,r,t));return i!==a&&u!==x||(!(0!==i||!z(e,n,t))||(!(0!==a||!z(e,r,t))||(!(0!==u||!z(n,e,r))||!(0!==x||!z(n,t,r)))))}function z(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function R(e){return e>0?1:e<0?-1:0}function L(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function D(e,t){var n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function G(e,t,n,r){var i=new T(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function W(e,t,n,r){for(var i=0,a=t,u=n-r;a<n;a+=r)i+=(e[u]-e[a])*(e[a+1]+e[u+1]),u=a;return i}p.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,u=Math.abs(W(e,0,a,n));if(i)for(var x=0,o=t.length;x<o;x++){var s=t[x]*n,p=x<o-1?t[x+1]*n:e.length;u-=Math.abs(W(e,s,p,n))}var l=0;for(x=0;x<r.length;x+=3){var h=r[x]*n,y=r[x+1]*n,f=r[x+2]*n;l+=Math.abs((e[h]-e[f])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[f+1]-e[h+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},p.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var u=0;u<t;u++)n.vertices.push(e[i][a][u]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},o.default=s;const $={CLOCKWISE:x.WebGLConstants.CW,COUNTER_CLOCKWISE:x.WebGLConstants.CCW,validate:function(e){return e===$.CLOCKWISE||e===$.COUNTER_CLOCKWISE}};var P=Object.freeze($);const I=new t.Cartesian3,B=new t.Cartesian3,N={computeArea2D:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++){const t=e[r],a=e[i];n+=t.x*a.y-a.x*t.y}return.5*n},computeWindingOrder2D:function(e){return N.computeArea2D(e)>0?P.COUNTER_CLOCKWISE:P.CLOCKWISE},triangulate:function(e,n){const r=t.Cartesian2.packArray(e);return o(r,n,2)}},U=new t.Cartesian3,_=new t.Cartesian3,K=new t.Cartesian3,V=new t.Cartesian3,k=new t.Cartesian3,q=new t.Cartesian3,F=new t.Cartesian3;N.computeSubdivision=function(e,n,a,x){x=i.defaultValue(x,r.CesiumMath.RADIANS_PER_DEGREE);const o=a.slice(0);let s;const p=n.length,l=new Array(3*p);let h=0;for(s=0;s<p;s++){const e=n[s];l[h++]=e.x,l[h++]=e.y,l[h++]=e.z}const y=[],f={},c=e.maximumRadius,v=r.CesiumMath.chordLength(x,c),d=v*v;for(;o.length>0;){const e=o.pop(),n=o.pop(),r=o.pop(),a=t.Cartesian3.fromArray(l,3*r,U),u=t.Cartesian3.fromArray(l,3*n,_),x=t.Cartesian3.fromArray(l,3*e,K),p=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(a,V),c,V),h=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(u,k),c,k),v=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(x,q),c,q),m=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(p,h,F)),C=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(h,v,F)),g=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(v,p,F)),w=Math.max(m,C,g);let b,E;w>d?m===w?(b=`${Math.min(r,n)} ${Math.max(r,n)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(a,u,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(r,s,e),o.push(s,n,e)):C===w?(b=`${Math.min(n,e)} ${Math.max(n,e)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(u,x,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(n,s,r),o.push(s,e,r)):g===w&&(b=`${Math.min(e,r)} ${Math.max(e,r)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(x,a,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(e,s,n),o.push(s,r,n)):(y.push(r),y.push(n),y.push(e))}return new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},indices:y,primitiveType:u.PrimitiveType.TRIANGLES})};const j=new t.Cartographic,H=new t.Cartographic,J=new t.Cartographic,Q=new t.Cartographic;N.computeRhumbLineSubdivision=function(e,n,x,o){o=i.defaultValue(o,r.CesiumMath.RADIANS_PER_DEGREE);const s=x.slice(0);let p;const l=n.length,h=new Array(3*l);let y=0;for(p=0;p<l;p++){const e=n[p];h[y++]=e.x,h[y++]=e.y,h[y++]=e.z}const f=[],c={},v=e.maximumRadius,d=r.CesiumMath.chordLength(o,v),m=new a.EllipsoidRhumbLine(void 0,void 0,e),C=new a.EllipsoidRhumbLine(void 0,void 0,e),g=new a.EllipsoidRhumbLine(void 0,void 0,e);for(;s.length>0;){const n=s.pop(),r=s.pop(),a=s.pop(),u=t.Cartesian3.fromArray(h,3*a,U),x=t.Cartesian3.fromArray(h,3*r,_),o=t.Cartesian3.fromArray(h,3*n,K),l=e.cartesianToCartographic(u,j),y=e.cartesianToCartographic(x,H),v=e.cartesianToCartographic(o,J);m.setEndPoints(l,y);const w=m.surfaceDistance;C.setEndPoints(y,v);const b=C.surfaceDistance;g.setEndPoints(v,l);const E=g.surfaceDistance,M=Math.max(w,b,E);let Z,S,A,z;M>d?w===M?(Z=`${Math.min(a,r)} ${Math.max(a,r)}`,p=c[Z],i.defined(p)||(S=m.interpolateUsingFraction(.5,Q),A=.5*(l.height+y.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(a,p,n),s.push(p,r,n)):b===M?(Z=`${Math.min(r,n)} ${Math.max(r,n)}`,p=c[Z],i.defined(p)||(S=C.interpolateUsingFraction(.5,Q),A=.5*(y.height+v.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(r,p,a),s.push(p,n,a)):E===M&&(Z=`${Math.min(n,a)} ${Math.max(n,a)}`,p=c[Z],i.defined(p)||(S=g.interpolateUsingFraction(.5,Q),A=.5*(v.height+l.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(n,p,r),s.push(p,a,r)):(f.push(a),f.push(r),f.push(n))}return new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h})},indices:f,primitiveType:u.PrimitiveType.TRIANGLES})},N.scaleToGeodeticHeight=function(e,n,r,a){r=i.defaultValue(r,t.Ellipsoid.WGS84);let u=I,x=B;if(n=i.defaultValue(n,0),a=i.defaultValue(a,!0),i.defined(e)){const i=e.length;for(let o=0;o<i;o+=3)t.Cartesian3.fromArray(e,o,x),a&&(x=r.scaleToGeodeticSurface(x,x)),0!==n&&(u=r.geodeticSurfaceNormal(x,u),t.Cartesian3.multiplyByScalar(u,n,u),t.Cartesian3.add(x,u,x)),e[o]=x.x,e[o+1]=x.y,e[o+2]=x.z}return e},e.PolygonPipeline=N,e.WindingOrder=P}));
1
+ define(["exports","./Matrix2-47e98d76","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./defaultValue-81eec7ed","./EllipsoidRhumbLine-6145377b","./GeometryAttribute-89a520b9","./WebGLConstants-508b9636"],(function(e,t,n,r,i,a,u,x){"use strict";var o=p,s=p;function p(e,t,n){n=n||2;var r,i,a,u,x,o,s,p=t&&t.length,f=p?t[0]*n:e.length,c=l(e,0,f,n,!0),v=[];if(!c||c.next===c.prev)return v;if(p&&(c=function(e,t,n,r){var i,a,u,x=[];for(i=0,a=t.length;i<a;i++)(u=l(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),x.push(b(u));for(x.sort(m),i=0;i<x.length;i++)n=h(n=C(x[i],n),n.next);return n}(e,t,c,n)),e.length>80*n){r=a=e[0],i=u=e[1];for(var d=n;d<f;d+=n)(x=e[d])<r&&(r=x),(o=e[d+1])<i&&(i=o),x>a&&(a=x),o>u&&(u=o);s=0!==(s=Math.max(a-r,u-i))?1/s:0}return y(c,v,n,r,i,s),v}function l(e,t,n,r,i){var a,u;if(i===W(e,t,n,r)>0)for(a=t;a<n;a+=r)u=G(a,e[a],e[a+1],u);else for(a=n-r;a>=t;a-=r)u=G(a,e[a],e[a+1],u);return u&&S(u,u.next)&&(O(u),u=u.next),u}function h(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!S(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(O(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function y(e,t,n,r,i,a,u){if(e){!u&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=w(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,u,x,o,s=1;do{for(n=e,e=null,a=null,u=0;n;){for(u++,r=n,x=0,t=0;t<s&&(x++,r=r.nextZ);t++);for(o=s;x>0||o>0&&r;)0!==x&&(0===o||!r||n.z<=r.z)?(i=n,n=n.nextZ,x--):(i=r,r=r.nextZ,o--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,s*=2}while(u>1)}(i)}(e,r,i,a);for(var x,o,s=e;e.prev!==e.next;)if(x=e.prev,o=e.next,a?c(e,r,i,a):f(e))t.push(x.i/n),t.push(e.i/n),t.push(o.i/n),O(e),e=o.next,s=o.next;else if((e=o)===s){u?1===u?y(e=v(h(e),t,n),t,n,r,i,a,2):2===u&&d(e,t,n,r,i,a):y(h(e),t,n,r,i,a,1);break}}}function f(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(E(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Z(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function c(e,t,n,r){var i=e.prev,a=e,u=e.next;if(Z(i,a,u)>=0)return!1;for(var x=i.x<a.x?i.x<u.x?i.x:u.x:a.x<u.x?a.x:u.x,o=i.y<a.y?i.y<u.y?i.y:u.y:a.y<u.y?a.y:u.y,s=i.x>a.x?i.x>u.x?i.x:u.x:a.x>u.x?a.x:u.x,p=i.y>a.y?i.y>u.y?i.y:u.y:a.y>u.y?a.y:u.y,l=w(x,o,t,n,r),h=w(s,p,t,n,r),y=e.prevZ,f=e.nextZ;y&&y.z>=l&&f&&f.z<=h;){if(y!==e.prev&&y!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,f!==e.prev&&f!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,f.x,f.y)&&Z(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;y&&y.z>=l;){if(y!==e.prev&&y!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&E(i.x,i.y,a.x,a.y,u.x,u.y,f.x,f.y)&&Z(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function v(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!S(i,a)&&A(i,r,r.next,a)&&L(i,a)&&L(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return h(r)}function d(e,t,n,r,i,a){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&M(u,x)){var o=D(u,x);return u=h(u,u.next),o=h(o,o.next),y(u,t,n,r,i,a),void y(o,t,n,r,i,a)}x=x.next}u=u.next}while(u!==e)}function m(e,t){return e.x-t.x}function C(e,t){var n=function(e,t){var n,r=t,i=e.x,a=e.y,u=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var x=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=i&&x>u){if(u=x,x===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===u)return n;var o,s=n,p=n.x,l=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=p&&i!==r.x&&E(a<l?i:u,a,p,l,a<l?u:i,a,r.x,r.y)&&(o=Math.abs(a-r.y)/(i-r.x),L(r,e)&&(o<h||o===h&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,h=o)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=D(n,e),i=h(n,n.next);return h(r,r.next),t===n?i:t}function g(e,t){return Z(e.prev,e,t.prev)<0&&Z(t.next,e,e.next)<0}function w(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function b(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function E(e,t,n,r,i,a,u,x){return(i-u)*(t-x)-(e-u)*(a-x)>=0&&(e-u)*(r-x)-(n-u)*(t-x)>=0&&(n-u)*(a-x)-(i-u)*(r-x)>=0}function M(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(L(e,t)&&L(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Z(e.prev,e,t.prev)||Z(e,t.prev,t))||S(e,t)&&Z(e.prev,e,e.next)>0&&Z(t.prev,t,t.next)>0)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var i=R(Z(e,t,n)),a=R(Z(e,t,r)),u=R(Z(n,r,e)),x=R(Z(n,r,t));return i!==a&&u!==x||(!(0!==i||!z(e,n,t))||(!(0!==a||!z(e,r,t))||(!(0!==u||!z(n,e,r))||!(0!==x||!z(n,t,r)))))}function z(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function R(e){return e>0?1:e<0?-1:0}function L(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function D(e,t){var n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function G(e,t,n,r){var i=new T(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function W(e,t,n,r){for(var i=0,a=t,u=n-r;a<n;a+=r)i+=(e[u]-e[a])*(e[a+1]+e[u+1]),u=a;return i}p.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,u=Math.abs(W(e,0,a,n));if(i)for(var x=0,o=t.length;x<o;x++){var s=t[x]*n,p=x<o-1?t[x+1]*n:e.length;u-=Math.abs(W(e,s,p,n))}var l=0;for(x=0;x<r.length;x+=3){var h=r[x]*n,y=r[x+1]*n,f=r[x+2]*n;l+=Math.abs((e[h]-e[f])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[f+1]-e[h+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},p.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var u=0;u<t;u++)n.vertices.push(e[i][a][u]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},o.default=s;const $={CLOCKWISE:x.WebGLConstants.CW,COUNTER_CLOCKWISE:x.WebGLConstants.CCW,validate:function(e){return e===$.CLOCKWISE||e===$.COUNTER_CLOCKWISE}};var P=Object.freeze($);const I=new t.Cartesian3,B=new t.Cartesian3,N={computeArea2D:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++){const t=e[r],a=e[i];n+=t.x*a.y-a.x*t.y}return.5*n},computeWindingOrder2D:function(e){return N.computeArea2D(e)>0?P.COUNTER_CLOCKWISE:P.CLOCKWISE},triangulate:function(e,n){const r=t.Cartesian2.packArray(e);return o(r,n,2)}},U=new t.Cartesian3,_=new t.Cartesian3,K=new t.Cartesian3,V=new t.Cartesian3,k=new t.Cartesian3,q=new t.Cartesian3,F=new t.Cartesian3;N.computeSubdivision=function(e,n,a,x){x=i.defaultValue(x,r.CesiumMath.RADIANS_PER_DEGREE);const o=a.slice(0);let s;const p=n.length,l=new Array(3*p);let h=0;for(s=0;s<p;s++){const e=n[s];l[h++]=e.x,l[h++]=e.y,l[h++]=e.z}const y=[],f={},c=e.maximumRadius,v=r.CesiumMath.chordLength(x,c),d=v*v;for(;o.length>0;){const e=o.pop(),n=o.pop(),r=o.pop(),a=t.Cartesian3.fromArray(l,3*r,U),u=t.Cartesian3.fromArray(l,3*n,_),x=t.Cartesian3.fromArray(l,3*e,K),p=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(a,V),c,V),h=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(u,k),c,k),v=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(x,q),c,q),m=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(p,h,F)),C=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(h,v,F)),g=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(v,p,F)),w=Math.max(m,C,g);let b,E;w>d?m===w?(b=`${Math.min(r,n)} ${Math.max(r,n)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(a,u,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(r,s,e),o.push(s,n,e)):C===w?(b=`${Math.min(n,e)} ${Math.max(n,e)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(u,x,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(n,s,r),o.push(s,e,r)):g===w&&(b=`${Math.min(e,r)} ${Math.max(e,r)}`,s=f[b],i.defined(s)||(E=t.Cartesian3.add(x,a,F),t.Cartesian3.multiplyByScalar(E,.5,E),l.push(E.x,E.y,E.z),s=l.length/3-1,f[b]=s),o.push(e,s,n),o.push(s,r,n)):(y.push(r),y.push(n),y.push(e))}return new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},indices:y,primitiveType:u.PrimitiveType.TRIANGLES})};const j=new t.Cartographic,H=new t.Cartographic,J=new t.Cartographic,Q=new t.Cartographic;N.computeRhumbLineSubdivision=function(e,n,x,o){o=i.defaultValue(o,r.CesiumMath.RADIANS_PER_DEGREE);const s=x.slice(0);let p;const l=n.length,h=new Array(3*l);let y=0;for(p=0;p<l;p++){const e=n[p];h[y++]=e.x,h[y++]=e.y,h[y++]=e.z}const f=[],c={},v=e.maximumRadius,d=r.CesiumMath.chordLength(o,v),m=new a.EllipsoidRhumbLine(void 0,void 0,e),C=new a.EllipsoidRhumbLine(void 0,void 0,e),g=new a.EllipsoidRhumbLine(void 0,void 0,e);for(;s.length>0;){const n=s.pop(),r=s.pop(),a=s.pop(),u=t.Cartesian3.fromArray(h,3*a,U),x=t.Cartesian3.fromArray(h,3*r,_),o=t.Cartesian3.fromArray(h,3*n,K),l=e.cartesianToCartographic(u,j),y=e.cartesianToCartographic(x,H),v=e.cartesianToCartographic(o,J);m.setEndPoints(l,y);const w=m.surfaceDistance;C.setEndPoints(y,v);const b=C.surfaceDistance;g.setEndPoints(v,l);const E=g.surfaceDistance,M=Math.max(w,b,E);let Z,S,A,z;M>d?w===M?(Z=`${Math.min(a,r)} ${Math.max(a,r)}`,p=c[Z],i.defined(p)||(S=m.interpolateUsingFraction(.5,Q),A=.5*(l.height+y.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(a,p,n),s.push(p,r,n)):b===M?(Z=`${Math.min(r,n)} ${Math.max(r,n)}`,p=c[Z],i.defined(p)||(S=C.interpolateUsingFraction(.5,Q),A=.5*(y.height+v.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(r,p,a),s.push(p,n,a)):E===M&&(Z=`${Math.min(n,a)} ${Math.max(n,a)}`,p=c[Z],i.defined(p)||(S=g.interpolateUsingFraction(.5,Q),A=.5*(v.height+l.height),z=t.Cartesian3.fromRadians(S.longitude,S.latitude,A,e,F),h.push(z.x,z.y,z.z),p=h.length/3-1,c[Z]=p),s.push(n,p,r),s.push(p,a,r)):(f.push(a),f.push(r),f.push(n))}return new u.Geometry({attributes:{position:new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:h})},indices:f,primitiveType:u.PrimitiveType.TRIANGLES})},N.scaleToGeodeticHeight=function(e,n,r,a){r=i.defaultValue(r,t.Ellipsoid.WGS84);let u=I,x=B;if(n=i.defaultValue(n,0),a=i.defaultValue(a,!0),i.defined(e)){const i=e.length;for(let o=0;o<i;o+=3)t.Cartesian3.fromArray(e,o,x),a&&(x=r.scaleToGeodeticSurface(x,x)),0!==n&&(u=r.geodeticSurfaceNormal(x,u),t.Cartesian3.multiplyByScalar(u,n,u),t.Cartesian3.add(x,u,x)),e[o]=x.x,e[o+1]=x.y,e[o+2]=x.z}return e},e.PolygonPipeline=N,e.WindingOrder=P}));
@@ -1 +1 @@
1
- define(["exports","./Matrix2-37e55508","./defaultValue-81eec7ed","./RuntimeError-8952249c","./EllipsoidGeodesic-cc3bace8","./EllipsoidRhumbLine-125a8b72","./IntersectionTests-ac2459de","./ComponentDatatype-a15c9a19","./Plane-6ee42cab"],(function(e,t,a,n,i,r,o,s,c){"use strict";const l={numberOfPoints:function(e,a,n){const i=t.Cartesian3.distance(e,a);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,a){const n=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(a*a))))}},u=new t.Cartographic;l.extractHeights=function(e,t){const a=e.length,n=new Array(a);for(let i=0;i<a;i++){const a=e[i];n[i]=t.cartesianToCartographic(a,u).height}return n};const h=new t.Matrix4,f=new t.Cartesian3,g=new t.Cartesian3,C=new c.Plane(t.Cartesian3.UNIT_X,0),p=new t.Cartesian3,d=new c.Plane(t.Cartesian3.UNIT_X,0),m=new t.Cartesian3,w=new t.Cartesian3,P=[];function T(e,t,a){const n=P;let i;if(n.length=e,t===a){for(i=0;i<e;i++)n[i]=t;return n}const r=(a-t)/e;for(i=0;i<e;i++){const e=t+i*r;n[i]=e}return n}const y=new t.Cartographic,A=new t.Cartographic,E=new t.Cartesian3,b=new t.Cartesian3,R=new t.Cartesian3,M=new i.EllipsoidGeodesic;let S=new r.EllipsoidRhumbLine;function D(e,a,n,i,r,o,s,c){const u=i.scaleToGeodeticSurface(e,b),h=i.scaleToGeodeticSurface(a,R),f=l.numberOfPoints(e,a,n),g=i.cartesianToCartographic(u,y),C=i.cartesianToCartographic(h,A),p=T(f,r,o);M.setEndPoints(g,C);const d=M.surfaceDistance/f;let m=c;g.height=r;let w=i.cartographicToCartesian(g,E);t.Cartesian3.pack(w,s,m),m+=3;for(let e=1;e<f;e++){const a=M.interpolateUsingSurfaceDistance(e*d,A);a.height=p[e],w=i.cartographicToCartesian(a,E),t.Cartesian3.pack(w,s,m),m+=3}return m}function x(e,a,n,i,o,s,c,u){const h=i.cartesianToCartographic(e,y),f=i.cartesianToCartographic(a,A),g=l.numberOfPointsRhumbLine(h,f,n);h.height=0,f.height=0;const C=T(g,o,s);S.ellipsoid.equals(i)||(S=new r.EllipsoidRhumbLine(void 0,void 0,i)),S.setEndPoints(h,f);const p=S.surfaceDistance/g;let d=u;h.height=o;let m=i.cartographicToCartesian(h,E);t.Cartesian3.pack(m,c,d),d+=3;for(let e=1;e<g;e++){const a=S.interpolateUsingSurfaceDistance(e*p,A);a.height=C[e],m=i.cartographicToCartesian(a,E),t.Cartesian3.pack(m,c,d),d+=3}return d}l.wrapLongitude=function(e,n){const i=[],r=[];if(a.defined(e)&&e.length>0){n=a.defaultValue(n,t.Matrix4.IDENTITY);const s=t.Matrix4.inverseTransformation(n,h),l=t.Matrix4.multiplyByPoint(s,t.Cartesian3.ZERO,f),u=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_Y,g),g),P=c.Plane.fromPointNormal(l,u,C),T=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_X,p),p),y=c.Plane.fromPointNormal(l,T,d);let A=1;i.push(t.Cartesian3.clone(e[0]));let E=i[0];const b=e.length;for(let n=1;n<b;++n){const s=e[n];if(c.Plane.getPointDistance(y,E)<0||c.Plane.getPointDistance(y,s)<0){const e=o.IntersectionTests.lineSegmentPlane(E,s,P,m);if(a.defined(e)){const a=t.Cartesian3.multiplyByScalar(u,5e-9,w);c.Plane.getPointDistance(P,E)<0&&t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),r.push(A+1),t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),A=1}}i.push(t.Cartesian3.clone(e[n])),A++,E=s}r.push(A)}return{positions:i,lengths:r}},l.generateArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let o=a.defaultValue(e.height,0);const c=Array.isArray(o);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],b);if(o=c?o[0]:o,0!==o){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,o,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}let u=e.minDistance;if(!a.defined(u)){const t=a.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);u=s.CesiumMath.chordLength(t,r.maximumRadius)}let h,f=0;for(h=0;h<i-1;h++)f+=l.numberOfPoints(n[h],n[h+1],u);const g=3*(f+1),C=new Array(g);let p=0;for(h=0;h<i-1;h++){p=D(n[h],n[h+1],u,r,c?o[h]:o,c?o[h+1]:o,C,p)}P.length=0;const d=n[i-1],m=r.cartesianToCartographic(d,y);m.height=c?o[i-1]:o;const w=r.cartographicToCartesian(m,E);return t.Cartesian3.pack(w,C,g-3),C};const N=new t.Cartographic,G=new t.Cartographic;l.generateRhumbArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let o=a.defaultValue(e.height,0);const c=Array.isArray(o);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],b);if(o=c?o[0]:o,0!==o){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,o,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}const u=a.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);let h,f,g=0,C=r.cartesianToCartographic(n[0],N);for(h=0;h<i-1;h++)f=r.cartesianToCartographic(n[h+1],G),g+=l.numberOfPointsRhumbLine(C,f,u),C=t.Cartographic.clone(f,N);const p=3*(g+1),d=new Array(p);let m=0;for(h=0;h<i-1;h++){m=x(n[h],n[h+1],u,r,c?o[h]:o,c?o[h+1]:o,d,m)}P.length=0;const w=n[i-1],T=r.cartesianToCartographic(w,y);T.height=c?o[i-1]:o;const A=r.cartographicToCartesian(T,E);return t.Cartesian3.pack(A,d,p-3),d},l.generateCartesianArc=function(e){const a=l.generateArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},l.generateCartesianRhumbArc=function(e){const a=l.generateRhumbArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},e.PolylinePipeline=l}));
1
+ define(["exports","./Matrix2-47e98d76","./defaultValue-81eec7ed","./RuntimeError-8952249c","./EllipsoidGeodesic-19e75e11","./EllipsoidRhumbLine-6145377b","./IntersectionTests-58aa8f80","./ComponentDatatype-a15c9a19","./Plane-3f01019d"],(function(e,t,a,n,i,r,o,s,c){"use strict";const l={numberOfPoints:function(e,a,n){const i=t.Cartesian3.distance(e,a);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,a){const n=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(a*a))))}},u=new t.Cartographic;l.extractHeights=function(e,t){const a=e.length,n=new Array(a);for(let i=0;i<a;i++){const a=e[i];n[i]=t.cartesianToCartographic(a,u).height}return n};const h=new t.Matrix4,f=new t.Cartesian3,g=new t.Cartesian3,C=new c.Plane(t.Cartesian3.UNIT_X,0),p=new t.Cartesian3,d=new c.Plane(t.Cartesian3.UNIT_X,0),m=new t.Cartesian3,w=new t.Cartesian3,P=[];function T(e,t,a){const n=P;let i;if(n.length=e,t===a){for(i=0;i<e;i++)n[i]=t;return n}const r=(a-t)/e;for(i=0;i<e;i++){const e=t+i*r;n[i]=e}return n}const y=new t.Cartographic,A=new t.Cartographic,E=new t.Cartesian3,R=new t.Cartesian3,b=new t.Cartesian3,M=new i.EllipsoidGeodesic;let S=new r.EllipsoidRhumbLine;function D(e,a,n,i,r,o,s,c){const u=i.scaleToGeodeticSurface(e,R),h=i.scaleToGeodeticSurface(a,b),f=l.numberOfPoints(e,a,n),g=i.cartesianToCartographic(u,y),C=i.cartesianToCartographic(h,A),p=T(f,r,o);M.setEndPoints(g,C);const d=M.surfaceDistance/f;let m=c;g.height=r;let w=i.cartographicToCartesian(g,E);t.Cartesian3.pack(w,s,m),m+=3;for(let e=1;e<f;e++){const a=M.interpolateUsingSurfaceDistance(e*d,A);a.height=p[e],w=i.cartographicToCartesian(a,E),t.Cartesian3.pack(w,s,m),m+=3}return m}function x(e,a,n,i,o,s,c,u){const h=i.cartesianToCartographic(e,y),f=i.cartesianToCartographic(a,A),g=l.numberOfPointsRhumbLine(h,f,n);h.height=0,f.height=0;const C=T(g,o,s);S.ellipsoid.equals(i)||(S=new r.EllipsoidRhumbLine(void 0,void 0,i)),S.setEndPoints(h,f);const p=S.surfaceDistance/g;let d=u;h.height=o;let m=i.cartographicToCartesian(h,E);t.Cartesian3.pack(m,c,d),d+=3;for(let e=1;e<g;e++){const a=S.interpolateUsingSurfaceDistance(e*p,A);a.height=C[e],m=i.cartographicToCartesian(a,E),t.Cartesian3.pack(m,c,d),d+=3}return d}l.wrapLongitude=function(e,n){const i=[],r=[];if(a.defined(e)&&e.length>0){n=a.defaultValue(n,t.Matrix4.IDENTITY);const s=t.Matrix4.inverseTransformation(n,h),l=t.Matrix4.multiplyByPoint(s,t.Cartesian3.ZERO,f),u=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_Y,g),g),P=c.Plane.fromPointNormal(l,u,C),T=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_X,p),p),y=c.Plane.fromPointNormal(l,T,d);let A=1;i.push(t.Cartesian3.clone(e[0]));let E=i[0];const R=e.length;for(let n=1;n<R;++n){const s=e[n];if(c.Plane.getPointDistance(y,E)<0||c.Plane.getPointDistance(y,s)<0){const e=o.IntersectionTests.lineSegmentPlane(E,s,P,m);if(a.defined(e)){const a=t.Cartesian3.multiplyByScalar(u,5e-9,w);c.Plane.getPointDistance(P,E)<0&&t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),r.push(A+1),t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),A=1}}i.push(t.Cartesian3.clone(e[n])),A++,E=s}r.push(A)}return{positions:i,lengths:r}},l.generateArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let o=a.defaultValue(e.height,0);const c=Array.isArray(o);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],R);if(o=c?o[0]:o,0!==o){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,o,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}let u=e.minDistance;if(!a.defined(u)){const t=a.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);u=s.CesiumMath.chordLength(t,r.maximumRadius)}let h,f=0;for(h=0;h<i-1;h++)f+=l.numberOfPoints(n[h],n[h+1],u);const g=3*(f+1),C=new Array(g);let p=0;for(h=0;h<i-1;h++){p=D(n[h],n[h+1],u,r,c?o[h]:o,c?o[h+1]:o,C,p)}P.length=0;const d=n[i-1],m=r.cartesianToCartographic(d,y);m.height=c?o[i-1]:o;const w=r.cartographicToCartesian(m,E);return t.Cartesian3.pack(w,C,g-3),C};const N=new t.Cartographic,G=new t.Cartographic;l.generateRhumbArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let o=a.defaultValue(e.height,0);const c=Array.isArray(o);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],R);if(o=c?o[0]:o,0!==o){const a=r.geodeticSurfaceNormal(e,E);t.Cartesian3.multiplyByScalar(a,o,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}const u=a.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);let h,f,g=0,C=r.cartesianToCartographic(n[0],N);for(h=0;h<i-1;h++)f=r.cartesianToCartographic(n[h+1],G),g+=l.numberOfPointsRhumbLine(C,f,u),C=t.Cartographic.clone(f,N);const p=3*(g+1),d=new Array(p);let m=0;for(h=0;h<i-1;h++){m=x(n[h],n[h+1],u,r,c?o[h]:o,c?o[h+1]:o,d,m)}P.length=0;const w=n[i-1],T=r.cartesianToCartographic(w,y);T.height=c?o[i-1]:o;const A=r.cartographicToCartesian(T,E);return t.Cartesian3.pack(A,d,p-3),d},l.generateCartesianArc=function(e){const a=l.generateArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},l.generateCartesianRhumbArc=function(e){const a=l.generateRhumbArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},e.PolylinePipeline=l}));
@@ -1 +1 @@
1
- define(["exports","./Matrix2-37e55508","./EllipsoidTangentPlane-678e34e4","./ComponentDatatype-a15c9a19","./PolylinePipeline-6757400c","./Transforms-eb5c1a84","./defaultValue-81eec7ed","./RuntimeError-8952249c"],(function(e,a,t,n,r,i,o,s){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new a.Cartesian3,new a.Cartesian3],d=new a.Cartesian3,g=new a.Cartesian3,y=new a.Cartesian3,m=new a.Cartesian3,h=new a.Cartesian3,f=new a.Cartesian3,p=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3,E=new a.Cartesian3,P=new a.Cartesian3,M={};let T=new a.Cartographic;function b(e,t,n,r){const i=e[0],o=e[1],s=a.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=new Array(l);let C;if(t===n){for(C=0;C<l;C++)c[C]=t;return c.push(n),c}const u=(n-t)/l;for(C=1;C<l;C++){const e=t+C*u;c[C]=e}return c[0]=t,c.push(n),c}const B=new a.Cartesian3,z=new a.Cartesian3;const S=new a.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new a.Matrix3;const O=a.Matrix3.IDENTITY.clone(),V=new a.Cartesian3,I=new a.Cartesian4,N=new a.Cartesian3;function v(e,n,r,o,s,l,c,C){let u=V,d=I;A=i.Transforms.eastNorthUpToFixedFrame(e,s,A),u=a.Matrix4.multiplyByPointAsVector(A,S,u),u=a.Cartesian3.normalize(u,u);const g=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z),c=a.Cartesian2.angleBetween(s,l);return l.x*s.y-l.y*s.x>=0?-c:c}(u,n,e,s);R=a.Matrix3.fromRotationZ(g,R),N.z=l,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,N,D),A);const y=O;y[0]=c;for(let e=0;e<C;e++)for(let e=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(A,d,d),o.push(d.x,d.y,d.z);return o}const G=new a.Cartesian3;function H(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,G),t,n,r,i,o[l/3],s,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,o=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-o;return n}const j=new i.Quaternion,Q=new a.Cartesian3,q=new a.Matrix3;function F(e,t,r,o,s,c,C,u,d,g){const y=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,E),a.Cartesian3.subtract(r,e,P)),m=o===l.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));let h,f,p;if(h=s?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,E),y/(m+1),j),q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(m+1),j),q),t=a.Cartesian3.clone(t,Q),m>0){const n=g?2:1;for(let r=0;r<m;r++)t=a.Matrix3.multiplyByVector(h,t,t),f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,n)}else f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,1),r=a.Cartesian3.clone(r,Q),f=a.Cartesian3.subtract(r,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(r,P),C=v(p,f,u,C,c,d,1,1);return C}M.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],o=e[i];a.Cartesian2.equals(t,o)||n.push(o)}return n},M.angleIsGreaterThanPi=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z);return l.x*s.y-l.y*s.x>=0};const U=new a.Cartesian3,_=new a.Cartesian3;M.computePositions=function(e,t,i,o,s){const c=o._ellipsoid,P=function(e,a){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];T=a.cartesianToCartographic(r,T),t[n]=T.height,e[n]=a.scaleToGeodeticSurface(r,r)}return t}(e,c),B=o._granularity,z=o._cornerType,S=s?function(e,a){const t=e.length,n=new Array(6*t);let r=0;const i=a.x+a.width/2,o=a.y+a.height/2;let s=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(let a=1;a<t;a++){s=e[a];const t=s.x-i,l=s.y-o;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}return s=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}(t,i):L(t,i),A=s?L(t,i):void 0,D=i.height/2,R=i.width/2;let O=e.length,V=[],I=s?[]:void 0,N=d,G=g,j=y,Q=m,q=h,Z=f,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y);let X,$,ee=P[0],ae=P[1];s&&(I=v(J,Y,A,I,c,ee+D,1,1)),k=a.Cartesian3.clone(J,k),J=K,G=a.Cartesian3.negate(N,G);for(let t=1;t<O-1;t++){const i=s?2:1;if(K=e[t+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),j=a.Cartesian3.add(N,G,j),j=a.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);const o=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(N,Q),U);a.Cartesian3.subtract(N,o,o),a.Cartesian3.normalize(o,o);const d=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(G,Q),_);a.Cartesian3.subtract(G,d,d),a.Cartesian3.normalize(d,d);if(!n.CesiumMath.equalsEpsilon(Math.abs(a.Cartesian3.dot(o,d)),1,n.CesiumMath.EPSILON7)){j=a.Cartesian3.cross(j,Q,j),j=a.Cartesian3.cross(Q,j,j),j=a.Cartesian3.normalize(j,j);const e=1/Math.max(.25,a.Cartesian3.magnitude(a.Cartesian3.cross(j,G,E))),t=M.angleIsGreaterThanPi(N,G,J,c);t?(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,V,S,ae+D,s):(j=a.Cartesian3.negate(j,j),V=v(J,j,S,V,c,ae+D,e,i)),k=a.Cartesian3.clone(W,k)):(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=b(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,V,S,ae+D,s):V=v(J,j,S,V,c,ae+D,e,i),k=a.Cartesian3.clone(W,k)),G=a.Cartesian3.negate(N,G)}else V=v(k,Y,S,V,c,ee+D,1,1),k=J;ee=ae,ae=P[t+1],J=K}u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(J,u[1]),X=b(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),s&&(I=v(J,Y,A,I,c,ae+D,1,1)),O=V.length;const te=s?O+I.length:O,ne=new Float64Array(te);return ne.set(V),s&&ne.set(I,O),ne},e.CornerType=l,e.PolylineVolumeGeometryLibrary=M,e.oneTimeWarning=C}));
1
+ define(["exports","./Matrix2-47e98d76","./EllipsoidTangentPlane-a01286f6","./ComponentDatatype-a15c9a19","./PolylinePipeline-8095c9bc","./Transforms-c8cb8f43","./defaultValue-81eec7ed","./RuntimeError-8952249c"],(function(e,a,t,n,r,i,o,s){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new a.Cartesian3,new a.Cartesian3],d=new a.Cartesian3,g=new a.Cartesian3,y=new a.Cartesian3,m=new a.Cartesian3,f=new a.Cartesian3,h=new a.Cartesian3,p=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3,E=new a.Cartesian3,P=new a.Cartesian3,M={};let b=new a.Cartographic;function T(e,t,n,r){const i=e[0],o=e[1],s=a.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=new Array(l);let C;if(t===n){for(C=0;C<l;C++)c[C]=t;return c.push(n),c}const u=(n-t)/l;for(C=1;C<l;C++){const e=t+C*u;c[C]=e}return c[0]=t,c.push(n),c}const B=new a.Cartesian3,z=new a.Cartesian3;const S=new a.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new a.Matrix3;const O=a.Matrix3.IDENTITY.clone(),V=new a.Cartesian3,I=new a.Cartesian4,N=new a.Cartesian3;function v(e,n,r,o,s,l,c,C){let u=V,d=I;A=i.Transforms.eastNorthUpToFixedFrame(e,s,A),u=a.Matrix4.multiplyByPointAsVector(A,S,u),u=a.Cartesian3.normalize(u,u);const g=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z),c=a.Cartesian2.angleBetween(s,l);return l.x*s.y-l.y*s.x>=0?-c:c}(u,n,e,s);R=a.Matrix3.fromRotationZ(g,R),N.z=l,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,N,D),A);const y=O;y[0]=c;for(let e=0;e<C;e++)for(let e=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(A,d,d),o.push(d.x,d.y,d.z);return o}const G=new a.Cartesian3;function H(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,G),t,n,r,i,o[l/3],s,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,o=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-o;return n}const j=new i.Quaternion,Q=new a.Cartesian3,q=new a.Matrix3;function F(e,t,r,o,s,c,C,u,d,g){const y=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,E),a.Cartesian3.subtract(r,e,P)),m=o===l.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));let f,h,p;if(f=s?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,E),y/(m+1),j),q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(m+1),j),q),t=a.Cartesian3.clone(t,Q),m>0){const n=g?2:1;for(let r=0;r<m;r++)t=a.Matrix3.multiplyByVector(f,t,t),h=a.Cartesian3.subtract(t,e,E),h=a.Cartesian3.normalize(h,h),s||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(t,P),C=v(p,h,u,C,c,d,1,n)}else h=a.Cartesian3.subtract(t,e,E),h=a.Cartesian3.normalize(h,h),s||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(t,P),C=v(p,h,u,C,c,d,1,1),r=a.Cartesian3.clone(r,Q),h=a.Cartesian3.subtract(r,e,E),h=a.Cartesian3.normalize(h,h),s||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(r,P),C=v(p,h,u,C,c,d,1,1);return C}M.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],o=e[i];a.Cartesian2.equals(t,o)||n.push(o)}return n},M.angleIsGreaterThanPi=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z);return l.x*s.y-l.y*s.x>=0};const U=new a.Cartesian3,_=new a.Cartesian3;M.computePositions=function(e,t,i,o,s){const c=o._ellipsoid,P=function(e,a){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];b=a.cartesianToCartographic(r,b),t[n]=b.height,e[n]=a.scaleToGeodeticSurface(r,r)}return t}(e,c),B=o._granularity,z=o._cornerType,S=s?function(e,a){const t=e.length,n=new Array(6*t);let r=0;const i=a.x+a.width/2,o=a.y+a.height/2;let s=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(let a=1;a<t;a++){s=e[a];const t=s.x-i,l=s.y-o;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}return s=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}(t,i):L(t,i),A=s?L(t,i):void 0,D=i.height/2,R=i.width/2;let O=e.length,V=[],I=s?[]:void 0,N=d,G=g,j=y,Q=m,q=f,Z=h,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y);let X,$,ee=P[0],ae=P[1];s&&(I=v(J,Y,A,I,c,ee+D,1,1)),k=a.Cartesian3.clone(J,k),J=K,G=a.Cartesian3.negate(N,G);for(let t=1;t<O-1;t++){const i=s?2:1;if(K=e[t+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),j=a.Cartesian3.add(N,G,j),j=a.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);const o=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(N,Q),U);a.Cartesian3.subtract(N,o,o),a.Cartesian3.normalize(o,o);const d=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(G,Q),_);a.Cartesian3.subtract(G,d,d),a.Cartesian3.normalize(d,d);if(!n.CesiumMath.equalsEpsilon(Math.abs(a.Cartesian3.dot(o,d)),1,n.CesiumMath.EPSILON7)){j=a.Cartesian3.cross(j,Q,j),j=a.Cartesian3.cross(Q,j,j),j=a.Cartesian3.normalize(j,j);const e=1/Math.max(.25,a.Cartesian3.magnitude(a.Cartesian3.cross(j,G,E))),t=M.angleIsGreaterThanPi(N,G,J,c);t?(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,V,S,ae+D,s):(j=a.Cartesian3.negate(j,j),V=v(J,j,S,V,c,ae+D,e,i)),k=a.Cartesian3.clone(W,k)):(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,V,S,ae+D,s):V=v(J,j,S,V,c,ae+D,e,i),k=a.Cartesian3.clone(W,k)),G=a.Cartesian3.negate(N,G)}else V=v(k,Y,S,V,c,ee+D,1,1),k=J;ee=ae,ae=P[t+1],J=K}u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(J,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),V=H($,Y,S,V,c,X,1),s&&(I=v(J,Y,A,I,c,ae+D,1,1)),O=V.length;const te=s?O+I.length:O,ne=new Float64Array(te);return ne.set(V),s&&ne.set(I,O),ne},e.CornerType=l,e.PolylineVolumeGeometryLibrary=M,e.oneTimeWarning=C}));