@cesium/engine 3.0.1 → 4.0.0

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 (234) hide show
  1. package/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
  2. package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
  3. package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
  4. package/Build/Workers/chunk-27R2KRIK.js +634 -0
  5. package/Build/Workers/chunk-2C65EKYA.js +55 -0
  6. package/Build/Workers/chunk-2NLMZNJI.js +138 -0
  7. package/Build/Workers/chunk-4V6RCTVH.js +289 -0
  8. package/Build/Workers/chunk-4VWUFKYW.js +368 -0
  9. package/Build/Workers/chunk-527JG4D7.js +629 -0
  10. package/Build/Workers/chunk-5U4UHRZ2.js +8644 -0
  11. package/Build/Workers/chunk-7CZEWQWE.js +353 -0
  12. package/Build/Workers/chunk-7IMAWM6A.js +842 -0
  13. package/Build/Workers/{package.js → chunk-A6EA6KIE.js} +13 -2
  14. package/Build/Workers/chunk-AXGQUPXA.js +1075 -0
  15. package/Build/Workers/chunk-BT6YIL2N.js +39 -0
  16. package/Build/Workers/chunk-C6MRR5YL.js +476 -0
  17. package/Build/Workers/chunk-DJUTBX6A.js +1860 -0
  18. package/Build/Workers/chunk-EQ6ZAP37.js +218 -0
  19. package/Build/Workers/chunk-F7P2HCYZ.js +73 -0
  20. package/Build/Workers/chunk-FE2XG3SS.js +73 -0
  21. package/Build/Workers/chunk-FKHRSGKP.js +781 -0
  22. package/Build/Workers/chunk-FVDTKX3F.js +58 -0
  23. package/Build/Workers/chunk-FYHCAKU6.js +684 -0
  24. package/Build/Workers/chunk-G3MOT7BZ.js +157 -0
  25. package/Build/Workers/chunk-H52L6U76.js +421 -0
  26. package/Build/Workers/chunk-H6MBQ4W4.js +305 -0
  27. package/Build/Workers/chunk-HCZR75II.js +2716 -0
  28. package/Build/Workers/chunk-I5MQWHBR.js +102 -0
  29. package/Build/Workers/chunk-KAFF2QX3.js +258 -0
  30. package/Build/Workers/chunk-LGSGX2RH.js +757 -0
  31. package/Build/Workers/chunk-LQRFWCNX.js +124 -0
  32. package/Build/Workers/chunk-N5MMDSD2.js +44 -0
  33. package/Build/Workers/chunk-NRETMGYL.js +390 -0
  34. package/Build/Workers/chunk-P4M4QUNQ.js +196 -0
  35. package/Build/Workers/chunk-P7PWX5HR.js +430 -0
  36. package/Build/Workers/chunk-PGB3EFR7.js +171 -0
  37. package/Build/Workers/chunk-PW5CA4MJ.js +3273 -0
  38. package/Build/Workers/chunk-PWDYKCNC.js +501 -0
  39. package/Build/Workers/chunk-QIS3NB7U.js +1258 -0
  40. package/Build/Workers/chunk-QVJ6IRKV.js +77 -0
  41. package/Build/Workers/chunk-RDCDRNJ7.js +117 -0
  42. package/Build/Workers/chunk-RDM3BKNC.js +1009 -0
  43. package/Build/Workers/chunk-RRUPTJ6P.js +452 -0
  44. package/Build/Workers/chunk-SGRWJKNO.js +400 -0
  45. package/Build/Workers/chunk-TF5D2H7B.js +138 -0
  46. package/Build/Workers/chunk-TVYIHH4V.js +513 -0
  47. package/Build/Workers/chunk-U5LKG6LX.js +101 -0
  48. package/Build/Workers/chunk-UGZGTV5K.js +302 -0
  49. package/Build/Workers/chunk-UN7AK64D.js +163 -0
  50. package/Build/Workers/chunk-V2LKNJGT.js +59 -0
  51. package/Build/Workers/chunk-VSCXSFHE.js +1477 -0
  52. package/Build/Workers/chunk-XJCTFTBM.js +2041 -0
  53. package/Build/Workers/chunk-XZVQMPWG.js +100 -0
  54. package/Build/Workers/chunk-YLAFWVOW.js +834 -0
  55. package/Build/Workers/chunk-YLS3FX3U.js +236 -0
  56. package/Build/Workers/chunk-YMJPANZZ.js +693 -0
  57. package/Build/Workers/combineGeometry.js +65 -15
  58. package/Build/Workers/createBoxGeometry.js +55 -10
  59. package/Build/Workers/createBoxOutlineGeometry.js +231 -310
  60. package/Build/Workers/createCircleGeometry.js +185 -202
  61. package/Build/Workers/createCircleOutlineGeometry.js +141 -155
  62. package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
  63. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
  64. package/Build/Workers/createCorridorGeometry.js +1162 -1307
  65. package/Build/Workers/createCorridorOutlineGeometry.js +533 -569
  66. package/Build/Workers/createCylinderGeometry.js +57 -10
  67. package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
  68. package/Build/Workers/createEllipseGeometry.js +68 -12
  69. package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
  70. package/Build/Workers/createEllipsoidGeometry.js +56 -10
  71. package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
  72. package/Build/Workers/createFrustumGeometry.js +55 -10
  73. package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
  74. package/Build/Workers/createGeometry.js +143 -48
  75. package/Build/Workers/createGroundPolylineGeometry.js +1484 -2011
  76. package/Build/Workers/createPlaneGeometry.js +216 -243
  77. package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
  78. package/Build/Workers/createPolygonGeometry.js +1041 -1327
  79. package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
  80. package/Build/Workers/createPolylineGeometry.js +471 -547
  81. package/Build/Workers/createPolylineVolumeGeometry.js +352 -384
  82. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
  83. package/Build/Workers/createRectangleGeometry.js +1128 -1331
  84. package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
  85. package/Build/Workers/createSimplePolylineGeometry.js +381 -440
  86. package/Build/Workers/createSphereGeometry.js +112 -118
  87. package/Build/Workers/createSphereOutlineGeometry.js +112 -121
  88. package/Build/Workers/createTaskProcessorWorker.js +32 -127
  89. package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
  90. package/Build/Workers/createVectorTileGeometries.js +377 -436
  91. package/Build/Workers/createVectorTilePoints.js +110 -77
  92. package/Build/Workers/createVectorTilePolygons.js +369 -391
  93. package/Build/Workers/createVectorTilePolylines.js +252 -244
  94. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
  95. package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
  96. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
  97. package/Build/Workers/createWallGeometry.js +459 -593
  98. package/Build/Workers/createWallOutlineGeometry.js +324 -419
  99. package/Build/Workers/decodeDraco.js +327 -347
  100. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
  101. package/Build/Workers/decodeI3S.js +765 -970
  102. package/Build/Workers/transcodeKTX2.js +3353 -1464
  103. package/Build/Workers/transferTypedArrayTest.js +3 -4
  104. package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
  105. package/LICENSE.md +0 -12
  106. package/Source/Core/FeatureDetection.js +9 -0
  107. package/Source/Core/GoogleMaps.js +1 -1
  108. package/Source/Core/GroundPolylineGeometry.js +3 -2
  109. package/Source/Core/Ion.js +1 -1
  110. package/Source/Core/KTX2Transcoder.js +7 -3
  111. package/Source/Core/RequestScheduler.js +1 -0
  112. package/Source/Core/TaskProcessor.js +150 -146
  113. package/Source/Core/Transforms.js +2 -2
  114. package/Source/Core/buildModuleUrl.js +6 -5
  115. package/Source/DataSources/CzmlDataSource.js +6 -4
  116. package/Source/Scene/ArcGisMapService.js +1 -1
  117. package/Source/Scene/DracoLoader.js +26 -3
  118. package/Source/Scene/GltfLoaderUtil.js +1 -7
  119. package/Source/Scene/I3SDataProvider.js +0 -27
  120. package/Source/Scene/I3SDecoder.js +127 -0
  121. package/Source/Scene/I3SNode.js +32 -110
  122. package/Source/Scene/ImageryLayer.js +2 -2
  123. package/Source/Scene/Implicit3DTileContent.js +13 -0
  124. package/Source/Scene/ImplicitTileset.js +5 -0
  125. package/Source/Scene/Model/I3dmLoader.js +5 -1
  126. package/Source/Scene/Model/Model.js +4 -1
  127. package/Source/Scene/OpenStreetMapImageryProvider.js +7 -4
  128. package/Source/Scene/SingleTileImageryProvider.js +4 -2
  129. package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
  130. package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
  131. package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
  132. package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
  133. package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
  134. package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
  135. package/Source/Workers/transferTypedArrayTest.js +0 -6
  136. package/index.d.ts +20 -11
  137. package/index.js +170 -169
  138. package/package.json +3 -2
  139. package/Build/Workers/ArcType-2d9abbbc.js +0 -37
  140. package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
  141. package/Build/Workers/AxisAlignedBoundingBox-4bfd84f3.js +0 -258
  142. package/Build/Workers/BoundingRectangle-5fd6403a.js +0 -369
  143. package/Build/Workers/BoxGeometry-7aa4ce7f.js +0 -884
  144. package/Build/Workers/Check-6ede7e26.js +0 -290
  145. package/Build/Workers/Color-8e135f71.js +0 -2262
  146. package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
  147. package/Build/Workers/CoplanarPolygonGeometryLibrary-59c69b0a.js +0 -132
  148. package/Build/Workers/CorridorGeometryLibrary-63907365.js +0 -498
  149. package/Build/Workers/CylinderGeometry-8fc7c44b.js +0 -467
  150. package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
  151. package/Build/Workers/EllipseGeometry-16b3736a.js +0 -1304
  152. package/Build/Workers/EllipseGeometryLibrary-21262a28.js +0 -366
  153. package/Build/Workers/EllipseOutlineGeometry-05d35d18.js +0 -443
  154. package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
  155. package/Build/Workers/EllipsoidGeometry-a503d1d6.js +0 -637
  156. package/Build/Workers/EllipsoidOutlineGeometry-7b09f24d.js +0 -454
  157. package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
  158. package/Build/Workers/EllipsoidTangentPlane-546c0d5e.js +0 -373
  159. package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
  160. package/Build/Workers/FrustumGeometry-87ce8622.js +0 -2540
  161. package/Build/Workers/GeometryAttribute-8fcff0d5.js +0 -619
  162. package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
  163. package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
  164. package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
  165. package/Build/Workers/GeometryPipeline-70d69a43.js +0 -3690
  166. package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
  167. package/Build/Workers/IntersectionTests-85350792.js +0 -1836
  168. package/Build/Workers/Math-0a2ac845.js +0 -1340
  169. package/Build/Workers/Matrix2-e1298525.js +0 -7086
  170. package/Build/Workers/Matrix3-41c58dde.js +0 -4283
  171. package/Build/Workers/OrientedBoundingBox-29fb0fcd.js +0 -1259
  172. package/Build/Workers/Plane-4c3d403b.js +0 -309
  173. package/Build/Workers/PolygonGeometryLibrary-bad6329a.js +0 -1074
  174. package/Build/Workers/PolygonPipeline-dd13ee78.js +0 -1344
  175. package/Build/Workers/PolylinePipeline-7119eb3f.js +0 -573
  176. package/Build/Workers/PolylineVolumeGeometryLibrary-d25f0050.js +0 -781
  177. package/Build/Workers/PrimitivePipeline-111ee29f.js +0 -966
  178. package/Build/Workers/RectangleGeometryLibrary-bb378fb6.js +0 -280
  179. package/Build/Workers/RuntimeError-ef395448.js +0 -68
  180. package/Build/Workers/TerrainEncoding-c8e029a2.js +0 -1227
  181. package/Build/Workers/Transforms-e2d4a55a.js +0 -14713
  182. package/Build/Workers/VertexFormat-030f11ff.js +0 -312
  183. package/Build/Workers/WallGeometryLibrary-3e0819ec.js +0 -211
  184. package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
  185. package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
  186. package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
  187. package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
  188. package/Build/Workers/combine-d9581036.js +0 -82
  189. package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
  190. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
  191. package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
  192. package/Source/Workers/package.json +0 -1
  193. /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
  194. /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
  195. /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
  196. /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
  197. /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
  198. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
  199. /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
  200. /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
  201. /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
  202. /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
  203. /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
  204. /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
  205. /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
  206. /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
  207. /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
  208. /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
  209. /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
  210. /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
  211. /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
  212. /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
  213. /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
  214. /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
  215. /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
  216. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
  217. /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
  218. /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
  219. /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
  220. /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
  221. /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
  222. /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
  223. /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
  224. /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
  225. /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
  226. /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
  227. /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
  228. /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
  229. /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
  230. /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
  231. /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
  232. /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
  233. /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
  234. /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
