@pggis/pg-sdk 3.3.10 → 4.3.3

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/pggis.min.js +10980 -7539
  5. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  7. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  8. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  9. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  10. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  11. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  12. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  13. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  14. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  15. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  16. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  17. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  18. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  19. package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  20. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  21. package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
  22. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  23. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  24. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  25. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  26. package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
  27. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  28. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  29. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  30. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  31. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  32. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  33. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  34. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  35. package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
  36. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  37. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  38. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  39. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  40. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  41. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  42. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  43. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  44. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  45. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  46. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  47. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  48. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  49. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  50. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  51. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  52. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  53. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  54. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  55. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  56. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  57. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  58. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  59. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  60. package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
  61. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  62. package/dist/resources/Workers/combineGeometry.js +2 -44
  63. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  64. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  65. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  66. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  67. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  68. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  69. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  70. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  71. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  72. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  73. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  74. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  75. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  76. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  77. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  78. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  79. package/dist/resources/Workers/createGeometry.js +2 -147
  80. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  81. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  82. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  83. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  84. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  85. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  86. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  87. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  88. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  89. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  90. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  91. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  92. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  93. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  94. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  95. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  96. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  97. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  98. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  99. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  100. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  101. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  102. package/dist/resources/Workers/createWallGeometry.js +2 -466
  103. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  104. package/dist/resources/Workers/decodeDraco.js +2 -345
  105. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  106. package/dist/resources/Workers/decodeI3S.js +2 -1320
  107. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  108. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  109. package/dist/resources/Workers/transcodeKTX2.js +29 -3398
  110. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  111. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  112. package/package.json +9 -8
  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,468 +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
