@rtzh/engine 0.0.1 → 0.0.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 (115) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/Source/Scene/Model/CustomShader.js +2 -2
  3. package/index.js +504 -504
  4. package/package.json +1 -1
  5. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  6. package/Build/Workers/chunk-245NZYCR.js +0 -124
  7. package/Build/Workers/chunk-25BA4527.js +0 -837
  8. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  9. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  10. package/Build/Workers/chunk-55IROWAX.js +0 -139
  11. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  12. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  13. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  14. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  15. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  16. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  17. package/Build/Workers/chunk-6XJO625E.js +0 -497
  18. package/Build/Workers/chunk-75UGCVME.js +0 -102
  19. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  20. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  21. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  22. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  23. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  24. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  25. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  26. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  27. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  28. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  29. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  30. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  31. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  32. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  33. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  34. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  35. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  36. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  37. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  38. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  39. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  40. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  41. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  42. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  43. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  44. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  45. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  46. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  47. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  48. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  49. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  50. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  51. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  52. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  53. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  54. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  55. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  56. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  57. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  58. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  59. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  60. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  61. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  62. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  63. package/Build/Workers/combineGeometry.js +0 -66
  64. package/Build/Workers/createBoxGeometry.js +0 -58
  65. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  66. package/Build/Workers/createCircleGeometry.js +0 -201
  67. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  68. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  69. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  70. package/Build/Workers/createCorridorGeometry.js +0 -1258
  71. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  72. package/Build/Workers/createCylinderGeometry.js +0 -60
  73. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  74. package/Build/Workers/createEllipseGeometry.js +0 -72
  75. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  76. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  77. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  78. package/Build/Workers/createFrustumGeometry.js +0 -58
  79. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  80. package/Build/Workers/createGeometry.js +0 -173
  81. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  82. package/Build/Workers/createPlaneGeometry.js +0 -223
  83. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  84. package/Build/Workers/createPolygonGeometry.js +0 -1404
  85. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  86. package/Build/Workers/createPolylineGeometry.js +0 -491
  87. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  88. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  89. package/Build/Workers/createRectangleGeometry.js +0 -1264
  90. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  91. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  92. package/Build/Workers/createSphereGeometry.js +0 -116
  93. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  94. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  95. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  96. package/Build/Workers/createVectorTileGeometries.js +0 -387
  97. package/Build/Workers/createVectorTilePoints.js +0 -114
  98. package/Build/Workers/createVectorTilePolygons.js +0 -386
  99. package/Build/Workers/createVectorTilePolylines.js +0 -262
  100. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  101. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  102. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  103. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  104. package/Build/Workers/createWallGeometry.js +0 -487
  105. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  106. package/Build/Workers/decodeDraco.js +0 -369
  107. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  108. package/Build/Workers/decodeI3S.js +0 -1339
  109. package/Build/Workers/gaussianSplatSorter.js +0 -62
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  112. package/Build/Workers/transcodeKTX2.js +0 -3463
  113. package/Build/Workers/transferTypedArrayTest.js +0 -41
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,532 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
5
- *
6
- * Copyright 2011-2022 Cesium Contributors
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- *
20
- * Columbus View (Pat. Pend.)
21
- *
22
- * Portions licensed separately.
23
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
- */
25
-
26
- import {
27
- PolygonGeometryLibrary_default
28
- } from "./chunk-7B23DD46.js";
29
- import {
30
- ArcType_default
31
- } from "./chunk-X65Y2JSA.js";
32
- import {
33
- GeometryInstance_default
34
- } from "./chunk-SBFTVHRW.js";
35
- import {
36
- GeometryPipeline_default
37
- } from "./chunk-PV5B2YNB.js";
38
- import "./chunk-6LZBBEA7.js";
39
- import "./chunk-75UGCVME.js";
40
- import {
41
- GeometryOffsetAttribute_default
42
- } from "./chunk-6H33B6OL.js";
43
- import {
44
- EllipsoidTangentPlane_default
45
- } from "./chunk-WAS3IHIQ.js";
46
- import "./chunk-K4IMD7KH.js";
47
- import {
48
- PolygonPipeline_default,
49
- WindingOrder_default
50
- } from "./chunk-WO5ZNC7S.js";
51
- import "./chunk-HAY6YE7M.js";
52
- import "./chunk-FVYRV2T6.js";
53
- import "./chunk-66YGZWBI.js";
54
- import "./chunk-J4MIJCN5.js";
55
- import {
56
- IndexDatatype_default
57
- } from "./chunk-55IROWAX.js";
58
- import {
59
- GeometryAttributes_default
60
- } from "./chunk-BOV6T7FO.js";
61
- import {
62
- GeometryAttribute_default,
63
- Geometry_default,
64
- PrimitiveType_default
65
- } from "./chunk-XOVHLPKW.js";
66
- import {
67
- BoundingSphere_default
68
- } from "./chunk-OAOREOSO.js";
69
- import "./chunk-EKMWNF4U.js";
70
- import "./chunk-KQIZ7AFF.js";
71
- import "./chunk-POY6ZE32.js";
72
- import {
73
- ComponentDatatype_default
74
- } from "./chunk-AL22JVIA.js";
75
- import "./chunk-5VZISKJF.js";
76
- import "./chunk-UYT2PBMV.js";
77
- import {
78
- Ellipsoid_default
79
- } from "./chunk-YPGJSFOO.js";
80
- import {
81
- Cartesian3_default,
82
- Frozen_default
83
- } from "./chunk-QWV2DM66.js";
84
- import {
85
- Math_default
86
- } from "./chunk-6XJO625E.js";
87
- import {
88
- Check_default,
89
- DeveloperError_default
90
- } from "./chunk-KH2OWUUA.js";
91
- import {
92
- defined_default
93
- } from "./chunk-AVSQILVI.js";
94
-
95
- // packages/engine/Source/Core/PolygonOutlineGeometry.js
96
- var createGeometryFromPositionsPositions = [];
97
- var createGeometryFromPositionsSubdivided = [];
98
- function createGeometryFromPositions(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
99
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
100
- const positions2D = tangentPlane.projectPointsOntoPlane(
101
- positions,
102
- createGeometryFromPositionsPositions
103
- );
104
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
105
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
106
- positions2D.reverse();
107
- positions = positions.slice().reverse();
108
- }
109
- let subdividedPositions;
110
- let i;
111
- let length = positions.length;
112
- let index = 0;
113
- if (!perPositionHeight) {
114
- let numVertices = 0;
115
- if (arcType === ArcType_default.GEODESIC) {
116
- for (i = 0; i < length; i++) {
117
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
118
- positions[i],
119
- positions[(i + 1) % length],
120
- minDistance
121
- );
122
- }
123
- } else if (arcType === ArcType_default.RHUMB) {
124
- for (i = 0; i < length; i++) {
125
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
126
- ellipsoid,
127
- positions[i],
128
- positions[(i + 1) % length],
129
- minDistance
130
- );
131
- }
132
- }
133
- subdividedPositions = new Float64Array(numVertices * 3);
134
- for (i = 0; i < length; i++) {
135
- let tempPositions;
136
- if (arcType === ArcType_default.GEODESIC) {
137
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
138
- positions[i],
139
- positions[(i + 1) % length],
140
- minDistance,
141
- createGeometryFromPositionsSubdivided
142
- );
143
- } else if (arcType === ArcType_default.RHUMB) {
144
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
145
- ellipsoid,
146
- positions[i],
147
- positions[(i + 1) % length],
148
- minDistance,
149
- createGeometryFromPositionsSubdivided
150
- );
151
- }
152
- const tempPositionsLength = tempPositions.length;
153
- for (let j = 0; j < tempPositionsLength; ++j) {
154
- subdividedPositions[index++] = tempPositions[j];
155
- }
156
- }
157
- } else {
158
- subdividedPositions = new Float64Array(length * 2 * 3);
159
- for (i = 0; i < length; i++) {
160
- const p0 = positions[i];
161
- const p1 = positions[(i + 1) % length];
162
- subdividedPositions[index++] = p0.x;
163
- subdividedPositions[index++] = p0.y;
164
- subdividedPositions[index++] = p0.z;
165
- subdividedPositions[index++] = p1.x;
166
- subdividedPositions[index++] = p1.y;
167
- subdividedPositions[index++] = p1.z;
168
- }
169
- }
170
- length = subdividedPositions.length / 3;
171
- const indicesSize = length * 2;
172
- const indices = IndexDatatype_default.createTypedArray(length, indicesSize);
173
- index = 0;
174
- for (i = 0; i < length - 1; i++) {
175
- indices[index++] = i;
176
- indices[index++] = i + 1;
177
- }
178
- indices[index++] = length - 1;
179
- indices[index++] = 0;
180
- return new GeometryInstance_default({
181
- geometry: new Geometry_default({
182
- attributes: new GeometryAttributes_default({
183
- position: new GeometryAttribute_default({
184
- componentDatatype: ComponentDatatype_default.DOUBLE,
185
- componentsPerAttribute: 3,
186
- values: subdividedPositions
187
- })
188
- }),
189
- indices,
190
- primitiveType: PrimitiveType_default.LINES
191
- })
192
- });
193
- }
194
- function createGeometryFromPositionsExtruded(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
195
- const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
196
- const positions2D = tangentPlane.projectPointsOntoPlane(
197
- positions,
198
- createGeometryFromPositionsPositions
199
- );
200
- const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
201
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
202
- positions2D.reverse();
203
- positions = positions.slice().reverse();
204
- }
205
- let subdividedPositions;
206
- let i;
207
- let length = positions.length;
208
- const corners = new Array(length);
209
- let index = 0;
210
- if (!perPositionHeight) {
211
- let numVertices = 0;
212
- if (arcType === ArcType_default.GEODESIC) {
213
- for (i = 0; i < length; i++) {
214
- numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
215
- positions[i],
216
- positions[(i + 1) % length],
217
- minDistance
218
- );
219
- }
220
- } else if (arcType === ArcType_default.RHUMB) {
221
- for (i = 0; i < length; i++) {
222
- numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
223
- ellipsoid,
224
- positions[i],
225
- positions[(i + 1) % length],
226
- minDistance
227
- );
228
- }
229
- }
230
- subdividedPositions = new Float64Array(numVertices * 3 * 2);
231
- for (i = 0; i < length; ++i) {
232
- corners[i] = index / 3;
233
- let tempPositions;
234
- if (arcType === ArcType_default.GEODESIC) {
235
- tempPositions = PolygonGeometryLibrary_default.subdivideLine(
236
- positions[i],
237
- positions[(i + 1) % length],
238
- minDistance,
239
- createGeometryFromPositionsSubdivided
240
- );
241
- } else if (arcType === ArcType_default.RHUMB) {
242
- tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
243
- ellipsoid,
244
- positions[i],
245
- positions[(i + 1) % length],
246
- minDistance,
247
- createGeometryFromPositionsSubdivided
248
- );
249
- }
250
- const tempPositionsLength = tempPositions.length;
251
- for (let j = 0; j < tempPositionsLength; ++j) {
252
- subdividedPositions[index++] = tempPositions[j];
253
- }
254
- }
255
- } else {
256
- subdividedPositions = new Float64Array(length * 2 * 3 * 2);
257
- for (i = 0; i < length; ++i) {
258
- corners[i] = index / 3;
259
- const p0 = positions[i];
260
- const p1 = positions[(i + 1) % length];
261
- subdividedPositions[index++] = p0.x;
262
- subdividedPositions[index++] = p0.y;
263
- subdividedPositions[index++] = p0.z;
264
- subdividedPositions[index++] = p1.x;
265
- subdividedPositions[index++] = p1.y;
266
- subdividedPositions[index++] = p1.z;
267
- }
268
- }
269
- length = subdividedPositions.length / (3 * 2);
270
- const cornersLength = corners.length;
271
- const indicesSize = (length * 2 + cornersLength) * 2;
272
- const indices = IndexDatatype_default.createTypedArray(
273
- length + cornersLength,
274
- indicesSize
275
- );
276
- index = 0;
277
- for (i = 0; i < length; ++i) {
278
- indices[index++] = i;
279
- indices[index++] = (i + 1) % length;
280
- indices[index++] = i + length;
281
- indices[index++] = (i + 1) % length + length;
282
- }
283
- for (i = 0; i < cornersLength; i++) {
284
- const corner = corners[i];
285
- indices[index++] = corner;
286
- indices[index++] = corner + length;
287
- }
288
- return new GeometryInstance_default({
289
- geometry: new Geometry_default({
290
- attributes: new GeometryAttributes_default({
291
- position: new GeometryAttribute_default({
292
- componentDatatype: ComponentDatatype_default.DOUBLE,
293
- componentsPerAttribute: 3,
294
- values: subdividedPositions
295
- })
296
- }),
297
- indices,
298
- primitiveType: PrimitiveType_default.LINES
299
- })
300
- });
301
- }
302
- function PolygonOutlineGeometry(options) {
303
- Check_default.typeOf.object("options", options);
304
- Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
305
- if (options.perPositionHeight && defined_default(options.height)) {
306
- throw new DeveloperError_default(
307
- "Cannot use both options.perPositionHeight and options.height"
308
- );
309
- }
310
- if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
311
- throw new DeveloperError_default(
312
- "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
313
- );
314
- }
315
- const polygonHierarchy = options.polygonHierarchy;
316
- const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
317
- const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
318
- const perPositionHeight = options.perPositionHeight ?? false;
319
- const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
320
- const arcType = options.arcType ?? ArcType_default.GEODESIC;
321
- let height = options.height ?? 0;
322
- let extrudedHeight = options.extrudedHeight ?? height;
323
- if (!perPositionHeightExtrude) {
324
- const h = Math.max(height, extrudedHeight);
325
- extrudedHeight = Math.min(height, extrudedHeight);
326
- height = h;
327
- }
328
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
329
- this._granularity = granularity;
330
- this._height = height;
331
- this._extrudedHeight = extrudedHeight;
332
- this._arcType = arcType;
333
- this._polygonHierarchy = polygonHierarchy;
334
- this._perPositionHeight = perPositionHeight;
335
- this._perPositionHeightExtrude = perPositionHeightExtrude;
336
- this._offsetAttribute = options.offsetAttribute;
337
- this._workerName = "createPolygonOutlineGeometry";
338
- this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
339
- polygonHierarchy,
340
- Cartesian3_default
341
- ) + Ellipsoid_default.packedLength + 8;
342
- }
343
- PolygonOutlineGeometry.pack = function(value, array, startingIndex) {
344
- Check_default.typeOf.object("value", value);
345
- Check_default.defined("array", array);
346
- startingIndex = startingIndex ?? 0;
347
- startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
348
- value._polygonHierarchy,
349
- array,
350
- startingIndex,
351
- Cartesian3_default
352
- );
353
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
354
- startingIndex += Ellipsoid_default.packedLength;
355
- array[startingIndex++] = value._height;
356
- array[startingIndex++] = value._extrudedHeight;
357
- array[startingIndex++] = value._granularity;
358
- array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
359
- array[startingIndex++] = value._perPositionHeight ? 1 : 0;
360
- array[startingIndex++] = value._arcType;
361
- array[startingIndex++] = value._offsetAttribute ?? -1;
362
- array[startingIndex] = value.packedLength;
363
- return array;
364
- };
365
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
366
- var dummyOptions = {
367
- polygonHierarchy: {}
368
- };
369
- PolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
370
- Check_default.defined("array", array);
371
- startingIndex = startingIndex ?? 0;
372
- const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
373
- array,
374
- startingIndex,
375
- Cartesian3_default
376
- );
377
- startingIndex = polygonHierarchy.startingIndex;
378
- delete polygonHierarchy.startingIndex;
379
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
380
- startingIndex += Ellipsoid_default.packedLength;
381
- const height = array[startingIndex++];
382
- const extrudedHeight = array[startingIndex++];
383
- const granularity = array[startingIndex++];
384
- const perPositionHeightExtrude = array[startingIndex++] === 1;
385
- const perPositionHeight = array[startingIndex++] === 1;
386
- const arcType = array[startingIndex++];
387
- const offsetAttribute = array[startingIndex++];
388
- const packedLength = array[startingIndex];
389
- if (!defined_default(result)) {
390
- result = new PolygonOutlineGeometry(dummyOptions);
391
- }
392
- result._polygonHierarchy = polygonHierarchy;
393
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
394
- result._height = height;
395
- result._extrudedHeight = extrudedHeight;
396
- result._granularity = granularity;
397
- result._perPositionHeight = perPositionHeight;
398
- result._perPositionHeightExtrude = perPositionHeightExtrude;
399
- result._arcType = arcType;
400
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
401
- result.packedLength = packedLength;
402
- return result;
403
- };
404
- PolygonOutlineGeometry.fromPositions = function(options) {
405
- options = options ?? Frozen_default.EMPTY_OBJECT;
406
- Check_default.defined("options.positions", options.positions);
407
- const newOptions = {
408
- polygonHierarchy: {
409
- positions: options.positions
410
- },
411
- height: options.height,
412
- extrudedHeight: options.extrudedHeight,
413
- ellipsoid: options.ellipsoid,
414
- granularity: options.granularity,
415
- perPositionHeight: options.perPositionHeight,
416
- arcType: options.arcType,
417
- offsetAttribute: options.offsetAttribute
418
- };
419
- return new PolygonOutlineGeometry(newOptions);
420
- };
421
- PolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
422
- const ellipsoid = polygonGeometry._ellipsoid;
423
- const granularity = polygonGeometry._granularity;
424
- const polygonHierarchy = polygonGeometry._polygonHierarchy;
425
- const perPositionHeight = polygonGeometry._perPositionHeight;
426
- const arcType = polygonGeometry._arcType;
427
- const polygons = PolygonGeometryLibrary_default.polygonOutlinesFromHierarchy(
428
- polygonHierarchy,
429
- !perPositionHeight,
430
- ellipsoid
431
- );
432
- if (polygons.length === 0) {
433
- return void 0;
434
- }
435
- let geometryInstance;
436
- const geometries = [];
437
- const minDistance = Math_default.chordLength(
438
- granularity,
439
- ellipsoid.maximumRadius
440
- );
441
- const height = polygonGeometry._height;
442
- const extrudedHeight = polygonGeometry._extrudedHeight;
443
- const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
444
- let offsetValue;
445
- let i;
446
- if (extrude) {
447
- for (i = 0; i < polygons.length; i++) {
448
- geometryInstance = createGeometryFromPositionsExtruded(
449
- ellipsoid,
450
- polygons[i],
451
- minDistance,
452
- perPositionHeight,
453
- arcType
454
- );
455
- geometryInstance.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
456
- geometryInstance.geometry,
457
- height,
458
- extrudedHeight,
459
- ellipsoid,
460
- perPositionHeight
461
- );
462
- if (defined_default(polygonGeometry._offsetAttribute)) {
463
- const size = geometryInstance.geometry.attributes.position.values.length / 3;
464
- let offsetAttribute = new Uint8Array(size);
465
- if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
466
- offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
467
- } else {
468
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
469
- offsetAttribute = offsetAttribute.fill(offsetValue);
470
- }
471
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default({
472
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
473
- componentsPerAttribute: 1,
474
- values: offsetAttribute
475
- });
476
- }
477
- geometries.push(geometryInstance);
478
- }
479
- } else {
480
- for (i = 0; i < polygons.length; i++) {
481
- geometryInstance = createGeometryFromPositions(
482
- ellipsoid,
483
- polygons[i],
484
- minDistance,
485
- perPositionHeight,
486
- arcType
487
- );
488
- geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
489
- geometryInstance.geometry.attributes.position.values,
490
- height,
491
- ellipsoid,
492
- !perPositionHeight
493
- );
494
- if (defined_default(polygonGeometry._offsetAttribute)) {
495
- const length = geometryInstance.geometry.attributes.position.values.length;
496
- offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
497
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
498
- geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default({
499
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
500
- componentsPerAttribute: 1,
501
- values: applyOffset
502
- });
503
- }
504
- geometries.push(geometryInstance);
505
- }
506
- }
507
- const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
508
- const boundingSphere = BoundingSphere_default.fromVertices(
509
- geometry.attributes.position.values
510
- );
511
- return new Geometry_default({
512
- attributes: geometry.attributes,
513
- indices: geometry.indices,
514
- primitiveType: geometry.primitiveType,
515
- boundingSphere,
516
- offsetAttribute: polygonGeometry._offsetAttribute
517
- });
518
- };
519
- var PolygonOutlineGeometry_default = PolygonOutlineGeometry;
520
-
521
- // packages/engine/Source/Workers/createPolygonOutlineGeometry.js
522
- function createPolygonOutlineGeometry(polygonGeometry, offset) {
523
- if (defined_default(offset)) {
524
- polygonGeometry = PolygonOutlineGeometry_default.unpack(polygonGeometry, offset);
525
- }
526
- polygonGeometry._ellipsoid = Ellipsoid_default.clone(polygonGeometry._ellipsoid);
527
- return PolygonOutlineGeometry_default.createGeometry(polygonGeometry);
528
- }
529
- var createPolygonOutlineGeometry_default = createPolygonOutlineGeometry;
530
- export {
531
- createPolygonOutlineGeometry_default as default
532
- };