@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,511 +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
- PolygonGeometryLibrary_default
28
- } from "./chunk-PGRPDNHG.js";
29
- import {
30
- ArcType_default
31
- } from "./chunk-PRGYLLJT.js";
32
- import {
33
- GeometryInstance_default
34
- } from "./chunk-7KTQP4VB.js";
35
- import {
36
- GeometryPipeline_default
37
- } from "./chunk-GGZJN2TI.js";
38
- import "./chunk-NGPPMXRM.js";
39
- import "./chunk-C6YYBQXW.js";
40
- import {
41
- GeometryOffsetAttribute_default
42
- } from "./chunk-I2ITFFPX.js";
43
- import {
44
- EllipsoidTangentPlane_default
45
- } from "./chunk-CKY7HOHV.js";
46
- import "./chunk-S6MRMMQU.js";
47
- import {
48
- PolygonPipeline_default,
49
- WindingOrder_default
50
- } from "./chunk-SMDOP47J.js";
51
- import "./chunk-472HQ3EH.js";
52
- import "./chunk-E6V6SQZW.js";
53
- import "./chunk-3Q2L65QU.js";
54
- import "./chunk-2ZGOQXYU.js";
55
- import {
56
- IndexDatatype_default
57
- } from "./chunk-26GA3JAM.js";
58
- import {
59
- GeometryAttributes_default
60
- } from "./chunk-DI5NGJUP.js";
61
- import {
62
- GeometryAttribute_default,
63
- Geometry_default,
64
- PrimitiveType_default
65
- } from "./chunk-GWCFU2SA.js";
66
- import {
67
- BoundingSphere_default
68
- } from "./chunk-VJZB3WAV.js";
69
- import "./chunk-5PTXS2GO.js";
70
- import {
71
- ComponentDatatype_default
72
- } from "./chunk-K4GQUNB5.js";
73
- import {
74
- Cartesian3_default,
75
- Ellipsoid_default
76
- } from "./chunk-YFXQECWV.js";
77
- import {
78
- Math_default
79
- } from "./chunk-XY4BATBS.js";
80
- import "./chunk-MXIZJAPH.js";
81
- import "./chunk-6CHGCNMW.js";
82
- import {
83
- defaultValue_default
84
- } from "./chunk-7JO7GPJN.js";
85
- import {
86
- Check_default,
87
- DeveloperError_default
88
- } from "./chunk-AD63PIY6.js";
89
- import {
90
- defined_default
91
- } from "./chunk-E63IIM5T.js";
92
-
93
- // packages/engine/Source/Core/PolygonOutlineGeometry.js
94
- var createGeometryFromPositionsPositions = [];
95
- var createGeometryFromPositionsSubdivided = [];
96
- function createGeometryFromPositions(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
97
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
98
- const positions2D = tangentPlane.projectPointsOntoPlane(
99
- positions,
100
- createGeometryFromPositionsPositions
101
- );
102
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
103
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
104
- positions2D.reverse();
105
- positions = positions.slice().reverse();
106
- }
107
- let subdividedPositions;
108
- let i;
109
- let length = positions.length;
110
- let index = 0;
111
- if (!perPositionHeight) {
112
- let numVertices = 0;
113
- if (arcType === ArcType_default.GEODESIC) {
114
- for (i = 0; i < length; i++) {
115
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
116
- positions[i],
117
- positions[(i + 1) % length],
118
- minDistance
119
- );
120
- }
121
- } else if (arcType === ArcType_default.RHUMB) {
122
- for (i = 0; i < length; i++) {
123
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
124
- ellipsoid,
125
- positions[i],
126
- positions[(i + 1) % length],
127
- minDistance
128
- );
129
- }
130
- }
131
- subdividedPositions = new Float64Array(numVertices * 3);
132
- for (i = 0; i < length; i++) {
133
- let tempPositions;
134
- if (arcType === ArcType_default.GEODESIC) {
135
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
136
- positions[i],
137
- positions[(i + 1) % length],
138
- minDistance,
139
- createGeometryFromPositionsSubdivided
140
- );
141
- } else if (arcType === ArcType_default.RHUMB) {
142
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
143
- ellipsoid,
144
- positions[i],
145
- positions[(i + 1) % length],
146
- minDistance,
147
- createGeometryFromPositionsSubdivided
148
- );
149
- }
150
- const tempPositionsLength = tempPositions.length;
151
- for (let j = 0; j < tempPositionsLength; ++j) {
152
- subdividedPositions[index++] = tempPositions[j];
153
- }
154
- }
155
- } else {
156
- subdividedPositions = new Float64Array(length * 2 * 3);
157
- for (i = 0; i < length; i++) {
158
- const p0 = positions[i];
159
- const p1 = positions[(i + 1) % length];
160
- subdividedPositions[index++] = p0.x;
161
- subdividedPositions[index++] = p0.y;
162
- subdividedPositions[index++] = p0.z;
163
- subdividedPositions[index++] = p1.x;
164
- subdividedPositions[index++] = p1.y;
165
- subdividedPositions[index++] = p1.z;
166
- }
167
- }
168
- length = subdividedPositions.length / 3;
169
- const indicesSize = length * 2;
170
- const indices = IndexDatatype_default.createTypedArray(length, indicesSize);
171
- index = 0;
172
- for (i = 0; i < length - 1; i++) {
173
- indices[index++] = i;
174
- indices[index++] = i + 1;
175
- }
176
- indices[index++] = length - 1;
177
- indices[index++] = 0;
178
- return new GeometryInstance_default({
179
- geometry: new Geometry_default({
180
- attributes: new GeometryAttributes_default({
181
- position: new GeometryAttribute_default({
182
- componentDatatype: ComponentDatatype_default.DOUBLE,
183
- componentsPerAttribute: 3,
184
- values: subdividedPositions
185
- })
186
- }),
187
- indices,
188
- primitiveType: PrimitiveType_default.LINES
189
- })
190
- });
191
- }
192
- function createGeometryFromPositionsExtruded(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
193
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
194
- const positions2D = tangentPlane.projectPointsOntoPlane(
195
- positions,
196
- createGeometryFromPositionsPositions
197
- );
198
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
199
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
200
- positions2D.reverse();
201
- positions = positions.slice().reverse();
202
- }
203
- let subdividedPositions;
204
- let i;
205
- let length = positions.length;
206
- const corners = new Array(length);
207
- let index = 0;
208
- if (!perPositionHeight) {
209
- let numVertices = 0;
210
- if (arcType === ArcType_default.GEODESIC) {
211
- for (i = 0; i < length; i++) {
212
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
213
- positions[i],
214
- positions[(i + 1) % length],
215
- minDistance
216
- );
217
- }
218
- } else if (arcType === ArcType_default.RHUMB) {
219
- for (i = 0; i < length; i++) {
220
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
221
- ellipsoid,
222
- positions[i],
223
- positions[(i + 1) % length],
224
- minDistance
225
- );
226
- }
227
- }
228
- subdividedPositions = new Float64Array(numVertices * 3 * 2);
229
- for (i = 0; i < length; ++i) {
230
- corners[i] = index / 3;
231
- let tempPositions;
232
- if (arcType === ArcType_default.GEODESIC) {
233
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
234
- positions[i],
235
- positions[(i + 1) % length],
236
- minDistance,
237
- createGeometryFromPositionsSubdivided
238
- );
239
- } else if (arcType === ArcType_default.RHUMB) {
240
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
241
- ellipsoid,
242
- positions[i],
243
- positions[(i + 1) % length],
244
- minDistance,
245
- createGeometryFromPositionsSubdivided
246
- );
247
- }
248
- const tempPositionsLength = tempPositions.length;
249
- for (let j = 0; j < tempPositionsLength; ++j) {
250
- subdividedPositions[index++] = tempPositions[j];
251
- }
252
- }
253
- } else {
254
- subdividedPositions = new Float64Array(length * 2 * 3 * 2);
255
- for (i = 0; i < length; ++i) {
256
- corners[i] = index / 3;
257
- const p0 = positions[i];
258
- const p1 = positions[(i + 1) % length];
259
- subdividedPositions[index++] = p0.x;
260
- subdividedPositions[index++] = p0.y;
261
- subdividedPositions[index++] = p0.z;
262
- subdividedPositions[index++] = p1.x;
263
- subdividedPositions[index++] = p1.y;
264
- subdividedPositions[index++] = p1.z;
265
- }
266
- }
267
- length = subdividedPositions.length / (3 * 2);
268
- const cornersLength = corners.length;
269
- const indicesSize = (length * 2 + cornersLength) * 2;
270
- const indices = IndexDatatype_default.createTypedArray(
271
- length + cornersLength,
272
- indicesSize
273
- );
274
- index = 0;
275
- for (i = 0; i < length; ++i) {
276
- indices[index++] = i;
277
- indices[index++] = (i + 1) % length;
278
- indices[index++] = i + length;
279
- indices[index++] = (i + 1) % length + length;
280
- }
281
- for (i = 0; i < cornersLength; i++) {
282
- const corner = corners[i];
283
- indices[index++] = corner;
284
- indices[index++] = corner + length;
285
- }
286
- return new GeometryInstance_default({
287
- geometry: new Geometry_default({
288
- attributes: new GeometryAttributes_default({
289
- position: new GeometryAttribute_default({
290
- componentDatatype: ComponentDatatype_default.DOUBLE,
291
- componentsPerAttribute: 3,
292
- values: subdividedPositions
293
- })
294
- }),
295
- indices,
296
- primitiveType: PrimitiveType_default.LINES
297
- })
298
- });
299
- }
300
- function PolygonOutlineGeometry(options) {
301
- Check_default.typeOf.object("options", options);
302
- Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
303
- if (options.perPositionHeight && defined_default(options.height)) {
304
- throw new DeveloperError_default(
305
- "Cannot use both options.perPositionHeight and options.height"
306
- );
307
- }
308
- if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
309
- throw new DeveloperError_default(
310
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
311
- );
312
- }
313
- const polygonHierarchy = options.polygonHierarchy;
314
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
315
- const granularity = defaultValue_default(
316
- options.granularity,
317
- Math_default.RADIANS_PER_DEGREE
318
- );
319
- const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
320
- const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
321
- const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
322
- let height = defaultValue_default(options.height, 0);
323
- let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
324
- if (!perPositionHeightExtrude) {
325
- const h = Math.max(height, extrudedHeight);
326
- extrudedHeight = Math.min(height, extrudedHeight);
327
- height = h;
328
- }
329
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
330
- this._granularity = granularity;
331
- this._height = height;
332
- this._extrudedHeight = extrudedHeight;
333
- this._arcType = arcType;
334
- this._polygonHierarchy = polygonHierarchy;
335
- this._perPositionHeight = perPositionHeight;
336
- this._perPositionHeightExtrude = perPositionHeightExtrude;
337
- this._offsetAttribute = options.offsetAttribute;
338
- this._workerName = "createPolygonOutlineGeometry";
339
- this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
340
- polygonHierarchy,
341
- Cartesian3_default
342
- ) + Ellipsoid_default.packedLength + 8;
343
- }
344
- PolygonOutlineGeometry.pack = function(value, array, startingIndex) {
345
- Check_default.typeOf.object("value", value);
346
- Check_default.defined("array", array);
347
- startingIndex = defaultValue_default(startingIndex, 0);
348
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
349
- value._polygonHierarchy,
350
- array,
351
- startingIndex,
352
- Cartesian3_default
353
- );
354
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
355
- startingIndex += Ellipsoid_default.packedLength;
356
- array[startingIndex++] = value._height;
357
- array[startingIndex++] = value._extrudedHeight;
358
- array[startingIndex++] = value._granularity;
359
- array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
360
- array[startingIndex++] = value._perPositionHeight ? 1 : 0;
361
- array[startingIndex++] = value._arcType;
362
- array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
363
- array[startingIndex] = value.packedLength;
364
- return array;
365
- };
366
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
367
- var dummyOptions = {
368
- polygonHierarchy: {}
369
- };
370
- PolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
371
- Check_default.defined("array", array);
372
- startingIndex = defaultValue_default(startingIndex, 0);
373
- const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
374
- array,
375
- startingIndex,
376
- Cartesian3_default
377
- );
378
- startingIndex = polygonHierarchy.startingIndex;
379
- delete polygonHierarchy.startingIndex;
380
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
381
- startingIndex += Ellipsoid_default.packedLength;
382
- const height = array[startingIndex++];
383
- const extrudedHeight = array[startingIndex++];
384
- const granularity = array[startingIndex++];
385
- const perPositionHeightExtrude = array[startingIndex++] === 1;
386
- const perPositionHeight = array[startingIndex++] === 1;
387
- const arcType = array[startingIndex++];
388
- const offsetAttribute = array[startingIndex++];
389
- const packedLength = array[startingIndex];
390
- if (!defined_default(result)) {
391
- result = new PolygonOutlineGeometry(dummyOptions);
392
- }
393
- result._polygonHierarchy = polygonHierarchy;
394
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
395
- result._height = height;
396
- result._extrudedHeight = extrudedHeight;
397
- result._granularity = granularity;
398
- result._perPositionHeight = perPositionHeight;
399
- result._perPositionHeightExtrude = perPositionHeightExtrude;
400
- result._arcType = arcType;
401
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
402
- result.packedLength = packedLength;
403
- return result;
404
- };
405
- PolygonOutlineGeometry.fromPositions = function(options) {
406
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
407
- Check_default.defined("options.positions", options.positions);
408
- const newOptions = {
409
- polygonHierarchy: {
410
- positions: options.positions
411
- },
412
- height: options.height,
413
- extrudedHeight: options.extrudedHeight,
414
- ellipsoid: options.ellipsoid,
415
- granularity: options.granularity,
416
- perPositionHeight: options.perPositionHeight,
417
- arcType: options.arcType,
418
- offsetAttribute: options.offsetAttribute
419
- };
420
- return new PolygonOutlineGeometry(newOptions);
421
- };
422
- PolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
423
- const ellipsoid = polygonGeometry._ellipsoid;
424
- const granularity = polygonGeometry._granularity;
425
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
426
- const perPositionHeight = polygonGeometry._perPositionHeight;
427
- const arcType = polygonGeometry._arcType;
428
- const polygons = PolygonGeometryLibrary_default.polygonOutlinesFromHierarchy(
429
- polygonHierarchy,
430
- !perPositionHeight,
431
- ellipsoid
432
- );
433
- if (polygons.length === 0) {
434
- return void 0;
435
- }
436
- let geometryInstance;
437
- const geometries = [];
438
- const minDistance = Math_default.chordLength(
439
- granularity,
440
- ellipsoid.maximumRadius
441
- );
442
- const height = polygonGeometry._height;
443
- const extrudedHeight = polygonGeometry._extrudedHeight;
444
- const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
445
- let offsetValue;
446
- let i;
447
- if (extrude) {
448
- for (i = 0; i < polygons.length; i++) {
449
- geometryInstance = createGeometryFromPositionsExtruded(
450
- ellipsoid,
451
- polygons[i],
452
- minDistance,
453
- perPositionHeight,
454
- arcType
455
- );
456
- geometryInstance.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
457
- geometryInstance.geometry,
458
- height,
459
- extrudedHeight,
460
- ellipsoid,
461
- perPositionHeight
462
- );
463
- if (defined_default(polygonGeometry._offsetAttribute)) {
464
- const size = geometryInstance.geometry.attributes.position.values.length / 3;
465
- let offsetAttribute = new Uint8Array(size);
466
- if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
467
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
468
- } else {
469
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
470
- offsetAttribute = offsetAttribute.fill(offsetValue);
471
- }
472
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default({
473
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
474
- componentsPerAttribute: 1,
475
- values: offsetAttribute
476
- });
477
- }
478
- geometries.push(geometryInstance);
479
- }
480
- } else {
481
- for (i = 0; i < polygons.length; i++) {
482
- geometryInstance = createGeometryFromPositions(
483
- ellipsoid,
484
- polygons[i],
485
- minDistance,
486
- perPositionHeight,
487
- arcType
488
- );
489
- geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
490
- geometryInstance.geometry.attributes.position.values,
491
- height,
492
- ellipsoid,
493
- !perPositionHeight
494
- );
495
- if (defined_default(polygonGeometry._offsetAttribute)) {
496
- const length = geometryInstance.geometry.attributes.position.values.length;
497
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
498
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
499
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default({
500
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
501
- componentsPerAttribute: 1,
502
- values: applyOffset
503
- });
504
- }
505
- geometries.push(geometryInstance);
506
- }
507
- }
508
- const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
509
- const boundingSphere = BoundingSphere_default.fromVertices(
510
- geometry.attributes.position.values
511
- );
512
- return new Geometry_default({
513
- attributes: geometry.attributes,
514
- indices: geometry.indices,
515
- primitiveType: geometry.primitiveType,
516
- boundingSphere,
517
- offsetAttribute: polygonGeometry._offsetAttribute
518
- });
519
- };
520
- var PolygonOutlineGeometry_default = PolygonOutlineGeometry;
521
-
522
- // packages/engine/Source/Workers/createPolygonOutlineGeometry.js
523
- function createPolygonOutlineGeometry(polygonGeometry, offset) {
524
- if (defined_default(offset)) {
525
- polygonGeometry = PolygonOutlineGeometry_default.unpack(polygonGeometry, offset);
526
- }
527
- polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
528
- return PolygonOutlineGeometry_default.createGeometry(polygonGeometry);
529
- }
530
- var createPolygonOutlineGeometry_default = createPolygonOutlineGeometry;
531
- export {
532
- createPolygonOutlineGeometry_default as default
533
- };
26
+ import{a}from"./chunk-AJYK4IVJ.js";import{a as P}from"./chunk-J6UP6FLE.js";import{a as F}from"./chunk-D6AA5QVT.js";import{a as V}from"./chunk-VW6VD53G.js";import"./chunk-DEPHB2WM.js";import"./chunk-QOUAJ6TL.js";import{a as C}from"./chunk-GBYLG25F.js";import{a as M}from"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import{a as W,b as D}from"./chunk-77IHZJJ3.js";import"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as G}from"./chunk-OFUUQVMR.js";import{a as B}from"./chunk-A56XVLQR.js";import{b as U,c as S,d as w}from"./chunk-RCV6KWXS.js";import{d as x}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as T}from"./chunk-AU7IKHOH.js";import{a as v,d as y,f as j}from"./chunk-64RSHJUE.js";import{a as L}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as N,b as O}from"./chunk-LEYMRMBK.js";import{e as E}from"./chunk-VTAIKJXX.js";var Y=[],k=[];function K(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=0;if(b)for(n=new Float64Array(o*2*3),i=0;i<o;i++){let u=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{let u=0;if(l===P.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(u*3),i=0;i<o;i++){let h;l===P.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let g=h.length;for(let d=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;let f=o*2,m=G.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;return m[c++]=o-1,m[c++]=0,new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:U.LINES})})}function q(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=new Array(o),f=0;if(b)for(n=new Float64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;let g=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{let g=0;if(l===P.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;let d;l===P.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let _=d.length;for(let R=0;R<_;++R)n[f++]=d[R]}}o=n.length/6;let m=c.length,u=(o*2+m)*2,h=G.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){let g=c[i];h[f++]=g,h[f++]=g+o}return new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:U.LINES})})}function A(e){if(O.typeOf.object("options",e),O.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&E(e.height))throw new N("Cannot use both options.perPositionHeight and options.height");if(E(e.arcType)&&e.arcType!==P.GEODESIC&&e.arcType!==P.RHUMB)throw new N("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,r=e.ellipsoid??y.default,b=e.granularity??L.RADIANS_PER_DEGREE,l=e.perPositionHeight??!1,H=l&&E(e.extrudedHeight),p=e.arcType??P.GEODESIC,s=e.height??0,n=e.extrudedHeight??s;if(!H){let i=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=b,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=H,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,v)+y.packedLength+8}A.pack=function(e,t,r){return O.typeOf.object("value",e),O.defined("array",t),r=r??0,r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,v),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=e._offsetAttribute??-1,t[r]=e.packedLength,t};var J=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};A.unpack=function(e,t,r){O.defined("array",e),t=t??0;let b=a.unpackPolygonHierarchy(e,t,v);t=b.startingIndex,delete b.startingIndex;let l=y.unpack(e,t,J);t+=y.packedLength;let H=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];return E(r)||(r=new A(Q)),r._polygonHierarchy=b,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=H,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void 0:c,r.packedLength=f,r};A.fromPositions=function(e){e=e??j.EMPTY_OBJECT,O.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new A(t)};A.createGeometry=function(e){let t=e._ellipsoid,r=e._granularity,b=e._polygonHierarchy,l=e._perPositionHeight,H=e._arcType,p=a.polygonOutlinesFromHierarchy(b,!l,t);if(p.length===0)return;let s,n=[],i=L.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!L.equalsEpsilon(o,c,0,L.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,H),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length/3,_=new Uint8Array(d);e._offsetAttribute===C.TOP?_=_.fill(1,0,d/2):(m=e._offsetAttribute===C.NONE?0:1,_=_.fill(m)),s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}else for(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,H),s.geometry.attributes.position.values=D.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length;m=e._offsetAttribute===C.NONE?0:1;let _=new Uint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}let h=V.combineInstances(n)[0],g=x.fromVertices(h.attributes.position.values);return new S({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};var z=A;function X(e,t){return E(t)&&(e=z.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),z.createGeometry(e)}var Oe=X;export{Oe as default};