@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,484 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- BoundingRectangle_default
28
- } from "./chunk-2A75IWRS.js";
29
- import {
30
- CoplanarPolygonGeometryLibrary_default
31
- } from "./chunk-7ZFGPDJA.js";
32
- import "./chunk-A5DWLWCY.js";
33
- import {
34
- PolygonGeometryLibrary_default
35
- } from "./chunk-I46ZRR5W.js";
36
- import "./chunk-EHWHNOEX.js";
37
- import {
38
- GeometryInstance_default
39
- } from "./chunk-BIKA3NRA.js";
40
- import {
41
- GeometryPipeline_default
42
- } from "./chunk-EG6PTBY2.js";
43
- import "./chunk-Z3TIFFGF.js";
44
- import "./chunk-ZT7KWISZ.js";
45
- import {
46
- VertexFormat_default
47
- } from "./chunk-2FWRMUTY.js";
48
- import "./chunk-FNIRWHJB.js";
49
- import "./chunk-G43QFN4Q.js";
50
- import {
51
- PolygonPipeline_default
52
- } from "./chunk-MDWEGWPA.js";
53
- import {
54
- arrayRemoveDuplicates_default
55
- } from "./chunk-FZRIVR7Y.js";
56
- import "./chunk-SH5USDPI.js";
57
- import "./chunk-2FRVPMCS.js";
58
- import "./chunk-Y5UQJLYE.js";
59
- import {
60
- IndexDatatype_default
61
- } from "./chunk-LPR3YNP2.js";
62
- import {
63
- GeometryAttributes_default
64
- } from "./chunk-4H7PY4U5.js";
65
- import {
66
- GeometryAttribute_default,
67
- Geometry_default,
68
- PrimitiveType_default
69
- } from "./chunk-7TC63SJW.js";
70
- import {
71
- BoundingSphere_default,
72
- Quaternion_default
73
- } from "./chunk-FJKNFAKQ.js";
74
- import "./chunk-TTUZP4BO.js";
75
- import "./chunk-BG4UCVXN.js";
76
- import "./chunk-YJEBABKH.js";
77
- import {
78
- ComponentDatatype_default
79
- } from "./chunk-PPH7OFP3.js";
80
- import {
81
- Cartesian2_default,
82
- Cartesian3_default,
83
- Ellipsoid_default,
84
- Matrix3_default
85
- } from "./chunk-OGXZVPPM.js";
86
- import {
87
- Math_default
88
- } from "./chunk-5QULIR53.js";
89
- import "./chunk-SOWMRMWA.js";
90
- import "./chunk-STW2DGFI.js";
91
- import {
92
- defaultValue_default
93
- } from "./chunk-BBWDMCVU.js";
94
- import {
95
- Check_default
96
- } from "./chunk-XGI5BXZY.js";
97
- import {
98
- defined_default
99
- } from "./chunk-YWTJ2B4B.js";
100
-
101
- // packages/engine/Source/Core/CoplanarPolygonGeometry.js
102
- var scratchPosition = new Cartesian3_default();
103
- var scratchBR = new BoundingRectangle_default();
104
- var stScratch = new Cartesian2_default();
105
- var textureCoordinatesOrigin = new Cartesian2_default();
106
- var scratchNormal = new Cartesian3_default();
107
- var scratchTangent = new Cartesian3_default();
108
- var scratchBitangent = new Cartesian3_default();
109
- var centerScratch = new Cartesian3_default();
110
- var axis1Scratch = new Cartesian3_default();
111
- var axis2Scratch = new Cartesian3_default();
112
- var quaternionScratch = new Quaternion_default();
113
- var textureMatrixScratch = new Matrix3_default();
114
- var tangentRotationScratch = new Matrix3_default();
115
- var surfaceNormalScratch = new Cartesian3_default();
116
- function createGeometryFromPolygon(polygon, vertexFormat, boundingRectangle, stRotation, hardcodedTextureCoordinates, projectPointTo2D, normal, tangent, bitangent) {
117
- const positions = polygon.positions;
118
- let indices = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
119
- if (indices.length < 3) {
120
- indices = [0, 1, 2];
121
- }
122
- const newIndices = IndexDatatype_default.createTypedArray(
123
- positions.length,
124
- indices.length
125
- );
126
- newIndices.set(indices);
127
- let textureMatrix = textureMatrixScratch;
128
- if (stRotation !== 0) {
129
- let rotation = Quaternion_default.fromAxisAngle(
130
- normal,
131
- stRotation,
132
- quaternionScratch
133
- );
134
- textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
135
- if (vertexFormat.tangent || vertexFormat.bitangent) {
136
- rotation = Quaternion_default.fromAxisAngle(
137
- normal,
138
- -stRotation,
139
- quaternionScratch
140
- );
141
- const tangentRotation = Matrix3_default.fromQuaternion(
142
- rotation,
143
- tangentRotationScratch
144
- );
145
- tangent = Cartesian3_default.normalize(
146
- Matrix3_default.multiplyByVector(tangentRotation, tangent, tangent),
147
- tangent
148
- );
149
- if (vertexFormat.bitangent) {
150
- bitangent = Cartesian3_default.normalize(
151
- Cartesian3_default.cross(normal, tangent, bitangent),
152
- bitangent
153
- );
154
- }
155
- }
156
- } else {
157
- textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
158
- }
159
- const stOrigin = textureCoordinatesOrigin;
160
- if (vertexFormat.st) {
161
- stOrigin.x = boundingRectangle.x;
162
- stOrigin.y = boundingRectangle.y;
163
- }
164
- const length = positions.length;
165
- const size = length * 3;
166
- const flatPositions = new Float64Array(size);
167
- const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
168
- const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
169
- const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
170
- const textureCoordinates = vertexFormat.st ? new Float32Array(length * 2) : void 0;
171
- let positionIndex = 0;
172
- let normalIndex = 0;
173
- let bitangentIndex = 0;
174
- let tangentIndex = 0;
175
- let stIndex = 0;
176
- for (let i = 0; i < length; i++) {
177
- const position = positions[i];
178
- flatPositions[positionIndex++] = position.x;
179
- flatPositions[positionIndex++] = position.y;
180
- flatPositions[positionIndex++] = position.z;
181
- if (vertexFormat.st) {
182
- if (defined_default(hardcodedTextureCoordinates) && hardcodedTextureCoordinates.positions.length === length) {
183
- textureCoordinates[stIndex++] = hardcodedTextureCoordinates.positions[i].x;
184
- textureCoordinates[stIndex++] = hardcodedTextureCoordinates.positions[i].y;
185
- } else {
186
- const p = Matrix3_default.multiplyByVector(
187
- textureMatrix,
188
- position,
189
- scratchPosition
190
- );
191
- const st = projectPointTo2D(p, stScratch);
192
- Cartesian2_default.subtract(st, stOrigin, st);
193
- const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
194
- const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
195
- textureCoordinates[stIndex++] = stx;
196
- textureCoordinates[stIndex++] = sty;
197
- }
198
- }
199
- if (vertexFormat.normal) {
200
- normals[normalIndex++] = normal.x;
201
- normals[normalIndex++] = normal.y;
202
- normals[normalIndex++] = normal.z;
203
- }
204
- if (vertexFormat.tangent) {
205
- tangents[tangentIndex++] = tangent.x;
206
- tangents[tangentIndex++] = tangent.y;
207
- tangents[tangentIndex++] = tangent.z;
208
- }
209
- if (vertexFormat.bitangent) {
210
- bitangents[bitangentIndex++] = bitangent.x;
211
- bitangents[bitangentIndex++] = bitangent.y;
212
- bitangents[bitangentIndex++] = bitangent.z;
213
- }
214
- }
215
- const attributes = new GeometryAttributes_default();
216
- if (vertexFormat.position) {
217
- attributes.position = new GeometryAttribute_default({
218
- componentDatatype: ComponentDatatype_default.DOUBLE,
219
- componentsPerAttribute: 3,
220
- values: flatPositions
221
- });
222
- }
223
- if (vertexFormat.normal) {
224
- attributes.normal = new GeometryAttribute_default({
225
- componentDatatype: ComponentDatatype_default.FLOAT,
226
- componentsPerAttribute: 3,
227
- values: normals
228
- });
229
- }
230
- if (vertexFormat.tangent) {
231
- attributes.tangent = new GeometryAttribute_default({
232
- componentDatatype: ComponentDatatype_default.FLOAT,
233
- componentsPerAttribute: 3,
234
- values: tangents
235
- });
236
- }
237
- if (vertexFormat.bitangent) {
238
- attributes.bitangent = new GeometryAttribute_default({
239
- componentDatatype: ComponentDatatype_default.FLOAT,
240
- componentsPerAttribute: 3,
241
- values: bitangents
242
- });
243
- }
244
- if (vertexFormat.st) {
245
- attributes.st = new GeometryAttribute_default({
246
- componentDatatype: ComponentDatatype_default.FLOAT,
247
- componentsPerAttribute: 2,
248
- values: textureCoordinates
249
- });
250
- }
251
- return new Geometry_default({
252
- attributes,
253
- indices: newIndices,
254
- primitiveType: PrimitiveType_default.TRIANGLES
255
- });
256
- }
257
- function CoplanarPolygonGeometry(options) {
258
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
259
- const polygonHierarchy = options.polygonHierarchy;
260
- const textureCoordinates = options.textureCoordinates;
261
- Check_default.defined("options.polygonHierarchy", polygonHierarchy);
262
- const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
263
- this._vertexFormat = VertexFormat_default.clone(vertexFormat);
264
- this._polygonHierarchy = polygonHierarchy;
265
- this._stRotation = defaultValue_default(options.stRotation, 0);
266
- this._ellipsoid = Ellipsoid_default.clone(
267
- defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
268
- );
269
- this._workerName = "createCoplanarPolygonGeometry";
270
- this._textureCoordinates = textureCoordinates;
271
- this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
272
- polygonHierarchy,
273
- Cartesian3_default
274
- ) + VertexFormat_default.packedLength + Ellipsoid_default.packedLength + (defined_default(textureCoordinates) ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
275
- textureCoordinates,
276
- Cartesian2_default
277
- ) : 1) + 2;
278
- }
279
- CoplanarPolygonGeometry.fromPositions = function(options) {
280
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
281
- Check_default.defined("options.positions", options.positions);
282
- const newOptions = {
283
- polygonHierarchy: {
284
- positions: options.positions
285
- },
286
- vertexFormat: options.vertexFormat,
287
- stRotation: options.stRotation,
288
- ellipsoid: options.ellipsoid,
289
- textureCoordinates: options.textureCoordinates
290
- };
291
- return new CoplanarPolygonGeometry(newOptions);
292
- };
293
- CoplanarPolygonGeometry.pack = function(value, array, startingIndex) {
294
- Check_default.typeOf.object("value", value);
295
- Check_default.defined("array", array);
296
- startingIndex = defaultValue_default(startingIndex, 0);
297
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
298
- value._polygonHierarchy,
299
- array,
300
- startingIndex,
301
- Cartesian3_default
302
- );
303
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
304
- startingIndex += Ellipsoid_default.packedLength;
305
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
306
- startingIndex += VertexFormat_default.packedLength;
307
- array[startingIndex++] = value._stRotation;
308
- if (defined_default(value._textureCoordinates)) {
309
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
310
- value._textureCoordinates,
311
- array,
312
- startingIndex,
313
- Cartesian2_default
314
- );
315
- } else {
316
- array[startingIndex++] = -1;
317
- }
318
- array[startingIndex++] = value.packedLength;
319
- return array;
320
- };
321
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
322
- var scratchVertexFormat = new VertexFormat_default();
323
- var scratchOptions = {
324
- polygonHierarchy: {}
325
- };
326
- CoplanarPolygonGeometry.unpack = function(array, startingIndex, result) {
327
- Check_default.defined("array", array);
328
- startingIndex = defaultValue_default(startingIndex, 0);
329
- const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
330
- array,
331
- startingIndex,
332
- Cartesian3_default
333
- );
334
- startingIndex = polygonHierarchy.startingIndex;
335
- delete polygonHierarchy.startingIndex;
336
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
337
- startingIndex += Ellipsoid_default.packedLength;
338
- const vertexFormat = VertexFormat_default.unpack(
339
- array,
340
- startingIndex,
341
- scratchVertexFormat
342
- );
343
- startingIndex += VertexFormat_default.packedLength;
344
- const stRotation = array[startingIndex++];
345
- const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
346
- array,
347
- startingIndex,
348
- Cartesian2_default
349
- );
350
- if (defined_default(textureCoordinates)) {
351
- startingIndex = textureCoordinates.startingIndex;
352
- delete textureCoordinates.startingIndex;
353
- } else {
354
- startingIndex++;
355
- }
356
- const packedLength = array[startingIndex++];
357
- if (!defined_default(result)) {
358
- result = new CoplanarPolygonGeometry(scratchOptions);
359
- }
360
- result._polygonHierarchy = polygonHierarchy;
361
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
362
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
363
- result._stRotation = stRotation;
364
- result._textureCoordinates = textureCoordinates;
365
- result.packedLength = packedLength;
366
- return result;
367
- };
368
- CoplanarPolygonGeometry.createGeometry = function(polygonGeometry) {
369
- const vertexFormat = polygonGeometry._vertexFormat;
370
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
371
- const stRotation = polygonGeometry._stRotation;
372
- const textureCoordinates = polygonGeometry._textureCoordinates;
373
- const hasTextureCoordinates = defined_default(textureCoordinates);
374
- let outerPositions = polygonHierarchy.positions;
375
- outerPositions = arrayRemoveDuplicates_default(
376
- outerPositions,
377
- Cartesian3_default.equalsEpsilon,
378
- true
379
- );
380
- if (outerPositions.length < 3) {
381
- return;
382
- }
383
- let normal = scratchNormal;
384
- let tangent = scratchTangent;
385
- let bitangent = scratchBitangent;
386
- let axis1 = axis1Scratch;
387
- const axis2 = axis2Scratch;
388
- const validGeometry = CoplanarPolygonGeometryLibrary_default.computeProjectTo2DArguments(
389
- outerPositions,
390
- centerScratch,
391
- axis1,
392
- axis2
393
- );
394
- if (!validGeometry) {
395
- return void 0;
396
- }
397
- normal = Cartesian3_default.cross(axis1, axis2, normal);
398
- normal = Cartesian3_default.normalize(normal, normal);
399
- if (!Cartesian3_default.equalsEpsilon(
400
- centerScratch,
401
- Cartesian3_default.ZERO,
402
- Math_default.EPSILON6
403
- )) {
404
- const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(
405
- centerScratch,
406
- surfaceNormalScratch
407
- );
408
- if (Cartesian3_default.dot(normal, surfaceNormal) < 0) {
409
- normal = Cartesian3_default.negate(normal, normal);
410
- axis1 = Cartesian3_default.negate(axis1, axis1);
411
- }
412
- }
413
- const projectPoints = CoplanarPolygonGeometryLibrary_default.createProjectPointsTo2DFunction(
414
- centerScratch,
415
- axis1,
416
- axis2
417
- );
418
- const projectPoint = CoplanarPolygonGeometryLibrary_default.createProjectPointTo2DFunction(
419
- centerScratch,
420
- axis1,
421
- axis2
422
- );
423
- if (vertexFormat.tangent) {
424
- tangent = Cartesian3_default.clone(axis1, tangent);
425
- }
426
- if (vertexFormat.bitangent) {
427
- bitangent = Cartesian3_default.clone(axis2, bitangent);
428
- }
429
- const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
430
- polygonHierarchy,
431
- hasTextureCoordinates,
432
- projectPoints,
433
- false
434
- );
435
- const hierarchy = results.hierarchy;
436
- const polygons = results.polygons;
437
- const dummyFunction = function(identity) {
438
- return identity;
439
- };
440
- const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
441
- textureCoordinates,
442
- true,
443
- dummyFunction,
444
- false
445
- ).polygons : void 0;
446
- if (hierarchy.length === 0) {
447
- return;
448
- }
449
- outerPositions = hierarchy[0].outerRing;
450
- const boundingSphere = BoundingSphere_default.fromPoints(outerPositions);
451
- const boundingRectangle = PolygonGeometryLibrary_default.computeBoundingRectangle(
452
- normal,
453
- projectPoint,
454
- outerPositions,
455
- stRotation,
456
- scratchBR
457
- );
458
- const geometries = [];
459
- for (let i = 0; i < polygons.length; i++) {
460
- const geometryInstance = new GeometryInstance_default({
461
- geometry: createGeometryFromPolygon(
462
- polygons[i],
463
- vertexFormat,
464
- boundingRectangle,
465
- stRotation,
466
- hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
467
- projectPoint,
468
- normal,
469
- tangent,
470
- bitangent
471
- )
472
- });
473
- geometries.push(geometryInstance);
474
- }
475
- const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
476
- geometry.attributes.position.values = new Float64Array(
477
- geometry.attributes.position.values
478
- );
479
- geometry.indices = IndexDatatype_default.createTypedArray(
480
- geometry.attributes.position.values.length / 3,
481
- geometry.indices
482
- );
483
- const attributes = geometry.attributes;
484
- if (!vertexFormat.position) {
485
- delete attributes.position;
486
- }
487
- return new Geometry_default({
488
- attributes,
489
- indices: geometry.indices,
490
- primitiveType: geometry.primitiveType,
491
- boundingSphere
492
- });
493
- };
494
- var CoplanarPolygonGeometry_default = CoplanarPolygonGeometry;
495
-
496
- // packages/engine/Source/Workers/createCoplanarPolygonGeometry.js
497
- function createCoplanarPolygonGeometry(polygonGeometry, offset) {
498
- if (defined_default(offset)) {
499
- polygonGeometry = CoplanarPolygonGeometry_default.unpack(polygonGeometry, offset);
500
- }
501
- return CoplanarPolygonGeometry_default.createGeometry(polygonGeometry);
502
- }
503
- var createCoplanarPolygonGeometry_default = createCoplanarPolygonGeometry;
504
- export {
505
- createCoplanarPolygonGeometry_default as default
506
- };
26
+ import{a as et}from"./chunk-WGGIH7QW.js";import{a as Q}from"./chunk-EZUYS2JF.js";import"./chunk-CNCV5UL7.js";import{a as u}from"./chunk-AJYK4IVJ.js";import"./chunk-J6UP6FLE.js";import{a as I}from"./chunk-D6AA5QVT.js";import{a as $}from"./chunk-VW6VD53G.js";import"./chunk-DEPHB2WM.js";import"./chunk-QOUAJ6TL.js";import{a as f}from"./chunk-CYCB63OH.js";import"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import{b as ot}from"./chunk-77IHZJJ3.js";import{a as tt}from"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as J}from"./chunk-OFUUQVMR.js";import{a as X}from"./chunk-A56XVLQR.js";import{b as W,c as Y,d as z}from"./chunk-RCV6KWXS.js";import{d as K}from"./chunk-4IW2T6GF.js";import{f as q}from"./chunk-PSPPBZWI.js";import{a as B}from"./chunk-AU7IKHOH.js";import{a as i,c as H,d as m,e as g,f as U}from"./chunk-64RSHJUE.js";import{a as V}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{b as G}from"./chunk-LEYMRMBK.js";import{e as d}from"./chunk-VTAIKJXX.js";var st=new i,at=new et,pt=new H,lt=new H,mt=new i,ft=new i,ut=new i,M=new i,yt=new i,ht=new i,nt=new q,dt=new g,gt=new g,Pt=new i;function wt(e,t,o,a,y,_,r,n,p){let A=e.positions,c=ot.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);let P=J.createTypedArray(A.length,c.length);P.set(c);let E=dt;if(a!==0){let h=q.fromAxisAngle(r,a,nt);if(E=g.fromQuaternion(h,E),t.tangent||t.bitangent){h=q.fromAxisAngle(r,-a,nt);let O=g.fromQuaternion(h,gt);n=i.normalize(g.multiplyByVector(O,n,n),n),t.bitangent&&(p=i.normalize(i.cross(r,n,p),p))}}else E=g.clone(g.IDENTITY,E);let N=lt;t.st&&(N.x=o.x,N.y=o.y);let b=A.length,k=b*3,C=new Float64Array(k),L=t.normal?new Float32Array(k):void 0,D=t.tangent?new Float32Array(k):void 0,F=t.bitangent?new Float32Array(k):void 0,T=t.st?new Float32Array(b*2):void 0,j=0,R=0,l=0,S=0,s=0;for(let h=0;h<b;h++){let O=A[h];if(C[j++]=O.x,C[j++]=O.y,C[j++]=O.z,t.st)if(d(y)&&y.positions.length===b)T[s++]=y.positions[h].x,T[s++]=y.positions[h].y;else{let it=g.multiplyByVector(E,O,st),v=_(it,pt);H.subtract(v,N,v);let rt=V.clamp(v.x/o.width,0,1),ct=V.clamp(v.y/o.height,0,1);T[s++]=rt,T[s++]=ct}t.normal&&(L[R++]=r.x,L[R++]=r.y,L[R++]=r.z),t.tangent&&(D[S++]=n.x,D[S++]=n.y,D[S++]=n.z),t.bitangent&&(F[l++]=p.x,F[l++]=p.y,F[l++]=p.z)}let w=new X;return t.position&&(w.position=new z({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(w.normal=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:L})),t.tangent&&(w.tangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:D})),t.bitangent&&(w.bitangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:F})),t.st&&(w.st=new z({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:T})),new Y({attributes:w,indices:P,primitiveType:W.TRIANGLES})}function x(e){e=e??U.EMPTY_OBJECT;let t=e.polygonHierarchy,o=e.textureCoordinates;G.defined("options.polygonHierarchy",t);let a=e.vertexFormat??f.DEFAULT;this._vertexFormat=f.clone(a),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=m.clone(e.ellipsoid??m.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=o,this.packedLength=u.computeHierarchyPackedLength(t,i)+f.packedLength+m.packedLength+(d(o)?u.computeHierarchyPackedLength(o,H):1)+2}x.fromPositions=function(e){e=e??U.EMPTY_OBJECT,G.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new x(t)};x.pack=function(e,t,o){return G.typeOf.object("value",e),G.defined("array",t),o=o??0,o=u.packPolygonHierarchy(e._polygonHierarchy,t,o,i),m.pack(e._ellipsoid,t,o),o+=m.packedLength,f.pack(e._vertexFormat,t,o),o+=f.packedLength,t[o++]=e._stRotation,d(e._textureCoordinates)?o=u.packPolygonHierarchy(e._textureCoordinates,t,o,H):t[o++]=-1,t[o++]=e.packedLength,t};var _t=m.clone(m.UNIT_SPHERE),At=new f,bt={polygonHierarchy:{}};x.unpack=function(e,t,o){G.defined("array",e),t=t??0;let a=u.unpackPolygonHierarchy(e,t,i);t=a.startingIndex,delete a.startingIndex;let y=m.unpack(e,t,_t);t+=m.packedLength;let _=f.unpack(e,t,At);t+=f.packedLength;let r=e[t++],n=e[t]===-1?void 0:u.unpackPolygonHierarchy(e,t,H);d(n)?(t=n.startingIndex,delete n.startingIndex):t++;let p=e[t++];return d(o)||(o=new x(bt)),o._polygonHierarchy=a,o._ellipsoid=m.clone(y,o._ellipsoid),o._vertexFormat=f.clone(_,o._vertexFormat),o._stRotation=r,o._textureCoordinates=n,o.packedLength=p,o};x.createGeometry=function(e){let t=e._vertexFormat,o=e._polygonHierarchy,a=e._stRotation,y=e._textureCoordinates,_=d(y),r=o.positions;if(r=tt(r,i.equalsEpsilon,!0),r.length<3)return;let n=mt,p=ft,A=ut,c=yt,P=ht;if(!Q.computeProjectTo2DArguments(r,M,c,P))return;if(n=i.cross(c,P,n),n=i.normalize(n,n),!i.equalsEpsilon(M,i.ZERO,V.EPSILON6)){let s=e._ellipsoid.geodeticSurfaceNormal(M,Pt);i.dot(n,s)<0&&(n=i.negate(n,n),c=i.negate(c,c))}let N=Q.createProjectPointsTo2DFunction(M,c,P),b=Q.createProjectPointTo2DFunction(M,c,P);t.tangent&&(p=i.clone(c,p)),t.bitangent&&(A=i.clone(P,A));let k=u.polygonsFromHierarchy(o,_,N,!1),C=k.hierarchy,L=k.polygons,D=function(s){return s},F=_?u.polygonsFromHierarchy(y,!0,D,!1).polygons:void 0;if(C.length===0)return;r=C[0].outerRing;let T=K.fromPoints(r),j=u.computeBoundingRectangle(n,b,r,a,at),R=[];for(let s=0;s<L.length;s++){let w=new I({geometry:wt(L[s],t,j,a,_?F[s]:void 0,b,n,p,A)});R.push(w)}let l=$.combineInstances(R)[0];l.attributes.position.values=new Float64Array(l.attributes.position.values),l.indices=J.createTypedArray(l.attributes.position.values.length/3,l.indices);let S=l.attributes;return t.position||delete S.position,new Y({attributes:S,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:T})};var Z=x;function kt(e,t){return d(t)&&(e=Z.unpack(e,t)),Z.createGeometry(e)}var Xt=kt;export{Xt as default};