@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,314 +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-IBLIYJZR.js";
29
- import "./chunk-TGONEMZO.js";
30
- import "./chunk-BHQJ2NT7.js";
31
- import "./chunk-472HQ3EH.js";
32
- import "./chunk-E6V6SQZW.js";
33
- import "./chunk-3Q2L65QU.js";
34
- import "./chunk-2ZGOQXYU.js";
35
- import {
36
- IndexDatatype_default
37
- } from "./chunk-26GA3JAM.js";
38
- import {
39
- GeometryAttributes_default
40
- } from "./chunk-DI5NGJUP.js";
41
- import {
42
- GeometryAttribute_default,
43
- Geometry_default,
44
- PrimitiveType_default
45
- } from "./chunk-GWCFU2SA.js";
46
- import {
47
- BoundingSphere_default
48
- } from "./chunk-VJZB3WAV.js";
49
- import "./chunk-5PTXS2GO.js";
50
- import {
51
- ComponentDatatype_default
52
- } from "./chunk-K4GQUNB5.js";
53
- import {
54
- Cartesian3_default,
55
- Ellipsoid_default
56
- } from "./chunk-YFXQECWV.js";
57
- import {
58
- Math_default
59
- } from "./chunk-XY4BATBS.js";
60
- import "./chunk-MXIZJAPH.js";
61
- import "./chunk-6CHGCNMW.js";
62
- import {
63
- defaultValue_default
64
- } from "./chunk-7JO7GPJN.js";
65
- import {
66
- DeveloperError_default
67
- } from "./chunk-AD63PIY6.js";
68
- import {
69
- defined_default
70
- } from "./chunk-E63IIM5T.js";
71
-
72
- // packages/engine/Source/Core/WallOutlineGeometry.js
73
- var scratchCartesian3Position1 = new Cartesian3_default();
74
- var scratchCartesian3Position2 = new Cartesian3_default();
75
- function WallOutlineGeometry(options) {
76
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
77
- const wallPositions = options.positions;
78
- const maximumHeights = options.maximumHeights;
79
- const minimumHeights = options.minimumHeights;
80
- if (!defined_default(wallPositions)) {
81
- throw new DeveloperError_default("options.positions is required.");
82
- }
83
- if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
84
- throw new DeveloperError_default(
85
- "options.positions and options.maximumHeights must have the same length."
86
- );
87
- }
88
- if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
89
- throw new DeveloperError_default(
90
- "options.positions and options.minimumHeights must have the same length."
91
- );
92
- }
93
- const granularity = defaultValue_default(
94
- options.granularity,
95
- Math_default.RADIANS_PER_DEGREE
96
- );
97
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
98
- this._positions = wallPositions;
99
- this._minimumHeights = minimumHeights;
100
- this._maximumHeights = maximumHeights;
101
- this._granularity = granularity;
102
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
103
- this._workerName = "createWallOutlineGeometry";
104
- let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
105
- if (defined_default(minimumHeights)) {
106
- numComponents += minimumHeights.length;
107
- }
108
- if (defined_default(maximumHeights)) {
109
- numComponents += maximumHeights.length;
110
- }
111
- this.packedLength = numComponents + Ellipsoid_default.packedLength + 1;
112
- }
113
- WallOutlineGeometry.pack = function(value, array, startingIndex) {
114
- if (!defined_default(value)) {
115
- throw new DeveloperError_default("value is required");
116
- }
117
- if (!defined_default(array)) {
118
- throw new DeveloperError_default("array is required");
119
- }
120
- startingIndex = defaultValue_default(startingIndex, 0);
121
- let i;
122
- const positions = value._positions;
123
- let length = positions.length;
124
- array[startingIndex++] = length;
125
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
126
- Cartesian3_default.pack(positions[i], array, startingIndex);
127
- }
128
- const minimumHeights = value._minimumHeights;
129
- length = defined_default(minimumHeights) ? minimumHeights.length : 0;
130
- array[startingIndex++] = length;
131
- if (defined_default(minimumHeights)) {
132
- for (i = 0; i < length; ++i) {
133
- array[startingIndex++] = minimumHeights[i];
134
- }
135
- }
136
- const maximumHeights = value._maximumHeights;
137
- length = defined_default(maximumHeights) ? maximumHeights.length : 0;
138
- array[startingIndex++] = length;
139
- if (defined_default(maximumHeights)) {
140
- for (i = 0; i < length; ++i) {
141
- array[startingIndex++] = maximumHeights[i];
142
- }
143
- }
144
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
145
- startingIndex += Ellipsoid_default.packedLength;
146
- array[startingIndex] = value._granularity;
147
- return array;
148
- };
149
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
150
- var scratchOptions = {
151
- positions: void 0,
152
- minimumHeights: void 0,
153
- maximumHeights: void 0,
154
- ellipsoid: scratchEllipsoid,
155
- granularity: void 0
156
- };
157
- WallOutlineGeometry.unpack = function(array, startingIndex, result) {
158
- if (!defined_default(array)) {
159
- throw new DeveloperError_default("array is required");
160
- }
161
- startingIndex = defaultValue_default(startingIndex, 0);
162
- let i;
163
- let length = array[startingIndex++];
164
- const positions = new Array(length);
165
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
166
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
167
- }
168
- length = array[startingIndex++];
169
- let minimumHeights;
170
- if (length > 0) {
171
- minimumHeights = new Array(length);
172
- for (i = 0; i < length; ++i) {
173
- minimumHeights[i] = array[startingIndex++];
174
- }
175
- }
176
- length = array[startingIndex++];
177
- let maximumHeights;
178
- if (length > 0) {
179
- maximumHeights = new Array(length);
180
- for (i = 0; i < length; ++i) {
181
- maximumHeights[i] = array[startingIndex++];
182
- }
183
- }
184
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
185
- startingIndex += Ellipsoid_default.packedLength;
186
- const granularity = array[startingIndex];
187
- if (!defined_default(result)) {
188
- scratchOptions.positions = positions;
189
- scratchOptions.minimumHeights = minimumHeights;
190
- scratchOptions.maximumHeights = maximumHeights;
191
- scratchOptions.granularity = granularity;
192
- return new WallOutlineGeometry(scratchOptions);
193
- }
194
- result._positions = positions;
195
- result._minimumHeights = minimumHeights;
196
- result._maximumHeights = maximumHeights;
197
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
198
- result._granularity = granularity;
199
- return result;
200
- };
201
- WallOutlineGeometry.fromConstantHeights = function(options) {
202
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
203
- const positions = options.positions;
204
- if (!defined_default(positions)) {
205
- throw new DeveloperError_default("options.positions is required.");
206
- }
207
- let minHeights;
208
- let maxHeights;
209
- const min = options.minimumHeight;
210
- const max = options.maximumHeight;
211
- const doMin = defined_default(min);
212
- const doMax = defined_default(max);
213
- if (doMin || doMax) {
214
- const length = positions.length;
215
- minHeights = doMin ? new Array(length) : void 0;
216
- maxHeights = doMax ? new Array(length) : void 0;
217
- for (let i = 0; i < length; ++i) {
218
- if (doMin) {
219
- minHeights[i] = min;
220
- }
221
- if (doMax) {
222
- maxHeights[i] = max;
223
- }
224
- }
225
- }
226
- const newOptions = {
227
- positions,
228
- maximumHeights: maxHeights,
229
- minimumHeights: minHeights,
230
- ellipsoid: options.ellipsoid
231
- };
232
- return new WallOutlineGeometry(newOptions);
233
- };
234
- WallOutlineGeometry.createGeometry = function(wallGeometry) {
235
- const wallPositions = wallGeometry._positions;
236
- const minimumHeights = wallGeometry._minimumHeights;
237
- const maximumHeights = wallGeometry._maximumHeights;
238
- const granularity = wallGeometry._granularity;
239
- const ellipsoid = wallGeometry._ellipsoid;
240
- const pos = WallGeometryLibrary_default.computePositions(
241
- ellipsoid,
242
- wallPositions,
243
- maximumHeights,
244
- minimumHeights,
245
- granularity,
246
- false
247
- );
248
- if (!defined_default(pos)) {
249
- return;
250
- }
251
- const bottomPositions = pos.bottomPositions;
252
- const topPositions = pos.topPositions;
253
- let length = topPositions.length;
254
- let size = length * 2;
255
- const positions = new Float64Array(size);
256
- let positionIndex = 0;
257
- length /= 3;
258
- let i;
259
- for (i = 0; i < length; ++i) {
260
- const i3 = i * 3;
261
- const topPosition = Cartesian3_default.fromArray(
262
- topPositions,
263
- i3,
264
- scratchCartesian3Position1
265
- );
266
- const bottomPosition = Cartesian3_default.fromArray(
267
- bottomPositions,
268
- i3,
269
- scratchCartesian3Position2
270
- );
271
- positions[positionIndex++] = bottomPosition.x;
272
- positions[positionIndex++] = bottomPosition.y;
273
- positions[positionIndex++] = bottomPosition.z;
274
- positions[positionIndex++] = topPosition.x;
275
- positions[positionIndex++] = topPosition.y;
276
- positions[positionIndex++] = topPosition.z;
277
- }
278
- const attributes = new GeometryAttributes_default({
279
- position: new GeometryAttribute_default({
280
- componentDatatype: ComponentDatatype_default.DOUBLE,
281
- componentsPerAttribute: 3,
282
- values: positions
283
- })
284
- });
285
- const numVertices = size / 3;
286
- size = 2 * numVertices - 4 + numVertices;
287
- const indices = IndexDatatype_default.createTypedArray(numVertices, size);
288
- let edgeIndex = 0;
289
- for (i = 0; i < numVertices - 2; i += 2) {
290
- const LL = i;
291
- const LR = i + 2;
292
- const pl = Cartesian3_default.fromArray(
293
- positions,
294
- LL * 3,
295
- scratchCartesian3Position1
296
- );
297
- const pr = Cartesian3_default.fromArray(
298
- positions,
299
- LR * 3,
300
- scratchCartesian3Position2
301
- );
302
- if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
303
- continue;
304
- }
305
- const UL = i + 1;
306
- const UR = i + 3;
307
- indices[edgeIndex++] = UL;
308
- indices[edgeIndex++] = LL;
309
- indices[edgeIndex++] = UL;
310
- indices[edgeIndex++] = UR;
311
- indices[edgeIndex++] = LL;
312
- indices[edgeIndex++] = LR;
313
- }
314
- indices[edgeIndex++] = numVertices - 2;
315
- indices[edgeIndex++] = numVertices - 1;
316
- return new Geometry_default({
317
- attributes,
318
- indices,
319
- primitiveType: PrimitiveType_default.LINES,
320
- boundingSphere: new BoundingSphere_default.fromVertices(positions)
321
- });
322
- };
323
- var WallOutlineGeometry_default = WallOutlineGeometry;
324
-
325
- // packages/engine/Source/Workers/createWallOutlineGeometry.js
326
- function createWallOutlineGeometry(wallGeometry, offset) {
327
- if (defined_default(offset)) {
328
- wallGeometry = WallOutlineGeometry_default.unpack(wallGeometry, offset);
329
- }
330
- wallGeometry._ellipsoid = Ellipsoid_default.clone(wallGeometry._ellipsoid);
331
- return WallOutlineGeometry_default.createGeometry(wallGeometry);
332
- }
333
- var createWallOutlineGeometry_default = createWallOutlineGeometry;
334
- export {
335
- createWallOutlineGeometry_default as default
336
- };
26
+ import{a as z}from"./chunk-NB3ML6JO.js";import"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as W}from"./chunk-OFUUQVMR.js";import{a as N}from"./chunk-A56XVLQR.js";import{b as R,c as S,d as M}from"./chunk-RCV6KWXS.js";import{d as D}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as q}from"./chunk-AU7IKHOH.js";import{a as p,d as l,f as O}from"./chunk-64RSHJUE.js";import{a as b}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as H}from"./chunk-LEYMRMBK.js";import{e as m}from"./chunk-VTAIKJXX.js";var B=new p,U=new p;function _(i){i=i??O.EMPTY_OBJECT;let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new H("options.positions is required.");if(m(e)&&e.length!==t.length)throw new H("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new H("options.positions and options.minimumHeights must have the same length.");let s=i.granularity??b.RADIANS_PER_DEGREE,r=i.ellipsoid??l.default;this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}_.pack=function(i,t,e){if(!m(i))throw new H("value is required");if(!m(t))throw new H("array is required");e=e??0;let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),L={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};_.unpack=function(i,t,e){if(!m(i))throw new H("array is required");t=t??0;let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let w=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(w,e._ellipsoid),e._granularity=u,e):(L.positions=r,L.minimumHeights=n,L.maximumHeights=c,L.granularity=u,new _(L))};_.fromConstantHeights=function(i){i=i??O.EMPTY_OBJECT;let t=i.positions;if(!m(t))throw new H("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let g=0;g<u;++g)n&&(e[g]=s),c&&(o[g]=r)}let w={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new _(w)};_.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=z.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,w=n.topPositions,u=w.length,g=u*2,f=new Float64Array(g),E=0;u/=3;let h;for(h=0;h<u;++h){let y=h*3,A=p.fromArray(w,y,B),k=p.fromArray(c,y,U);f[E++]=k.x,f[E++]=k.y,f[E++]=k.z,f[E++]=A.x,f[E++]=A.y,f[E++]=A.z}let v=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),P=g/3;g=2*P-4+P;let a=W.createTypedArray(P,g),d=0;for(h=0;h<P-2;h+=2){let y=h,A=h+2,k=p.fromArray(f,y*3,B),x=p.fromArray(f,A*3,U);if(p.equalsEpsilon(k,x,b.EPSILON10))continue;let T=h+1,F=h+3;a[d++]=T,a[d++]=y,a[d++]=T,a[d++]=F,a[d++]=y,a[d++]=A}return a[d++]=P-2,a[d++]=P-1,new S({attributes:v,indices:a,primitiveType:R.LINES,boundingSphere:new D.fromVertices(f)})};var C=_;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default};
@@ -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,347 +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
- require_draco_decoder_nodejs
28
- } from "./chunk-GESF4OXQ.js";
29
- import {
30
- createTaskProcessorWorker_default
31
- } from "./chunk-5ODQSF26.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-26GA3JAM.js";
35
- import {
36
- ComponentDatatype_default
37
- } from "./chunk-K4GQUNB5.js";
38
- import "./chunk-XY4BATBS.js";
39
- import "./chunk-MXIZJAPH.js";
40
- import {
41
- RuntimeError_default
42
- } from "./chunk-6CHGCNMW.js";
43
- import "./chunk-7JO7GPJN.js";
44
- import "./chunk-AD63PIY6.js";
45
- import {
46
- __toESM,
47
- defined_default
48
- } from "./chunk-E63IIM5T.js";
49
-
50
- // packages/engine/Source/Workers/decodeDraco.js
51
- var import_draco_decoder_nodejs = __toESM(require_draco_decoder_nodejs(), 1);
52
- var draco;
53
- function decodeIndexArray(dracoGeometry, dracoDecoder) {
54
- const numPoints = dracoGeometry.num_points();
55
- const numFaces = dracoGeometry.num_faces();
56
- const faceIndices = new draco.DracoInt32Array();
57
- const numIndices = numFaces * 3;
58
- const indexArray = IndexDatatype_default.createTypedArray(numPoints, numIndices);
59
- let offset = 0;
60
- for (let i = 0; i < numFaces; ++i) {
61
- dracoDecoder.GetFaceFromMesh(dracoGeometry, i, faceIndices);
62
- indexArray[offset + 0] = faceIndices.GetValue(0);
63
- indexArray[offset + 1] = faceIndices.GetValue(1);
64
- indexArray[offset + 2] = faceIndices.GetValue(2);
65
- offset += 3;
66
- }
67
- draco.destroy(faceIndices);
68
- return {
69
- typedArray: indexArray,
70
- numberOfIndices: numIndices
71
- };
72
- }
73
- function decodeQuantizedDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, quantization, vertexArrayLength) {
74
- let vertexArray;
75
- let attributeData;
76
- if (quantization.quantizationBits <= 8) {
77
- attributeData = new draco.DracoUInt8Array();
78
- vertexArray = new Uint8Array(vertexArrayLength);
79
- dracoDecoder.GetAttributeUInt8ForAllPoints(
80
- dracoGeometry,
81
- dracoAttribute,
82
- attributeData
83
- );
84
- } else if (quantization.quantizationBits <= 16) {
85
- attributeData = new draco.DracoUInt16Array();
86
- vertexArray = new Uint16Array(vertexArrayLength);
87
- dracoDecoder.GetAttributeUInt16ForAllPoints(
88
- dracoGeometry,
89
- dracoAttribute,
90
- attributeData
91
- );
92
- } else {
93
- attributeData = new draco.DracoFloat32Array();
94
- vertexArray = new Float32Array(vertexArrayLength);
95
- dracoDecoder.GetAttributeFloatForAllPoints(
96
- dracoGeometry,
97
- dracoAttribute,
98
- attributeData
99
- );
100
- }
101
- for (let i = 0; i < vertexArrayLength; ++i) {
102
- vertexArray[i] = attributeData.GetValue(i);
103
- }
104
- draco.destroy(attributeData);
105
- return vertexArray;
106
- }
107
- function decodeDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, vertexArrayLength) {
108
- let vertexArray;
109
- let attributeData;
110
- switch (dracoAttribute.data_type()) {
111
- case 1:
112
- case 11:
113
- attributeData = new draco.DracoInt8Array();
114
- vertexArray = new Int8Array(vertexArrayLength);
115
- dracoDecoder.GetAttributeInt8ForAllPoints(
116
- dracoGeometry,
117
- dracoAttribute,
118
- attributeData
119
- );
120
- break;
121
- case 2:
122
- attributeData = new draco.DracoUInt8Array();
123
- vertexArray = new Uint8Array(vertexArrayLength);
124
- dracoDecoder.GetAttributeUInt8ForAllPoints(
125
- dracoGeometry,
126
- dracoAttribute,
127
- attributeData
128
- );
129
- break;
130
- case 3:
131
- attributeData = new draco.DracoInt16Array();
132
- vertexArray = new Int16Array(vertexArrayLength);
133
- dracoDecoder.GetAttributeInt16ForAllPoints(
134
- dracoGeometry,
135
- dracoAttribute,
136
- attributeData
137
- );
138
- break;
139
- case 4:
140
- attributeData = new draco.DracoUInt16Array();
141
- vertexArray = new Uint16Array(vertexArrayLength);
142
- dracoDecoder.GetAttributeUInt16ForAllPoints(
143
- dracoGeometry,
144
- dracoAttribute,
145
- attributeData
146
- );
147
- break;
148
- case 5:
149
- case 7:
150
- attributeData = new draco.DracoInt32Array();
151
- vertexArray = new Int32Array(vertexArrayLength);
152
- dracoDecoder.GetAttributeInt32ForAllPoints(
153
- dracoGeometry,
154
- dracoAttribute,
155
- attributeData
156
- );
157
- break;
158
- case 6:
159
- case 8:
160
- attributeData = new draco.DracoUInt32Array();
161
- vertexArray = new Uint32Array(vertexArrayLength);
162
- dracoDecoder.GetAttributeUInt32ForAllPoints(
163
- dracoGeometry,
164
- dracoAttribute,
165
- attributeData
166
- );
167
- break;
168
- case 9:
169
- case 10:
170
- attributeData = new draco.DracoFloat32Array();
171
- vertexArray = new Float32Array(vertexArrayLength);
172
- dracoDecoder.GetAttributeFloatForAllPoints(
173
- dracoGeometry,
174
- dracoAttribute,
175
- attributeData
176
- );
177
- break;
178
- }
179
- for (let i = 0; i < vertexArrayLength; ++i) {
180
- vertexArray[i] = attributeData.GetValue(i);
181
- }
182
- draco.destroy(attributeData);
183
- return vertexArray;
184
- }
185
- function decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) {
186
- const numPoints = dracoGeometry.num_points();
187
- const numComponents = dracoAttribute.num_components();
188
- let quantization;
189
- let transform = new draco.AttributeQuantizationTransform();
190
- if (transform.InitFromAttribute(dracoAttribute)) {
191
- const minValues = new Array(numComponents);
192
- for (let i = 0; i < numComponents; ++i) {
193
- minValues[i] = transform.min_value(i);
194
- }
195
- quantization = {
196
- quantizationBits: transform.quantization_bits(),
197
- minValues,
198
- range: transform.range(),
199
- octEncoded: false
200
- };
201
- }
202
- draco.destroy(transform);
203
- transform = new draco.AttributeOctahedronTransform();
204
- if (transform.InitFromAttribute(dracoAttribute)) {
205
- quantization = {
206
- quantizationBits: transform.quantization_bits(),
207
- octEncoded: true
208
- };
209
- }
210
- draco.destroy(transform);
211
- const vertexArrayLength = numPoints * numComponents;
212
- let vertexArray;
213
- if (defined_default(quantization)) {
214
- vertexArray = decodeQuantizedDracoTypedArray(
215
- dracoGeometry,
216
- dracoDecoder,
217
- dracoAttribute,
218
- quantization,
219
- vertexArrayLength
220
- );
221
- } else {
222
- vertexArray = decodeDracoTypedArray(
223
- dracoGeometry,
224
- dracoDecoder,
225
- dracoAttribute,
226
- vertexArrayLength
227
- );
228
- }
229
- const componentDatatype = ComponentDatatype_default.fromTypedArray(vertexArray);
230
- return {
231
- array: vertexArray,
232
- data: {
233
- componentsPerAttribute: numComponents,
234
- componentDatatype,
235
- byteOffset: dracoAttribute.byte_offset(),
236
- byteStride: ComponentDatatype_default.getSizeInBytes(componentDatatype) * numComponents,
237
- normalized: dracoAttribute.normalized(),
238
- quantization
239
- }
240
- };
241
- }
242
- function decodePointCloud(parameters) {
243
- const dracoDecoder = new draco.Decoder();
244
- if (parameters.dequantizeInShader) {
245
- dracoDecoder.SkipAttributeTransform(draco.POSITION);
246
- dracoDecoder.SkipAttributeTransform(draco.NORMAL);
247
- }
248
- const buffer = new draco.DecoderBuffer();
249
- buffer.Init(parameters.buffer, parameters.buffer.length);
250
- const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
251
- if (geometryType !== draco.POINT_CLOUD) {
252
- throw new RuntimeError_default("Draco geometry type must be POINT_CLOUD.");
253
- }
254
- const dracoPointCloud = new draco.PointCloud();
255
- const decodingStatus = dracoDecoder.DecodeBufferToPointCloud(
256
- buffer,
257
- dracoPointCloud
258
- );
259
- if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) {
260
- throw new RuntimeError_default(
261
- `Error decoding draco point cloud: ${decodingStatus.error_msg()}`
262
- );
263
- }
264
- draco.destroy(buffer);
265
- const result = {};
266
- const properties = parameters.properties;
267
- for (const propertyName in properties) {
268
- if (properties.hasOwnProperty(propertyName)) {
269
- let dracoAttribute;
270
- if (propertyName === "POSITION" || propertyName === "NORMAL") {
271
- const dracoAttributeId = dracoDecoder.GetAttributeId(
272
- dracoPointCloud,
273
- draco[propertyName]
274
- );
275
- dracoAttribute = dracoDecoder.GetAttribute(
276
- dracoPointCloud,
277
- dracoAttributeId
278
- );
279
- } else {
280
- const attributeId = properties[propertyName];
281
- dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
282
- dracoPointCloud,
283
- attributeId
284
- );
285
- }
286
- result[propertyName] = decodeAttribute(
287
- dracoPointCloud,
288
- dracoDecoder,
289
- dracoAttribute
290
- );
291
- }
292
- }
293
- draco.destroy(dracoPointCloud);
294
- draco.destroy(dracoDecoder);
295
- return result;
296
- }
297
- function decodePrimitive(parameters) {
298
- const dracoDecoder = new draco.Decoder();
299
- const attributesToSkip = ["POSITION", "NORMAL", "COLOR", "TEX_COORD"];
300
- if (parameters.dequantizeInShader) {
301
- for (let i = 0; i < attributesToSkip.length; ++i) {
302
- dracoDecoder.SkipAttributeTransform(draco[attributesToSkip[i]]);
303
- }
304
- }
305
- const bufferView = parameters.bufferView;
306
- const buffer = new draco.DecoderBuffer();
307
- buffer.Init(parameters.array, bufferView.byteLength);
308
- const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
309
- if (geometryType !== draco.TRIANGULAR_MESH) {
310
- throw new RuntimeError_default("Unsupported draco mesh geometry type.");
311
- }
312
- const dracoGeometry = new draco.Mesh();
313
- const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);
314
- if (!decodingStatus.ok() || dracoGeometry.ptr === 0) {
315
- throw new RuntimeError_default(
316
- `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`
317
- );
318
- }
319
- draco.destroy(buffer);
320
- const attributeData = {};
321
- const compressedAttributes = parameters.compressedAttributes;
322
- for (const attributeName in compressedAttributes) {
323
- if (compressedAttributes.hasOwnProperty(attributeName)) {
324
- const compressedAttribute = compressedAttributes[attributeName];
325
- const dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
326
- dracoGeometry,
327
- compressedAttribute
328
- );
329
- attributeData[attributeName] = decodeAttribute(
330
- dracoGeometry,
331
- dracoDecoder,
332
- dracoAttribute
333
- );
334
- }
335
- }
336
- const result = {
337
- indexArray: decodeIndexArray(dracoGeometry, dracoDecoder),
338
- attributeData
339
- };
340
- draco.destroy(dracoGeometry);
341
- draco.destroy(dracoDecoder);
342
- return result;
343
- }
344
- async function decode(parameters, transferableObjects) {
345
- if (defined_default(parameters.bufferView)) {
346
- return decodePrimitive(parameters);
347
- }
348
- return decodePointCloud(parameters);
349
- }
350
- async function initWorker(parameters, transferableObjects) {
351
- const wasmConfig = parameters.webAssemblyConfig;
352
- if (defined_default(wasmConfig) && defined_default(wasmConfig.wasmBinaryFile)) {
353
- draco = await (0, import_draco_decoder_nodejs.default)(wasmConfig);
354
- } else {
355
- draco = await (0, import_draco_decoder_nodejs.default)();
356
- }
357
- return true;
358
- }
359
- async function decodeDraco(parameters, transferableObjects) {
360
- const wasmConfig = parameters.webAssemblyConfig;
361
- if (defined_default(wasmConfig)) {
362
- return initWorker(parameters, transferableObjects);
363
- }
364
- return decode(parameters, transferableObjects);
365
- }
366
- var decodeDraco_default = createTaskProcessorWorker_default(decodeDraco);
367
- export {
368
- decodeDraco_default as default
369
- };
26
+ import{a as D}from"./chunk-35SHYARM.js";import{a as I}from"./chunk-WZDE3RYP.js";import{a as m}from"./chunk-OFUUQVMR.js";import{a as w}from"./chunk-AU7IKHOH.js";import"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import{a as A}from"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import{d as P,e as d}from"./chunk-VTAIKJXX.js";var b=P(D(),1),r;function F(t,n){let o=t.num_points(),a=t.num_faces(),i=new r.DracoInt32Array,e=a*3,s=m.createTypedArray(o,e),u=0;for(let f=0;f<a;++f)n.GetFaceFromMesh(t,f,i),s[u+0]=i.GetValue(0),s[u+1]=i.GetValue(1),s[u+2]=i.GetValue(2),u+=3;return r.destroy(i),{typedArray:s,numberOfIndices:e}}function U(t,n,o,a,i){let e,s;a.quantizationBits<=8?(s=new r.DracoUInt8Array,e=new Uint8Array(i),n.GetAttributeUInt8ForAllPoints(t,o,s)):a.quantizationBits<=16?(s=new r.DracoUInt16Array,e=new Uint16Array(i),n.GetAttributeUInt16ForAllPoints(t,o,s)):(s=new r.DracoFloat32Array,e=new Float32Array(i),n.GetAttributeFloatForAllPoints(t,o,s));for(let u=0;u<i;++u)e[u]=s.GetValue(u);return r.destroy(s),e}function k(t,n,o,a){let i,e;switch(o.data_type()){case 1:case 11:e=new r.DracoInt8Array,i=new Int8Array(a),n.GetAttributeInt8ForAllPoints(t,o,e);break;case 2:e=new r.DracoUInt8Array,i=new Uint8Array(a),n.GetAttributeUInt8ForAllPoints(t,o,e);break;case 3:e=new r.DracoInt16Array,i=new Int16Array(a),n.GetAttributeInt16ForAllPoints(t,o,e);break;case 4:e=new r.DracoUInt16Array,i=new Uint16Array(a),n.GetAttributeUInt16ForAllPoints(t,o,e);break;case 5:case 7:e=new r.DracoInt32Array,i=new Int32Array(a),n.GetAttributeInt32ForAllPoints(t,o,e);break;case 6:case 8:e=new r.DracoUInt32Array,i=new Uint32Array(a),n.GetAttributeUInt32ForAllPoints(t,o,e);break;case 9:case 10:e=new r.DracoFloat32Array,i=new Float32Array(a),n.GetAttributeFloatForAllPoints(t,o,e);break}for(let s=0;s<a;++s)i[s]=e.GetValue(s);return r.destroy(e),i}function p(t,n,o){let a=t.num_points(),i=o.num_components(),e,s=new r.AttributeQuantizationTransform;if(s.InitFromAttribute(o)){let c=new Array(i);for(let y=0;y<i;++y)c[y]=s.min_value(y);e={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}r.destroy(s),s=new r.AttributeOctahedronTransform,s.InitFromAttribute(o)&&(e={quantizationBits:s.quantization_bits(),octEncoded:!0}),r.destroy(s);let u=a*i,f;d(e)?f=U(t,n,o,e,u):f=k(t,n,o,u);let l=w.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:i,componentDatatype:l,byteOffset:o.byte_offset(),byteStride:w.getSizeInBytes(l)*i,normalized:o.normalized(),quantization:e}}}function O(t){let n=new r.Decoder;t.dequantizeInShader&&(n.SkipAttributeTransform(r.POSITION),n.SkipAttributeTransform(r.NORMAL));let o=new r.DecoderBuffer;if(o.Init(t.buffer,t.buffer.length),n.GetEncodedGeometryType(o)!==r.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let i=new r.PointCloud,e=n.DecodeBufferToPointCloud(o,i);if(!e.ok()||i.ptr===0)throw new A(`Error decoding draco point cloud: ${e.error_msg()}`);r.destroy(o);let s={},u=t.properties;for(let f in u)if(u.hasOwnProperty(f)){let l;if(f==="POSITION"||f==="NORMAL"){let c=n.GetAttributeId(i,r[f]);l=n.GetAttribute(i,c)}else{let c=u[f];l=n.GetAttributeByUniqueId(i,c)}s[f]=p(i,n,l)}return r.destroy(i),r.destroy(n),s}function g(t){let n=new r.Decoder;if(t.dequantizeInShader)for(let c=0;c<t.attributesToSkipTransform.length;++c)n.SkipAttributeTransform(r[t.attributesToSkipTransform[c]]);let o=t.bufferView,a=new r.DecoderBuffer;if(a.Init(t.array,o.byteLength),n.GetEncodedGeometryType(a)!==r.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let e=new r.Mesh,s=n.DecodeBufferToMesh(a,e);if(!s.ok()||e.ptr===0)throw new A(`Error decoding draco mesh geometry: ${s.error_msg()}`);r.destroy(a);let u={},f=t.compressedAttributes;for(let c in f)if(f.hasOwnProperty(c)){let y=f[c],T=n.GetAttributeByUniqueId(e,y);u[c]=p(e,n,T)}let l={indexArray:F(e,n),attributeData:u};return r.destroy(e),r.destroy(n),l}async function z(t,n){return d(t.bufferView)?g(t):O(t)}async function G(t,n){let o=t.webAssemblyConfig;return d(o)&&d(o.wasmBinaryFile)?r=await(0,b.default)(o):r=await(0,b.default)(),!0}async function S(t,n){let o=t.webAssemblyConfig;return d(o)?G(t,n):z(t,n)}var h=I(S);export{h as default};