@gmgis/gm-sdk 1.12.5 → 2.0.2

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 (159) hide show
  1. package/dist/dist/index.js +1848 -0
  2. package/dist/gm.min.js +16983 -16483
  3. package/dist/index.js +1436 -1434
  4. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  5. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  8. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  9. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  10. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  11. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  12. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  13. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  14. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  15. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  16. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  17. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  18. package/dist/resources/Workers/{chunk-I2ITFFPX.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-PRGYLLJT.js → chunk-ARG42DC4.js} +2 -31
  21. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  22. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  23. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  24. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  25. package/dist/resources/Workers/{chunk-DI5NGJUP.js → chunk-D6AA5QVT.js} +2 -20
  26. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  27. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  28. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  29. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  30. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  31. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  32. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  33. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  34. package/dist/resources/Workers/{chunk-7JO7GPJN.js → chunk-GBYLG25F.js} +2 -15
  35. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  36. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  37. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  38. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  39. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  40. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  41. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  42. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  43. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  44. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  45. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  46. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  47. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  48. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  49. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  50. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  51. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  52. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  53. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  54. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  55. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  56. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  57. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  58. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  59. package/dist/resources/Workers/{chunk-6CHGCNMW.js → chunk-WZDE3RYP.js} +4 -34
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -40
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -32
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -209
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -175
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -121
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -481
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -199
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1237
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -542
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -34
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -205
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -45
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -38
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -33
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -35
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -32
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -210
  78. package/dist/resources/Workers/createGeometry.js +2 -144
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1582
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -198
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -98
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1381
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -509
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -470
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -354
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -251
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1246
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -453
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -374
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -92
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -92
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -466
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -361
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -359
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -236
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -539
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2252
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -729
  101. package/dist/resources/Workers/createWallGeometry.js +2 -464
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -312
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2642
  105. package/dist/resources/Workers/decodeI3S.js +2 -1319
  106. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  108. package/dist/resources/Workers/transcodeKTX2.js +29 -3360
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -793
  111. package/package.json +74 -74
  112. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  113. package/dist/resources/Workers/chunk-26GA3JAM.js +0 -139
  114. package/dist/resources/Workers/chunk-27HUZ7SA.js +0 -305
  115. package/dist/resources/Workers/chunk-2ZGOQXYU.js +0 -171
  116. package/dist/resources/Workers/chunk-3Q2L65QU.js +0 -1258
  117. package/dist/resources/Workers/chunk-472HQ3EH.js +0 -100
  118. package/dist/resources/Workers/chunk-5ODQSF26.js +0 -101
  119. package/dist/resources/Workers/chunk-5OOFQLKF.js +0 -634
  120. package/dist/resources/Workers/chunk-5PTXS2GO.js +0 -10390
  121. package/dist/resources/Workers/chunk-76BYBWHP.js +0 -122
  122. package/dist/resources/Workers/chunk-7BMOHCPM.js +0 -390
  123. package/dist/resources/Workers/chunk-7KTQP4VB.js +0 -59
  124. package/dist/resources/Workers/chunk-7O373FFS.js +0 -665
  125. package/dist/resources/Workers/chunk-AD63PIY6.js +0 -163
  126. package/dist/resources/Workers/chunk-BHQJ2NT7.js +0 -353
  127. package/dist/resources/Workers/chunk-C6YYBQXW.js +0 -102
  128. package/dist/resources/Workers/chunk-CKY7HOHV.js +0 -287
  129. package/dist/resources/Workers/chunk-DHYHSFFJ.js +0 -73
  130. package/dist/resources/Workers/chunk-E27BLMDD.js +0 -115
  131. package/dist/resources/Workers/chunk-E63IIM5T.js +0 -75
  132. package/dist/resources/Workers/chunk-E6V6SQZW.js +0 -456
  133. package/dist/resources/Workers/chunk-EJZTDTUH.js +0 -138
  134. package/dist/resources/Workers/chunk-FDOV2LBJ.js +0 -220
  135. package/dist/resources/Workers/chunk-FIGIZHAQ.js +0 -684
  136. package/dist/resources/Workers/chunk-GESF4OXQ.js +0 -1800
  137. package/dist/resources/Workers/chunk-GGZJN2TI.js +0 -2717
  138. package/dist/resources/Workers/chunk-GNBFYG7F.js +0 -1481
  139. package/dist/resources/Workers/chunk-GWCFU2SA.js +0 -300
  140. package/dist/resources/Workers/chunk-IBLIYJZR.js +0 -196
  141. package/dist/resources/Workers/chunk-JW4FOI6M.js +0 -476
  142. package/dist/resources/Workers/chunk-K4GQUNB5.js +0 -262
  143. package/dist/resources/Workers/chunk-M3GMB5OP.js +0 -834
  144. package/dist/resources/Workers/chunk-MXIZJAPH.js +0 -629
  145. package/dist/resources/Workers/chunk-N5KJGGCM.js +0 -1073
  146. package/dist/resources/Workers/chunk-NGPPMXRM.js +0 -435
  147. package/dist/resources/Workers/chunk-O3E4OAOE.js +0 -511
  148. package/dist/resources/Workers/chunk-PGRPDNHG.js +0 -1048
  149. package/dist/resources/Workers/chunk-S6MRMMQU.js +0 -157
  150. package/dist/resources/Workers/chunk-SMDOP47J.js +0 -945
  151. package/dist/resources/Workers/chunk-TGONEMZO.js +0 -421
  152. package/dist/resources/Workers/chunk-TKVT5GQM.js +0 -781
  153. package/dist/resources/Workers/chunk-U72QNFOJ.js +0 -758
  154. package/dist/resources/Workers/chunk-VJZB3WAV.js +0 -963
  155. package/dist/resources/Workers/chunk-VU2MNO7L.js +0 -239
  156. package/dist/resources/Workers/chunk-XY4BATBS.js +0 -500
  157. package/dist/resources/Workers/chunk-YFXQECWV.js +0 -2857
  158. package/dist/resources/Workers/chunk-YSGTGQQO.js +0 -398
  159. package/dist/resources/Workers/chunk-YZ733KKS.js +0 -368
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.122
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,1383 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- BoundingRectangle_default
28
- } from "./chunk-FDOV2LBJ.js";
29
- import {
30
- PolygonGeometryLibrary_default
31
- } from "./chunk-PGRPDNHG.js";
32
- import {
33
- ArcType_default
34
- } from "./chunk-PRGYLLJT.js";
35
- import {
36
- GeometryInstance_default
37
- } from "./chunk-7KTQP4VB.js";
38
- import {
39
- GeometryPipeline_default
40
- } from "./chunk-GGZJN2TI.js";
41
- import "./chunk-NGPPMXRM.js";
42
- import "./chunk-C6YYBQXW.js";
43
- import {
44
- GeometryOffsetAttribute_default
45
- } from "./chunk-I2ITFFPX.js";
46
- import {
47
- VertexFormat_default
48
- } from "./chunk-EJZTDTUH.js";
49
- import {
50
- EllipsoidTangentPlane_default
51
- } from "./chunk-CKY7HOHV.js";
52
- import "./chunk-S6MRMMQU.js";
53
- import {
54
- PolygonPipeline_default,
55
- WindingOrder_default
56
- } from "./chunk-SMDOP47J.js";
57
- import "./chunk-472HQ3EH.js";
58
- import "./chunk-E6V6SQZW.js";
59
- import {
60
- IntersectionTests_default,
61
- Ray_default
62
- } from "./chunk-3Q2L65QU.js";
63
- import "./chunk-2ZGOQXYU.js";
64
- import {
65
- IndexDatatype_default
66
- } from "./chunk-26GA3JAM.js";
67
- import "./chunk-DI5NGJUP.js";
68
- import {
69
- GeometryAttribute_default,
70
- Geometry_default
71
- } from "./chunk-GWCFU2SA.js";
72
- import {
73
- BoundingSphere_default
74
- } from "./chunk-VJZB3WAV.js";
75
- import {
76
- Quaternion_default,
77
- Rectangle_default
78
- } from "./chunk-5PTXS2GO.js";
79
- import {
80
- ComponentDatatype_default
81
- } from "./chunk-K4GQUNB5.js";
82
- import {
83
- Cartesian2_default,
84
- Cartesian3_default,
85
- Cartographic_default,
86
- Ellipsoid_default,
87
- Matrix3_default
88
- } from "./chunk-YFXQECWV.js";
89
- import {
90
- Math_default
91
- } from "./chunk-XY4BATBS.js";
92
- import "./chunk-MXIZJAPH.js";
93
- import "./chunk-6CHGCNMW.js";
94
- import {
95
- defaultValue_default
96
- } from "./chunk-7JO7GPJN.js";
97
- import {
98
- Check_default,
99
- DeveloperError_default
100
- } from "./chunk-AD63PIY6.js";
101
- import {
102
- defined_default
103
- } from "./chunk-E63IIM5T.js";
104
-
105
- // packages/engine/Source/Core/Stereographic.js
106
- function Stereographic(position, tangentPlane) {
107
- this.position = position;
108
- if (!defined_default(this.position)) {
109
- this.position = new Cartesian2_default();
110
- }
111
- this.tangentPlane = tangentPlane;
112
- if (!defined_default(this.tangentPlane)) {
113
- this.tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;
114
- }
115
- }
116
- Object.defineProperties(Stereographic.prototype, {
117
- /**
118
- * Gets the ellipsoid.
119
- * @memberof Stereographic.prototype
120
- * @type {Ellipsoid}
121
- */
122
- ellipsoid: {
123
- get: function() {
124
- return this.tangentPlane.ellipsoid;
125
- }
126
- },
127
- /**
128
- * Gets the x coordinate
129
- * @memberof Stereographic.prototype
130
- * @type {number}
131
- */
132
- x: {
133
- get: function() {
134
- return this.position.x;
135
- }
136
- },
137
- /**
138
- * Gets the y coordinate
139
- * @memberof Stereographic.prototype
140
- * @type {number}
141
- */
142
- y: {
143
- get: function() {
144
- return this.position.y;
145
- }
146
- },
147
- /**
148
- * Computes the conformal latitude, or the ellipsoidal latitude projected onto an arbitrary sphere.
149
- * @memberof Stereographic.prototype
150
- * @type {number}
151
- */
152
- conformalLatitude: {
153
- get: function() {
154
- const r = Cartesian2_default.magnitude(this.position);
155
- const d = 2 * this.ellipsoid.maximumRadius;
156
- const sign = this.tangentPlane.plane.normal.z;
157
- return sign * (Math_default.PI_OVER_TWO - 2 * Math.atan2(r, d));
158
- }
159
- },
160
- /**
161
- * Computes the longitude
162
- * @memberof Stereographic.prototype
163
- * @type {number}
164
- */
165
- longitude: {
166
- get: function() {
167
- let longitude = Math_default.PI_OVER_TWO + Math.atan2(this.y, this.x);
168
- if (longitude > Math.PI) {
169
- longitude -= Math_default.TWO_PI;
170
- }
171
- return longitude;
172
- }
173
- }
174
- });
175
- var scratchCartographic = new Cartographic_default();
176
- var scratchCartesian = new Cartesian3_default();
177
- Stereographic.prototype.getLatitude = function(ellipsoid) {
178
- if (!defined_default(ellipsoid)) {
179
- ellipsoid = Ellipsoid_default.default;
180
- }
181
- scratchCartographic.latitude = this.conformalLatitude;
182
- scratchCartographic.longitude = this.longitude;
183
- scratchCartographic.height = 0;
184
- const cartesian = this.ellipsoid.cartographicToCartesian(
185
- scratchCartographic,
186
- scratchCartesian
187
- );
188
- ellipsoid.cartesianToCartographic(cartesian, scratchCartographic);
189
- return scratchCartographic.latitude;
190
- };
191
- var scratchProjectPointOntoPlaneRay = new Ray_default();
192
- var scratchProjectPointOntoPlaneRayDirection = new Cartesian3_default();
193
- var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
194
- Stereographic.fromCartesian = function(cartesian, result) {
195
- Check_default.defined("cartesian", cartesian);
196
- const sign = Math_default.signNotZero(cartesian.z);
197
- let tangentPlane = Stereographic.NORTH_POLE_TANGENT_PLANE;
198
- let origin = Stereographic.SOUTH_POLE;
199
- if (sign < 0) {
200
- tangentPlane = Stereographic.SOUTH_POLE_TANGENT_PLANE;
201
- origin = Stereographic.NORTH_POLE;
202
- }
203
- const ray = scratchProjectPointOntoPlaneRay;
204
- ray.origin = tangentPlane.ellipsoid.scaleToGeocentricSurface(
205
- cartesian,
206
- ray.origin
207
- );
208
- ray.direction = Cartesian3_default.subtract(
209
- ray.origin,
210
- origin,
211
- scratchProjectPointOntoPlaneRayDirection
212
- );
213
- Cartesian3_default.normalize(ray.direction, ray.direction);
214
- const intersectionPoint = IntersectionTests_default.rayPlane(
215
- ray,
216
- tangentPlane.plane,
217
- scratchProjectPointOntoPlaneCartesian3
218
- );
219
- const v = Cartesian3_default.subtract(intersectionPoint, origin, intersectionPoint);
220
- const x = Cartesian3_default.dot(tangentPlane.xAxis, v);
221
- const y = sign * Cartesian3_default.dot(tangentPlane.yAxis, v);
222
- if (!defined_default(result)) {
223
- return new Stereographic(new Cartesian2_default(x, y), tangentPlane);
224
- }
225
- result.position = new Cartesian2_default(x, y);
226
- result.tangentPlane = tangentPlane;
227
- return result;
228
- };
229
- Stereographic.fromCartesianArray = function(cartesians, result) {
230
- Check_default.defined("cartesians", cartesians);
231
- const length = cartesians.length;
232
- if (!defined_default(result)) {
233
- result = new Array(length);
234
- } else {
235
- result.length = length;
236
- }
237
- for (let i = 0; i < length; i++) {
238
- result[i] = Stereographic.fromCartesian(cartesians[i], result[i]);
239
- }
240
- return result;
241
- };
242
- Stereographic.clone = function(stereographic, result) {
243
- if (!defined_default(stereographic)) {
244
- return void 0;
245
- }
246
- if (!defined_default(result)) {
247
- return new Stereographic(
248
- stereographic.position,
249
- stereographic.tangentPlane
250
- );
251
- }
252
- result.position = stereographic.position;
253
- result.tangentPlane = stereographic.tangentPlane;
254
- return result;
255
- };
256
- Stereographic.HALF_UNIT_SPHERE = Object.freeze(new Ellipsoid_default(0.5, 0.5, 0.5));
257
- Stereographic.NORTH_POLE = Object.freeze(new Cartesian3_default(0, 0, 0.5));
258
- Stereographic.SOUTH_POLE = Object.freeze(new Cartesian3_default(0, 0, -0.5));
259
- Stereographic.NORTH_POLE_TANGENT_PLANE = Object.freeze(
260
- new EllipsoidTangentPlane_default(
261
- Stereographic.NORTH_POLE,
262
- Stereographic.HALF_UNIT_SPHERE
263
- )
264
- );
265
- Stereographic.SOUTH_POLE_TANGENT_PLANE = Object.freeze(
266
- new EllipsoidTangentPlane_default(
267
- Stereographic.SOUTH_POLE,
268
- Stereographic.HALF_UNIT_SPHERE
269
- )
270
- );
271
- var Stereographic_default = Stereographic;
272
-
273
- // packages/engine/Source/Core/PolygonGeometry.js
274
- var scratchCarto1 = new Cartographic_default();
275
- var scratchCarto2 = new Cartographic_default();
276
- function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
277
- const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
278
- const height = carto1.height;
279
- const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
280
- p1Carto.height = height;
281
- ellipsoid.cartographicToCartesian(p1Carto, p1);
282
- const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
283
- p2Carto.height = height - 100;
284
- ellipsoid.cartographicToCartesian(p2Carto, p2);
285
- }
286
- var scratchBoundingRectangle = new BoundingRectangle_default();
287
- var scratchPosition = new Cartesian3_default();
288
- var scratchNormal = new Cartesian3_default();
289
- var scratchTangent = new Cartesian3_default();
290
- var scratchBitangent = new Cartesian3_default();
291
- var p1Scratch = new Cartesian3_default();
292
- var p2Scratch = new Cartesian3_default();
293
- var scratchPerPosNormal = new Cartesian3_default();
294
- var scratchPerPosTangent = new Cartesian3_default();
295
- var scratchPerPosBitangent = new Cartesian3_default();
296
- var appendTextureCoordinatesOrigin = new Cartesian2_default();
297
- var appendTextureCoordinatesCartesian2 = new Cartesian2_default();
298
- var appendTextureCoordinatesCartesian3 = new Cartesian3_default();
299
- var appendTextureCoordinatesQuaternion = new Quaternion_default();
300
- var appendTextureCoordinatesMatrix3 = new Matrix3_default();
301
- var tangentMatrixScratch = new Matrix3_default();
302
- function computeAttributes(options) {
303
- const vertexFormat = options.vertexFormat;
304
- const geometry = options.geometry;
305
- const shadowVolume = options.shadowVolume;
306
- const flatPositions = geometry.attributes.position.values;
307
- const flatTexcoords = defined_default(geometry.attributes.st) ? geometry.attributes.st.values : void 0;
308
- let length = flatPositions.length;
309
- const wall = options.wall;
310
- const top = options.top || wall;
311
- const bottom = options.bottom || wall;
312
- if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
313
- const boundingRectangle = options.boundingRectangle;
314
- const rotationAxis = options.rotationAxis;
315
- const projectTo2d = options.projectTo2d;
316
- const ellipsoid = options.ellipsoid;
317
- const stRotation = options.stRotation;
318
- const perPositionHeight = options.perPositionHeight;
319
- const origin = appendTextureCoordinatesOrigin;
320
- origin.x = boundingRectangle.x;
321
- origin.y = boundingRectangle.y;
322
- const textureCoordinates = vertexFormat.st ? new Float32Array(2 * (length / 3)) : void 0;
323
- let normals;
324
- if (vertexFormat.normal) {
325
- if (perPositionHeight && top && !wall) {
326
- normals = geometry.attributes.normal.values;
327
- } else {
328
- normals = new Float32Array(length);
329
- }
330
- }
331
- const tangents = vertexFormat.tangent ? new Float32Array(length) : void 0;
332
- const bitangents = vertexFormat.bitangent ? new Float32Array(length) : void 0;
333
- const extrudeNormals = shadowVolume ? new Float32Array(length) : void 0;
334
- let textureCoordIndex = 0;
335
- let attrIndex = 0;
336
- let normal = scratchNormal;
337
- let tangent = scratchTangent;
338
- let bitangent = scratchBitangent;
339
- let recomputeNormal = true;
340
- let textureMatrix = appendTextureCoordinatesMatrix3;
341
- let tangentRotationMatrix = tangentMatrixScratch;
342
- if (stRotation !== 0) {
343
- let rotation = Quaternion_default.fromAxisAngle(
344
- rotationAxis,
345
- stRotation,
346
- appendTextureCoordinatesQuaternion
347
- );
348
- textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
349
- rotation = Quaternion_default.fromAxisAngle(
350
- rotationAxis,
351
- -stRotation,
352
- appendTextureCoordinatesQuaternion
353
- );
354
- tangentRotationMatrix = Matrix3_default.fromQuaternion(
355
- rotation,
356
- tangentRotationMatrix
357
- );
358
- } else {
359
- textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
360
- tangentRotationMatrix = Matrix3_default.clone(
361
- Matrix3_default.IDENTITY,
362
- tangentRotationMatrix
363
- );
364
- }
365
- let bottomOffset = 0;
366
- let bottomOffset2 = 0;
367
- if (top && bottom) {
368
- bottomOffset = length / 2;
369
- bottomOffset2 = length / 3;
370
- length /= 2;
371
- }
372
- for (let i = 0; i < length; i += 3) {
373
- const position = Cartesian3_default.fromArray(
374
- flatPositions,
375
- i,
376
- appendTextureCoordinatesCartesian3
377
- );
378
- if (vertexFormat.st) {
379
- if (!defined_default(flatTexcoords)) {
380
- let p = Matrix3_default.multiplyByVector(
381
- textureMatrix,
382
- position,
383
- scratchPosition
384
- );
385
- p = ellipsoid.scaleToGeodeticSurface(p, p);
386
- const st = projectTo2d([p], appendTextureCoordinatesCartesian2)[0];
387
- Cartesian2_default.subtract(st, origin, st);
388
- const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
389
- const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
390
- if (bottom) {
391
- textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
392
- textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
393
- }
394
- if (top) {
395
- textureCoordinates[textureCoordIndex] = stx;
396
- textureCoordinates[textureCoordIndex + 1] = sty;
397
- }
398
- textureCoordIndex += 2;
399
- }
400
- }
401
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
402
- const attrIndex1 = attrIndex + 1;
403
- const attrIndex2 = attrIndex + 2;
404
- if (wall) {
405
- if (i + 3 < length) {
406
- const p1 = Cartesian3_default.fromArray(flatPositions, i + 3, p1Scratch);
407
- if (recomputeNormal) {
408
- const p2 = Cartesian3_default.fromArray(
409
- flatPositions,
410
- i + length,
411
- p2Scratch
412
- );
413
- if (perPositionHeight) {
414
- adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
415
- }
416
- Cartesian3_default.subtract(p1, position, p1);
417
- Cartesian3_default.subtract(p2, position, p2);
418
- normal = Cartesian3_default.normalize(
419
- Cartesian3_default.cross(p2, p1, normal),
420
- normal
421
- );
422
- recomputeNormal = false;
423
- }
424
- if (Cartesian3_default.equalsEpsilon(p1, position, Math_default.EPSILON10)) {
425
- recomputeNormal = true;
426
- }
427
- }
428
- if (vertexFormat.tangent || vertexFormat.bitangent) {
429
- bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
430
- if (vertexFormat.tangent) {
431
- tangent = Cartesian3_default.normalize(
432
- Cartesian3_default.cross(bitangent, normal, tangent),
433
- tangent
434
- );
435
- }
436
- }
437
- } else {
438
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
439
- if (vertexFormat.tangent || vertexFormat.bitangent) {
440
- if (perPositionHeight) {
441
- scratchPerPosNormal = Cartesian3_default.fromArray(
442
- normals,
443
- attrIndex,
444
- scratchPerPosNormal
445
- );
446
- scratchPerPosTangent = Cartesian3_default.cross(
447
- Cartesian3_default.UNIT_Z,
448
- scratchPerPosNormal,
449
- scratchPerPosTangent
450
- );
451
- scratchPerPosTangent = Cartesian3_default.normalize(
452
- Matrix3_default.multiplyByVector(
453
- tangentRotationMatrix,
454
- scratchPerPosTangent,
455
- scratchPerPosTangent
456
- ),
457
- scratchPerPosTangent
458
- );
459
- if (vertexFormat.bitangent) {
460
- scratchPerPosBitangent = Cartesian3_default.normalize(
461
- Cartesian3_default.cross(
462
- scratchPerPosNormal,
463
- scratchPerPosTangent,
464
- scratchPerPosBitangent
465
- ),
466
- scratchPerPosBitangent
467
- );
468
- }
469
- }
470
- tangent = Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent);
471
- tangent = Cartesian3_default.normalize(
472
- Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent),
473
- tangent
474
- );
475
- if (vertexFormat.bitangent) {
476
- bitangent = Cartesian3_default.normalize(
477
- Cartesian3_default.cross(normal, tangent, bitangent),
478
- bitangent
479
- );
480
- }
481
- }
482
- }
483
- if (vertexFormat.normal) {
484
- if (options.wall) {
485
- normals[attrIndex + bottomOffset] = normal.x;
486
- normals[attrIndex1 + bottomOffset] = normal.y;
487
- normals[attrIndex2 + bottomOffset] = normal.z;
488
- } else if (bottom) {
489
- normals[attrIndex + bottomOffset] = -normal.x;
490
- normals[attrIndex1 + bottomOffset] = -normal.y;
491
- normals[attrIndex2 + bottomOffset] = -normal.z;
492
- }
493
- if (top && !perPositionHeight || wall) {
494
- normals[attrIndex] = normal.x;
495
- normals[attrIndex1] = normal.y;
496
- normals[attrIndex2] = normal.z;
497
- }
498
- }
499
- if (shadowVolume) {
500
- if (wall) {
501
- normal = ellipsoid.geodeticSurfaceNormal(position, normal);
502
- }
503
- extrudeNormals[attrIndex + bottomOffset] = -normal.x;
504
- extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
505
- extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
506
- }
507
- if (vertexFormat.tangent) {
508
- if (options.wall) {
509
- tangents[attrIndex + bottomOffset] = tangent.x;
510
- tangents[attrIndex1 + bottomOffset] = tangent.y;
511
- tangents[attrIndex2 + bottomOffset] = tangent.z;
512
- } else if (bottom) {
513
- tangents[attrIndex + bottomOffset] = -tangent.x;
514
- tangents[attrIndex1 + bottomOffset] = -tangent.y;
515
- tangents[attrIndex2 + bottomOffset] = -tangent.z;
516
- }
517
- if (top) {
518
- if (perPositionHeight) {
519
- tangents[attrIndex] = scratchPerPosTangent.x;
520
- tangents[attrIndex1] = scratchPerPosTangent.y;
521
- tangents[attrIndex2] = scratchPerPosTangent.z;
522
- } else {
523
- tangents[attrIndex] = tangent.x;
524
- tangents[attrIndex1] = tangent.y;
525
- tangents[attrIndex2] = tangent.z;
526
- }
527
- }
528
- }
529
- if (vertexFormat.bitangent) {
530
- if (bottom) {
531
- bitangents[attrIndex + bottomOffset] = bitangent.x;
532
- bitangents[attrIndex1 + bottomOffset] = bitangent.y;
533
- bitangents[attrIndex2 + bottomOffset] = bitangent.z;
534
- }
535
- if (top) {
536
- if (perPositionHeight) {
537
- bitangents[attrIndex] = scratchPerPosBitangent.x;
538
- bitangents[attrIndex1] = scratchPerPosBitangent.y;
539
- bitangents[attrIndex2] = scratchPerPosBitangent.z;
540
- } else {
541
- bitangents[attrIndex] = bitangent.x;
542
- bitangents[attrIndex1] = bitangent.y;
543
- bitangents[attrIndex2] = bitangent.z;
544
- }
545
- }
546
- }
547
- attrIndex += 3;
548
- }
549
- }
550
- if (vertexFormat.st && !defined_default(flatTexcoords)) {
551
- geometry.attributes.st = new GeometryAttribute_default({
552
- componentDatatype: ComponentDatatype_default.FLOAT,
553
- componentsPerAttribute: 2,
554
- values: textureCoordinates
555
- });
556
- }
557
- if (vertexFormat.normal) {
558
- geometry.attributes.normal = new GeometryAttribute_default({
559
- componentDatatype: ComponentDatatype_default.FLOAT,
560
- componentsPerAttribute: 3,
561
- values: normals
562
- });
563
- }
564
- if (vertexFormat.tangent) {
565
- geometry.attributes.tangent = new GeometryAttribute_default({
566
- componentDatatype: ComponentDatatype_default.FLOAT,
567
- componentsPerAttribute: 3,
568
- values: tangents
569
- });
570
- }
571
- if (vertexFormat.bitangent) {
572
- geometry.attributes.bitangent = new GeometryAttribute_default({
573
- componentDatatype: ComponentDatatype_default.FLOAT,
574
- componentsPerAttribute: 3,
575
- values: bitangents
576
- });
577
- }
578
- if (shadowVolume) {
579
- geometry.attributes.extrudeDirection = new GeometryAttribute_default({
580
- componentDatatype: ComponentDatatype_default.FLOAT,
581
- componentsPerAttribute: 3,
582
- values: extrudeNormals
583
- });
584
- }
585
- }
586
- if (options.extrude && defined_default(options.offsetAttribute)) {
587
- const size = flatPositions.length / 3;
588
- let offsetAttribute = new Uint8Array(size);
589
- if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
590
- if (top && bottom || wall) {
591
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
592
- } else if (top) {
593
- offsetAttribute = offsetAttribute.fill(1);
594
- }
595
- } else {
596
- const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
597
- offsetAttribute = offsetAttribute.fill(offsetValue);
598
- }
599
- geometry.attributes.applyOffset = new GeometryAttribute_default({
600
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
601
- componentsPerAttribute: 1,
602
- values: offsetAttribute
603
- });
604
- }
605
- return geometry;
606
- }
607
- var createGeometryFromPositionsExtrudedPositions = [];
608
- function createGeometryFromPositionsExtruded(ellipsoid, polygon2, textureCoordinates, granularity, hierarchy, perPositionHeight, closeTop, closeBottom, vertexFormat, arcType) {
609
- const geos = {
610
- walls: []
611
- };
612
- let i;
613
- if (closeTop || closeBottom) {
614
- const topGeo = PolygonGeometryLibrary_default.createGeometryFromPositions(
615
- ellipsoid,
616
- polygon2,
617
- textureCoordinates,
618
- granularity,
619
- perPositionHeight,
620
- vertexFormat,
621
- arcType
622
- );
623
- const edgePoints = topGeo.attributes.position.values;
624
- const indices = topGeo.indices;
625
- let numPositions;
626
- let newIndices;
627
- if (closeTop && closeBottom) {
628
- const topBottomPositions = edgePoints.concat(edgePoints);
629
- numPositions = topBottomPositions.length / 3;
630
- newIndices = IndexDatatype_default.createTypedArray(
631
- numPositions,
632
- indices.length * 2
633
- );
634
- newIndices.set(indices);
635
- const ilength = indices.length;
636
- const length = numPositions / 2;
637
- for (i = 0; i < ilength; i += 3) {
638
- const i0 = newIndices[i] + length;
639
- const i1 = newIndices[i + 1] + length;
640
- const i2 = newIndices[i + 2] + length;
641
- newIndices[i + ilength] = i2;
642
- newIndices[i + 1 + ilength] = i1;
643
- newIndices[i + 2 + ilength] = i0;
644
- }
645
- topGeo.attributes.position.values = topBottomPositions;
646
- if (perPositionHeight && vertexFormat.normal) {
647
- const normals = topGeo.attributes.normal.values;
648
- topGeo.attributes.normal.values = new Float32Array(
649
- topBottomPositions.length
650
- );
651
- topGeo.attributes.normal.values.set(normals);
652
- }
653
- if (vertexFormat.st && defined_default(textureCoordinates)) {
654
- const texcoords = topGeo.attributes.st.values;
655
- topGeo.attributes.st.values = new Float32Array(numPositions * 2);
656
- topGeo.attributes.st.values = texcoords.concat(texcoords);
657
- }
658
- topGeo.indices = newIndices;
659
- } else if (closeBottom) {
660
- numPositions = edgePoints.length / 3;
661
- newIndices = IndexDatatype_default.createTypedArray(numPositions, indices.length);
662
- for (i = 0; i < indices.length; i += 3) {
663
- newIndices[i] = indices[i + 2];
664
- newIndices[i + 1] = indices[i + 1];
665
- newIndices[i + 2] = indices[i];
666
- }
667
- topGeo.indices = newIndices;
668
- }
669
- geos.topAndBottom = new GeometryInstance_default({
670
- geometry: topGeo
671
- });
672
- }
673
- let outerRing = hierarchy.outerRing;
674
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
675
- let positions2D = tangentPlane.projectPointsOntoPlane(
676
- outerRing,
677
- createGeometryFromPositionsExtrudedPositions
678
- );
679
- let windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
680
- if (windingOrder === WindingOrder_default.CLOCKWISE) {
681
- outerRing = outerRing.slice().reverse();
682
- }
683
- let wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
684
- outerRing,
685
- textureCoordinates,
686
- ellipsoid,
687
- granularity,
688
- perPositionHeight,
689
- arcType
690
- );
691
- geos.walls.push(
692
- new GeometryInstance_default({
693
- geometry: wallGeo
694
- })
695
- );
696
- const holes = hierarchy.holes;
697
- for (i = 0; i < holes.length; i++) {
698
- let hole = holes[i];
699
- positions2D = tangentPlane.projectPointsOntoPlane(
700
- hole,
701
- createGeometryFromPositionsExtrudedPositions
702
- );
703
- windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
704
- if (windingOrder === WindingOrder_default.COUNTER_CLOCKWISE) {
705
- hole = hole.slice().reverse();
706
- }
707
- wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
708
- hole,
709
- textureCoordinates,
710
- ellipsoid,
711
- granularity,
712
- perPositionHeight,
713
- arcType
714
- );
715
- geos.walls.push(
716
- new GeometryInstance_default({
717
- geometry: wallGeo
718
- })
719
- );
720
- }
721
- return geos;
722
- }
723
- function PolygonGeometry(options) {
724
- Check_default.typeOf.object("options", options);
725
- Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
726
- if (defined_default(options.perPositionHeight) && options.perPositionHeight && defined_default(options.height)) {
727
- throw new DeveloperError_default(
728
- "Cannot use both options.perPositionHeight and options.height"
729
- );
730
- }
731
- if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
732
- throw new DeveloperError_default(
733
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
734
- );
735
- }
736
- const polygonHierarchy = options.polygonHierarchy;
737
- const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
738
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
739
- const granularity = defaultValue_default(
740
- options.granularity,
741
- Math_default.RADIANS_PER_DEGREE
742
- );
743
- const stRotation = defaultValue_default(options.stRotation, 0);
744
- const textureCoordinates = options.textureCoordinates;
745
- const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
746
- const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
747
- let height = defaultValue_default(options.height, 0);
748
- let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
749
- if (!perPositionHeightExtrude) {
750
- const h = Math.max(height, extrudedHeight);
751
- extrudedHeight = Math.min(height, extrudedHeight);
752
- height = h;
753
- }
754
- this._vertexFormat = VertexFormat_default.clone(vertexFormat);
755
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
756
- this._granularity = granularity;
757
- this._stRotation = stRotation;
758
- this._height = height;
759
- this._extrudedHeight = extrudedHeight;
760
- this._closeTop = defaultValue_default(options.closeTop, true);
761
- this._closeBottom = defaultValue_default(options.closeBottom, true);
762
- this._polygonHierarchy = polygonHierarchy;
763
- this._perPositionHeight = perPositionHeight;
764
- this._perPositionHeightExtrude = perPositionHeightExtrude;
765
- this._shadowVolume = defaultValue_default(options.shadowVolume, false);
766
- this._workerName = "createPolygonGeometry";
767
- this._offsetAttribute = options.offsetAttribute;
768
- this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
769
- this._rectangle = void 0;
770
- this._textureCoordinateRotationPoints = void 0;
771
- this._textureCoordinates = textureCoordinates;
772
- this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
773
- polygonHierarchy,
774
- Cartesian3_default
775
- ) + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + (textureCoordinates ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
776
- textureCoordinates,
777
- Cartesian2_default
778
- ) : 1) + 12;
779
- }
780
- PolygonGeometry.fromPositions = function(options) {
781
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
782
- Check_default.defined("options.positions", options.positions);
783
- const newOptions = {
784
- polygonHierarchy: {
785
- positions: options.positions
786
- },
787
- height: options.height,
788
- extrudedHeight: options.extrudedHeight,
789
- vertexFormat: options.vertexFormat,
790
- stRotation: options.stRotation,
791
- ellipsoid: options.ellipsoid,
792
- granularity: options.granularity,
793
- perPositionHeight: options.perPositionHeight,
794
- closeTop: options.closeTop,
795
- closeBottom: options.closeBottom,
796
- offsetAttribute: options.offsetAttribute,
797
- arcType: options.arcType,
798
- textureCoordinates: options.textureCoordinates
799
- };
800
- return new PolygonGeometry(newOptions);
801
- };
802
- PolygonGeometry.pack = function(value, array, startingIndex) {
803
- Check_default.typeOf.object("value", value);
804
- Check_default.defined("array", array);
805
- startingIndex = defaultValue_default(startingIndex, 0);
806
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
807
- value._polygonHierarchy,
808
- array,
809
- startingIndex,
810
- Cartesian3_default
811
- );
812
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
813
- startingIndex += Ellipsoid_default.packedLength;
814
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
815
- startingIndex += VertexFormat_default.packedLength;
816
- array[startingIndex++] = value._height;
817
- array[startingIndex++] = value._extrudedHeight;
818
- array[startingIndex++] = value._granularity;
819
- array[startingIndex++] = value._stRotation;
820
- array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
821
- array[startingIndex++] = value._perPositionHeight ? 1 : 0;
822
- array[startingIndex++] = value._closeTop ? 1 : 0;
823
- array[startingIndex++] = value._closeBottom ? 1 : 0;
824
- array[startingIndex++] = value._shadowVolume ? 1 : 0;
825
- array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
826
- array[startingIndex++] = value._arcType;
827
- if (defined_default(value._textureCoordinates)) {
828
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
829
- value._textureCoordinates,
830
- array,
831
- startingIndex,
832
- Cartesian2_default
833
- );
834
- } else {
835
- array[startingIndex++] = -1;
836
- }
837
- array[startingIndex++] = value.packedLength;
838
- return array;
839
- };
840
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
841
- var scratchVertexFormat = new VertexFormat_default();
842
- var dummyOptions = {
843
- polygonHierarchy: {}
844
- };
845
- PolygonGeometry.unpack = function(array, startingIndex, result) {
846
- Check_default.defined("array", array);
847
- startingIndex = defaultValue_default(startingIndex, 0);
848
- const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
849
- array,
850
- startingIndex,
851
- Cartesian3_default
852
- );
853
- startingIndex = polygonHierarchy.startingIndex;
854
- delete polygonHierarchy.startingIndex;
855
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
856
- startingIndex += Ellipsoid_default.packedLength;
857
- const vertexFormat = VertexFormat_default.unpack(
858
- array,
859
- startingIndex,
860
- scratchVertexFormat
861
- );
862
- startingIndex += VertexFormat_default.packedLength;
863
- const height = array[startingIndex++];
864
- const extrudedHeight = array[startingIndex++];
865
- const granularity = array[startingIndex++];
866
- const stRotation = array[startingIndex++];
867
- const perPositionHeightExtrude = array[startingIndex++] === 1;
868
- const perPositionHeight = array[startingIndex++] === 1;
869
- const closeTop = array[startingIndex++] === 1;
870
- const closeBottom = array[startingIndex++] === 1;
871
- const shadowVolume = array[startingIndex++] === 1;
872
- const offsetAttribute = array[startingIndex++];
873
- const arcType = array[startingIndex++];
874
- const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
875
- array,
876
- startingIndex,
877
- Cartesian2_default
878
- );
879
- if (defined_default(textureCoordinates)) {
880
- startingIndex = textureCoordinates.startingIndex;
881
- delete textureCoordinates.startingIndex;
882
- } else {
883
- startingIndex++;
884
- }
885
- const packedLength = array[startingIndex++];
886
- if (!defined_default(result)) {
887
- result = new PolygonGeometry(dummyOptions);
888
- }
889
- result._polygonHierarchy = polygonHierarchy;
890
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
891
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
892
- result._height = height;
893
- result._extrudedHeight = extrudedHeight;
894
- result._granularity = granularity;
895
- result._stRotation = stRotation;
896
- result._perPositionHeightExtrude = perPositionHeightExtrude;
897
- result._perPositionHeight = perPositionHeight;
898
- result._closeTop = closeTop;
899
- result._closeBottom = closeBottom;
900
- result._shadowVolume = shadowVolume;
901
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
902
- result._arcType = arcType;
903
- result._textureCoordinates = textureCoordinates;
904
- result.packedLength = packedLength;
905
- return result;
906
- };
907
- var scratchCartesian0 = new Cartesian2_default();
908
- var scratchCartesian1 = new Cartesian2_default();
909
- var scratchPolarClosest = new Stereographic_default();
910
- function expandRectangle(polar, lastPolar, ellipsoid, arcType, polygon2, result) {
911
- const longitude = polar.longitude;
912
- const lonAdjusted = longitude >= 0 ? longitude : longitude + Math_default.TWO_PI;
913
- polygon2.westOverIdl = Math.min(polygon2.westOverIdl, lonAdjusted);
914
- polygon2.eastOverIdl = Math.max(polygon2.eastOverIdl, lonAdjusted);
915
- result.west = Math.min(result.west, longitude);
916
- result.east = Math.max(result.east, longitude);
917
- const latitude = polar.getLatitude(ellipsoid);
918
- let segmentLatitude = latitude;
919
- result.south = Math.min(result.south, latitude);
920
- result.north = Math.max(result.north, latitude);
921
- if (arcType !== ArcType_default.RHUMB) {
922
- const segment = Cartesian2_default.subtract(
923
- lastPolar.position,
924
- polar.position,
925
- scratchCartesian0
926
- );
927
- const t = Cartesian2_default.dot(lastPolar.position, segment) / Cartesian2_default.dot(segment, segment);
928
- if (t > 0 && t < 1) {
929
- const projected = Cartesian2_default.add(
930
- lastPolar.position,
931
- Cartesian2_default.multiplyByScalar(segment, -t, segment),
932
- scratchCartesian1
933
- );
934
- const closestPolar = Stereographic_default.clone(lastPolar, scratchPolarClosest);
935
- closestPolar.position = projected;
936
- const adjustedLatitude = closestPolar.getLatitude(ellipsoid);
937
- result.south = Math.min(result.south, adjustedLatitude);
938
- result.north = Math.max(result.north, adjustedLatitude);
939
- if (Math.abs(latitude) > Math.abs(adjustedLatitude)) {
940
- segmentLatitude = adjustedLatitude;
941
- }
942
- }
943
- }
944
- const direction = lastPolar.x * polar.y - polar.x * lastPolar.y;
945
- let angle = Math.sign(direction);
946
- if (angle !== 0) {
947
- angle *= Cartesian2_default.angleBetween(lastPolar.position, polar.position);
948
- }
949
- if (segmentLatitude >= 0) {
950
- polygon2.northAngle += angle;
951
- }
952
- if (segmentLatitude <= 0) {
953
- polygon2.southAngle += angle;
954
- }
955
- }
956
- var scratchPolar = new Stereographic_default();
957
- var scratchPolarPrevious = new Stereographic_default();
958
- var polygon = {
959
- northAngle: 0,
960
- southAngle: 0,
961
- westOverIdl: 0,
962
- eastOverIdl: 0
963
- };
964
- PolygonGeometry.computeRectangleFromPositions = function(positions, ellipsoid, arcType, result) {
965
- Check_default.defined("positions", positions);
966
- if (!defined_default(result)) {
967
- result = new Rectangle_default();
968
- }
969
- if (positions.length < 3) {
970
- return result;
971
- }
972
- result.west = Number.POSITIVE_INFINITY;
973
- result.east = Number.NEGATIVE_INFINITY;
974
- result.south = Number.POSITIVE_INFINITY;
975
- result.north = Number.NEGATIVE_INFINITY;
976
- polygon.northAngle = 0;
977
- polygon.southAngle = 0;
978
- polygon.westOverIdl = Number.POSITIVE_INFINITY;
979
- polygon.eastOverIdl = Number.NEGATIVE_INFINITY;
980
- const positionsLength = positions.length;
981
- let lastPolarPosition = Stereographic_default.fromCartesian(
982
- positions[0],
983
- scratchPolarPrevious
984
- );
985
- for (let i = 1; i < positionsLength; i++) {
986
- const polarPosition = Stereographic_default.fromCartesian(
987
- positions[i],
988
- scratchPolar
989
- );
990
- expandRectangle(
991
- polarPosition,
992
- lastPolarPosition,
993
- ellipsoid,
994
- arcType,
995
- polygon,
996
- result
997
- );
998
- lastPolarPosition = Stereographic_default.clone(polarPosition, lastPolarPosition);
999
- }
1000
- expandRectangle(
1001
- Stereographic_default.fromCartesian(positions[0], scratchPolar),
1002
- lastPolarPosition,
1003
- ellipsoid,
1004
- arcType,
1005
- polygon,
1006
- result
1007
- );
1008
- if (result.east - result.west > polygon.eastOverIdl - polygon.westOverIdl) {
1009
- result.west = polygon.westOverIdl;
1010
- result.east = polygon.eastOverIdl;
1011
- if (result.east > Math_default.PI) {
1012
- result.east = result.east - Math_default.TWO_PI;
1013
- }
1014
- if (result.west > Math_default.PI) {
1015
- result.west = result.west - Math_default.TWO_PI;
1016
- }
1017
- }
1018
- if (Math_default.equalsEpsilon(
1019
- Math.abs(polygon.northAngle),
1020
- Math_default.TWO_PI,
1021
- Math_default.EPSILON10
1022
- )) {
1023
- result.north = Math_default.PI_OVER_TWO;
1024
- result.east = Math_default.PI;
1025
- result.west = -Math_default.PI;
1026
- }
1027
- if (Math_default.equalsEpsilon(
1028
- Math.abs(polygon.southAngle),
1029
- Math_default.TWO_PI,
1030
- Math_default.EPSILON10
1031
- )) {
1032
- result.south = -Math_default.PI_OVER_TWO;
1033
- result.east = Math_default.PI;
1034
- result.west = -Math_default.PI;
1035
- }
1036
- return result;
1037
- };
1038
- var scratchPolarForPlane = new Stereographic_default();
1039
- function getTangentPlane(rectangle, positions, ellipsoid) {
1040
- if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
1041
- const polar = Stereographic_default.fromCartesian(
1042
- positions[0],
1043
- scratchPolarForPlane
1044
- );
1045
- return polar.tangentPlane;
1046
- }
1047
- return EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
1048
- }
1049
- var scratchCartographicCyllindrical = new Cartographic_default();
1050
- function createProjectTo2d(rectangle, outerPositions, ellipsoid) {
1051
- return (positions, results) => {
1052
- if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
1053
- if (rectangle.south < 0 && rectangle.north > 0) {
1054
- if (!defined_default(results)) {
1055
- results = [];
1056
- }
1057
- for (let i = 0; i < positions.length; ++i) {
1058
- const cartographic = ellipsoid.cartesianToCartographic(
1059
- positions[i],
1060
- scratchCartographicCyllindrical
1061
- );
1062
- results[i] = new Cartesian2_default(
1063
- cartographic.longitude / Math_default.PI,
1064
- cartographic.latitude / Math_default.PI_OVER_TWO
1065
- );
1066
- }
1067
- results.length = positions.length;
1068
- return results;
1069
- }
1070
- return Stereographic_default.fromCartesianArray(positions, results);
1071
- }
1072
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
1073
- outerPositions,
1074
- ellipsoid
1075
- );
1076
- return tangentPlane.projectPointsOntoPlane(positions, results);
1077
- };
1078
- }
1079
- function createProjectPositionTo2d(rectangle, outerRing, ellipsoid) {
1080
- if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
1081
- return (position, result) => {
1082
- if (rectangle.south < 0 && rectangle.north > 0) {
1083
- const cartographic = ellipsoid.cartesianToCartographic(
1084
- position,
1085
- scratchCartographicCyllindrical
1086
- );
1087
- if (!defined_default(result)) {
1088
- result = new Cartesian2_default();
1089
- }
1090
- result.x = cartographic.longitude / Math_default.PI;
1091
- result.y = cartographic.latitude / Math_default.PI_OVER_TWO;
1092
- return result;
1093
- }
1094
- return Stereographic_default.fromCartesian(position, result);
1095
- };
1096
- }
1097
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
1098
- return (position, result) => {
1099
- return tangentPlane.projectPointsOntoPlane(position, result);
1100
- };
1101
- }
1102
- function createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) {
1103
- return (polygons, results) => {
1104
- if (!perPositionHeight && (rectangle.height >= Math_default.PI_OVER_TWO || rectangle.width >= 2 * Math_default.PI_OVER_THREE)) {
1105
- return PolygonGeometryLibrary_default.splitPolygonsOnEquator(
1106
- polygons,
1107
- ellipsoid,
1108
- arcType,
1109
- results
1110
- );
1111
- }
1112
- return polygons;
1113
- };
1114
- }
1115
- function computeBoundingRectangle(outerRing, rectangle, ellipsoid, stRotation) {
1116
- if (rectangle.height >= Math_default.PI || rectangle.width >= Math_default.PI) {
1117
- return BoundingRectangle_default.fromRectangle(
1118
- rectangle,
1119
- void 0,
1120
- scratchBoundingRectangle
1121
- );
1122
- }
1123
- const outerPositions = outerRing;
1124
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
1125
- outerPositions,
1126
- ellipsoid
1127
- );
1128
- return PolygonGeometryLibrary_default.computeBoundingRectangle(
1129
- tangentPlane.plane.normal,
1130
- tangentPlane.projectPointOntoPlane.bind(tangentPlane),
1131
- outerPositions,
1132
- stRotation,
1133
- scratchBoundingRectangle
1134
- );
1135
- }
1136
- PolygonGeometry.createGeometry = function(polygonGeometry) {
1137
- const vertexFormat = polygonGeometry._vertexFormat;
1138
- const ellipsoid = polygonGeometry._ellipsoid;
1139
- const granularity = polygonGeometry._granularity;
1140
- const stRotation = polygonGeometry._stRotation;
1141
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
1142
- const perPositionHeight = polygonGeometry._perPositionHeight;
1143
- const closeTop = polygonGeometry._closeTop;
1144
- const closeBottom = polygonGeometry._closeBottom;
1145
- const arcType = polygonGeometry._arcType;
1146
- const textureCoordinates = polygonGeometry._textureCoordinates;
1147
- const hasTextureCoordinates = defined_default(textureCoordinates);
1148
- const outerPositions = polygonHierarchy.positions;
1149
- if (outerPositions.length < 3) {
1150
- return;
1151
- }
1152
- const rectangle = polygonGeometry.rectangle;
1153
- const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
1154
- polygonHierarchy,
1155
- hasTextureCoordinates,
1156
- createProjectTo2d(rectangle, outerPositions, ellipsoid),
1157
- !perPositionHeight,
1158
- ellipsoid,
1159
- createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight)
1160
- );
1161
- const hierarchy = results.hierarchy;
1162
- const polygons = results.polygons;
1163
- const dummyFunction = function(identity) {
1164
- return identity;
1165
- };
1166
- const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
1167
- textureCoordinates,
1168
- true,
1169
- dummyFunction,
1170
- false,
1171
- ellipsoid
1172
- ).polygons : void 0;
1173
- if (hierarchy.length === 0) {
1174
- return;
1175
- }
1176
- const outerRing = hierarchy[0].outerRing;
1177
- const boundingRectangle = computeBoundingRectangle(
1178
- outerRing,
1179
- rectangle,
1180
- ellipsoid,
1181
- stRotation
1182
- );
1183
- const geometries = [];
1184
- const height = polygonGeometry._height;
1185
- const extrudedHeight = polygonGeometry._extrudedHeight;
1186
- const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
1187
- const options = {
1188
- perPositionHeight,
1189
- vertexFormat,
1190
- geometry: void 0,
1191
- rotationAxis: getTangentPlane(rectangle, outerRing, ellipsoid).plane.normal,
1192
- projectTo2d: createProjectPositionTo2d(rectangle, outerRing, ellipsoid),
1193
- boundingRectangle,
1194
- ellipsoid,
1195
- stRotation,
1196
- textureCoordinates: void 0,
1197
- bottom: false,
1198
- top: true,
1199
- wall: false,
1200
- extrude: false,
1201
- arcType
1202
- };
1203
- let i;
1204
- if (extrude) {
1205
- options.extrude = true;
1206
- options.top = closeTop;
1207
- options.bottom = closeBottom;
1208
- options.shadowVolume = polygonGeometry._shadowVolume;
1209
- options.offsetAttribute = polygonGeometry._offsetAttribute;
1210
- for (i = 0; i < polygons.length; i++) {
1211
- const splitGeometry = createGeometryFromPositionsExtruded(
1212
- ellipsoid,
1213
- polygons[i],
1214
- hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
1215
- granularity,
1216
- hierarchy[i],
1217
- perPositionHeight,
1218
- closeTop,
1219
- closeBottom,
1220
- vertexFormat,
1221
- arcType
1222
- );
1223
- let topAndBottom;
1224
- if (closeTop && closeBottom) {
1225
- topAndBottom = splitGeometry.topAndBottom;
1226
- options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
1227
- topAndBottom.geometry,
1228
- height,
1229
- extrudedHeight,
1230
- ellipsoid,
1231
- perPositionHeight
1232
- );
1233
- } else if (closeTop) {
1234
- topAndBottom = splitGeometry.topAndBottom;
1235
- topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1236
- topAndBottom.geometry.attributes.position.values,
1237
- height,
1238
- ellipsoid,
1239
- !perPositionHeight
1240
- );
1241
- options.geometry = topAndBottom.geometry;
1242
- } else if (closeBottom) {
1243
- topAndBottom = splitGeometry.topAndBottom;
1244
- topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1245
- topAndBottom.geometry.attributes.position.values,
1246
- extrudedHeight,
1247
- ellipsoid,
1248
- true
1249
- );
1250
- options.geometry = topAndBottom.geometry;
1251
- }
1252
- if (closeTop || closeBottom) {
1253
- options.wall = false;
1254
- topAndBottom.geometry = computeAttributes(options);
1255
- geometries.push(topAndBottom);
1256
- }
1257
- const walls = splitGeometry.walls;
1258
- options.wall = true;
1259
- for (let k = 0; k < walls.length; k++) {
1260
- const wall = walls[k];
1261
- options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
1262
- wall.geometry,
1263
- height,
1264
- extrudedHeight,
1265
- ellipsoid,
1266
- perPositionHeight
1267
- );
1268
- wall.geometry = computeAttributes(options);
1269
- geometries.push(wall);
1270
- }
1271
- }
1272
- } else {
1273
- for (i = 0; i < polygons.length; i++) {
1274
- const geometryInstance = new GeometryInstance_default({
1275
- geometry: PolygonGeometryLibrary_default.createGeometryFromPositions(
1276
- ellipsoid,
1277
- polygons[i],
1278
- hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
1279
- granularity,
1280
- perPositionHeight,
1281
- vertexFormat,
1282
- arcType
1283
- )
1284
- });
1285
- geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1286
- geometryInstance.geometry.attributes.position.values,
1287
- height,
1288
- ellipsoid,
1289
- !perPositionHeight
1290
- );
1291
- options.geometry = geometryInstance.geometry;
1292
- geometryInstance.geometry = computeAttributes(options);
1293
- if (defined_default(polygonGeometry._offsetAttribute)) {
1294
- const length = geometryInstance.geometry.attributes.position.values.length;
1295
- const offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1296
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
1297
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default({
1298
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1299
- componentsPerAttribute: 1,
1300
- values: applyOffset
1301
- });
1302
- }
1303
- geometries.push(geometryInstance);
1304
- }
1305
- }
1306
- const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
1307
- geometry.attributes.position.values = new Float64Array(
1308
- geometry.attributes.position.values
1309
- );
1310
- geometry.indices = IndexDatatype_default.createTypedArray(
1311
- geometry.attributes.position.values.length / 3,
1312
- geometry.indices
1313
- );
1314
- const attributes = geometry.attributes;
1315
- const boundingSphere = BoundingSphere_default.fromVertices(
1316
- attributes.position.values
1317
- );
1318
- if (!vertexFormat.position) {
1319
- delete attributes.position;
1320
- }
1321
- return new Geometry_default({
1322
- attributes,
1323
- indices: geometry.indices,
1324
- primitiveType: geometry.primitiveType,
1325
- boundingSphere,
1326
- offsetAttribute: polygonGeometry._offsetAttribute
1327
- });
1328
- };
1329
- PolygonGeometry.createShadowVolume = function(polygonGeometry, minHeightFunc, maxHeightFunc) {
1330
- const granularity = polygonGeometry._granularity;
1331
- const ellipsoid = polygonGeometry._ellipsoid;
1332
- const minHeight = minHeightFunc(granularity, ellipsoid);
1333
- const maxHeight = maxHeightFunc(granularity, ellipsoid);
1334
- return new PolygonGeometry({
1335
- polygonHierarchy: polygonGeometry._polygonHierarchy,
1336
- ellipsoid,
1337
- stRotation: polygonGeometry._stRotation,
1338
- granularity,
1339
- perPositionHeight: false,
1340
- extrudedHeight: minHeight,
1341
- height: maxHeight,
1342
- vertexFormat: VertexFormat_default.POSITION_ONLY,
1343
- shadowVolume: true,
1344
- arcType: polygonGeometry._arcType
1345
- });
1346
- };
1347
- function textureCoordinateRotationPoints(polygonGeometry) {
1348
- const stRotation = -polygonGeometry._stRotation;
1349
- if (stRotation === 0) {
1350
- return [0, 0, 0, 1, 1, 0];
1351
- }
1352
- const ellipsoid = polygonGeometry._ellipsoid;
1353
- const positions = polygonGeometry._polygonHierarchy.positions;
1354
- const boundingRectangle = polygonGeometry.rectangle;
1355
- return Geometry_default._textureCoordinateRotationPoints(
1356
- positions,
1357
- stRotation,
1358
- ellipsoid,
1359
- boundingRectangle
1360
- );
1361
- }
1362
- Object.defineProperties(PolygonGeometry.prototype, {
1363
- /**
1364
- * @private
1365
- */
1366
- rectangle: {
1367
- get: function() {
1368
- if (!defined_default(this._rectangle)) {
1369
- const positions = this._polygonHierarchy.positions;
1370
- this._rectangle = PolygonGeometry.computeRectangleFromPositions(
1371
- positions,
1372
- this._ellipsoid,
1373
- this._arcType
1374
- );
1375
- }
1376
- return this._rectangle;
1377
- }
1378
- },
1379
- /**
1380
- * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
1381
- * @private
1382
- */
1383
- textureCoordinateRotationPoints: {
1384
- get: function() {
1385
- if (!defined_default(this._textureCoordinateRotationPoints)) {
1386
- this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(this);
1387
- }
1388
- return this._textureCoordinateRotationPoints;
1389
- }
1390
- }
1391
- });
1392
- var PolygonGeometry_default = PolygonGeometry;
1393
-
1394
- // packages/engine/Source/Workers/createPolygonGeometry.js
1395
- function createPolygonGeometry(polygonGeometry, offset) {
1396
- if (defined_default(offset)) {
1397
- polygonGeometry = PolygonGeometry_default.unpack(polygonGeometry, offset);
1398
- }
1399
- polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
1400
- return PolygonGeometry_default.createGeometry(polygonGeometry);
1401
- }
1402
- var createPolygonGeometry_default = createPolygonGeometry;
1403
- export {
1404
- createPolygonGeometry_default as default
1405
- };
26
+ import{a as mt}from"./chunk-WGGIH7QW.js";import{a as L}from"./chunk-AJYK4IVJ.js";import{a as st}from"./chunk-J6UP6FLE.js";import{a as rt}from"./chunk-D6AA5QVT.js";import{a as bt}from"./chunk-VW6VD53G.js";import"./chunk-DEPHB2WM.js";import"./chunk-QOUAJ6TL.js";import{a as lt}from"./chunk-GBYLG25F.js";import{a as q}from"./chunk-CYCB63OH.js";import{a as Z}from"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import{a as dt,b as ot}from"./chunk-77IHZJJ3.js";import"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import{a as wt,b as yt}from"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as ct}from"./chunk-OFUUQVMR.js";import"./chunk-A56XVLQR.js";import{c as ut,d as $}from"./chunk-RCV6KWXS.js";import{d as Tt}from"./chunk-4IW2T6GF.js";import{f as at,h as _t}from"./chunk-PSPPBZWI.js";import{a as X}from"./chunk-AU7IKHOH.js";import{a as c,b as et,c as O,d as S,e as D,f as Pt}from"./chunk-64RSHJUE.js";import{a as l}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as ft,b as Y}from"./chunk-LEYMRMBK.js";import{e as P}from"./chunk-VTAIKJXX.js";function b(t,e){this.position=t,P(this.position)||(this.position=new O),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let t=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var nt=new et,Rt=new c;b.prototype.getLatitude=function(t){P(t)||(t=S.default),nt.latitude=this.conformalLatitude,nt.longitude=this.longitude,nt.height=0;let e=this.ellipsoid.cartographicToCartesian(nt,Rt);return t.cartesianToCartographic(e,nt),nt.latitude};var It=new wt,Lt=new c,Ft=new c;b.fromCartesian=function(t,e){Y.defined("cartesian",t);let o=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);let i=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);let r=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);return P(e)?(e.position=new O(d,p),e.tangentPlane=n,e):new b(new O(d,p),n)};b.fromCartesianArray=function(t,e){Y.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);return e};b.clone=function(t,e){if(P(t))return P(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):new b(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(new S(.5,.5,.5));b.NORTH_POLE=Object.freeze(new c(0,0,.5));b.SOUTH_POLE=Object.freeze(new c(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));var z=b;var vt=new et,Ot=new et;function St(t,e,o,n){let i=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);let f=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}var Et=new mt,Vt=new c,Bt=new c,Mt=new c,jt=new c,kt=new c,zt=new c,ht=new c,Q=new c,it=new c,Dt=new O,Ut=new O,Wt=new c,At=new at,Gt=new D,Yt=new D;function gt(t){let e=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void 0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){let w=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,M=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;let V=e.st?new Float32Array(2*(r/3)):void 0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=new Float32Array(r));let E=e.tangent?new Float32Array(r):void 0,A=e.bitangent?new Float32Array(r):void 0,F=n?new Float32Array(r):void 0,T=0,y=0,_=Bt,h=Mt,g=jt,j=!0,G=Gt,K=Yt;if(M!==0){let B=at.fromAxisAngle(a,M,At);G=D.fromQuaternion(B,G),B=at.fromAxisAngle(a,-M,At),K=D.fromQuaternion(B,K)}else G=D.clone(D.IDENTITY,G),K=D.clone(D.IDENTITY,K);let m=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(let B=0;B<r;B+=3){let k=c.fromArray(s,B,Wt);if(e.st&&!P(i)){let N=D.multiplyByVector(G,k,Vt);N=x.scaleToGeodeticSurface(N,N);let v=H([N],Ut)[0];O.subtract(v,R,v);let J=l.clamp(v.x/w.width,0,1),tt=l.clamp(v.y/w.height,0,1);p&&(V[T+I]=J,V[T+1+I]=tt),d&&(V[T]=J,V[T+1]=tt),T+=2}if(e.normal||e.tangent||e.bitangent||n){let N=y+1,v=y+2;if(f){if(B+3<r){let J=c.fromArray(s,B+3,kt);if(j){let tt=c.fromArray(s,B+r,zt);C&&St(k,J,tt,x),c.subtract(J,k,J),c.subtract(tt,k,tt),_=c.normalize(c.cross(tt,J,_),_),j=!1}c.equalsEpsilon(J,k,l.EPSILON10)&&(j=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(k,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else _=x.geodeticSurfaceNormal(k,_),(e.tangent||e.bitangent)&&(C&&(ht=c.fromArray(u,y,ht),Q=c.cross(c.UNIT_Z,ht,Q),Q=c.normalize(D.multiplyByVector(K,Q,Q),Q),e.bitangent&&(it=c.normalize(c.cross(ht,Q,it),it))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(D.multiplyByVector(K,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[v+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[v+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[v]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(k,_)),F[y+m]=-_.x,F[N+m]=-_.y,F[v+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[v+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[v+m]=-h.z),d&&(C?(E[y]=Q.x,E[N]=Q.y,E[v]=Q.z):(E[y]=h.x,E[N]=h.y,E[v]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[v+m]=g.z),d&&(C?(A[y]=it.x,A[N]=it.y,A[v]=it.z):(A[y]=g.x,A[N]=g.y,A[v]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=new $({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:V})),e.normal&&(o.attributes.normal=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}))}if(t.extrude&&P(t.offsetAttribute)){let w=s.length/3,a=new Uint8Array(w);if(t.offsetAttribute===lt.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{let H=t.offsetAttribute===lt.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return o}var Ht=[];function qt(t,e,o,n,s,i,r,f,d,p){let w={walls:[]},a;if(r||f){let u=L.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,F,T;if(r&&f){let y=E.concat(E);F=y.length/3,T=ct.createTypedArray(F,A.length*2),T.set(A);let _=A.length,h=F/2;for(a=0;a<_;a+=3){let g=T[a]+h,j=T[a+1]+h,G=T[a+2]+h;T[a+_]=G,T[a+1+_]=j,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){let g=u.attributes.normal.values;u.attributes.normal.values=new Float32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){let g=u.attributes.st.values;u.attributes.st.values=new Float32Array(F*2),u.attributes.st.values=g.concat(g)}u.indices=T}else if(f){for(F=E.length/3,T=ct.createTypedArray(F,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=new rt({geometry:u})}let H=s.outerRing,x=Z.fromPoints(H,t),M=x.projectPointsOntoPlane(H,Ht),C=ot.computeWindingOrder2D(M);C===dt.CLOCKWISE&&(H=H.slice().reverse());let R=L.computeWallGeometry(H,o,t,n,i,p);w.walls.push(new rt({geometry:R}));let V=s.holes;for(a=0;a<V.length;a++){let u=V[a];M=x.projectPointsOntoPlane(u,Ht),C=ot.computeWindingOrder2D(M),C===dt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=L.computeWallGeometry(u,o,t,n,i,p),w.walls.push(new rt({geometry:R}))}return w}function W(t){if(Y.typeOf.object("options",t),Y.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))throw new ft("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==st.GEODESIC&&t.arcType!==st.RHUMB)throw new ft("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let e=t.polygonHierarchy,o=t.vertexFormat??q.DEFAULT,n=t.ellipsoid??S.default,s=t.granularity??l.RADIANS_PER_DEGREE,i=t.stRotation??0,r=t.textureCoordinates,f=t.perPositionHeight??!1,d=f&&P(t.extrudedHeight),p=t.height??0,w=t.extrudedHeight??p;if(!d){let a=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=q.clone(o),this._ellipsoid=S.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=t.closeTop??!0,this._closeBottom=t.closeBottom??!0,this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=t.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=t.arcType??st.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=r,this.packedLength=L.computeHierarchyPackedLength(e,c)+S.packedLength+q.packedLength+(r?L.computeHierarchyPackedLength(r,O):1)+12}W.fromPositions=function(t){t=t??Pt.EMPTY_OBJECT,Y.defined("options.positions",t.positions);let e={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new W(e)};W.pack=function(t,e,o){return Y.typeOf.object("value",t),Y.defined("array",e),o=o??0,o=L.packPolygonHierarchy(t._polygonHierarchy,e,o,c),S.pack(t._ellipsoid,e,o),o+=S.packedLength,q.pack(t._vertexFormat,e,o),o+=q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=t._offsetAttribute??-1,e[o++]=t._arcType,P(t._textureCoordinates)?o=L.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o++]=t.packedLength,e};var Qt=S.clone(S.UNIT_SPHERE),Zt=new q,Kt={polygonHierarchy:{}};W.unpack=function(t,e,o){Y.defined("array",t),e=e??0;let n=L.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,delete n.startingIndex;let s=S.unpack(t,e,Qt);e+=S.packedLength;let i=q.unpack(t,e,Zt);e+=q.packedLength;let r=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,M=t[e++]===1,C=t[e++],R=t[e++],V=t[e]===-1?void 0:L.unpackPolygonHierarchy(t,e,O);P(V)?(e=V.startingIndex,delete V.startingIndex):e++;let u=t[e++];return P(o)||(o=new W(Kt)),o._polygonHierarchy=n,o._ellipsoid=S.clone(s,o._ellipsoid),o._vertexFormat=q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=M,o._offsetAttribute=C===-1?void 0:C,o._arcType=R,o._textureCoordinates=V,o.packedLength=u,o};var Jt=new O,Xt=new O,$t=new z;function xt(t,e,o,n,s,i){let r=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let d=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==st.RHUMB){let H=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){let M=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=z.clone(e,$t);C.position=M;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}var Ct=new z,te=new z,U={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};W.computeRectangleFromPositions=function(t,e,o,n){if(Y.defined("positions",t),P(n)||(n=new _t),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,U.northAngle=0,U.southAngle=0,U.westOverIdl=Number.POSITIVE_INFINITY,U.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=z.fromCartesian(t[0],te);for(let r=1;r<s;r++){let f=z.fromCartesian(t[r],Ct);xt(f,i,e,o,U,n),i=z.clone(f,i)}return xt(z.fromCartesian(t[0],Ct),i,e,o,U,n),n.east-n.west>U.eastOverIdl-U.westOverIdl&&(n.west=U.westOverIdl,n.east=U.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(U.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(U.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ee=new z;function oe(t,e,o){return t.height>=l.PI||t.width>=l.PI?z.fromCartesian(e[0],ee).tangentPlane:Z.fromPoints(e,o)}var Nt=new et;function ne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r<n.length;++r){let f=o.cartesianToCartographic(n[r],Nt);s[r]=new O(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}return s.length=n.length,s}return z.fromCartesianArray(n,s)}return Z.fromPoints(e,o).projectPointsOntoPlane(n,s)}}function ie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,Nt);return P(i)||(i=new O),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return z.fromCartesian(s,i)};let n=Z.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function re(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?L.splitPolygonsOnEquator(s,e,o,i):s}function se(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return mt.fromRectangle(e,void 0,Et);let s=t,i=Z.fromPoints(s,o);return L.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}W.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,M=L.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=M.hierarchy,R=M.polygons,V=function(m){return m},u=a?L.polygonsFromHierarchy(w,!0,V,!1,o).polygons:void 0;if(C.length===0)return;let E=C[0].outerRing,A=se(E,x,o,s),F=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){let m=qt(o,R[g],a?u[g]:void 0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=L.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=gt(h),F.push(I));let B=m.walls;h.wall=!0;for(let k=0;k<B.length;k++){let N=B[k];h.geometry=L.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=gt(h),F.push(N)}}else for(g=0;g<R.length;g++){let m=new rt({geometry:L.createGeometryFromPositions(o,R[g],a?u[g]:void 0,n,r,e,p)});if(m.geometry.attributes.position.values=ot.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=gt(h),P(t._offsetAttribute)){let I=m.geometry.attributes.position.values.length,B=t._offsetAttribute===lt.NONE?0:1,k=new Uint8Array(I/3).fill(B);m.geometry.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}F.push(m)}let j=bt.combineInstances(F)[0];j.attributes.position.values=new Float64Array(j.attributes.position.values),j.indices=ct.createTypedArray(j.attributes.position.values.length/3,j.indices);let G=j.attributes,K=Tt.fromVertices(G.position.values);return e.position||delete G.position,new ut({attributes:G,indices:j.indices,primitiveType:j.primitiveType,boundingSphere:K,offsetAttribute:t._offsetAttribute})};W.createShadowVolume=function(t,e,o){let n=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);return new W({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};function ae(t){let e=-t._stRotation;if(e===0)return[0,0,0,1,1,0];let o=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;return ut._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(W.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){let t=this._polygonHierarchy.positions;this._rectangle=W.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return P(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});var pt=W;function ce(t,e){return P(e)&&(t=pt.unpack(t,e)),t._ellipsoid=S.clone(t._ellipsoid),pt.createGeometry(t)}var Xe=ce;export{Xe as default};