@pggis/pg-sdk 3.3.9 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +8 -8
  2. package/dist/index.js +1966 -4
  3. package/dist/pggis.min.css +1 -1
  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-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-EHWHNOEX.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-4H7PY4U5.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-BBWDMCVU.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-WZDE3RYP.js +28 -0
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -44
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  78. package/dist/resources/Workers/createGeometry.js +2 -147
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  101. package/dist/resources/Workers/createWallGeometry.js +2 -466
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  105. package/dist/resources/Workers/decodeI3S.js +2 -1320
  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 -3398
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  111. package/package.json +9 -8
  112. package/dist/pggis.min.js +0 -14796
  113. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  114. package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
  115. package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
  116. package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
  117. package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
  118. package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
  119. package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
  120. package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
  121. package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
  122. package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
  123. package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
  124. package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
  125. package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
  126. package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
  127. package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
  128. package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
  129. package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
  130. package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
  131. package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
  132. package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
  133. package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
  134. package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
  135. package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
  136. package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
  137. package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
  138. package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
  139. package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
  140. package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
  141. package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
  142. package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
  143. package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
  144. package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
  145. package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
  146. package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
  147. package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
  148. package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
  149. package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
  150. package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
  151. package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
  152. package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
  153. package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
  154. package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
  155. package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
  156. package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
  157. package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
  158. package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
  159. package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
  160. package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
  161. package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
  162. package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
  163. package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,521 +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-I46ZRR5W.js";
