@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,1054 +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
- ArcType_default
28
- } from "./chunk-X65Y2JSA.js";
29
- import {
30
- GeometryPipeline_default
31
- } from "./chunk-PV5B2YNB.js";
32
- import {
33
- PolygonPipeline_default,
34
- WindingOrder_default
35
- } from "./chunk-WO5ZNC7S.js";
36
- import {
37
- arrayRemoveDuplicates_default
38
- } from "./chunk-HAY6YE7M.js";
39
- import {
40
- EllipsoidRhumbLine_default
41
- } from "./chunk-FVYRV2T6.js";
42
- import {
43
- IntersectionTests_default
44
- } from "./chunk-66YGZWBI.js";
45
- import {
46
- Plane_default
47
- } from "./chunk-J4MIJCN5.js";
48
- import {
49
- IndexDatatype_default
50
- } from "./chunk-55IROWAX.js";
51
- import {
52
- GeometryAttributes_default
53
- } from "./chunk-BOV6T7FO.js";
54
- import {
55
- GeometryAttribute_default,
56
- Geometry_default,
57
- PrimitiveType_default
58
- } from "./chunk-XOVHLPKW.js";
59
- import {
60
- Quaternion_default
61
- } from "./chunk-KQIZ7AFF.js";
62
- import {
63
- ComponentDatatype_default
64
- } from "./chunk-AL22JVIA.js";
65
- import {
66
- Cartesian2_default,
67
- Cartographic_default,
68
- Ellipsoid_default
69
- } from "./chunk-YPGJSFOO.js";
70
- import {
71
- Cartesian3_default,
72
- Matrix3_default
73
- } from "./chunk-QWV2DM66.js";
74
- import {
75
- Math_default
76
- } from "./chunk-6XJO625E.js";
77
- import {
78
- defined_default
79
- } from "./chunk-AVSQILVI.js";
80
-
81
- // packages/engine/Source/Core/PolygonHierarchy.js
82
- function PolygonHierarchy(positions, holes) {
83
- this.positions = defined_default(positions) ? positions : [];
84
- this.holes = defined_default(holes) ? holes : [];
85
- }
86
- var PolygonHierarchy_default = PolygonHierarchy;
87
-
88
- // packages/engine/Source/Core/Queue.js
89
- function Queue() {
90
- this._array = [];
91
- this._offset = 0;
92
- this._length = 0;
93
- }
94
- Object.defineProperties(Queue.prototype, {
95
- /**
96
- * The length of the queue.
97
- *
98
- * @memberof Queue.prototype
99
- *
100
- * @type {number}
101
- * @readonly
102
- */
103
- length: {
104
- get: function() {
105
- return this._length;
106
- }
107
- }
108
- });
109
- Queue.prototype.enqueue = function(item) {
110
- this._array.push(item);
111
- this._length++;
112
- };
113
- Queue.prototype.dequeue = function() {
114
- if (this._length === 0) {
115
- return void 0;
116
- }
117
- const array = this._array;
118
- let offset = this._offset;
119
- const item = array[offset];
120
- array[offset] = void 0;
121
- offset++;
122
- if (offset > 10 && offset * 2 > array.length) {
123
- this._array = array.slice(offset);
124
- offset = 0;
125
- }
126
- this._offset = offset;
127
- this._length--;
128
- return item;
129
- };
130
- Queue.prototype.peek = function() {
131
- if (this._length === 0) {
132
- return void 0;
133
- }
134
- return this._array[this._offset];
135
- };
136
- Queue.prototype.contains = function(item) {
137
- return this._array.indexOf(item) !== -1;
138
- };
139
- Queue.prototype.clear = function() {
140
- this._array.length = this._offset = this._length = 0;
141
- };
142
- Queue.prototype.sort = function(compareFunction) {
143
- if (this._offset > 0) {
144
- this._array = this._array.slice(this._offset);
145
- this._offset = 0;
146
- }
147
- this._array.sort(compareFunction);
148
- };
149
- var Queue_default = Queue;
150
-
151
- // packages/engine/Source/Core/PolygonGeometryLibrary.js
152
- var PolygonGeometryLibrary = {};
153
- PolygonGeometryLibrary.computeHierarchyPackedLength = function(polygonHierarchy, CartesianX) {
154
- let numComponents = 0;
155
- const stack = [polygonHierarchy];
156
- while (stack.length > 0) {
157
- const hierarchy = stack.pop();
158
- if (!defined_default(hierarchy)) {
159
- continue;
160
- }
161
- numComponents += 2;
162
- const positions = hierarchy.positions;
163
- const holes = hierarchy.holes;
164
- if (defined_default(positions) && positions.length > 0) {
165
- numComponents += positions.length * CartesianX.packedLength;
166
- }
167
- if (defined_default(holes)) {
168
- const length = holes.length;
169
- for (let i = 0; i < length; ++i) {
170
- stack.push(holes[i]);
171
- }
172
- }
173
- }
174
- return numComponents;
175
- };
176
- PolygonGeometryLibrary.packPolygonHierarchy = function(polygonHierarchy, array, startingIndex, CartesianX) {
177
- const stack = [polygonHierarchy];
178
- while (stack.length > 0) {
179
- const hierarchy = stack.pop();
180
- if (!defined_default(hierarchy)) {
181
- continue;
182
- }
183
- const positions = hierarchy.positions;
184
- const holes = hierarchy.holes;
185
- array[startingIndex++] = defined_default(positions) ? positions.length : 0;
186
- array[startingIndex++] = defined_default(holes) ? holes.length : 0;
187
- if (defined_default(positions)) {
188
- const positionsLength = positions.length;
189
- for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
190
- CartesianX.pack(positions[i], array, startingIndex);
191
- }
192
- }
193
- if (defined_default(holes)) {
194
- const holesLength = holes.length;
195
- for (let j = 0; j < holesLength; ++j) {
196
- stack.push(holes[j]);
197
- }
198
- }
199
- }
200
- return startingIndex;
201
- };
202
- PolygonGeometryLibrary.unpackPolygonHierarchy = function(array, startingIndex, CartesianX) {
203
- const positionsLength = array[startingIndex++];
204
- const holesLength = array[startingIndex++];
205
- const positions = new Array(positionsLength);
206
- const holes = holesLength > 0 ? new Array(holesLength) : void 0;
207
- for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
208
- positions[i] = CartesianX.unpack(array, startingIndex);
209
- }
210
- for (let j = 0; j < holesLength; ++j) {
211
- holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(
212
- array,
213
- startingIndex,
214
- CartesianX
215
- );
216
- startingIndex = holes[j].startingIndex;
217
- delete holes[j].startingIndex;
218
- }
219
- return {
220
- positions,
221
- holes,
222
- startingIndex
223
- };
224
- };
225
- var distance2DScratch = new Cartesian2_default();
226
- function getPointAtDistance2D(p0, p1, distance, length) {
227
- Cartesian2_default.subtract(p1, p0, distance2DScratch);
228
- Cartesian2_default.multiplyByScalar(
229
- distance2DScratch,
230
- distance / length,
231
- distance2DScratch
232
- );
233
- Cartesian2_default.add(p0, distance2DScratch, distance2DScratch);
234
- return [distance2DScratch.x, distance2DScratch.y];
235
- }
236
- var distanceScratch = new Cartesian3_default();
237
- function getPointAtDistance(p0, p1, distance, length) {
238
- Cartesian3_default.subtract(p1, p0, distanceScratch);
239
- Cartesian3_default.multiplyByScalar(
240
- distanceScratch,
241
- distance / length,
242
- distanceScratch
243
- );
244
- Cartesian3_default.add(p0, distanceScratch, distanceScratch);
245
- return [distanceScratch.x, distanceScratch.y, distanceScratch.z];
246
- }
247
- PolygonGeometryLibrary.subdivideLineCount = function(p0, p1, minDistance) {
248
- const distance = Cartesian3_default.distance(p0, p1);
249
- const n = distance / minDistance;
250
- const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
251
- return Math.pow(2, countDivide);
252
- };
253
- var scratchCartographic0 = new Cartographic_default();
254
- var scratchCartographic1 = new Cartographic_default();
255
- var scratchCartographic2 = new Cartographic_default();
256
- var scratchCartesian0 = new Cartesian3_default();
257
- var scratchRhumbLine = new EllipsoidRhumbLine_default();
258
- PolygonGeometryLibrary.subdivideRhumbLineCount = function(ellipsoid, p0, p1, minDistance) {
259
- const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
260
- const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
261
- const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
262
- const n = rhumb.surfaceDistance / minDistance;
263
- const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
264
- return Math.pow(2, countDivide);
265
- };
266
- PolygonGeometryLibrary.subdivideTexcoordLine = function(t0, t1, p0, p1, minDistance, result) {
267
- const subdivisions = PolygonGeometryLibrary.subdivideLineCount(
268
- p0,
269
- p1,
270
- minDistance
271
- );
272
- const length2D = Cartesian2_default.distance(t0, t1);
273
- const distanceBetweenCoords = length2D / subdivisions;
274
- const texcoords = result;
275
- texcoords.length = subdivisions * 2;
276
- let index = 0;
277
- for (let i = 0; i < subdivisions; i++) {
278
- const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
279
- texcoords[index++] = t[0];
280
- texcoords[index++] = t[1];
281
- }
282
- return texcoords;
283
- };
284
- PolygonGeometryLibrary.subdivideLine = function(p0, p1, minDistance, result) {
285
- const numVertices = PolygonGeometryLibrary.subdivideLineCount(
286
- p0,
287
- p1,
288
- minDistance
289
- );
290
- const length = Cartesian3_default.distance(p0, p1);
291
- const distanceBetweenVertices = length / numVertices;
292
- if (!defined_default(result)) {
293
- result = [];
294
- }
295
- const positions = result;
296
- positions.length = numVertices * 3;
297
- let index = 0;
298
- for (let i = 0; i < numVertices; i++) {
299
- const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);
300
- positions[index++] = p[0];
301
- positions[index++] = p[1];
302
- positions[index++] = p[2];
303
- }
304
- return positions;
305
- };
306
- PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function(t0, t1, ellipsoid, p0, p1, minDistance, result) {
307
- const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
308
- const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
309
- scratchRhumbLine.setEndPoints(c0, c1);
310
- const n = scratchRhumbLine.surfaceDistance / minDistance;
311
- const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
312
- const subdivisions = Math.pow(2, countDivide);
313
- const length2D = Cartesian2_default.distance(t0, t1);
314
- const distanceBetweenCoords = length2D / subdivisions;
315
- const texcoords = result;
316
- texcoords.length = subdivisions * 2;
317
- let index = 0;
318
- for (let i = 0; i < subdivisions; i++) {
319
- const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
320
- texcoords[index++] = t[0];
321
- texcoords[index++] = t[1];
322
- }
323
- return texcoords;
324
- };
325
- PolygonGeometryLibrary.subdivideRhumbLine = function(ellipsoid, p0, p1, minDistance, result) {
326
- const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
327
- const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
328
- const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
329
- if (!defined_default(result)) {
330
- result = [];
331
- }
332
- if (rhumb.surfaceDistance <= minDistance) {
333
- result.length = 3;
334
- result[0] = p0.x;
335
- result[1] = p0.y;
336
- result[2] = p0.z;
337
- return result;
338
- }
339
- const n = rhumb.surfaceDistance / minDistance;
340
- const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
341
- const numVertices = Math.pow(2, countDivide);
342
- const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;
343
- const positions = result;
344
- positions.length = numVertices * 3;
345
- let index = 0;
346
- for (let i = 0; i < numVertices; i++) {
347
- const c = rhumb.interpolateUsingSurfaceDistance(
348
- i * distanceBetweenVertices,
349
- scratchCartographic2
350
- );
351
- const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);
352
- positions[index++] = p.x;
353
- positions[index++] = p.y;
354
- positions[index++] = p.z;
355
- }
356
- return positions;
357
- };
358
- var scaleToGeodeticHeightN1 = new Cartesian3_default();
359
- var scaleToGeodeticHeightN2 = new Cartesian3_default();
360
- var scaleToGeodeticHeightP1 = new Cartesian3_default();
361
- var scaleToGeodeticHeightP2 = new Cartesian3_default();
362
- PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function(geometry, maxHeight, minHeight, ellipsoid, perPositionHeight) {
363
- ellipsoid = ellipsoid ?? Ellipsoid_default.default;
364
- const n1 = scaleToGeodeticHeightN1;
365
- let n2 = scaleToGeodeticHeightN2;
366
- const p = scaleToGeodeticHeightP1;
367
- let p2 = scaleToGeodeticHeightP2;
368
- if (defined_default(geometry) && defined_default(geometry.attributes) && defined_default(geometry.attributes.position)) {
369
- const positions = geometry.attributes.position.values;
370
- const length = positions.length / 2;
371
- for (let i = 0; i < length; i += 3) {
372
- Cartesian3_default.fromArray(positions, i, p);
373
- ellipsoid.geodeticSurfaceNormal(p, n1);
374
- p2 = ellipsoid.scaleToGeodeticSurface(p, p2);
375
- n2 = Cartesian3_default.multiplyByScalar(n1, minHeight, n2);
376
- n2 = Cartesian3_default.add(p2, n2, n2);
377
- positions[i + length] = n2.x;
378
- positions[i + 1 + length] = n2.y;
379
- positions[i + 2 + length] = n2.z;
380
- if (perPositionHeight) {
381
- p2 = Cartesian3_default.clone(p, p2);
382
- }
383
- n2 = Cartesian3_default.multiplyByScalar(n1, maxHeight, n2);
384
- n2 = Cartesian3_default.add(p2, n2, n2);
385
- positions[i] = n2.x;
386
- positions[i + 1] = n2.y;
387
- positions[i + 2] = n2.z;
388
- }
389
- }
390
- return geometry;
391
- };
392
- PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function(polygonHierarchy, scaleToEllipsoidSurface, ellipsoid) {
393
- const polygons = [];
394
- const queue = new Queue_default();
395
- queue.enqueue(polygonHierarchy);
396
- let i;
397
- let j;
398
- let length;
399
- while (queue.length !== 0) {
400
- const outerNode = queue.dequeue();
401
- let outerRing = outerNode.positions;
402
- if (scaleToEllipsoidSurface) {
403
- length = outerRing.length;
404
- for (i = 0; i < length; i++) {
405
- ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
406
- }
407
- }
408
- outerRing = arrayRemoveDuplicates_default(
409
- outerRing,
410
- Cartesian3_default.equalsEpsilon,
411
- true
412
- );
413
- if (outerRing.length < 3) {
414
- continue;
415
- }
416
- const numChildren = outerNode.holes ? outerNode.holes.length : 0;
417
- for (i = 0; i < numChildren; i++) {
418
- const hole = outerNode.holes[i];
419
- let holePositions = hole.positions;
420
- if (scaleToEllipsoidSurface) {
421
- length = holePositions.length;
422
- for (j = 0; j < length; ++j) {
423
- ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
424
- }
425
- }
426
- holePositions = arrayRemoveDuplicates_default(
427
- holePositions,
428
- Cartesian3_default.equalsEpsilon,
429
- true
430
- );
431
- if (holePositions.length < 3) {
432
- continue;
433
- }
434
- polygons.push(holePositions);
435
- let numGrandchildren = 0;
436
- if (defined_default(hole.holes)) {
437
- numGrandchildren = hole.holes.length;
438
- }
439
- for (j = 0; j < numGrandchildren; j++) {
440
- queue.enqueue(hole.holes[j]);
441
- }
442
- }
443
- polygons.push(outerRing);
444
- }
445
- return polygons;
446
- };
447
- var scratchRhumbIntersection = new Cartographic_default();
448
- function computeEquatorIntersectionRhumb(start, end, ellipsoid) {
449
- const c0 = ellipsoid.cartesianToCartographic(start, scratchCartographic0);
450
- const c1 = ellipsoid.cartesianToCartographic(end, scratchCartographic1);
451
- if (Math.sign(c0.latitude) === Math.sign(c1.latitude)) {
452
- return;
453
- }
454
- scratchRhumbLine.setEndPoints(c0, c1);
455
- const intersection = scratchRhumbLine.findIntersectionWithLatitude(
456
- 0,
457
- scratchRhumbIntersection
458
- );
459
- if (!defined_default(intersection)) {
460
- return;
461
- }
462
- let minLongitude = Math.min(c0.longitude, c1.longitude);
463
- let maxLongitude = Math.max(c0.longitude, c1.longitude);
464
- if (Math.abs(maxLongitude - minLongitude) > Math_default.PI) {
465
- const swap = minLongitude;
466
- minLongitude = maxLongitude;
467
- maxLongitude = swap;
468
- }
469
- if (intersection.longitude < minLongitude || intersection.longitude > maxLongitude) {
470
- return;
471
- }
472
- return ellipsoid.cartographicToCartesian(intersection);
473
- }
474
- function computeEquatorIntersection(start, end, ellipsoid, arcType) {
475
- if (arcType === ArcType_default.RHUMB) {
476
- return computeEquatorIntersectionRhumb(start, end, ellipsoid);
477
- }
478
- const intersection = IntersectionTests_default.lineSegmentPlane(
479
- start,
480
- end,
481
- Plane_default.ORIGIN_XY_PLANE
482
- );
483
- if (!defined_default(intersection)) {
484
- return;
485
- }
486
- return ellipsoid.scaleToGeodeticSurface(intersection, intersection);
487
- }
488
- var scratchCartographic = new Cartographic_default();
489
- function computeEdgesOnPlane(positions, ellipsoid, arcType) {
490
- const edgesOnPlane = [];
491
- let startPoint, endPoint, type, next, intersection, i = 0;
492
- while (i < positions.length) {
493
- startPoint = positions[i];
494
- endPoint = positions[(i + 1) % positions.length];
495
- type = Math_default.sign(startPoint.z);
496
- next = Math_default.sign(endPoint.z);
497
- const getLongitude = (position) => {
498
- const cartographic = ellipsoid.cartesianToCartographic(
499
- position,
500
- scratchCartographic
501
- );
502
- return cartographic.longitude;
503
- };
504
- if (type === 0) {
505
- edgesOnPlane.push({
506
- position: i,
507
- type,
508
- visited: false,
509
- next,
510
- theta: getLongitude(startPoint)
511
- });
512
- } else if (next !== 0) {
513
- intersection = computeEquatorIntersection(
514
- startPoint,
515
- endPoint,
516
- ellipsoid,
517
- arcType
518
- );
519
- ++i;
520
- if (!defined_default(intersection)) {
521
- continue;
522
- }
523
- positions.splice(i, 0, intersection);
524
- edgesOnPlane.push({
525
- position: i,
526
- type,
527
- visited: false,
528
- next,
529
- theta: getLongitude(intersection)
530
- });
531
- }
532
- ++i;
533
- }
534
- return edgesOnPlane;
535
- }
536
- function wirePolygon(polygons, polygonIndex, positions, edgesOnPlane, toDelete, startIndex, abovePlane) {
537
- const polygon = [];
538
- let i = startIndex;
539
- const getMatchingEdge = (i2) => (edge) => edge.position === i2;
540
- const polygonsToWire = [];
541
- do {
542
- const position = positions[i];
543
- polygon.push(position);
544
- const edgeIndex = edgesOnPlane.findIndex(getMatchingEdge(i));
545
- const edge = edgesOnPlane[edgeIndex];
546
- if (!defined_default(edge)) {
547
- ++i;
548
- continue;
549
- }
550
- const { visited: hasBeenVisited, type, next } = edge;
551
- edge.visited = true;
552
- if (type === 0) {
553
- if (next === 0) {
554
- const previousEdge = edgesOnPlane[edgeIndex - (abovePlane ? 1 : -1)];
555
- if (previousEdge?.position === i + 1) {
556
- previousEdge.visited = true;
557
- } else {
558
- ++i;
559
- continue;
560
- }
561
- }
562
- if (!hasBeenVisited && abovePlane && next > 0 || startIndex === i && !abovePlane && next < 0) {
563
- ++i;
564
- continue;
565
- }
566
- }
567
- const followEdge = abovePlane ? type >= 0 : type <= 0;
568
- if (!followEdge) {
569
- ++i;
570
- continue;
571
- }
572
- if (!hasBeenVisited) {
573
- polygonsToWire.push(i);
574
- }
575
- const nextEdgeIndex = edgeIndex + (abovePlane ? 1 : -1);
576
- const nextEdge = edgesOnPlane[nextEdgeIndex];
577
- if (!defined_default(nextEdge)) {
578
- ++i;
579
- continue;
580
- }
581
- i = nextEdge.position;
582
- } while (i < positions.length && i >= 0 && i !== startIndex && polygon.length < positions.length);
583
- polygons.splice(polygonIndex, toDelete, polygon);
584
- for (const index of polygonsToWire) {
585
- polygonIndex = wirePolygon(
586
- polygons,
587
- ++polygonIndex,
588
- positions,
589
- edgesOnPlane,
590
- 0,
591
- index,
592
- !abovePlane
593
- );
594
- }
595
- return polygonIndex;
596
- }
597
- PolygonGeometryLibrary.splitPolygonsOnEquator = function(outerRings, ellipsoid, arcType, result) {
598
- if (!defined_default(result)) {
599
- result = [];
600
- }
601
- result.splice(0, 0, ...outerRings);
602
- result.length = outerRings.length;
603
- let currentPolygon = 0;
604
- while (currentPolygon < result.length) {
605
- const outerRing = result[currentPolygon];
606
- const positions = outerRing.slice();
607
- if (outerRing.length < 3) {
608
- result[currentPolygon] = positions;
609
- ++currentPolygon;
610
- continue;
611
- }
612
- const edgesOnPlane = computeEdgesOnPlane(positions, ellipsoid, arcType);
613
- if (positions.length === outerRing.length || edgesOnPlane.length <= 1) {
614
- result[currentPolygon] = positions;
615
- ++currentPolygon;
616
- continue;
617
- }
618
- edgesOnPlane.sort((a, b) => {
619
- return a.theta - b.theta;
620
- });
621
- const north = positions[0].z >= 0;
622
- currentPolygon = wirePolygon(
623
- result,
624
- currentPolygon,
625
- positions,
626
- edgesOnPlane,
627
- 1,
628
- 0,
629
- north
630
- );
631
- }
632
- return result;
633
- };
634
- PolygonGeometryLibrary.polygonsFromHierarchy = function(polygonHierarchy, keepDuplicates, projectPointsTo2D, scaleToEllipsoidSurface, ellipsoid, splitPolygons) {
635
- const hierarchy = [];
636
- const polygons = [];
637
- const queue = new Queue_default();
638
- queue.enqueue(polygonHierarchy);
639
- let split = defined_default(splitPolygons);
640
- while (queue.length !== 0) {
641
- const outerNode = queue.dequeue();
642
- let outerRing = outerNode.positions;
643
- const holes = outerNode.holes;
644
- let i;
645
- let length;
646
- if (scaleToEllipsoidSurface) {
647
- length = outerRing.length;
648
- for (i = 0; i < length; i++) {
649
- ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
650
- }
651
- }
652
- if (!keepDuplicates) {
653
- outerRing = arrayRemoveDuplicates_default(
654
- outerRing,
655
- Cartesian3_default.equalsEpsilon,
656
- true
657
- );
658
- }
659
- if (outerRing.length < 3) {
660
- continue;
661
- }
662
- let positions2D = projectPointsTo2D(outerRing);
663
- if (!defined_default(positions2D)) {
664
- continue;
665
- }
666
- const holeIndices = [];
667
- let originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
668
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
669
- positions2D.reverse();
670
- outerRing = outerRing.slice().reverse();
671
- }
672
- if (split) {
673
- split = false;
674
- let polygons2 = [outerRing];
675
- polygons2 = splitPolygons(polygons2, polygons2);
676
- if (polygons2.length > 1) {
677
- for (const positions2 of polygons2) {
678
- queue.enqueue(new PolygonHierarchy_default(positions2, holes));
679
- }
680
- continue;
681
- }
682
- }
683
- let positions = outerRing.slice();
684
- const numChildren = defined_default(holes) ? holes.length : 0;
685
- const polygonHoles = [];
686
- let j;
687
- for (i = 0; i < numChildren; i++) {
688
- const hole = holes[i];
689
- let holePositions = hole.positions;
690
- if (scaleToEllipsoidSurface) {
691
- length = holePositions.length;
692
- for (j = 0; j < length; ++j) {
693
- ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
694
- }
695
- }
696
- if (!keepDuplicates) {
697
- holePositions = arrayRemoveDuplicates_default(
698
- holePositions,
699
- Cartesian3_default.equalsEpsilon,
700
- true
701
- );
702
- }
703
- if (holePositions.length < 3) {
704
- continue;
705
- }
706
- const holePositions2D = projectPointsTo2D(holePositions);
707
- if (!defined_default(holePositions2D)) {
708
- continue;
709
- }
710
- originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(holePositions2D);
711
- if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
712
- holePositions2D.reverse();
713
- holePositions = holePositions.slice().reverse();
714
- }
715
- polygonHoles.push(holePositions);
716
- holeIndices.push(positions.length);
717
- positions = positions.concat(holePositions);
718
- positions2D = positions2D.concat(holePositions2D);
719
- let numGrandchildren = 0;
720
- if (defined_default(hole.holes)) {
721
- numGrandchildren = hole.holes.length;
722
- }
723
- for (j = 0; j < numGrandchildren; j++) {
724
- queue.enqueue(hole.holes[j]);
725
- }
726
- }
727
- hierarchy.push({
728
- outerRing,
729
- holes: polygonHoles
730
- });
731
- polygons.push({
732
- positions,
733
- positions2D,
734
- holes: holeIndices
735
- });
736
- }
737
- return {
738
- hierarchy,
739
- polygons
740
- };
741
- };
742
- var computeBoundingRectangleCartesian2 = new Cartesian2_default();
743
- var computeBoundingRectangleCartesian3 = new Cartesian3_default();
744
- var computeBoundingRectangleQuaternion = new Quaternion_default();
745
- var computeBoundingRectangleMatrix3 = new Matrix3_default();
746
- PolygonGeometryLibrary.computeBoundingRectangle = function(planeNormal, projectPointTo2D, positions, angle, result) {
747
- const rotation = Quaternion_default.fromAxisAngle(
748
- planeNormal,
749
- angle,
750
- computeBoundingRectangleQuaternion
751
- );
752
- const textureMatrix = Matrix3_default.fromQuaternion(
753
- rotation,
754
- computeBoundingRectangleMatrix3
755
- );
756
- let minX = Number.POSITIVE_INFINITY;
757
- let maxX = Number.NEGATIVE_INFINITY;
758
- let minY = Number.POSITIVE_INFINITY;
759
- let maxY = Number.NEGATIVE_INFINITY;
760
- const length = positions.length;
761
- for (let i = 0; i < length; ++i) {
762
- const p = Cartesian3_default.clone(
763
- positions[i],
764
- computeBoundingRectangleCartesian3
765
- );
766
- Matrix3_default.multiplyByVector(textureMatrix, p, p);
767
- const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);
768
- if (defined_default(st)) {
769
- minX = Math.min(minX, st.x);
770
- maxX = Math.max(maxX, st.x);
771
- minY = Math.min(minY, st.y);
772
- maxY = Math.max(maxY, st.y);
773
- }
774
- }
775
- result.x = minX;
776
- result.y = minY;
777
- result.width = maxX - minX;
778
- result.height = maxY - minY;
779
- return result;
780
- };
781
- PolygonGeometryLibrary.createGeometryFromPositions = function(ellipsoid, polygon, textureCoordinates, granularity, perPositionHeight, vertexFormat, arcType) {
782
- let indices = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
783
- if (indices.length < 3) {
784
- indices = [0, 1, 2];
785
- }
786
- const positions = polygon.positions;
787
- const hasTexcoords = defined_default(textureCoordinates);
788
- const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
789
- if (perPositionHeight) {
790
- const length = positions.length;
791
- const flattenedPositions = new Array(length * 3);
792
- let index = 0;
793
- for (let i = 0; i < length; i++) {
794
- const p = positions[i];
795
- flattenedPositions[index++] = p.x;
796
- flattenedPositions[index++] = p.y;
797
- flattenedPositions[index++] = p.z;
798
- }
799
- const geometryOptions = {
800
- attributes: {
801
- position: new GeometryAttribute_default({
802
- componentDatatype: ComponentDatatype_default.DOUBLE,
803
- componentsPerAttribute: 3,
804
- values: flattenedPositions
805
- })
806
- },
807
- indices,
808
- primitiveType: PrimitiveType_default.TRIANGLES
809
- };
810
- if (hasTexcoords) {
811
- geometryOptions.attributes.st = new GeometryAttribute_default({
812
- componentDatatype: ComponentDatatype_default.FLOAT,
813
- componentsPerAttribute: 2,
814
- values: Cartesian2_default.packArray(texcoords)
815
- });
816
- }
817
- const geometry = new Geometry_default(geometryOptions);
818
- if (vertexFormat.normal) {
819
- return GeometryPipeline_default.computeNormal(geometry);
820
- }
821
- return geometry;
822
- }
823
- if (arcType === ArcType_default.GEODESIC) {
824
- return PolygonPipeline_default.computeSubdivision(
825
- ellipsoid,
826
- positions,
827
- indices,
828
- texcoords,
829
- granularity
830
- );
831
- } else if (arcType === ArcType_default.RHUMB) {
832
- return PolygonPipeline_default.computeRhumbLineSubdivision(
833
- ellipsoid,
834
- positions,
835
- indices,
836
- texcoords,
837
- granularity
838
- );
839
- }
840
- };
841
- var computeWallTexcoordsSubdivided = [];
842
- var computeWallIndicesSubdivided = [];
843
- var p1Scratch = new Cartesian3_default();
844
- var p2Scratch = new Cartesian3_default();
845
- PolygonGeometryLibrary.computeWallGeometry = function(positions, textureCoordinates, ellipsoid, granularity, perPositionHeight, arcType) {
846
- let edgePositions;
847
- let topEdgeLength;
848
- let i;
849
- let p1;
850
- let p2;
851
- let t1;
852
- let t2;
853
- let edgeTexcoords;
854
- let topEdgeTexcoordLength;
855
- let length = positions.length;
856
- let index = 0;
857
- let textureIndex = 0;
858
- const hasTexcoords = defined_default(textureCoordinates);
859
- const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
860
- if (!perPositionHeight) {
861
- const minDistance = Math_default.chordLength(
862
- granularity,
863
- ellipsoid.maximumRadius
864
- );
865
- let numVertices = 0;
866
- if (arcType === ArcType_default.GEODESIC) {
867
- for (i = 0; i < length; i++) {
868
- numVertices += PolygonGeometryLibrary.subdivideLineCount(
869
- positions[i],
870
- positions[(i + 1) % length],
871
- minDistance
872
- );
873
- }
874
- } else if (arcType === ArcType_default.RHUMB) {
875
- for (i = 0; i < length; i++) {
876
- numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(
877
- ellipsoid,
878
- positions[i],
879
- positions[(i + 1) % length],
880
- minDistance
881
- );
882
- }
883
- }
884
- topEdgeLength = (numVertices + length) * 3;
885
- edgePositions = new Array(topEdgeLength * 2);
886
- if (hasTexcoords) {
887
- topEdgeTexcoordLength = (numVertices + length) * 2;
888
- edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
889
- }
890
- for (i = 0; i < length; i++) {
891
- p1 = positions[i];
892
- p2 = positions[(i + 1) % length];
893
- let tempPositions;
894
- let tempTexcoords;
895
- if (hasTexcoords) {
896
- t1 = texcoords[i];
897
- t2 = texcoords[(i + 1) % length];
898
- }
899
- if (arcType === ArcType_default.GEODESIC) {
900
- tempPositions = PolygonGeometryLibrary.subdivideLine(
901
- p1,
902
- p2,
903
- minDistance,
904
- computeWallIndicesSubdivided
905
- );
906
- if (hasTexcoords) {
907
- tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(
908
- t1,
909
- t2,
910
- p1,
911
- p2,
912
- minDistance,
913
- computeWallTexcoordsSubdivided
914
- );
915
- }
916
- } else if (arcType === ArcType_default.RHUMB) {
917
- tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(
918
- ellipsoid,
919
- p1,
920
- p2,
921
- minDistance,
922
- computeWallIndicesSubdivided
923
- );
924
- if (hasTexcoords) {
925
- tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(
926
- t1,
927
- t2,
928
- ellipsoid,
929
- p1,
930
- p2,
931
- minDistance,
932
- computeWallTexcoordsSubdivided
933
- );
934
- }
935
- }
936
- const tempPositionsLength = tempPositions.length;
937
- for (let j = 0; j < tempPositionsLength; ++j, ++index) {
938
- edgePositions[index] = tempPositions[j];
939
- edgePositions[index + topEdgeLength] = tempPositions[j];
940
- }
941
- edgePositions[index] = p2.x;
942
- edgePositions[index + topEdgeLength] = p2.x;
943
- ++index;
944
- edgePositions[index] = p2.y;
945
- edgePositions[index + topEdgeLength] = p2.y;
946
- ++index;
947
- edgePositions[index] = p2.z;
948
- edgePositions[index + topEdgeLength] = p2.z;
949
- ++index;
950
- if (hasTexcoords) {
951
- const tempTexcoordsLength = tempTexcoords.length;
952
- for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {
953
- edgeTexcoords[textureIndex] = tempTexcoords[k];
954
- edgeTexcoords[textureIndex + topEdgeTexcoordLength] = tempTexcoords[k];
955
- }
956
- edgeTexcoords[textureIndex] = t2.x;
957
- edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
958
- ++textureIndex;
959
- edgeTexcoords[textureIndex] = t2.y;
960
- edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
961
- ++textureIndex;
962
- }
963
- }
964
- } else {
965
- topEdgeLength = length * 3 * 2;
966
- edgePositions = new Array(topEdgeLength * 2);
967
- if (hasTexcoords) {
968
- topEdgeTexcoordLength = length * 2 * 2;
969
- edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
970
- }
971
- for (i = 0; i < length; i++) {
972
- p1 = positions[i];
973
- p2 = positions[(i + 1) % length];
974
- edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;
975
- ++index;
976
- edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;
977
- ++index;
978
- edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;
979
- ++index;
980
- edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;
981
- ++index;
982
- edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;
983
- ++index;
984
- edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;
985
- ++index;
986
- if (hasTexcoords) {
987
- t1 = texcoords[i];
988
- t2 = texcoords[(i + 1) % length];
989
- edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.x;
990
- ++textureIndex;
991
- edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.y;
992
- ++textureIndex;
993
- edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
994
- ++textureIndex;
995
- edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
996
- ++textureIndex;
997
- }
998
- }
999
- }
1000
- length = edgePositions.length;
1001
- const indices = IndexDatatype_default.createTypedArray(
1002
- length / 3,
1003
- length - positions.length * 6
1004
- );
1005
- let edgeIndex = 0;
1006
- length /= 6;
1007
- for (i = 0; i < length; i++) {
1008
- const UL = i;
1009
- const UR = UL + 1;
1010
- const LL = UL + length;
1011
- const LR = LL + 1;
1012
- p1 = Cartesian3_default.fromArray(edgePositions, UL * 3, p1Scratch);
1013
- p2 = Cartesian3_default.fromArray(edgePositions, UR * 3, p2Scratch);
1014
- if (Cartesian3_default.equalsEpsilon(
1015
- p1,
1016
- p2,
1017
- Math_default.EPSILON10,
1018
- Math_default.EPSILON10
1019
- )) {
1020
- continue;
1021
- }
1022
- indices[edgeIndex++] = UL;
1023
- indices[edgeIndex++] = LL;
1024
- indices[edgeIndex++] = UR;
1025
- indices[edgeIndex++] = UR;
1026
- indices[edgeIndex++] = LL;
1027
- indices[edgeIndex++] = LR;
1028
- }
1029
- const geometryOptions = {
1030
- attributes: new GeometryAttributes_default({
1031
- position: new GeometryAttribute_default({
1032
- componentDatatype: ComponentDatatype_default.DOUBLE,
1033
- componentsPerAttribute: 3,
1034
- values: edgePositions
1035
- })
1036
- }),
1037
- indices,
1038
- primitiveType: PrimitiveType_default.TRIANGLES
1039
- };
1040
- if (hasTexcoords) {
1041
- geometryOptions.attributes.st = new GeometryAttribute_default({
1042
- componentDatatype: ComponentDatatype_default.FLOAT,
1043
- componentsPerAttribute: 2,
1044
- values: edgeTexcoords
1045
- });
1046
- }
1047
- const geometry = new Geometry_default(geometryOptions);
1048
- return geometry;
1049
- };
1050
- var PolygonGeometryLibrary_default = PolygonGeometryLibrary;
1051
-
1052
- export {
1053
- PolygonGeometryLibrary_default
1054
- };