@@ -1,72 +1,127 @@
1
- define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', './Transforms-e2d4a55a', './ComponentDatatype-cf1fa08e', './Check-6ede7e26', './GeometryAttribute-8fcff0d5', './GeometryAttributes-ad136444', './GeometryOffsetAttribute-9ad0019c', './IndexDatatype-2643aa47', './Math-0a2ac845', './PolygonPipeline-dd13ee78', './RectangleGeometryLibrary-bb378fb6', './RuntimeError-ef395448', './combine-d9581036', './WebGLConstants-0b1ce7ba', './EllipsoidRhumbLine-ef872433'], (function (defaultValue, Matrix3, Matrix2, Transforms, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, RectangleGeometryLibrary, RuntimeError, combine, WebGLConstants, EllipsoidRhumbLine) { 'use strict';
2
-
3
- const bottomBoundingSphere = new Transforms.BoundingSphere();
4
- const topBoundingSphere = new Transforms.BoundingSphere();
5
- const positionScratch = new Matrix3.Cartesian3();
6
- const rectangleScratch = new Matrix2.Rectangle();
7
-
8
- function constructRectangle(geometry, computedOptions) {
9
- const ellipsoid = geometry._ellipsoid;
10
- const height = computedOptions.height;
11
- const width = computedOptions.width;
12
- const northCap = computedOptions.northCap;
13
- const southCap = computedOptions.southCap;
14
-
15
- let rowHeight = height;
16
- let widthMultiplier = 2;
17
- let size = 0;
18
- let corners = 4;
19
- if (northCap) {
20
- widthMultiplier -= 1;
21
- rowHeight -= 1;
22
- size += 1;
23
- corners -= 2;
24
- }
25
- if (southCap) {
26
- widthMultiplier -= 1;
27
- rowHeight -= 1;
28
- size += 1;
29
- corners -= 2;
30
- }
31
- size += widthMultiplier * width + 2 * rowHeight - corners;
32
-
33
- const positions = new Float64Array(size * 3);
34
-
35
- let posIndex = 0;
36
- let row = 0;
37
- let col;
38
- const position = positionScratch;
39
- if (northCap) {
40
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
41
- computedOptions,
42
- ellipsoid,
43
- false,
44
- row,
45
- 0,
46
- position
47
- );
48
- positions[posIndex++] = position.x;
49
- positions[posIndex++] = position.y;
50
- positions[posIndex++] = position.z;
51
- } else {
52
- for (col = 0; col < width; col++) {
53
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
54
- computedOptions,
55
- ellipsoid,
56
- false,
57
- row,
58
- col,
59
- position
60
- );
61
- positions[posIndex++] = position.x;
62
- positions[posIndex++] = position.y;
63
- positions[posIndex++] = position.z;
64
- }
65
- }
66
-
67
- col = width - 1;
68
- for (row = 1; row < height; row++) {
69
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.109
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ RectangleGeometryLibrary_default
28
+ } from "./chunk-YLS3FX3U.js";
29
+ import {
30
+ GeometryOffsetAttribute_default
31
+ } from "./chunk-A6EA6KIE.js";
32
+ import {
33
+ PolygonPipeline_default
34
+ } from "./chunk-RDM3BKNC.js";
35
+ import "./chunk-RRUPTJ6P.js";
36
+ import {
37
+ IndexDatatype_default
38
+ } from "./chunk-TF5D2H7B.js";
39
+ import {
40
+ GeometryAttributes_default
41
+ } from "./chunk-N5MMDSD2.js";
42
+ import {
43
+ GeometryAttribute_default,
44
+ Geometry_default,
45
+ PrimitiveType_default
46
+ } from "./chunk-UGZGTV5K.js";
47
+ import {
48
+ BoundingSphere_default
49
+ } from "./chunk-5U4UHRZ2.js";
50
+ import "./chunk-FE2XG3SS.js";
51
+ import {
52
+ Rectangle_default
53
+ } from "./chunk-PW5CA4MJ.js";
54
+ import {
55
+ ComponentDatatype_default
56
+ } from "./chunk-KAFF2QX3.js";
57
+ import {
58
+ Cartesian3_default,
59
+ Cartographic_default,
60
+ Ellipsoid_default
61
+ } from "./chunk-XJCTFTBM.js";
62
+ import {
63
+ Math_default
64
+ } from "./chunk-PWDYKCNC.js";
65
+ import "./chunk-527JG4D7.js";
66
+ import "./chunk-FVDTKX3F.js";
67
+ import {
68
+ defaultValue_default
69
+ } from "./chunk-BT6YIL2N.js";
70
+ import {
71
+ DeveloperError_default
72
+ } from "./chunk-UN7AK64D.js";
73
+ import {
74
+ defined_default
75
+ } from "./chunk-QVJ6IRKV.js";
76
+
77
+ // packages/engine/Source/Core/RectangleOutlineGeometry.js
78
+ var bottomBoundingSphere = new BoundingSphere_default();
79
+ var topBoundingSphere = new BoundingSphere_default();
80
+ var positionScratch = new Cartesian3_default();
81
+ var rectangleScratch = new Rectangle_default();
82
+ function constructRectangle(geometry, computedOptions) {
83
+ const ellipsoid = geometry._ellipsoid;
84
+ const height = computedOptions.height;
85
+ const width = computedOptions.width;
86
+ const northCap = computedOptions.northCap;
87
+ const southCap = computedOptions.southCap;
88
+ let rowHeight = height;
89
+ let widthMultiplier = 2;
90
+ let size = 0;
91
+ let corners = 4;
92
+ if (northCap) {
93
+ widthMultiplier -= 1;
94
+ rowHeight -= 1;
95
+ size += 1;
96
+ corners -= 2;
97
+ }
98
+ if (southCap) {
99
+ widthMultiplier -= 1;
100
+ rowHeight -= 1;
101
+ size += 1;
102
+ corners -= 2;
103
+ }
104
+ size += widthMultiplier * width + 2 * rowHeight - corners;
105
+ const positions = new Float64Array(size * 3);
106
+ let posIndex = 0;
107
+ let row = 0;
108
+ let col;
109
+ const position = positionScratch;
110
+ if (northCap) {
111
+ RectangleGeometryLibrary_default.computePosition(
112
+ computedOptions,
113
+ ellipsoid,
114
+ false,
115
+ row,
116
+ 0,
117
+ position
118
+ );
119
+ positions[posIndex++] = position.x;
120
+ positions[posIndex++] = position.y;
121
+ positions[posIndex++] = position.z;
122
+ } else {
123
+ for (col = 0; col < width; col++) {
124
+ RectangleGeometryLibrary_default.computePosition(
70
125
  computedOptions,
71
126
  ellipsoid,
72
127
  false,
@@ -78,28 +133,25 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', '
78
133
  positions[posIndex++] = position.y;
79
134
  positions[posIndex++] = position.z;
80
135
  }
81
-
82
- row = height - 1;
83
- if (!southCap) {
84
- // if southCap is true, we dont need to add any more points because the south pole point was added by the iteration above
85
- for (col = width - 2; col >= 0; col--) {
86
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
87
- computedOptions,
88
- ellipsoid,
89
- false,
90
- row,
91
- col,
92
- position
93
- );
94
- positions[posIndex++] = position.x;
95
- positions[posIndex++] = position.y;
96
- positions[posIndex++] = position.z;
97
- }
98
- }
99
-
100
- col = 0;
101
- for (row = height - 2; row > 0; row--) {
102
- RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
136
+ }
137
+ col = width - 1;
138
+ for (row = 1; row < height; row++) {
139
+ RectangleGeometryLibrary_default.computePosition(
140
+ computedOptions,
141
+ ellipsoid,
142
+ false,
143
+ row,
144
+ col,
145
+ position
146
+ );
147
+ positions[posIndex++] = position.x;
148
+ positions[posIndex++] = position.y;
149
+ positions[posIndex++] = position.z;
150
+ }
151
+ row = height - 1;
152
+ if (!southCap) {
153
+ for (col = width - 2; col >= 0; col--) {
154
+ RectangleGeometryLibrary_default.computePosition(
103
155
  computedOptions,
104
156
  ellipsoid,
105
157
  false,
@@ -111,425 +163,318 @@ define(['./defaultValue-fe22d8c0', './Matrix3-41c58dde', './Matrix2-e1298525', '
111
163
  positions[posIndex++] = position.y;
112
164
  positions[posIndex++] = position.z;
113
165
  }
114
-
115
- const indicesSize = (positions.length / 3) * 2;
116
- const indices = IndexDatatype.IndexDatatype.createTypedArray(
117
- positions.length / 3,
118
- indicesSize
119
- );
120
-
121
- let index = 0;
122
- for (let i = 0; i < positions.length / 3 - 1; i++) {
123
- indices[index++] = i;
124
- indices[index++] = i + 1;
125
- }
126
- indices[index++] = positions.length / 3 - 1;
127
- indices[index++] = 0;
128
-
129
- const geo = new GeometryAttribute.Geometry({
130
- attributes: new GeometryAttributes.GeometryAttributes(),
131
- primitiveType: GeometryAttribute.PrimitiveType.LINES,
132
- });
133
-
134
- geo.attributes.position = new GeometryAttribute.GeometryAttribute({
135
- componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
136
- componentsPerAttribute: 3,
137
- values: positions,
138
- });
139
- geo.indices = indices;
140
-
141
- return geo;
142
166
  }
143
-
144
- function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
145
- const surfaceHeight = rectangleGeometry._surfaceHeight;
146
- const extrudedHeight = rectangleGeometry._extrudedHeight;
147
- const ellipsoid = rectangleGeometry._ellipsoid;
148
- const minHeight = extrudedHeight;
149
- const maxHeight = surfaceHeight;
150
- const geo = constructRectangle(rectangleGeometry, computedOptions);
151
-
152
- const height = computedOptions.height;
153
- const width = computedOptions.width;
154
-
155
- const topPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
156
- geo.attributes.position.values,
157
- maxHeight,
167
+ col = 0;
168
+ for (row = height - 2; row > 0; row--) {
169
+ RectangleGeometryLibrary_default.computePosition(
170
+ computedOptions,
158
171
  ellipsoid,
159
- false
160
- );
161
- let length = topPositions.length;
162
- const positions = new Float64Array(length * 2);
163
- positions.set(topPositions);
164
- const bottomPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
165
- geo.attributes.position.values,
166
- minHeight,
167
- ellipsoid
172
+ false,
173
+ row,
174
+ col,
175
+ position
168
176
  );
169
- positions.set(bottomPositions, length);
170
- geo.attributes.position.values = positions;
171
-
172
- const northCap = computedOptions.northCap;
173
- const southCap = computedOptions.southCap;
174
- let corners = 4;
175
- if (northCap) {
176
- corners -= 1;
177
- }
178
- if (southCap) {
179
- corners -= 1;
180
- }
181
-
182
- const indicesSize = (positions.length / 3 + corners) * 2;
183
- const indices = IndexDatatype.IndexDatatype.createTypedArray(
184
- positions.length / 3,
185
- indicesSize
186
- );
187
- length = positions.length / 6;
188
- let index = 0;
189
- for (let i = 0; i < length - 1; i++) {
190
- indices[index++] = i;
191
- indices[index++] = i + 1;
192
- indices[index++] = i + length;
193
- indices[index++] = i + length + 1;
194
- }
195
- indices[index++] = length - 1;
196
- indices[index++] = 0;
197
- indices[index++] = length + length - 1;
198
- indices[index++] = length;
199
-
200
- indices[index++] = 0;
201
- indices[index++] = length;
202
-
203
- let bottomCorner;
204
- if (northCap) {
205
- bottomCorner = height - 1;
206
- } else {
207
- const topRightCorner = width - 1;
208
- indices[index++] = topRightCorner;
209
- indices[index++] = topRightCorner + length;
210
- bottomCorner = width + height - 2;
211
- }
212
-
213
- indices[index++] = bottomCorner;
214
- indices[index++] = bottomCorner + length;
215
-
216
- if (!southCap) {
217
- const bottomLeftCorner = width + bottomCorner - 1;
218
- indices[index++] = bottomLeftCorner;
219
- indices[index] = bottomLeftCorner + length;
220
- }
221
-
222
- geo.indices = indices;
223
-
224
- return geo;
177
+ positions[posIndex++] = position.x;
178
+ positions[posIndex++] = position.y;
179
+ positions[posIndex++] = position.z;
225
180
  }
226
-
227
- /**
228
- * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
229
- *
230
- * @alias RectangleOutlineGeometry
231
- * @constructor
232
- *
233
- * @param {object} options Object with the following properties:
234
- * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
235
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
236
- * @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
237
- * @param {number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.
238
- * @param {number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
239
- * @param {number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.
240
- *
241
- * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].
242
- * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].
243
- * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].
244
- * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].
245
- * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>rectangle.south</code>.
246
- *
247
- * @see RectangleOutlineGeometry#createGeometry
248
- *
249
- * @example
250
- * const rectangle = new Cesium.RectangleOutlineGeometry({
251
- * ellipsoid : Cesium.Ellipsoid.WGS84,
252
- * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
253
- * height : 10000.0
254
- * });
255
- * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
256
- */
257
- function RectangleOutlineGeometry(options) {
258
- options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
259
-
260
- const rectangle = options.rectangle;
261
- const granularity = defaultValue.defaultValue(
262
- options.granularity,
263
- Math$1.CesiumMath.RADIANS_PER_DEGREE
181
+ const indicesSize = positions.length / 3 * 2;
182
+ const indices = IndexDatatype_default.createTypedArray(
183
+ positions.length / 3,
184
+ indicesSize
185
+ );
186
+ let index = 0;
187
+ for (let i = 0; i < positions.length / 3 - 1; i++) {
188
+ indices[index++] = i;
189
+ indices[index++] = i + 1;
190
+ }
191
+ indices[index++] = positions.length / 3 - 1;
192
+ indices[index++] = 0;
193
+ const geo = new Geometry_default({
194
+ attributes: new GeometryAttributes_default(),
195
+ primitiveType: PrimitiveType_default.LINES
196
+ });
197
+ geo.attributes.position = new GeometryAttribute_default({
198
+ componentDatatype: ComponentDatatype_default.DOUBLE,
199
+ componentsPerAttribute: 3,
200
+ values: positions
201
+ });
202
+ geo.indices = indices;
203
+ return geo;
204
+ }
205
+ function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
206
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
207
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
208
+ const ellipsoid = rectangleGeometry._ellipsoid;
209
+ const minHeight = extrudedHeight;
210
+ const maxHeight = surfaceHeight;
211
+ const geo = constructRectangle(rectangleGeometry, computedOptions);
212
+ const height = computedOptions.height;
213
+ const width = computedOptions.width;
214
+ const topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
215
+ geo.attributes.position.values,
216
+ maxHeight,
217
+ ellipsoid,
218
+ false
219
+ );
220
+ let length = topPositions.length;
221
+ const positions = new Float64Array(length * 2);
222
+ positions.set(topPositions);
223
+ const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
224
+ geo.attributes.position.values,
225
+ minHeight,
226
+ ellipsoid
227
+ );
228
+ positions.set(bottomPositions, length);
229
+ geo.attributes.position.values = positions;
230
+ const northCap = computedOptions.northCap;
231
+ const southCap = computedOptions.southCap;
232
+ let corners = 4;
233
+ if (northCap) {
234
+ corners -= 1;
235
+ }
236
+ if (southCap) {
237
+ corners -= 1;
238
+ }
239
+ const indicesSize = (positions.length / 3 + corners) * 2;
240
+ const indices = IndexDatatype_default.createTypedArray(
241
+ positions.length / 3,
242
+ indicesSize
243
+ );
244
+ length = positions.length / 6;
245
+ let index = 0;
246
+ for (let i = 0; i < length - 1; i++) {
247
+ indices[index++] = i;
248
+ indices[index++] = i + 1;
249
+ indices[index++] = i + length;
250
+ indices[index++] = i + length + 1;
251
+ }
252
+ indices[index++] = length - 1;
253
+ indices[index++] = 0;
254
+ indices[index++] = length + length - 1;
255
+ indices[index++] = length;
256
+ indices[index++] = 0;
257
+ indices[index++] = length;
258
+ let bottomCorner;
259
+ if (northCap) {
260
+ bottomCorner = height - 1;
261
+ } else {
262
+ const topRightCorner = width - 1;
263
+ indices[index++] = topRightCorner;
264
+ indices[index++] = topRightCorner + length;
265
+ bottomCorner = width + height - 2;
266
+ }
267
+ indices[index++] = bottomCorner;
268
+ indices[index++] = bottomCorner + length;
269
+ if (!southCap) {
270
+ const bottomLeftCorner = width + bottomCorner - 1;
271
+ indices[index++] = bottomLeftCorner;
272
+ indices[index] = bottomLeftCorner + length;
273
+ }
274
+ geo.indices = indices;
275
+ return geo;
276
+ }
277
+ function RectangleOutlineGeometry(options) {
278
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
279
+ const rectangle = options.rectangle;
280
+ const granularity = defaultValue_default(
281
+ options.granularity,
282
+ Math_default.RADIANS_PER_DEGREE
283
+ );
284
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
285
+ const rotation = defaultValue_default(options.rotation, 0);
286
+ if (!defined_default(rectangle)) {
287
+ throw new DeveloperError_default("rectangle is required.");
288
+ }
289
+ Rectangle_default.validate(rectangle);
290
+ if (rectangle.north < rectangle.south) {
291
+ throw new DeveloperError_default(
292
+ "options.rectangle.north must be greater than options.rectangle.south"
264
293
  );
265
- const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
266
- const rotation = defaultValue.defaultValue(options.rotation, 0.0);
267
-
268
- //>>includeStart('debug', pragmas.debug);
269
- if (!defaultValue.defined(rectangle)) {
270
- throw new Check.DeveloperError("rectangle is required.");
271
- }
272
- Matrix2.Rectangle.validate(rectangle);
273
- if (rectangle.north < rectangle.south) {
274
- throw new Check.DeveloperError(
275
- "options.rectangle.north must be greater than options.rectangle.south"
276
- );
277
- }
278
- //>>includeEnd('debug');
279
-
280
- const height = defaultValue.defaultValue(options.height, 0.0);
281
- const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
282
-
283
- this._rectangle = Matrix2.Rectangle.clone(rectangle);
284
- this._granularity = granularity;
285
- this._ellipsoid = ellipsoid;
286
- this._surfaceHeight = Math.max(height, extrudedHeight);
287
- this._rotation = rotation;
288
- this._extrudedHeight = Math.min(height, extrudedHeight);
289
- this._offsetAttribute = options.offsetAttribute;
290
- this._workerName = "createRectangleOutlineGeometry";
291
294
  }
292
-
293
- /**
294
- * The number of elements used to pack the object into an array.
295
- * @type {number}
296
- */
297
- RectangleOutlineGeometry.packedLength =
298
- Matrix2.Rectangle.packedLength + Matrix3.Ellipsoid.packedLength + 5;
299
-
300
- /**
301
- * Stores the provided instance into the provided array.
302
- *
303
- * @param {RectangleOutlineGeometry} value The value to pack.
304
- * @param {number[]} array The array to pack into.
305
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
306
- *
307
- * @returns {number[]} The array that was packed into
308
- */
309
- RectangleOutlineGeometry.pack = function (value, array, startingIndex) {
310
- //>>includeStart('debug', pragmas.debug);
311
- if (!defaultValue.defined(value)) {
312
- throw new Check.DeveloperError("value is required");
313
- }
314
-
315
- if (!defaultValue.defined(array)) {
316
- throw new Check.DeveloperError("array is required");
317
- }
318
- //>>includeEnd('debug');
319
-
320
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
321
-
322
- Matrix2.Rectangle.pack(value._rectangle, array, startingIndex);
323
- startingIndex += Matrix2.Rectangle.packedLength;
324
-
325
- Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
326
- startingIndex += Matrix3.Ellipsoid.packedLength;
327
-
328
- array[startingIndex++] = value._granularity;
329
- array[startingIndex++] = value._surfaceHeight;
330
- array[startingIndex++] = value._rotation;
331
- array[startingIndex++] = value._extrudedHeight;
332
- array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
333
-
334
- return array;
335
- };
336
-
337
- const scratchRectangle = new Matrix2.Rectangle();
338
- const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
339
- const scratchOptions = {
340
- rectangle: scratchRectangle,
341
- ellipsoid: scratchEllipsoid,
342
- granularity: undefined,
343
- height: undefined,
344
- rotation: undefined,
345
- extrudedHeight: undefined,
346
- offsetAttribute: undefined,
347
- };
348
-
349
- /**
350
- * Retrieves an instance from a packed array.
351
- *
352
- * @param {number[]} array The packed array.
353
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
354
- * @param {RectangleOutlineGeometry} [result] The object into which to store the result.
355
- * @returns {RectangleOutlineGeometry} The modified result parameter or a new Quaternion instance if one was not provided.
356
- */
357
- RectangleOutlineGeometry.unpack = function (array, startingIndex, result) {
358
- //>>includeStart('debug', pragmas.debug);
359
- if (!defaultValue.defined(array)) {
360
- throw new Check.DeveloperError("array is required");
361
- }
362
- //>>includeEnd('debug');
363
-
364
- startingIndex = defaultValue.defaultValue(startingIndex, 0);
365
-
366
- const rectangle = Matrix2.Rectangle.unpack(array, startingIndex, scratchRectangle);
367
- startingIndex += Matrix2.Rectangle.packedLength;
368
-
369
- const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
370
- startingIndex += Matrix3.Ellipsoid.packedLength;
371
-
372
- const granularity = array[startingIndex++];
373
- const height = array[startingIndex++];
374
- const rotation = array[startingIndex++];
375
- const extrudedHeight = array[startingIndex++];
376
- const offsetAttribute = array[startingIndex];
377
-
378
- if (!defaultValue.defined(result)) {
379
- scratchOptions.granularity = granularity;
380
- scratchOptions.height = height;
381
- scratchOptions.rotation = rotation;
382
- scratchOptions.extrudedHeight = extrudedHeight;
383
- scratchOptions.offsetAttribute =
384
- offsetAttribute === -1 ? undefined : offsetAttribute;
385
-
386
- return new RectangleOutlineGeometry(scratchOptions);
295
+ const height = defaultValue_default(options.height, 0);
296
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
297
+ this._rectangle = Rectangle_default.clone(rectangle);
298
+ this._granularity = granularity;
299
+ this._ellipsoid = ellipsoid;
300
+ this._surfaceHeight = Math.max(height, extrudedHeight);
301
+ this._rotation = rotation;
302
+ this._extrudedHeight = Math.min(height, extrudedHeight);
303
+ this._offsetAttribute = options.offsetAttribute;
304
+ this._workerName = "createRectangleOutlineGeometry";
305
+ }
306
+ RectangleOutlineGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + 5;
307
+ RectangleOutlineGeometry.pack = function(value, array, startingIndex) {
308
+ if (!defined_default(value)) {
309
+ throw new DeveloperError_default("value is required");
310
+ }
311
+ if (!defined_default(array)) {
312
+ throw new DeveloperError_default("array is required");
313
+ }
314
+ startingIndex = defaultValue_default(startingIndex, 0);
315
+ Rectangle_default.pack(value._rectangle, array, startingIndex);
316
+ startingIndex += Rectangle_default.packedLength;
317
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
318
+ startingIndex += Ellipsoid_default.packedLength;
319
+ array[startingIndex++] = value._granularity;
320
+ array[startingIndex++] = value._surfaceHeight;
321
+ array[startingIndex++] = value._rotation;
322
+ array[startingIndex++] = value._extrudedHeight;
323
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
324
+ return array;
325
+ };
326
+ var scratchRectangle = new Rectangle_default();
327
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
328
+ var scratchOptions = {
329
+ rectangle: scratchRectangle,
330
+ ellipsoid: scratchEllipsoid,
331
+ granularity: void 0,
332
+ height: void 0,
333
+ rotation: void 0,
334
+ extrudedHeight: void 0,
335
+ offsetAttribute: void 0
336
+ };
337
+ RectangleOutlineGeometry.unpack = function(array, startingIndex, result) {
338
+ if (!defined_default(array)) {
339
+ throw new DeveloperError_default("array is required");
340
+ }
341
+ startingIndex = defaultValue_default(startingIndex, 0);
342
+ const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle);
343
+ startingIndex += Rectangle_default.packedLength;
344
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
345
+ startingIndex += Ellipsoid_default.packedLength;
346
+ const granularity = array[startingIndex++];
347
+ const height = array[startingIndex++];
348
+ const rotation = array[startingIndex++];
349
+ const extrudedHeight = array[startingIndex++];
350
+ const offsetAttribute = array[startingIndex];
351
+ if (!defined_default(result)) {
352
+ scratchOptions.granularity = granularity;
353
+ scratchOptions.height = height;
354
+ scratchOptions.rotation = rotation;
355
+ scratchOptions.extrudedHeight = extrudedHeight;
356
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
357
+ return new RectangleOutlineGeometry(scratchOptions);
358
+ }
359
+ result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
360
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
361
+ result._surfaceHeight = height;
362
+ result._rotation = rotation;
363
+ result._extrudedHeight = extrudedHeight;
364
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
365
+ return result;
366
+ };
367
+ var nwScratch = new Cartographic_default();
368
+ RectangleOutlineGeometry.createGeometry = function(rectangleGeometry) {
369
+ const rectangle = rectangleGeometry._rectangle;
370
+ const ellipsoid = rectangleGeometry._ellipsoid;
371
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
372
+ rectangle,
373
+ rectangleGeometry._granularity,
374
+ rectangleGeometry._rotation,
375
+ 0,
376
+ rectangleScratch,
377
+ nwScratch
378
+ );
379
+ let geometry;
380
+ let boundingSphere;
381
+ if (Math_default.equalsEpsilon(
382
+ rectangle.north,
383
+ rectangle.south,
384
+ Math_default.EPSILON10
385
+ ) || Math_default.equalsEpsilon(
386
+ rectangle.east,
387
+ rectangle.west,
388
+ Math_default.EPSILON10
389
+ )) {
390
+ return void 0;
391
+ }
392
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
393
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
394
+ const extrude = !Math_default.equalsEpsilon(
395
+ surfaceHeight,
396
+ extrudedHeight,
397
+ 0,
398
+ Math_default.EPSILON2
399
+ );
400
+ let offsetValue;
401
+ if (extrude) {
402
+ geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
403
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
404
+ const size = geometry.attributes.position.values.length / 3;
405
+ let offsetAttribute = new Uint8Array(size);
406
+ if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
407
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
408
+ } else {
409
+ offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
410
+ offsetAttribute = offsetAttribute.fill(offsetValue);
411
+ }
412
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
413
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
414
+ componentsPerAttribute: 1,
415
+ values: offsetAttribute
416
+ });
387
417
  }