29
- import {
30
- ArcType_default
31
- } from "./chunk-EHWHNOEX.js";
32
- import {
33
- GeometryInstance_default
34
- } from "./chunk-BIKA3NRA.js";
35
- import {
36
- GeometryPipeline_default
37
- } from "./chunk-EG6PTBY2.js";
38
- import "./chunk-Z3TIFFGF.js";
39
- import "./chunk-ZT7KWISZ.js";
40
- import {
41
- GeometryOffsetAttribute_default
42
- } from "./chunk-F3YA3Y2Z.js";
43
- import {
44
- EllipsoidTangentPlane_default
45
- } from "./chunk-FNIRWHJB.js";
46
- import "./chunk-G43QFN4Q.js";
47
- import {
48
- PolygonPipeline_default,
49
- WindingOrder_default
50
- } from "./chunk-MDWEGWPA.js";
51
- import "./chunk-FZRIVR7Y.js";
52
- import "./chunk-SH5USDPI.js";
53
- import "./chunk-2FRVPMCS.js";
54
- import "./chunk-Y5UQJLYE.js";
55
- import {
56
- IndexDatatype_default
57
- } from "./chunk-LPR3YNP2.js";
58
- import {
59
- GeometryAttributes_default
60
- } from "./chunk-4H7PY4U5.js";
61
- import {
62
- GeometryAttribute_default,
63
- Geometry_default,
64
- PrimitiveType_default
65
- } from "./chunk-7TC63SJW.js";
66
- import {
67
- BoundingSphere_default
68
- } from "./chunk-FJKNFAKQ.js";
69
- import "./chunk-TTUZP4BO.js";
70
- import "./chunk-BG4UCVXN.js";
71
- import "./chunk-YJEBABKH.js";
72
- import {
73
- ComponentDatatype_default
74
- } from "./chunk-PPH7OFP3.js";
75
- import {
76
- Cartesian3_default,
77
- Ellipsoid_default
78
- } from "./chunk-OGXZVPPM.js";
79
- import {
80
- Math_default
81
- } from "./chunk-5QULIR53.js";
82
- import "./chunk-SOWMRMWA.js";
83
- import "./chunk-STW2DGFI.js";
84
- import {
85
- defaultValue_default
86
- } from "./chunk-BBWDMCVU.js";
87
- import {
88
- Check_default,
89
- DeveloperError_default
90
- } from "./chunk-XGI5BXZY.js";
91
- import {
92
- defined_default
93
- } from "./chunk-YWTJ2B4B.js";
94
-
95
- // packages/engine/Source/Core/PolygonOutlineGeometry.js
96
- var createGeometryFromPositionsPositions = [];
97
- var createGeometryFromPositionsSubdivided = [];
98
- function createGeometryFromPositions(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
99
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
100
- const positions2D = tangentPlane.projectPointsOntoPlane(
101
- positions,
102
- createGeometryFromPositionsPositions
103
- );
104
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
105
- positions2D
106
- );
107
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
108
- positions2D.reverse();
109
- positions = positions.slice().reverse();
110
- }
111
- let subdividedPositions;
112
- let i;
113
- let length = positions.length;
114
- let index = 0;
115
- if (!perPositionHeight) {
116
- let numVertices = 0;
117
- if (arcType === ArcType_default.GEODESIC) {
118
- for (i = 0; i < length; i++) {
119
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
120
- positions[i],
121
- positions[(i + 1) % length],
122
- minDistance
123
- );
124
- }
125
- } else if (arcType === ArcType_default.RHUMB) {
126
- for (i = 0; i < length; i++) {
127
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
128
- ellipsoid,
129
- positions[i],
130
- positions[(i + 1) % length],
131
- minDistance
132
- );
133
- }
134
- }
135
- subdividedPositions = new Float64Array(numVertices * 3);
136
- for (i = 0; i < length; i++) {
137
- let tempPositions;
138
- if (arcType === ArcType_default.GEODESIC) {
139
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
140
- positions[i],
141
- positions[(i + 1) % length],
142
- minDistance,
143
- createGeometryFromPositionsSubdivided
144
- );
145
- } else if (arcType === ArcType_default.RHUMB) {
146
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
147
- ellipsoid,
148
- positions[i],
149
- positions[(i + 1) % length],
150
- minDistance,
151
- createGeometryFromPositionsSubdivided
152
- );
153
- }
154
- const tempPositionsLength = tempPositions.length;
155
- for (let j = 0; j < tempPositionsLength; ++j) {
156
- subdividedPositions[index++] = tempPositions[j];
157
- }
158
- }
159
- } else {
160
- subdividedPositions = new Float64Array(length * 2 * 3);
161
- for (i = 0; i < length; i++) {
162
- const p0 = positions[i];
163
- const p1 = positions[(i + 1) % length];
164
- subdividedPositions[index++] = p0.x;
165
- subdividedPositions[index++] = p0.y;
166
- subdividedPositions[index++] = p0.z;
167
- subdividedPositions[index++] = p1.x;
168
- subdividedPositions[index++] = p1.y;
169
- subdividedPositions[index++] = p1.z;
170
- }
171
- }
172
- length = subdividedPositions.length / 3;
173
- const indicesSize = length * 2;
174
- const indices = IndexDatatype_default.createTypedArray(length, indicesSize);
175
- index = 0;
176
- for (i = 0; i < length - 1; i++) {
177
- indices[index++] = i;
178
- indices[index++] = i + 1;
179
- }
180
- indices[index++] = length - 1;
181
- indices[index++] = 0;
182
- return new GeometryInstance_default({
183
- geometry: new Geometry_default({
184
- attributes: new GeometryAttributes_default({
185
- position: new GeometryAttribute_default({
186
- componentDatatype: ComponentDatatype_default.DOUBLE,
187
- componentsPerAttribute: 3,
188
- values: subdividedPositions
189
- })
190
- }),
191
- indices,
192
- primitiveType: PrimitiveType_default.LINES
193
- })
194
- });
195
- }
196
- function createGeometryFromPositionsExtruded(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
197
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
198
- const positions2D = tangentPlane.projectPointsOntoPlane(
199
- positions,
200
- createGeometryFromPositionsPositions
201
- );
202
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
203
- positions2D
204
- );
205
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
206
- positions2D.reverse();
207
- positions = positions.slice().reverse();
208
- }
209
- let subdividedPositions;
210
- let i;
211
- let length = positions.length;
212
- const corners = new Array(length);
213
- let index = 0;
214
- if (!perPositionHeight) {
215
- let numVertices = 0;
216
- if (arcType === ArcType_default.GEODESIC) {
217
- for (i = 0; i < length; i++) {
218
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
219
- positions[i],
220
- positions[(i + 1) % length],
221
- minDistance
222
- );
223
- }
224
- } else if (arcType === ArcType_default.RHUMB) {
225
- for (i = 0; i < length; i++) {
226
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
227
- ellipsoid,
228
- positions[i],
229
- positions[(i + 1) % length],
230
- minDistance
231
- );
232
- }
233
- }
234
- subdividedPositions = new Float64Array(numVertices * 3 * 2);
235
- for (i = 0; i < length; ++i) {
236
- corners[i] = index / 3;
237
- let tempPositions;
238
- if (arcType === ArcType_default.GEODESIC) {
239
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
240
- positions[i],
241
- positions[(i + 1) % length],
242
- minDistance,
243
- createGeometryFromPositionsSubdivided
244
- );
245
- } else if (arcType === ArcType_default.RHUMB) {
246
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
247
- ellipsoid,
248
- positions[i],
249
- positions[(i + 1) % length],
250
- minDistance,
251
- createGeometryFromPositionsSubdivided
252
- );
253
- }
254
- const tempPositionsLength = tempPositions.length;
255
- for (let j = 0; j < tempPositionsLength; ++j) {
256
- subdividedPositions[index++] = tempPositions[j];
257
- }
258
- }
259
- } else {
260
- subdividedPositions = new Float64Array(length * 2 * 3 * 2);
261
- for (i = 0; i < length; ++i) {
262
- corners[i] = index / 3;
263
- const p0 = positions[i];
264
- const p1 = positions[(i + 1) % length];
265
- subdividedPositions[index++] = p0.x;
266
- subdividedPositions[index++] = p0.y;
267
- subdividedPositions[index++] = p0.z;
268
- subdividedPositions[index++] = p1.x;
269
- subdividedPositions[index++] = p1.y;
270
- subdividedPositions[index++] = p1.z;
271
- }
272
- }
273
- length = subdividedPositions.length / (3 * 2);
274
- const cornersLength = corners.length;
275
- const indicesSize = (length * 2 + cornersLength) * 2;
276
- const indices = IndexDatatype_default.createTypedArray(
277
- length + cornersLength,
278
- indicesSize
279
- );
280
- index = 0;
281
- for (i = 0; i < length; ++i) {
282
- indices[index++] = i;
283
- indices[index++] = (i + 1) % length;
284
- indices[index++] = i + length;
285
- indices[index++] = (i + 1) % length + length;
286
- }
287
- for (i = 0; i < cornersLength; i++) {
288
- const corner = corners[i];
289
- indices[index++] = corner;
290
- indices[index++] = corner + length;
291
- }
292
- return new GeometryInstance_default({
293
- geometry: new Geometry_default({
294
- attributes: new GeometryAttributes_default({
295
- position: new GeometryAttribute_default({
296
- componentDatatype: ComponentDatatype_default.DOUBLE,
297
- componentsPerAttribute: 3,
298
- values: subdividedPositions
299
- })
300
- }),
301
- indices,
302
- primitiveType: PrimitiveType_default.LINES
303
- })
304
- });
305
- }
306
- function PolygonOutlineGeometry(options) {
307
- Check_default.typeOf.object("options", options);
308
- Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
309
- if (options.perPositionHeight && defined_default(options.height)) {
310
- throw new DeveloperError_default(
311
- "Cannot use both options.perPositionHeight and options.height"
312
- );
313
- }
314
- if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
315
- throw new DeveloperError_default(
316
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
317
- );
318
- }
319
- const polygonHierarchy = options.polygonHierarchy;
320
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
321
- const granularity = defaultValue_default(
322
- options.granularity,
323
- Math_default.RADIANS_PER_DEGREE
324
- );
325
- const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
326
- const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
327
- const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
328
- let height = defaultValue_default(options.height, 0);
329
- let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
330
- if (!perPositionHeightExtrude) {
331
- const h = Math.max(height, extrudedHeight);
332
- extrudedHeight = Math.min(height, extrudedHeight);
333
- height = h;
334
- }
335
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
336
- this._granularity = granularity;
337
- this._height = height;
338
- this._extrudedHeight = extrudedHeight;
339
- this._arcType = arcType;
340
- this._polygonHierarchy = polygonHierarchy;
341
- this._perPositionHeight = perPositionHeight;
342
- this._perPositionHeightExtrude = perPositionHeightExtrude;
343
- this._offsetAttribute = options.offsetAttribute;
344
- this._workerName = "createPolygonOutlineGeometry";
345
- this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
346
- polygonHierarchy,
347
- Cartesian3_default
348
- ) + Ellipsoid_default.packedLength + 8;
349
- }
350
- PolygonOutlineGeometry.pack = function(value, array, startingIndex) {
351
- Check_default.typeOf.object("value", value);
352
- Check_default.defined("array", array);
353
- startingIndex = defaultValue_default(startingIndex, 0);
354
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
355
- value._polygonHierarchy,
356
- array,
357
- startingIndex,
358
- Cartesian3_default
359
- );
360
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
361
- startingIndex += Ellipsoid_default.packedLength;
362
- array[startingIndex++] = value._height;
363
- array[startingIndex++] = value._extrudedHeight;
364
- array[startingIndex++] = value._granularity;
365
- array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
366
- array[startingIndex++] = value._perPositionHeight ? 1 : 0;
367
- array[startingIndex++] = value._arcType;
368
- array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
369
- array[startingIndex] = value.packedLength;
370
- return array;
371
- };
372
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
373
- var dummyOptions = {
374
- polygonHierarchy: {}
375
- };
376
- PolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
377
- Check_default.defined("array", array);
378
- startingIndex = defaultValue_default(startingIndex, 0);
379
- const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
380
- array,
381
- startingIndex,
382
- Cartesian3_default
383
- );
384
- startingIndex = polygonHierarchy.startingIndex;
385
- delete polygonHierarchy.startingIndex;
386
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
387
- startingIndex += Ellipsoid_default.packedLength;
388
- const height = array[startingIndex++];
389
- const extrudedHeight = array[startingIndex++];
390
- const granularity = array[startingIndex++];
391
- const perPositionHeightExtrude = array[startingIndex++] === 1;
392
- const perPositionHeight = array[startingIndex++] === 1;
393
- const arcType = array[startingIndex++];
394
- const offsetAttribute = array[startingIndex++];
395
- const packedLength = array[startingIndex];
396
- if (!defined_default(result)) {
397
- result = new PolygonOutlineGeometry(dummyOptions);
398
- }
399
- result._polygonHierarchy = polygonHierarchy;
400
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
401
- result._height = height;
402
- result._extrudedHeight = extrudedHeight;
403
- result._granularity = granularity;
404
- result._perPositionHeight = perPositionHeight;
405
- result._perPositionHeightExtrude = perPositionHeightExtrude;
406
- result._arcType = arcType;
407
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
408
- result.packedLength = packedLength;
409
- return result;
410
- };
411
- PolygonOutlineGeometry.fromPositions = function(options) {
412
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
413
- Check_default.defined("options.positions", options.positions);
414
- const newOptions = {
415
- polygonHierarchy: {
416
- positions: options.positions
417
- },
418
- height: options.height,
419
- extrudedHeight: options.extrudedHeight,
420
- ellipsoid: options.ellipsoid,
421
- granularity: options.granularity,
422
- perPositionHeight: options.perPositionHeight,
423
- arcType: options.arcType,
424
- offsetAttribute: options.offsetAttribute
425
- };
426
- return new PolygonOutlineGeometry(newOptions);
427
- };
428
- PolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
429
- const ellipsoid = polygonGeometry._ellipsoid;
430
- const granularity = polygonGeometry._granularity;
431
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
432
- const perPositionHeight = polygonGeometry._perPositionHeight;
433
- const arcType = polygonGeometry._arcType;
434
- const polygons = PolygonGeometryLibrary_default.polygonOutlinesFromHierarchy(
435
- polygonHierarchy,
436
- !perPositionHeight,
437
- ellipsoid
438
- );
439
- if (polygons.length === 0) {
440
- return void 0;
441
- }
442
- let geometryInstance;
443
- const geometries = [];
444
- const minDistance = Math_default.chordLength(
445
- granularity,
446
- ellipsoid.maximumRadius
447
- );
448
- const height = polygonGeometry._height;
449
- const extrudedHeight = polygonGeometry._extrudedHeight;
450
- const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
451
- let offsetValue;
452
- let i;
453
- if (extrude) {
454
- for (i = 0; i < polygons.length; i++) {
455
- geometryInstance = createGeometryFromPositionsExtruded(
456
- ellipsoid,
457
- polygons[i],
458
- minDistance,
459
- perPositionHeight,
460
- arcType
461
- );
462
- geometryInstance.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
463
- geometryInstance.geometry,
464
- height,
465
- extrudedHeight,
466
- ellipsoid,
467
- perPositionHeight
468
- );
469
- if (defined_default(polygonGeometry._offsetAttribute)) {
470
- const size = geometryInstance.geometry.attributes.position.values.length / 3;
471
- let offsetAttribute = new Uint8Array(size);
472
- if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
473
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
474
- } else {
475
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
476
- offsetAttribute = offsetAttribute.fill(offsetValue);
477
- }
478
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
479
- {
480
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
481
- componentsPerAttribute: 1,
482
- values: offsetAttribute
483
- }
484
- );
485
- }
486
- geometries.push(geometryInstance);
487
- }
488
- } else {
489
- for (i = 0; i < polygons.length; i++) {
490
- geometryInstance = createGeometryFromPositions(
491
- ellipsoid,
492
- polygons[i],
493
- minDistance,
494
- perPositionHeight,
495
- arcType
496
- );
497
- geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
498
- geometryInstance.geometry.attributes.position.values,
499
- height,
500
- ellipsoid,
501
- !perPositionHeight
502
- );
503
- if (defined_default(polygonGeometry._offsetAttribute)) {
504
- const length = geometryInstance.geometry.attributes.position.values.length;
505
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
506
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
507
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
508
- {
509
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
510
- componentsPerAttribute: 1,
511
- values: applyOffset
512
- }
513
- );
514
- }
515
- geometries.push(geometryInstance);
516
- }
517
- }
518
- const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
519
- const boundingSphere = BoundingSphere_default.fromVertices(
520
- geometry.attributes.position.values
521
- );
522
- return new Geometry_default({
523
- attributes: geometry.attributes,
524
- indices: geometry.indices,
525
- primitiveType: geometry.primitiveType,
526
- boundingSphere,
527
- offsetAttribute: polygonGeometry._offsetAttribute
528
- });
529
- };
530
- var PolygonOutlineGeometry_default = PolygonOutlineGeometry;
531
-
532
- // packages/engine/Source/Workers/createPolygonOutlineGeometry.js
533
- function createPolygonOutlineGeometry(polygonGeometry, offset) {
534
- if (defined_default(offset)) {
535
- polygonGeometry = PolygonOutlineGeometry_default.unpack(polygonGeometry, offset);
536
- }
537
- polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
538
- return PolygonOutlineGeometry_default.createGeometry(polygonGeometry);
539
- }
540
- var createPolygonOutlineGeometry_default = createPolygonOutlineGeometry;
541
- export {
542
- createPolygonOutlineGeometry_default as default
543
- };
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};