- WallGeometryLibrary_default
28
- } from "./chunk-4DO5W5XZ.js";
29
- import "./chunk-KKCR2YOP.js";
30
- import "./chunk-F4HFJMGM.js";
31
- import {
32
- VertexFormat_default
33
- } from "./chunk-2FWRMUTY.js";
34
- import "./chunk-FZRIVR7Y.js";
35
- import "./chunk-SH5USDPI.js";
36
- import "./chunk-2FRVPMCS.js";
37
- import "./chunk-Y5UQJLYE.js";
38
- import {
39
- IndexDatatype_default
40
- } from "./chunk-LPR3YNP2.js";
41
- import {
42
- GeometryAttributes_default
43
- } from "./chunk-4H7PY4U5.js";
44
- import {
45
- GeometryAttribute_default,
46
- Geometry_default,
47
- PrimitiveType_default
48
- } from "./chunk-7TC63SJW.js";
49
- import {
50
- BoundingSphere_default
51
- } from "./chunk-FJKNFAKQ.js";
52
- import "./chunk-TTUZP4BO.js";
53
- import "./chunk-BG4UCVXN.js";
54
- import "./chunk-YJEBABKH.js";
55
- import {
56
- ComponentDatatype_default
57
- } from "./chunk-PPH7OFP3.js";
58
- import {
59
- Cartesian3_default,
60
- Ellipsoid_default
61
- } from "./chunk-OGXZVPPM.js";
62
- import {
63
- Math_default
64
- } from "./chunk-5QULIR53.js";
65
- import "./chunk-SOWMRMWA.js";
66
- import "./chunk-STW2DGFI.js";
67
- import {
68
- defaultValue_default
69
- } from "./chunk-BBWDMCVU.js";
70
- import {
71
- DeveloperError_default
72
- } from "./chunk-XGI5BXZY.js";
73
- import {
74
- defined_default
75
- } from "./chunk-YWTJ2B4B.js";
76
-
77
- // packages/engine/Source/Core/WallGeometry.js
78
- var scratchCartesian3Position1 = new Cartesian3_default();
79
- var scratchCartesian3Position2 = new Cartesian3_default();
80
- var scratchCartesian3Position4 = new Cartesian3_default();
81
- var scratchCartesian3Position5 = new Cartesian3_default();
82
- var scratchBitangent = new Cartesian3_default();
83
- var scratchTangent = new Cartesian3_default();
84
- var scratchNormal = new Cartesian3_default();
85
- function WallGeometry(options) {
86
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
87
- const wallPositions = options.positions;
88
- const maximumHeights = options.maximumHeights;
89
- const minimumHeights = options.minimumHeights;
90
- if (!defined_default(wallPositions)) {
91
- throw new DeveloperError_default("options.positions is required.");
92
- }
93
- if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
94
- throw new DeveloperError_default(
95
- "options.positions and options.maximumHeights must have the same length."
96
- );
97
- }
98
- if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
99
- throw new DeveloperError_default(
100
- "options.positions and options.minimumHeights must have the same length."
101
- );
102
- }
103
- const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
104
- const granularity = defaultValue_default(
105
- options.granularity,
106
- Math_default.RADIANS_PER_DEGREE
107
- );
108
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
109
- this._positions = wallPositions;
110
- this._minimumHeights = minimumHeights;
111
- this._maximumHeights = maximumHeights;
112
- this._vertexFormat = VertexFormat_default.clone(vertexFormat);
113
- this._granularity = granularity;
114
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
115
- this._workerName = "createWallGeometry";
116
- let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
117
- if (defined_default(minimumHeights)) {
118
- numComponents += minimumHeights.length;
119
- }
120
- if (defined_default(maximumHeights)) {
121
- numComponents += maximumHeights.length;
122
- }
123
- this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 1;
124
- }
125
- WallGeometry.pack = function(value, array, startingIndex) {
126
- if (!defined_default(value)) {
127
- throw new DeveloperError_default("value is required");
128
- }
129
- if (!defined_default(array)) {
130
- throw new DeveloperError_default("array is required");
131
- }
132
- startingIndex = defaultValue_default(startingIndex, 0);
133
- let i;
134
- const positions = value._positions;
135
- let length = positions.length;
136
- array[startingIndex++] = length;
137
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
138
- Cartesian3_default.pack(positions[i], array, startingIndex);
139
- }
140
- const minimumHeights = value._minimumHeights;
141
- length = defined_default(minimumHeights) ? minimumHeights.length : 0;
142
- array[startingIndex++] = length;
143
- if (defined_default(minimumHeights)) {
144
- for (i = 0; i < length; ++i) {
145
- array[startingIndex++] = minimumHeights[i];
146
- }
147
- }
148
- const maximumHeights = value._maximumHeights;
149
- length = defined_default(maximumHeights) ? maximumHeights.length : 0;
150
- array[startingIndex++] = length;
151
- if (defined_default(maximumHeights)) {
152
- for (i = 0; i < length; ++i) {
153
- array[startingIndex++] = maximumHeights[i];
154
- }
155
- }
156
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
157
- startingIndex += Ellipsoid_default.packedLength;
158
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
159
- startingIndex += VertexFormat_default.packedLength;
160
- array[startingIndex] = value._granularity;
161
- return array;
162
- };
163
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
164
- var scratchVertexFormat = new VertexFormat_default();
165
- var scratchOptions = {
166
- positions: void 0,
167
- minimumHeights: void 0,
168
- maximumHeights: void 0,
169
- ellipsoid: scratchEllipsoid,
170
- vertexFormat: scratchVertexFormat,
171
- granularity: void 0
172
- };
173
- WallGeometry.unpack = function(array, startingIndex, result) {
174
- if (!defined_default(array)) {
175
- throw new DeveloperError_default("array is required");
176
- }
177
- startingIndex = defaultValue_default(startingIndex, 0);
178
- let i;
179
- let length = array[startingIndex++];
180
- const positions = new Array(length);
181
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
182
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
183
- }
184
- length = array[startingIndex++];
185
- let minimumHeights;
186
- if (length > 0) {
187
- minimumHeights = new Array(length);
188
- for (i = 0; i < length; ++i) {
189
- minimumHeights[i] = array[startingIndex++];
190
- }
191
- }
192
- length = array[startingIndex++];
193
- let maximumHeights;
194
- if (length > 0) {
195
- maximumHeights = new Array(length);
196
- for (i = 0; i < length; ++i) {
197
- maximumHeights[i] = array[startingIndex++];
198
- }
199
- }
200
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
201
- startingIndex += Ellipsoid_default.packedLength;
202
- const vertexFormat = VertexFormat_default.unpack(
203
- array,
204
- startingIndex,
205
- scratchVertexFormat
206
- );
207
- startingIndex += VertexFormat_default.packedLength;
208
- const granularity = array[startingIndex];
209
- if (!defined_default(result)) {
210
- scratchOptions.positions = positions;
211
- scratchOptions.minimumHeights = minimumHeights;
212
- scratchOptions.maximumHeights = maximumHeights;
213
- scratchOptions.granularity = granularity;
214
- return new WallGeometry(scratchOptions);
215
- }
216
- result._positions = positions;
217
- result._minimumHeights = minimumHeights;
218
- result._maximumHeights = maximumHeights;
219
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
220
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
221
- result._granularity = granularity;
222
- return result;
223
- };
224
- WallGeometry.fromConstantHeights = function(options) {
225
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
226
- const positions = options.positions;
227
- if (!defined_default(positions)) {
228
- throw new DeveloperError_default("options.positions is required.");
229
- }
230
- let minHeights;
231
- let maxHeights;
232
- const min = options.minimumHeight;
233
- const max = options.maximumHeight;
234
- const doMin = defined_default(min);
235
- const doMax = defined_default(max);
236
- if (doMin || doMax) {
237
- const length = positions.length;
238
- minHeights = doMin ? new Array(length) : void 0;
239
- maxHeights = doMax ? new Array(length) : void 0;
240
- for (let i = 0; i < length; ++i) {
241
- if (doMin) {
242
- minHeights[i] = min;
243
- }
244
- if (doMax) {
245
- maxHeights[i] = max;
246
- }
247
- }
248
- }
249
- const newOptions = {
250
- positions,
251
- maximumHeights: maxHeights,
252
- minimumHeights: minHeights,
253
- ellipsoid: options.ellipsoid,
254
- vertexFormat: options.vertexFormat
255
- };
256
- return new WallGeometry(newOptions);
257
- };
258
- WallGeometry.createGeometry = function(wallGeometry) {
259
- const wallPositions = wallGeometry._positions;
260
- const minimumHeights = wallGeometry._minimumHeights;
261
- const maximumHeights = wallGeometry._maximumHeights;
262
- const vertexFormat = wallGeometry._vertexFormat;
263
- const granularity = wallGeometry._granularity;
264
- const ellipsoid = wallGeometry._ellipsoid;
265
- const pos = WallGeometryLibrary_default.computePositions(
266
- ellipsoid,
267
- wallPositions,
268
- maximumHeights,
269
- minimumHeights,
270
- granularity,
271
- true
272
- );
273
- if (!defined_default(pos)) {
274
- return;
275
- }
276
- const bottomPositions = pos.bottomPositions;
277
- const topPositions = pos.topPositions;
278
- const numCorners = pos.numCorners;
279
- let length = topPositions.length;
280
- let size = length * 2;
281
- const positions = vertexFormat.position ? new Float64Array(size) : void 0;
282
- const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
283
- const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
284
- const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
285
- const textureCoordinates = vertexFormat.st ? new Float32Array(size / 3 * 2) : void 0;
286
- let positionIndex = 0;
287
- let normalIndex = 0;
288
- let bitangentIndex = 0;
289
- let tangentIndex = 0;
290
- let stIndex = 0;
291
- let normal = scratchNormal;
292
- let tangent = scratchTangent;
293
- let bitangent = scratchBitangent;
294
- let recomputeNormal = true;
295
- length /= 3;
296
- let i;
297
- let s = 0;
298
- const ds = 1 / (length - numCorners - 1);
299
- for (i = 0; i < length; ++i) {
300
- const i3 = i * 3;
301
- const topPosition = Cartesian3_default.fromArray(
302
- topPositions,
303
- i3,
304
- scratchCartesian3Position1
305
- );
306
- const bottomPosition = Cartesian3_default.fromArray(
307
- bottomPositions,
308
- i3,
309
- scratchCartesian3Position2
310
- );
311
- if (vertexFormat.position) {
312
- positions[positionIndex++] = bottomPosition.x;
313
- positions[positionIndex++] = bottomPosition.y;
314
- positions[positionIndex++] = bottomPosition.z;
315
- positions[positionIndex++] = topPosition.x;
316
- positions[positionIndex++] = topPosition.y;
317
- positions[positionIndex++] = topPosition.z;
318
- }
319
- if (vertexFormat.st) {
320
- textureCoordinates[stIndex++] = s;
321
- textureCoordinates[stIndex++] = 0;
322
- textureCoordinates[stIndex++] = s;
323
- textureCoordinates[stIndex++] = 1;
324
- }
325
- if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
326
- let nextTop = Cartesian3_default.clone(
327
- Cartesian3_default.ZERO,
328
- scratchCartesian3Position5
329
- );
330
- const groundPosition = Cartesian3_default.subtract(
331
- topPosition,
332
- ellipsoid.geodeticSurfaceNormal(
333
- topPosition,
334
- scratchCartesian3Position2
335
- ),
336
- scratchCartesian3Position2
337
- );
338
- if (i + 1 < length) {
339
- nextTop = Cartesian3_default.fromArray(
340
- topPositions,
341
- i3 + 3,
342
- scratchCartesian3Position5
343
- );
344
- }
345
- if (recomputeNormal) {
346
- const scalednextPosition = Cartesian3_default.subtract(
347
- nextTop,
348
- topPosition,
349
- scratchCartesian3Position4
350
- );
351
- const scaledGroundPosition = Cartesian3_default.subtract(
352
- groundPosition,
353
- topPosition,
354
- scratchCartesian3Position1
355
- );
356
- normal = Cartesian3_default.normalize(
357
- Cartesian3_default.cross(scaledGroundPosition, scalednextPosition, normal),
358
- normal
359
- );
360
- recomputeNormal = false;
361
- }
362
- if (Cartesian3_default.equalsEpsilon(topPosition, nextTop, Math_default.EPSILON10)) {
363
- recomputeNormal = true;
364
- } else {
365
- s += ds;
366
- if (vertexFormat.tangent) {
367
- tangent = Cartesian3_default.normalize(
368
- Cartesian3_default.subtract(nextTop, topPosition, tangent),
369
- tangent
370
- );
371
- }
372
- if (vertexFormat.bitangent) {
373
- bitangent = Cartesian3_default.normalize(
374
- Cartesian3_default.cross(normal, tangent, bitangent),
375
- bitangent
376
- );
377
- }
378
- }
379
- if (vertexFormat.normal) {
380
- normals[normalIndex++] = normal.x;
381
- normals[normalIndex++] = normal.y;
382
- normals[normalIndex++] = normal.z;
383
- normals[normalIndex++] = normal.x;
384
- normals[normalIndex++] = normal.y;
385
- normals[normalIndex++] = normal.z;
386
- }
387
- if (vertexFormat.tangent) {
388
- tangents[tangentIndex++] = tangent.x;
389
- tangents[tangentIndex++] = tangent.y;
390
- tangents[tangentIndex++] = tangent.z;
391
- tangents[tangentIndex++] = tangent.x;
392
- tangents[tangentIndex++] = tangent.y;
393
- tangents[tangentIndex++] = tangent.z;
394
- }
395
- if (vertexFormat.bitangent) {
396
- bitangents[bitangentIndex++] = bitangent.x;
397
- bitangents[bitangentIndex++] = bitangent.y;
398
- bitangents[bitangentIndex++] = bitangent.z;
399
- bitangents[bitangentIndex++] = bitangent.x;
400
- bitangents[bitangentIndex++] = bitangent.y;
401
- bitangents[bitangentIndex++] = bitangent.z;
402
- }
403
- }
404
- }
405
- const attributes = new GeometryAttributes_default();
406
- if (vertexFormat.position) {
407
- attributes.position = new GeometryAttribute_default({
408
- componentDatatype: ComponentDatatype_default.DOUBLE,
409
- componentsPerAttribute: 3,
410
- values: positions
411
- });
412
- }
413
- if (vertexFormat.normal) {
414
- attributes.normal = new GeometryAttribute_default({
415
- componentDatatype: ComponentDatatype_default.FLOAT,
416
- componentsPerAttribute: 3,
417
- values: normals
418
- });
419
- }
420
- if (vertexFormat.tangent) {
421
- attributes.tangent = new GeometryAttribute_default({
422
- componentDatatype: ComponentDatatype_default.FLOAT,
423
- componentsPerAttribute: 3,
424
- values: tangents
425
- });
426
- }
427
- if (vertexFormat.bitangent) {
428
- attributes.bitangent = new GeometryAttribute_default({
429
- componentDatatype: ComponentDatatype_default.FLOAT,
430
- componentsPerAttribute: 3,
431
- values: bitangents
432
- });
433
- }
434
- if (vertexFormat.st) {
435
- attributes.st = new GeometryAttribute_default({
436
- componentDatatype: ComponentDatatype_default.FLOAT,
437
- componentsPerAttribute: 2,
438
- values: textureCoordinates
439
- });
440
- }
441
- const numVertices = size / 3;
442
- size -= 6 * (numCorners + 1);
443
- const indices = IndexDatatype_default.createTypedArray(numVertices, size);
444
- let edgeIndex = 0;
445
- for (i = 0; i < numVertices - 2; i += 2) {
446
- const LL = i;
447
- const LR = i + 2;
448
- const pl = Cartesian3_default.fromArray(
449
- positions,
450
- LL * 3,
451
- scratchCartesian3Position1
452
- );
453
- const pr = Cartesian3_default.fromArray(
454
- positions,
455
- LR * 3,
456
- scratchCartesian3Position2
457
- );
458
- if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
459
- continue;
460
- }
461
- const UL = i + 1;
462
- const UR = i + 3;
463
- indices[edgeIndex++] = UL;
464
- indices[edgeIndex++] = LL;
465
- indices[edgeIndex++] = UR;
466
- indices[edgeIndex++] = UR;
467
- indices[edgeIndex++] = LL;
468
- indices[edgeIndex++] = LR;
469
- }
470
- return new Geometry_default({
471
- attributes,
472
- indices,
473
- primitiveType: PrimitiveType_default.TRIANGLES,
474
- boundingSphere: new BoundingSphere_default.fromVertices(positions)
475
- });
476
- };
477
- var WallGeometry_default = WallGeometry;
478
-
479
- // packages/engine/Source/Workers/createWallGeometry.js
480
- function createWallGeometry(wallGeometry, offset) {
481
- if (defined_default(offset)) {
482
- wallGeometry = WallGeometry_default.unpack(wallGeometry, offset);
483
- }
484
- wallGeometry._ellipsoid = Ellipsoid_default.clone(wallGeometry._ellipsoid);
485
- return WallGeometry_default.createGeometry(wallGeometry);
486
- }
487
- var createWallGeometry_default = createWallGeometry;
488
- export {
489
- createWallGeometry_default as default
490
- };
26
+ import{a as nt}from"./chunk-NB3ML6JO.js";import"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import{a as w}from"./chunk-CYCB63OH.js";import"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as ot}from"./chunk-OFUUQVMR.js";import{a as it}from"./chunk-A56XVLQR.js";import{b as tt,c as et,d as R}from"./chunk-RCV6KWXS.js";import{d as I}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as N}from"./chunk-AU7IKHOH.js";import{a as s,d as l,f as K}from"./chunk-64RSHJUE.js";import{a as V}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as y}from"./chunk-LEYMRMBK.js";import{e as r}from"./chunk-VTAIKJXX.js";var Q=new s,J=new s,lt=new s,st=new s,pt=new s,ut=new s,ft=new s;function E(t){t=t??K.EMPTY_OBJECT;let e=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))throw new y("options.positions is required.");if(r(o)&&o.length!==e.length)throw new y("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)throw new y("options.positions and options.minimumHeights must have the same length.");let i=t.vertexFormat??w.DEFAULT,c=t.granularity??V.RADIANS_PER_DEGREE,a=t.ellipsoid??l.default;this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=w.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";let m=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+w.packedLength+1}E.pack=function(t,e,o){if(!r(t))throw new y("value is required");if(!r(e))throw new y("array is required");o=o??0;let n,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);let a=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];let m=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];return l.pack(t._ellipsoid,e,o),o+=l.packedLength,w.pack(t._vertexFormat,e,o),o+=w.packedLength,e[o]=t._granularity,e};var mt=l.clone(l.UNIT_SPHERE),rt=new w,U={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:mt,vertexFormat:rt,granularity:void 0};E.unpack=function(t,e,o){if(!r(t))throw new y("array is required");e=e??0;let n,i=t[e++],c=new Array(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];let a;if(i>0)for(a=new Array(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];let m;if(i>0)for(m=new Array(i),n=0;n<i;++n)m[n]=t[e++];let S=l.unpack(t,e,mt);e+=l.packedLength;let _=w.unpack(t,e,rt);e+=w.packedLength;let f=t[e];return r(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(S,o._ellipsoid),o._vertexFormat=w.clone(_,o._vertexFormat),o._granularity=f,o):(U.positions=c,U.minimumHeights=a,U.maximumHeights=m,U.granularity=f,new E(U))};E.fromConstantHeights=function(t){t=t??K.EMPTY_OBJECT;let e=t.positions;if(!r(e))throw new y("options.positions is required.");let o,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){let _=e.length;o=a?new Array(_):void 0,n=m?new Array(_):void 0;for(let f=0;f<_;++f)a&&(o[f]=i),m&&(n[f]=c)}let S={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};return new E(S)};E.createGeometry=function(t){let e=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;let S=m.bottomPositions,_=m.topPositions,f=m.numCorners,q=_.length,A=q*2,h=i.position?new Float64Array(A):void 0,P=i.normal?new Float32Array(A):void 0,b=i.tangent?new Float32Array(A):void 0,x=i.bitangent?new Float32Array(A):void 0,B=i.st?new Float32Array(A/3*2):void 0,k=0,v=0,T=0,C=0,W=0,g=ft,d=ut,H=pt,Y=!0;q/=3;let p,Z=0,ct=1/(q-f-1);for(p=0;p<q;++p){let L=p*3,u=s.fromArray(_,L,Q),M=s.fromArray(S,L,J);if(i.position&&(h[k++]=M.x,h[k++]=M.y,h[k++]=M.z,h[k++]=u.x,h[k++]=u.y,h[k++]=u.z),i.st&&(B[W++]=Z,B[W++]=0,B[W++]=Z,B[W++]=1),i.normal||i.tangent||i.bitangent){let O=s.clone(s.ZERO,st),j=s.subtract(u,a.geodeticSurfaceNormal(u,J),J);if(p+1<q&&(O=s.fromArray(_,L+3,st)),Y){let G=s.subtract(O,u,lt),at=s.subtract(j,u,Q);g=s.normalize(s.cross(at,G,g),g),Y=!1}s.equalsEpsilon(u,O,V.EPSILON10)?Y=!0:(Z+=ct,i.tangent&&(d=s.normalize(s.subtract(O,u,d),d)),i.bitangent&&(H=s.normalize(s.cross(g,d,H),H))),i.normal&&(P[v++]=g.x,P[v++]=g.y,P[v++]=g.z,P[v++]=g.x,P[v++]=g.y,P[v++]=g.z),i.tangent&&(b[C++]=d.x,b[C++]=d.y,b[C++]=d.z,b[C++]=d.x,b[C++]=d.y,b[C++]=d.z),i.bitangent&&(x[T++]=H.x,x[T++]=H.y,x[T++]=H.z,x[T++]=H.x,x[T++]=H.y,x[T++]=H.z)}}let z=new it;i.position&&(z.position=new R({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(z.normal=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:P})),i.tangent&&(z.tangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:b})),i.bitangent&&(z.bitangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:x})),i.st&&(z.st=new R({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:B}));let $=A/3;A-=6*(f+1);let F=ot.createTypedArray($,A),D=0;for(p=0;p<$-2;p+=2){let L=p,u=p+2,M=s.fromArray(h,L*3,Q),O=s.fromArray(h,u*3,J);if(s.equalsEpsilon(M,O,V.EPSILON10))continue;let j=p+1,G=p+3;F[D++]=j,F[D++]=L,F[D++]=G,F[D++]=G,F[D++]=L,F[D++]=u}return new et({attributes:z,indices:F,primitiveType:tt.TRIANGLES,boundingSphere:new I.fromVertices(h)})};var X=E;function ht(t,e){return r(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}var Ot=ht;export{Ot as default};