388
-
389
- result._rectangle = Matrix2.Rectangle.clone(rectangle, result._rectangle);
390
- result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
391
- result._surfaceHeight = height;
392
- result._rotation = rotation;
393
- result._extrudedHeight = extrudedHeight;
394
- result._offsetAttribute =
395
- offsetAttribute === -1 ? undefined : offsetAttribute;
396
-
397
- return result;
398
- };
399
-
400
- const nwScratch = new Matrix3.Cartographic();
401
- /**
402
- * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
403
- *
404
- * @param {RectangleOutlineGeometry} rectangleGeometry A description of the rectangle outline.
405
- * @returns {Geometry|undefined} The computed vertices and indices.
406
- *
407
- * @exception {DeveloperError} Rotated rectangle is invalid.
408
- */
409
- RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) {
410
- const rectangle = rectangleGeometry._rectangle;
411
- const ellipsoid = rectangleGeometry._ellipsoid;
412
- const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
418
+ const topBS = BoundingSphere_default.fromRectangle3D(
413
419
  rectangle,
414
- rectangleGeometry._granularity,
415
- rectangleGeometry._rotation,
416
- 0,
417
- rectangleScratch,
418
- nwScratch
419
- );
420
-
421
- let geometry;
422
- let boundingSphere;
423
-
424
- if (
425
- Math$1.CesiumMath.equalsEpsilon(
426
- rectangle.north,
427
- rectangle.south,
428
- Math$1.CesiumMath.EPSILON10
429
- ) ||
430
- Math$1.CesiumMath.equalsEpsilon(
431
- rectangle.east,
432
- rectangle.west,
433
- Math$1.CesiumMath.EPSILON10
434
- )
435
- ) {
436
- return undefined;
437
- }
438
-
439
- const surfaceHeight = rectangleGeometry._surfaceHeight;
440
- const extrudedHeight = rectangleGeometry._extrudedHeight;
441
- const extrude = !Math$1.CesiumMath.equalsEpsilon(
420
+ ellipsoid,
442
421
  surfaceHeight,
422
+ topBoundingSphere
423
+ );
424
+ const bottomBS = BoundingSphere_default.fromRectangle3D(
425
+ rectangle,
426
+ ellipsoid,
443
427
  extrudedHeight,
444
- 0,
445
- Math$1.CesiumMath.EPSILON2
428
+ bottomBoundingSphere
446
429
  );
447
- let offsetValue;
448
- if (extrude) {
449
- geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
450
- if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
451
- const size = geometry.attributes.position.values.length / 3;
452
- let offsetAttribute = new Uint8Array(size);
453
- if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
454
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
455
- } else {
456
- offsetValue =
457
- rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
458
- ? 0
459
- : 1;
460
- offsetAttribute = offsetAttribute.fill(offsetValue);
461
- }
462
-
463
- geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
464
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
465
- componentsPerAttribute: 1,
466
- values: offsetAttribute,
467
- });
468
- }
469
- const topBS = Transforms.BoundingSphere.fromRectangle3D(
470
- rectangle,
471
- ellipsoid,
472
- surfaceHeight,
473
- topBoundingSphere
474
- );
475
- const bottomBS = Transforms.BoundingSphere.fromRectangle3D(
476
- rectangle,
477
- ellipsoid,
478
- extrudedHeight,
479
- bottomBoundingSphere
480
- );
481
- boundingSphere = Transforms.BoundingSphere.union(topBS, bottomBS);
482
- } else {
483
- geometry = constructRectangle(rectangleGeometry, computedOptions);
484
- geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
485
- geometry.attributes.position.values,
486
- surfaceHeight,
487
- ellipsoid,
488
- false
489
- );
490
-
491
- if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
492
- const length = geometry.attributes.position.values.length;
493
- offsetValue =
494
- rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
495
- ? 0
496
- : 1;
497
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
498
- geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
499
- componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
500
- componentsPerAttribute: 1,
501
- values: applyOffset,
502
- });
503
- }
504
-
505
- boundingSphere = Transforms.BoundingSphere.fromRectangle3D(
506
- rectangle,
507
- ellipsoid,
508
- surfaceHeight
509
- );
510
- }
511
-
512
- return new GeometryAttribute.Geometry({
513
- attributes: geometry.attributes,
514
- indices: geometry.indices,
515
- primitiveType: GeometryAttribute.PrimitiveType.LINES,
516
- boundingSphere: boundingSphere,
517
- offsetAttribute: rectangleGeometry._offsetAttribute,
518
- });
519
- };
520
-
521
- function createRectangleOutlineGeometry(rectangleGeometry, offset) {
522
- if (defaultValue.defined(offset)) {
523
- rectangleGeometry = RectangleOutlineGeometry.unpack(
524
- rectangleGeometry,
525
- offset
526
- );
430
+ boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
431
+ } else {
432
+ geometry = constructRectangle(rectangleGeometry, computedOptions);
433
+ geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
434
+ geometry.attributes.position.values,
435
+ surfaceHeight,
436
+ ellipsoid,
437
+ false
438
+ );
439
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
440
+ const length = geometry.attributes.position.values.length;
441
+ offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
442
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
443
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
444
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
445
+ componentsPerAttribute: 1,
446
+ values: applyOffset
447
+ });
527
448
  }
