@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,374 +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
- BoundingRectangle_default
28
- } from "./chunk-EDIUN7V3.js";
29
- import {
30
- GeometryPipeline_default
31
- } from "./chunk-PV5B2YNB.js";
32
- import "./chunk-6LZBBEA7.js";
33
- import "./chunk-75UGCVME.js";
34
- import {
35
- CornerType_default,
36
- PolylineVolumeGeometryLibrary_default,
37
- oneTimeWarning_default
38
- } from "./chunk-KFMCOG26.js";
39
- import "./chunk-Q2DXNFYW.js";
40
- import "./chunk-AIW5F22O.js";
41
- import {
42
- VertexFormat_default
43
- } from "./chunk-I76SRIKN.js";
44
- import "./chunk-WAS3IHIQ.js";
45
- import "./chunk-K4IMD7KH.js";
46
- import {
47
- PolygonPipeline_default,
48
- WindingOrder_default
49
- } from "./chunk-WO5ZNC7S.js";
50
- import {
51
- arrayRemoveDuplicates_default
52
- } from "./chunk-HAY6YE7M.js";
53
- import "./chunk-FVYRV2T6.js";
54
- import "./chunk-66YGZWBI.js";
55
- import "./chunk-J4MIJCN5.js";
56
- import {
57
- IndexDatatype_default
58
- } from "./chunk-55IROWAX.js";
59
- import {
60
- GeometryAttributes_default
61
- } from "./chunk-BOV6T7FO.js";
62
- import {
63
- GeometryAttribute_default,
64
- Geometry_default,
65
- PrimitiveType_default
66
- } from "./chunk-XOVHLPKW.js";
67
- import {
68
- BoundingSphere_default
69
- } from "./chunk-OAOREOSO.js";
70
- import "./chunk-EKMWNF4U.js";
71
- import "./chunk-KQIZ7AFF.js";
72
- import "./chunk-POY6ZE32.js";
73
- import {
74
- ComponentDatatype_default
75
- } from "./chunk-AL22JVIA.js";
76
- import "./chunk-5VZISKJF.js";
77
- import "./chunk-UYT2PBMV.js";
78
- import {
79
- Cartesian2_default,
80
- Ellipsoid_default
81
- } from "./chunk-YPGJSFOO.js";
82
- import {
83
- Cartesian3_default,
84
- Frozen_default
85
- } from "./chunk-QWV2DM66.js";
86
- import {
87
- Math_default
88
- } from "./chunk-6XJO625E.js";
89
- import {
90
- DeveloperError_default
91
- } from "./chunk-KH2OWUUA.js";
92
- import {
93
- defined_default
94
- } from "./chunk-AVSQILVI.js";
95
-
96
- // packages/engine/Source/Core/PolylineVolumeGeometry.js
97
- function computeAttributes(combinedPositions, shape, boundingRectangle, vertexFormat) {
98
- const attributes = new GeometryAttributes_default();
99
- if (vertexFormat.position) {
100
- attributes.position = new GeometryAttribute_default({
101
- componentDatatype: ComponentDatatype_default.DOUBLE,
102
- componentsPerAttribute: 3,
103
- values: combinedPositions
104
- });
105
- }
106
- const shapeLength = shape.length;
107
- const vertexCount = combinedPositions.length / 3;
108
- const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);
109
- const firstEndIndices = PolygonPipeline_default.triangulate(shape);
110
- const indicesCount = (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;
111
- const indices = IndexDatatype_default.createTypedArray(vertexCount, indicesCount);
112
- let i, j;
113
- let ll, ul, ur, lr;
114
- const offset = shapeLength * 2;
115
- let index = 0;
116
- for (i = 0; i < length - 1; i++) {
117
- for (j = 0; j < shapeLength - 1; j++) {
118
- ll = j * 2 + i * shapeLength * 2;
119
- lr = ll + offset;
120
- ul = ll + 1;
121
- ur = ul + offset;
122
- indices[index++] = ul;
123
- indices[index++] = ll;
124
- indices[index++] = ur;
125
- indices[index++] = ur;
126
- indices[index++] = ll;
127
- indices[index++] = lr;
128
- }
129
- ll = shapeLength * 2 - 2 + i * shapeLength * 2;
130
- ul = ll + 1;
131
- ur = ul + offset;
132
- lr = ll + offset;
133
- indices[index++] = ul;
134
- indices[index++] = ll;
135
- indices[index++] = ur;
136
- indices[index++] = ur;
137
- indices[index++] = ll;
138
- indices[index++] = lr;
139
- }
140
- if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {
141
- const st = new Float32Array(vertexCount * 2);
142
- const lengthSt = 1 / (length - 1);
143
- const heightSt = 1 / boundingRectangle.height;
144
- const heightOffset = boundingRectangle.height / 2;
145
- let s, t;
146
- let stindex = 0;
147
- for (i = 0; i < length; i++) {
148
- s = i * lengthSt;
149
- t = heightSt * (shape[0].y + heightOffset);
150
- st[stindex++] = s;
151
- st[stindex++] = t;
152
- for (j = 1; j < shapeLength; j++) {
153
- t = heightSt * (shape[j].y + heightOffset);
154
- st[stindex++] = s;
155
- st[stindex++] = t;
156
- st[stindex++] = s;
157
- st[stindex++] = t;
158
- }
159
- t = heightSt * (shape[0].y + heightOffset);
160
- st[stindex++] = s;
161
- st[stindex++] = t;
162
- }
163
- for (j = 0; j < shapeLength; j++) {
164
- s = 0;
165
- t = heightSt * (shape[j].y + heightOffset);
166
- st[stindex++] = s;
167
- st[stindex++] = t;
168
- }
169
- for (j = 0; j < shapeLength; j++) {
170
- s = (length - 1) * lengthSt;
171
- t = heightSt * (shape[j].y + heightOffset);
172
- st[stindex++] = s;
173
- st[stindex++] = t;
174
- }
175
- attributes.st = new GeometryAttribute_default({
176
- componentDatatype: ComponentDatatype_default.FLOAT,
177
- componentsPerAttribute: 2,
178
- values: new Float32Array(st)
179
- });
180
- }
181
- const endOffset = vertexCount - shapeLength * 2;
182
- for (i = 0; i < firstEndIndices.length; i += 3) {
183
- const v0 = firstEndIndices[i] + endOffset;
184
- const v1 = firstEndIndices[i + 1] + endOffset;
185
- const v2 = firstEndIndices[i + 2] + endOffset;
186
- indices[index++] = v0;
187
- indices[index++] = v1;
188
- indices[index++] = v2;
189
- indices[index++] = v2 + shapeLength;
190
- indices[index++] = v1 + shapeLength;
191
- indices[index++] = v0 + shapeLength;
192
- }
193
- let geometry = new Geometry_default({
194
- attributes,
195
- indices,
196
- boundingSphere: BoundingSphere_default.fromVertices(combinedPositions),
197
- primitiveType: PrimitiveType_default.TRIANGLES
198
- });
199
- if (vertexFormat.normal) {
200
- geometry = GeometryPipeline_default.computeNormal(geometry);
201
- }
202
- if (vertexFormat.tangent || vertexFormat.bitangent) {
203
- try {
204
- geometry = GeometryPipeline_default.computeTangentAndBitangent(geometry);
205
- } catch (e) {
206
- oneTimeWarning_default(
207
- "polyline-volume-tangent-bitangent",
208
- "Unable to compute tangents and bitangents for polyline volume geometry"
209
- );
210
- }
211
- if (!vertexFormat.tangent) {
212
- geometry.attributes.tangent = void 0;
213
- }
214
- if (!vertexFormat.bitangent) {
215
- geometry.attributes.bitangent = void 0;
216
- }
217
- if (!vertexFormat.st) {
218
- geometry.attributes.st = void 0;
219
- }
220
- }
221
- return geometry;
222
- }
223
- function PolylineVolumeGeometry(options) {
224
- options = options ?? Frozen_default.EMPTY_OBJECT;
225
- const positions = options.polylinePositions;
226
- const shape = options.shapePositions;
227
- if (!defined_default(positions)) {
228
- throw new DeveloperError_default("options.polylinePositions is required.");
229
- }
230
- if (!defined_default(shape)) {
231
- throw new DeveloperError_default("options.shapePositions is required.");
232
- }
233
- this._positions = positions;
234
- this._shape = shape;
235
- this._ellipsoid = Ellipsoid_default.clone(options.ellipsoid ?? Ellipsoid_default.default);
236
- this._cornerType = options.cornerType ?? CornerType_default.ROUNDED;
237
- this._vertexFormat = VertexFormat_default.clone(
238
- options.vertexFormat ?? VertexFormat_default.DEFAULT
239
- );
240
- this._granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
241
- this._workerName = "createPolylineVolumeGeometry";
242
- let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
243
- numComponents += 1 + shape.length * Cartesian2_default.packedLength;
244
- this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 2;
245
- }
246
- PolylineVolumeGeometry.pack = function(value, array, startingIndex) {
247
- if (!defined_default(value)) {
248
- throw new DeveloperError_default("value is required");
249
- }
250
- if (!defined_default(array)) {
251
- throw new DeveloperError_default("array is required");
252
- }
253
- startingIndex = startingIndex ?? 0;
254
- let i;
255
- const positions = value._positions;
256
- let length = positions.length;
257
- array[startingIndex++] = length;
258
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
259
- Cartesian3_default.pack(positions[i], array, startingIndex);
260
- }
261
- const shape = value._shape;
262
- length = shape.length;
263
- array[startingIndex++] = length;
264
- for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
265
- Cartesian2_default.pack(shape[i], array, startingIndex);
266
- }
267
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
268
- startingIndex += Ellipsoid_default.packedLength;
269
- VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
270
- startingIndex += VertexFormat_default.packedLength;
271
- array[startingIndex++] = value._cornerType;
272
- array[startingIndex] = value._granularity;
273
- return array;
274
- };
275
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
276
- var scratchVertexFormat = new VertexFormat_default();
277
- var scratchOptions = {
278
- polylinePositions: void 0,
279
- shapePositions: void 0,
280
- ellipsoid: scratchEllipsoid,
281
- vertexFormat: scratchVertexFormat,
282
- cornerType: void 0,
283
- granularity: void 0
284
- };
285
- PolylineVolumeGeometry.unpack = function(array, startingIndex, result) {
286
- if (!defined_default(array)) {
287
- throw new DeveloperError_default("array is required");
288
- }
289
- startingIndex = startingIndex ?? 0;
290
- let i;
291
- let length = array[startingIndex++];
292
- const positions = new Array(length);
293
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
294
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
295
- }
296
- length = array[startingIndex++];
297
- const shape = new Array(length);
298
- for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
299
- shape[i] = Cartesian2_default.unpack(array, startingIndex);
300
- }
301
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
302
- startingIndex += Ellipsoid_default.packedLength;
303
- const vertexFormat = VertexFormat_default.unpack(
304
- array,
305
- startingIndex,
306
- scratchVertexFormat
307
- );
308
- startingIndex += VertexFormat_default.packedLength;
309
- const cornerType = array[startingIndex++];
310
- const granularity = array[startingIndex];
311
- if (!defined_default(result)) {
312
- scratchOptions.polylinePositions = positions;
313
- scratchOptions.shapePositions = shape;
314
- scratchOptions.cornerType = cornerType;
315
- scratchOptions.granularity = granularity;
316
- return new PolylineVolumeGeometry(scratchOptions);
317
- }
318
- result._positions = positions;
319
- result._shape = shape;
320
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
321
- result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
322
- result._cornerType = cornerType;
323
- result._granularity = granularity;
324
- return result;
325
- };
326
- var brScratch = new BoundingRectangle_default();
327
- PolylineVolumeGeometry.createGeometry = function(polylineVolumeGeometry) {
328
- const positions = polylineVolumeGeometry._positions;
329
- const cleanPositions = arrayRemoveDuplicates_default(
330
- positions,
331
- Cartesian3_default.equalsEpsilon
332
- );
333
- let shape2D = polylineVolumeGeometry._shape;
334
- shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
335
- if (cleanPositions.length < 2 || shape2D.length < 3) {
336
- return void 0;
337
- }
338
- if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
339
- shape2D.reverse();
340
- }
341
- const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch);
342
- const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
343
- cleanPositions,
344
- shape2D,
345
- boundingRectangle,
346
- polylineVolumeGeometry,
347
- true
348
- );
349
- return computeAttributes(
350
- computedPositions,
351
- shape2D,
352
- boundingRectangle,
353
- polylineVolumeGeometry._vertexFormat
354
- );
355
- };
356
- var PolylineVolumeGeometry_default = PolylineVolumeGeometry;
357
-
358
- // packages/engine/Source/Workers/createPolylineVolumeGeometry.js
359
- function createPolylineVolumeGeometry(polylineVolumeGeometry, offset) {
360
- if (defined_default(offset)) {
361
- polylineVolumeGeometry = PolylineVolumeGeometry_default.unpack(
362
- polylineVolumeGeometry,
363
- offset
364
- );
365
- }
366
- polylineVolumeGeometry._ellipsoid = Ellipsoid_default.clone(
367
- polylineVolumeGeometry._ellipsoid
368
- );
369
- return PolylineVolumeGeometry_default.createGeometry(polylineVolumeGeometry);
370
- }
371
- var createPolylineVolumeGeometry_default = createPolylineVolumeGeometry;
372
- export {
373
- createPolylineVolumeGeometry_default as default
374
- };
@@ -1,272 +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
- BoundingRectangle_default
28
- } from "./chunk-EDIUN7V3.js";
29
- import {
30
- CornerType_default,
31
- PolylineVolumeGeometryLibrary_default
32
- } from "./chunk-KFMCOG26.js";
33
- import "./chunk-Q2DXNFYW.js";
34
- import "./chunk-AIW5F22O.js";
35
- import "./chunk-WAS3IHIQ.js";
36
- import "./chunk-K4IMD7KH.js";
37
- import {
38
- PolygonPipeline_default,
39
- WindingOrder_default
40
- } from "./chunk-WO5ZNC7S.js";
41
- import {
42
- arrayRemoveDuplicates_default
43
- } from "./chunk-HAY6YE7M.js";
44
- import "./chunk-FVYRV2T6.js";
45
- import "./chunk-66YGZWBI.js";
46
- import "./chunk-J4MIJCN5.js";
47
- import {
48
- IndexDatatype_default
49
- } from "./chunk-55IROWAX.js";
50
- import {
51
- GeometryAttributes_default
52
- } from "./chunk-BOV6T7FO.js";
53
- import {
54
- GeometryAttribute_default,
55
- Geometry_default,
56
- PrimitiveType_default
57
- } from "./chunk-XOVHLPKW.js";
58
- import {
59
- BoundingSphere_default
60
- } from "./chunk-OAOREOSO.js";
61
- import "./chunk-EKMWNF4U.js";
62
- import "./chunk-KQIZ7AFF.js";
63
- import "./chunk-POY6ZE32.js";
64
- import {
65
- ComponentDatatype_default
66
- } from "./chunk-AL22JVIA.js";
67
- import "./chunk-5VZISKJF.js";
68
- import "./chunk-UYT2PBMV.js";
69
- import {
70
- Cartesian2_default,
71
- Ellipsoid_default
72
- } from "./chunk-YPGJSFOO.js";
73
- import {
74
- Cartesian3_default,
75
- Frozen_default
76
- } from "./chunk-QWV2DM66.js";
77
- import {
78
- Math_default
79
- } from "./chunk-6XJO625E.js";
80
- import {
81
- DeveloperError_default
82
- } from "./chunk-KH2OWUUA.js";
83
- import {
84
- defined_default
85
- } from "./chunk-AVSQILVI.js";
86
-
87
- // packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js
88
- function computeAttributes(positions, shape) {
89
- const attributes = new GeometryAttributes_default();
90
- attributes.position = new GeometryAttribute_default({
91
- componentDatatype: ComponentDatatype_default.DOUBLE,
92
- componentsPerAttribute: 3,
93
- values: positions
94
- });
95
- const shapeLength = shape.length;
96
- const vertexCount = attributes.position.values.length / 3;
97
- const positionLength = positions.length / 3;
98
- const shapeCount = positionLength / shapeLength;
99
- const indices = IndexDatatype_default.createTypedArray(
100
- vertexCount,
101
- 2 * shapeLength * (shapeCount + 1)
102
- );
103
- let i, j;
104
- let index = 0;
105
- i = 0;
106
- let offset = i * shapeLength;
107
- for (j = 0; j < shapeLength - 1; j++) {
108
- indices[index++] = j + offset;
109
- indices[index++] = j + offset + 1;
110
- }
111
- indices[index++] = shapeLength - 1 + offset;
112
- indices[index++] = offset;
113
- i = shapeCount - 1;
114
- offset = i * shapeLength;
115
- for (j = 0; j < shapeLength - 1; j++) {
116
- indices[index++] = j + offset;
117
- indices[index++] = j + offset + 1;
118
- }
119
- indices[index++] = shapeLength - 1 + offset;
120
- indices[index++] = offset;
121
- for (i = 0; i < shapeCount - 1; i++) {
122
- const firstOffset = shapeLength * i;
123
- const secondOffset = firstOffset + shapeLength;
124
- for (j = 0; j < shapeLength; j++) {
125
- indices[index++] = j + firstOffset;
126
- indices[index++] = j + secondOffset;
127
- }
128
- }
129
- const geometry = new Geometry_default({
130
- attributes,
131
- indices: IndexDatatype_default.createTypedArray(vertexCount, indices),
132
- boundingSphere: BoundingSphere_default.fromVertices(positions),
133
- primitiveType: PrimitiveType_default.LINES
134
- });
135
- return geometry;
136
- }
137
- function PolylineVolumeOutlineGeometry(options) {
138
- options = options ?? Frozen_default.EMPTY_OBJECT;
139
- const positions = options.polylinePositions;
140
- const shape = options.shapePositions;
141
- if (!defined_default(positions)) {
142
- throw new DeveloperError_default("options.polylinePositions is required.");
143
- }
144
- if (!defined_default(shape)) {
145
- throw new DeveloperError_default("options.shapePositions is required.");
146
- }
147
- this._positions = positions;
148
- this._shape = shape;
149
- this._ellipsoid = Ellipsoid_default.clone(options.ellipsoid ?? Ellipsoid_default.default);
150
- this._cornerType = options.cornerType ?? CornerType_default.ROUNDED;
151
- this._granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
152
- this._workerName = "createPolylineVolumeOutlineGeometry";
153
- let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
154
- numComponents += 1 + shape.length * Cartesian2_default.packedLength;
155
- this.packedLength = numComponents + Ellipsoid_default.packedLength + 2;
156
- }
157
- PolylineVolumeOutlineGeometry.pack = function(value, array, startingIndex) {
158
- if (!defined_default(value)) {
159
- throw new DeveloperError_default("value is required");
160
- }
161
- if (!defined_default(array)) {
162
- throw new DeveloperError_default("array is required");
163
- }
164
- startingIndex = startingIndex ?? 0;
165
- let i;
166
- const positions = value._positions;
167
- let length = positions.length;
168
- array[startingIndex++] = length;
169
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
170
- Cartesian3_default.pack(positions[i], array, startingIndex);
171
- }
172
- const shape = value._shape;
173
- length = shape.length;
174
- array[startingIndex++] = length;
175
- for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
176
- Cartesian2_default.pack(shape[i], array, startingIndex);
177
- }
178
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
179
- startingIndex += Ellipsoid_default.packedLength;
180
- array[startingIndex++] = value._cornerType;
181
- array[startingIndex] = value._granularity;
182
- return array;
183
- };
184
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
185
- var scratchOptions = {
186
- polylinePositions: void 0,
187
- shapePositions: void 0,
188
- ellipsoid: scratchEllipsoid,
189
- height: void 0,
190
- cornerType: void 0,
191
- granularity: void 0
192
- };
193
- PolylineVolumeOutlineGeometry.unpack = function(array, startingIndex, result) {
194
- if (!defined_default(array)) {
195
- throw new DeveloperError_default("array is required");
196
- }
197
- startingIndex = startingIndex ?? 0;
198
- let i;
199
- let length = array[startingIndex++];
200
- const positions = new Array(length);
201
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
202
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
203
- }
204
- length = array[startingIndex++];
205
- const shape = new Array(length);
206
- for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
207
- shape[i] = Cartesian2_default.unpack(array, startingIndex);
208
- }
209
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
210
- startingIndex += Ellipsoid_default.packedLength;
211
- const cornerType = array[startingIndex++];
212
- const granularity = array[startingIndex];
213
- if (!defined_default(result)) {
214
- scratchOptions.polylinePositions = positions;
215
- scratchOptions.shapePositions = shape;
216
- scratchOptions.cornerType = cornerType;
217
- scratchOptions.granularity = granularity;
218
- return new PolylineVolumeOutlineGeometry(scratchOptions);
219
- }
220
- result._positions = positions;
221
- result._shape = shape;
222
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
223
- result._cornerType = cornerType;
224
- result._granularity = granularity;
225
- return result;
226
- };
227
- var brScratch = new BoundingRectangle_default();
228
- PolylineVolumeOutlineGeometry.createGeometry = function(polylineVolumeOutlineGeometry) {
229
- const positions = polylineVolumeOutlineGeometry._positions;
230
- const cleanPositions = arrayRemoveDuplicates_default(
231
- positions,
232
- Cartesian3_default.equalsEpsilon
233
- );
234
- let shape2D = polylineVolumeOutlineGeometry._shape;
235
- shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
236
- if (cleanPositions.length < 2 || shape2D.length < 3) {
237
- return void 0;
238
- }
239
- if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
240
- shape2D.reverse();
241
- }
242
- const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch);
243
- const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
244
- cleanPositions,
245
- shape2D,
246
- boundingRectangle,
247
- polylineVolumeOutlineGeometry,
248
- false
249
- );
250
- return computeAttributes(computedPositions, shape2D);
251
- };
252
- var PolylineVolumeOutlineGeometry_default = PolylineVolumeOutlineGeometry;
253
-
254
- // packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js
255
- function createPolylineVolumeOutlineGeometry(polylineVolumeOutlineGeometry, offset) {
256
- if (defined_default(offset)) {
257
- polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry_default.unpack(
258
- polylineVolumeOutlineGeometry,
259
- offset
260
- );
261
- }
262
- polylineVolumeOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
263
- polylineVolumeOutlineGeometry._ellipsoid
264
- );
265
- return PolylineVolumeOutlineGeometry_default.createGeometry(
266
- polylineVolumeOutlineGeometry
267
- );
268
- }
269
- var createPolylineVolumeOutlineGeometry_default = createPolylineVolumeOutlineGeometry;
270
- export {
271
- createPolylineVolumeOutlineGeometry_default as default
272
- };