528
- rectangleGeometry._ellipsoid = Matrix3.Ellipsoid.clone(rectangleGeometry._ellipsoid);
529
- rectangleGeometry._rectangle = Matrix2.Rectangle.clone(rectangleGeometry._rectangle);
530
- return RectangleOutlineGeometry.createGeometry(rectangleGeometry);
449
+ boundingSphere = BoundingSphere_default.fromRectangle3D(
450
+ rectangle,
451
+ ellipsoid,
452
+ surfaceHeight
453
+ );
531
454
  }
532
-
533
- return createRectangleOutlineGeometry;
534
-
535
- }));
455
+ return new Geometry_default({
456
+ attributes: geometry.attributes,
457
+ indices: geometry.indices,
458
+ primitiveType: PrimitiveType_default.LINES,
459
+ boundingSphere,
460
+ offsetAttribute: rectangleGeometry._offsetAttribute
461
+ });
462
+ };
463
+ var RectangleOutlineGeometry_default = RectangleOutlineGeometry;
464
+
465
+ // packages/engine/Source/Workers/createRectangleOutlineGeometry.js
466
+ function createRectangleOutlineGeometry(rectangleGeometry, offset) {
467
+ if (defined_default(offset)) {
468
+ rectangleGeometry = RectangleOutlineGeometry_default.unpack(
469
+ rectangleGeometry,
470
+ offset
471
+ );
472
+ }
473
+ rectangleGeometry._ellipsoid = Ellipsoid_default.clone(rectangleGeometry._ellipsoid);
474
+ rectangleGeometry._rectangle = Rectangle_default.clone(rectangleGeometry._rectangle);
475
+ return RectangleOutlineGeometry_default.createGeometry(rectangleGeometry);
476
+ }
477
+ var createRectangleOutlineGeometry_default = createRectangleOutlineGeometry;
478
+ export {
479
+ createRectangleOutlineGeometry_default as default
480
+ };