@rtzh/engine 0.0.3 → 0.0.4

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 (172) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +640 -0
  2. package/Build/Workers/chunk-245NZYCR.js +124 -0
  3. package/Build/Workers/chunk-25BA4527.js +837 -0
  4. package/Build/Workers/chunk-2APW7KRS.js +101 -0
  5. package/Build/Workers/chunk-2BLQ3B4Q.js +299 -0
  6. package/Build/Workers/chunk-2CAIFJD5.js +387 -0
  7. package/Build/Workers/chunk-3K2PK2OU.js +1045 -0
  8. package/Build/Workers/chunk-3M5CRHSG.js +288 -0
  9. package/Build/Workers/chunk-4HXPSZRC.js +1483 -0
  10. package/Build/Workers/chunk-4Z26IS65.js +3514 -0
  11. package/Build/Workers/chunk-55IROWAX.js +139 -0
  12. package/Build/Workers/chunk-56XTN5NJ.js +1800 -0
  13. package/Build/Workers/chunk-5BIQOSBV.js +55 -0
  14. package/Build/Workers/chunk-5CSRWY7L.js +280 -0
  15. package/Build/Workers/chunk-5QTPACZQ.js +455 -0
  16. package/Build/Workers/chunk-5VZISKJF.js +629 -0
  17. package/Build/Workers/chunk-5WAG5YKS.js +368 -0
  18. package/Build/Workers/chunk-64W2RXA4.js +219 -0
  19. package/Build/Workers/chunk-66YGZWBI.js +1317 -0
  20. package/Build/Workers/chunk-6H33B6OL.js +37 -0
  21. package/Build/Workers/chunk-6LZBBEA7.js +439 -0
  22. package/Build/Workers/chunk-6QVMKRJ4.js +3514 -0
  23. package/Build/Workers/chunk-6XJO625E.js +497 -0
  24. package/Build/Workers/chunk-75UGCVME.js +102 -0
  25. package/Build/Workers/chunk-7B23DD46.js +1054 -0
  26. package/Build/Workers/chunk-7NCJH26L.js +352 -0
  27. package/Build/Workers/chunk-ACH67MPW.js +1483 -0
  28. package/Build/Workers/chunk-AIW5F22O.js +352 -0
  29. package/Build/Workers/chunk-AL22JVIA.js +256 -0
  30. package/Build/Workers/chunk-AVSQILVI.js +75 -0
  31. package/Build/Workers/chunk-B2VFNYD7.js +280 -0
  32. package/Build/Workers/chunk-BJ6WXQOW.js +305 -0
  33. package/Build/Workers/chunk-BN4WA7LX.js +75 -0
  34. package/Build/Workers/chunk-BOV6T7FO.js +44 -0
  35. package/Build/Workers/chunk-BXBGWQ3Z.js +171 -0
  36. package/Build/Workers/chunk-D7TGILR3.js +1054 -0
  37. package/Build/Workers/chunk-DBKYAGM6.js +1800 -0
  38. package/Build/Workers/chunk-DEIMB3B5.js +629 -0
  39. package/Build/Workers/chunk-DP76S3IQ.js +1067 -0
  40. package/Build/Workers/chunk-DSBEWMOQ.js +1067 -0
  41. package/Build/Workers/chunk-E2CARZA7.js +73 -0
  42. package/Build/Workers/chunk-EDIUN7V3.js +219 -0
  43. package/Build/Workers/chunk-EISI2CR2.js +2058 -0
  44. package/Build/Workers/chunk-EKMWNF4U.js +55 -0
  45. package/Build/Workers/chunk-ELXGXAYS.js +682 -0
  46. package/Build/Workers/chunk-F5LAPCFC.js +1460 -0
  47. package/Build/Workers/chunk-FJREGHFG.js +138 -0
  48. package/Build/Workers/chunk-FVYRV2T6.js +455 -0
  49. package/Build/Workers/chunk-GDIBU55R.js +778 -0
  50. package/Build/Workers/chunk-HAWJ7FMN.js +8366 -0
  51. package/Build/Workers/chunk-HAY6YE7M.js +97 -0
  52. package/Build/Workers/chunk-HGIGANIQ.js +163 -0
  53. package/Build/Workers/chunk-HI6X33GO.js +58 -0
  54. package/Build/Workers/chunk-HU5P7PMU.js +1317 -0
  55. package/Build/Workers/chunk-I76SRIKN.js +138 -0
  56. package/Build/Workers/chunk-IDVURFRN.js +241 -0
  57. package/Build/Workers/chunk-IELTSYPZ.js +241 -0
  58. package/Build/Workers/chunk-J3FBVUY4.js +37 -0
  59. package/Build/Workers/chunk-J4MIJCN5.js +171 -0
  60. package/Build/Workers/chunk-JFO3ELF3.js +642 -0
  61. package/Build/Workers/chunk-JH27ZGLN.js +352 -0
  62. package/Build/Workers/chunk-JURLMTV2.js +398 -0
  63. package/Build/Workers/chunk-K4IMD7KH.js +162 -0
  64. package/Build/Workers/chunk-KBAGFNQ4.js +139 -0
  65. package/Build/Workers/chunk-KFMCOG26.js +692 -0
  66. package/Build/Workers/chunk-KH2OWUUA.js +163 -0
  67. package/Build/Workers/chunk-KHKSE4WQ.js +778 -0
  68. package/Build/Workers/chunk-KKYQRQ57.js +368 -0
  69. package/Build/Workers/chunk-KQIZ7AFF.js +8366 -0
  70. package/Build/Workers/chunk-KUAWPGSB.js +511 -0
  71. package/Build/Workers/chunk-KVDSJXRK.js +114 -0
  72. package/Build/Workers/chunk-KVE5EAPO.js +398 -0
  73. package/Build/Workers/chunk-KXB3AARU.js +162 -0
  74. package/Build/Workers/chunk-LN4NMLYY.js +55 -0
  75. package/Build/Workers/chunk-LPM2FVDN.js +642 -0
  76. package/Build/Workers/chunk-MLFVICFZ.js +102 -0
  77. package/Build/Workers/chunk-MQ62ZE2U.js +124 -0
  78. package/Build/Workers/chunk-NOH3R3YY.js +198 -0
  79. package/Build/Workers/chunk-OAOREOSO.js +940 -0
  80. package/Build/Workers/chunk-OFJRMGNX.js +788 -0
  81. package/Build/Workers/chunk-OOB2KZC6.js +476 -0
  82. package/Build/Workers/chunk-OVPPHDU7.js +97 -0
  83. package/Build/Workers/chunk-P7M4VYFT.js +788 -0
  84. package/Build/Workers/chunk-PHB5MRHM.js +439 -0
  85. package/Build/Workers/chunk-PLLZB3R4.js +198 -0
  86. package/Build/Workers/chunk-POY6ZE32.js +2058 -0
  87. package/Build/Workers/chunk-PV5B2YNB.js +2719 -0
  88. package/Build/Workers/chunk-Q2DXNFYW.js +414 -0
  89. package/Build/Workers/chunk-QWV2DM66.js +1443 -0
  90. package/Build/Workers/chunk-R73BHGGI.js +305 -0
  91. package/Build/Workers/chunk-S3AE3MZZ.js +511 -0
  92. package/Build/Workers/chunk-SBFTVHRW.js +57 -0
  93. package/Build/Workers/chunk-SOR7PD4V.js +114 -0
  94. package/Build/Workers/chunk-TDI7UQBO.js +57 -0
  95. package/Build/Workers/chunk-TO7TWUET.js +476 -0
  96. package/Build/Workers/chunk-TSAJNE4K.js +101 -0
  97. package/Build/Workers/chunk-TWF4XRZ6.js +73 -0
  98. package/Build/Workers/chunk-U364CIW4.js +682 -0
  99. package/Build/Workers/chunk-UOD5YNH3.js +940 -0
  100. package/Build/Workers/chunk-UTWLMOPM.js +387 -0
  101. package/Build/Workers/chunk-UUJXSLQ2.js +2719 -0
  102. package/Build/Workers/chunk-UYT2PBMV.js +58 -0
  103. package/Build/Workers/chunk-VIYQ56Z7.js +837 -0
  104. package/Build/Workers/chunk-VR2L2Y4Z.js +1443 -0
  105. package/Build/Workers/chunk-WAS3IHIQ.js +288 -0
  106. package/Build/Workers/chunk-WLREXLZ7.js +414 -0
  107. package/Build/Workers/chunk-WMGESUDW.js +497 -0
  108. package/Build/Workers/chunk-WO5ZNC7S.js +1045 -0
  109. package/Build/Workers/chunk-X65Y2JSA.js +55 -0
  110. package/Build/Workers/chunk-XJKMLTSH.js +692 -0
  111. package/Build/Workers/chunk-XOVHLPKW.js +299 -0
  112. package/Build/Workers/chunk-YBVMSCW4.js +352 -0
  113. package/Build/Workers/chunk-YPGJSFOO.js +1460 -0
  114. package/Build/Workers/chunk-Z356SW7E.js +256 -0
  115. package/Build/Workers/chunk-ZV42SJKS.js +44 -0
  116. package/Build/Workers/combineGeometry.js +66 -0
  117. package/Build/Workers/createBoxGeometry.js +58 -0
  118. package/Build/Workers/createBoxOutlineGeometry.js +231 -0
  119. package/Build/Workers/createCircleGeometry.js +201 -0
  120. package/Build/Workers/createCircleOutlineGeometry.js +147 -0
  121. package/Build/Workers/createCoplanarPolygonGeometry.js +505 -0
  122. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +225 -0
  123. package/Build/Workers/createCorridorGeometry.js +1258 -0
  124. package/Build/Workers/createCorridorOutlineGeometry.js +563 -0
  125. package/Build/Workers/createCylinderGeometry.js +60 -0
  126. package/Build/Workers/createCylinderOutlineGeometry.js +231 -0
  127. package/Build/Workers/createEllipseGeometry.js +72 -0
  128. package/Build/Workers/createEllipseOutlineGeometry.js +65 -0
  129. package/Build/Workers/createEllipsoidGeometry.js +59 -0
  130. package/Build/Workers/createEllipsoidOutlineGeometry.js +61 -0
  131. package/Build/Workers/createFrustumGeometry.js +58 -0
  132. package/Build/Workers/createFrustumOutlineGeometry.js +234 -0
  133. package/Build/Workers/createGeometry.js +173 -0
  134. package/Build/Workers/createGroundPolylineGeometry.js +1602 -0
  135. package/Build/Workers/createPlaneGeometry.js +223 -0
  136. package/Build/Workers/createPlaneOutlineGeometry.js +124 -0
  137. package/Build/Workers/createPolygonGeometry.js +1404 -0
  138. package/Build/Workers/createPolygonOutlineGeometry.js +532 -0
  139. package/Build/Workers/createPolylineGeometry.js +491 -0
  140. package/Build/Workers/createPolylineVolumeGeometry.js +374 -0
  141. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -0
  142. package/Build/Workers/createRectangleGeometry.js +1264 -0
  143. package/Build/Workers/createRectangleOutlineGeometry.js +476 -0
  144. package/Build/Workers/createSimplePolylineGeometry.js +397 -0
  145. package/Build/Workers/createSphereGeometry.js +116 -0
  146. package/Build/Workers/createSphereOutlineGeometry.js +116 -0
  147. package/Build/Workers/createTaskProcessorWorker.js +32 -0
  148. package/Build/Workers/createVectorTileClampedPolylines.js +492 -0
  149. package/Build/Workers/createVectorTileGeometries.js +387 -0
  150. package/Build/Workers/createVectorTilePoints.js +114 -0
  151. package/Build/Workers/createVectorTilePolygons.js +386 -0
  152. package/Build/Workers/createVectorTilePolylines.js +262 -0
  153. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
  154. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +565 -0
  155. package/Build/Workers/createVerticesFromHeightmap.js +2254 -0
  156. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +499 -0
  157. package/Build/Workers/createWallGeometry.js +487 -0
  158. package/Build/Workers/createWallOutlineGeometry.js +335 -0
  159. package/Build/Workers/decodeDraco.js +369 -0
  160. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2680 -0
  161. package/Build/Workers/decodeI3S.js +1339 -0
  162. package/Build/Workers/gaussianSplatSorter.js +62 -0
  163. package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
  164. package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
  165. package/Build/Workers/transcodeKTX2.js +3463 -0
  166. package/Build/Workers/transferTypedArrayTest.js +41 -0
  167. package/Build/Workers/upsampleQuantizedTerrainMesh.js +820 -0
  168. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
  169. package/Source/Scene/GltfLoader.js +2 -2
  170. package/Source/Scene/Model/I3dmLoader.js +2 -2
  171. package/index.js +110 -110
  172. package/package.json +1 -1
@@ -0,0 +1,563 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.4
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
+ CorridorGeometryLibrary_default
28
+ } from "./chunk-OOB2KZC6.js";
29
+ import {
30
+ CornerType_default
31
+ } from "./chunk-XJKMLTSH.js";
32
+ import "./chunk-WLREXLZ7.js";
33
+ import "./chunk-JH27ZGLN.js";
34
+ import {
35
+ GeometryOffsetAttribute_default
36
+ } from "./chunk-J3FBVUY4.js";
37
+ import "./chunk-3M5CRHSG.js";
38
+ import "./chunk-KXB3AARU.js";
39
+ import {
40
+ PolygonPipeline_default
41
+ } from "./chunk-3K2PK2OU.js";
42
+ import {
43
+ arrayRemoveDuplicates_default
44
+ } from "./chunk-OVPPHDU7.js";
45
+ import "./chunk-5QTPACZQ.js";
46
+ import "./chunk-HU5P7PMU.js";
47
+ import "./chunk-BXBGWQ3Z.js";
48
+ import {
49
+ IndexDatatype_default
50
+ } from "./chunk-KBAGFNQ4.js";
51
+ import {
52
+ GeometryAttributes_default
53
+ } from "./chunk-ZV42SJKS.js";
54
+ import {
55
+ GeometryAttribute_default,
56
+ Geometry_default,
57
+ PrimitiveType_default
58
+ } from "./chunk-2BLQ3B4Q.js";
59
+ import {
60
+ BoundingSphere_default
61
+ } from "./chunk-UOD5YNH3.js";
62
+ import "./chunk-5BIQOSBV.js";
63
+ import "./chunk-HAWJ7FMN.js";
64
+ import "./chunk-EISI2CR2.js";
65
+ import {
66
+ ComponentDatatype_default
67
+ } from "./chunk-Z356SW7E.js";
68
+ import "./chunk-DEIMB3B5.js";
69
+ import "./chunk-HI6X33GO.js";
70
+ import {
71
+ Ellipsoid_default
72
+ } from "./chunk-F5LAPCFC.js";
73
+ import {
74
+ Cartesian3_default,
75
+ Frozen_default
76
+ } from "./chunk-VR2L2Y4Z.js";
77
+ import {
78
+ Math_default
79
+ } from "./chunk-WMGESUDW.js";
80
+ import {
81
+ Check_default
82
+ } from "./chunk-HGIGANIQ.js";
83
+ import {
84
+ defined_default
85
+ } from "./chunk-BN4WA7LX.js";
86
+
87
+ // packages/engine/Source/Core/CorridorOutlineGeometry.js
88
+ var cartesian1 = new Cartesian3_default();
89
+ var cartesian2 = new Cartesian3_default();
90
+ var cartesian3 = new Cartesian3_default();
91
+ function scaleToSurface(positions, ellipsoid) {
92
+ for (let i = 0; i < positions.length; i++) {
93
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
94
+ }
95
+ return positions;
96
+ }
97
+ function combine(computedPositions, cornerType) {
98
+ const wallIndices = [];
99
+ const positions = computedPositions.positions;
100
+ const corners = computedPositions.corners;
101
+ const endPositions = computedPositions.endPositions;
102
+ const attributes = new GeometryAttributes_default();
103
+ let corner;
104
+ let leftCount = 0;
105
+ let rightCount = 0;
106
+ let i;
107
+ let indicesLength = 0;
108
+ let length;
109
+ for (i = 0; i < positions.length; i += 2) {
110
+ length = positions[i].length - 3;
111
+ leftCount += length;
112
+ indicesLength += length / 3 * 4;
113
+ rightCount += positions[i + 1].length - 3;
114
+ }
115
+ leftCount += 3;
116
+ rightCount += 3;
117
+ for (i = 0; i < corners.length; i++) {
118
+ corner = corners[i];
119
+ const leftSide = corners[i].leftPositions;
120
+ if (defined_default(leftSide)) {
121
+ length = leftSide.length;
122
+ leftCount += length;
123
+ indicesLength += length / 3 * 2;
124
+ } else {
125
+ length = corners[i].rightPositions.length;
126
+ rightCount += length;
127
+ indicesLength += length / 3 * 2;
128
+ }
129
+ }
130
+ const addEndPositions = defined_default(endPositions);
131
+ let endPositionLength;
132
+ if (addEndPositions) {
133
+ endPositionLength = endPositions[0].length - 3;
134
+ leftCount += endPositionLength;
135
+ rightCount += endPositionLength;
136
+ endPositionLength /= 3;
137
+ indicesLength += endPositionLength * 4;
138
+ }
139
+ const size = leftCount + rightCount;
140
+ const finalPositions = new Float64Array(size);
141
+ let front = 0;
142
+ let back = size - 1;
143
+ let UL, LL, UR, LR;
144
+ let rightPos, leftPos;
145
+ const halfLength = endPositionLength / 2;
146
+ const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength + 4);
147
+ let index = 0;
148
+ indices[index++] = front / 3;
149
+ indices[index++] = (back - 2) / 3;
150
+ if (addEndPositions) {
151
+ wallIndices.push(front / 3);
152
+ leftPos = cartesian1;
153
+ rightPos = cartesian2;
154
+ const firstEndPositions = endPositions[0];
155
+ for (i = 0; i < halfLength; i++) {
156
+ leftPos = Cartesian3_default.fromArray(
157
+ firstEndPositions,
158
+ (halfLength - 1 - i) * 3,
159
+ leftPos
160
+ );
161
+ rightPos = Cartesian3_default.fromArray(
162
+ firstEndPositions,
163
+ (halfLength + i) * 3,
164
+ rightPos
165
+ );
166
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
167
+ CorridorGeometryLibrary_default.addAttribute(
168
+ finalPositions,
169
+ leftPos,
170
+ void 0,
171
+ back
172
+ );
173
+ LL = front / 3;
174
+ LR = LL + 1;
175
+ UL = (back - 2) / 3;
176
+ UR = UL - 1;
177
+ indices[index++] = UL;
178
+ indices[index++] = UR;
179
+ indices[index++] = LL;
180
+ indices[index++] = LR;
181
+ front += 3;
182
+ back -= 3;
183
+ }
184
+ }
185
+ let posIndex = 0;
186
+ let rightEdge = positions[posIndex++];
187
+ let leftEdge = positions[posIndex++];
188
+ finalPositions.set(rightEdge, front);
189
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
190
+ length = leftEdge.length - 3;
191
+ wallIndices.push(front / 3, (back - 2) / 3);
192
+ for (i = 0; i < length; i += 3) {
193
+ LL = front / 3;
194
+ LR = LL + 1;
195
+ UL = (back - 2) / 3;
196
+ UR = UL - 1;
197
+ indices[index++] = UL;
198
+ indices[index++] = UR;
199
+ indices[index++] = LL;
200
+ indices[index++] = LR;
201
+ front += 3;
202
+ back -= 3;
203
+ }
204
+ for (i = 0; i < corners.length; i++) {
205
+ let j;
206
+ corner = corners[i];
207
+ const l = corner.leftPositions;
208
+ const r = corner.rightPositions;
209
+ let start;
210
+ let outsidePoint = cartesian3;
211
+ if (defined_default(l)) {
212
+ back -= 3;
213
+ start = UR;
214
+ wallIndices.push(LR);
215
+ for (j = 0; j < l.length / 3; j++) {
216
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
217
+ indices[index++] = start - j - 1;
218
+ indices[index++] = start - j;
219
+ CorridorGeometryLibrary_default.addAttribute(
220
+ finalPositions,
221
+ outsidePoint,
222
+ void 0,
223
+ back
224
+ );
225
+ back -= 3;
226
+ }
227
+ wallIndices.push(start - Math.floor(l.length / 6));
228
+ if (cornerType === CornerType_default.BEVELED) {
229
+ wallIndices.push((back - 2) / 3 + 1);
230
+ }
231
+ front += 3;
232
+ } else {
233
+ front += 3;
234
+ start = LR;
235
+ wallIndices.push(UR);
236
+ for (j = 0; j < r.length / 3; j++) {
237
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
238
+ indices[index++] = start + j;
239
+ indices[index++] = start + j + 1;
240
+ CorridorGeometryLibrary_default.addAttribute(
241
+ finalPositions,
242
+ outsidePoint,
243
+ front
244
+ );
245
+ front += 3;
246
+ }
247
+ wallIndices.push(start + Math.floor(r.length / 6));
248
+ if (cornerType === CornerType_default.BEVELED) {
249
+ wallIndices.push(front / 3 - 1);
250
+ }
251
+ back -= 3;
252
+ }
253
+ rightEdge = positions[posIndex++];
254
+ leftEdge = positions[posIndex++];
255
+ rightEdge.splice(0, 3);
256
+ leftEdge.splice(leftEdge.length - 3, 3);
257
+ finalPositions.set(rightEdge, front);
258
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
259
+ length = leftEdge.length - 3;
260
+ for (j = 0; j < leftEdge.length; j += 3) {
261
+ LR = front / 3;
262
+ LL = LR - 1;
263
+ UR = (back - 2) / 3;
264
+ UL = UR + 1;
265
+ indices[index++] = UL;
266
+ indices[index++] = UR;
267
+ indices[index++] = LL;
268
+ indices[index++] = LR;
269
+ front += 3;
270
+ back -= 3;
271
+ }
272
+ front -= 3;
273
+ back += 3;
274
+ wallIndices.push(front / 3, (back - 2) / 3);
275
+ }
276
+ if (addEndPositions) {
277
+ front += 3;
278
+ back -= 3;
279
+ leftPos = cartesian1;
280
+ rightPos = cartesian2;
281
+ const lastEndPositions = endPositions[1];
282
+ for (i = 0; i < halfLength; i++) {
283
+ leftPos = Cartesian3_default.fromArray(
284
+ lastEndPositions,
285
+ (endPositionLength - i - 1) * 3,
286
+ leftPos
287
+ );
288
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
289
+ CorridorGeometryLibrary_default.addAttribute(
290
+ finalPositions,
291
+ leftPos,
292
+ void 0,
293
+ back
294
+ );
295
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
296
+ LR = front / 3;
297
+ LL = LR - 1;
298
+ UR = (back - 2) / 3;
299
+ UL = UR + 1;
300
+ indices[index++] = UL;
301
+ indices[index++] = UR;
302
+ indices[index++] = LL;
303
+ indices[index++] = LR;
304
+ front += 3;
305
+ back -= 3;
306
+ }
307
+ wallIndices.push(front / 3);
308
+ } else {
309
+ wallIndices.push(front / 3, (back - 2) / 3);
310
+ }
311
+ indices[index++] = front / 3;
312
+ indices[index++] = (back - 2) / 3;
313
+ attributes.position = new GeometryAttribute_default({
314
+ componentDatatype: ComponentDatatype_default.DOUBLE,
315
+ componentsPerAttribute: 3,
316
+ values: finalPositions
317
+ });
318
+ return {
319
+ attributes,
320
+ indices,
321
+ wallIndices
322
+ };
323
+ }
324
+ function computePositionsExtruded(params) {
325
+ const ellipsoid = params.ellipsoid;
326
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
327
+ const attr = combine(computedPositions, params.cornerType);
328
+ const wallIndices = attr.wallIndices;
329
+ const height = params.height;
330
+ const extrudedHeight = params.extrudedHeight;
331
+ const attributes = attr.attributes;
332
+ const indices = attr.indices;
333
+ let positions = attributes.position.values;
334
+ let length = positions.length;
335
+ let extrudedPositions = new Float64Array(length);
336
+ extrudedPositions.set(positions);
337
+ const newPositions = new Float64Array(length * 2);
338
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
339
+ positions,
340
+ height,
341
+ ellipsoid
342
+ );
343
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
344
+ extrudedPositions,
345
+ extrudedHeight,
346
+ ellipsoid
347
+ );
348
+ newPositions.set(positions);
349
+ newPositions.set(extrudedPositions, length);
350
+ attributes.position.values = newPositions;
351
+ length /= 3;
352
+ if (defined_default(params.offsetAttribute)) {
353
+ let applyOffset = new Uint8Array(length * 2);
354
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
355
+ applyOffset = applyOffset.fill(1, 0, length);
356
+ } else {
357
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
358
+ applyOffset = applyOffset.fill(applyOffsetValue);
359
+ }
360
+ attributes.applyOffset = new GeometryAttribute_default({
361
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
362
+ componentsPerAttribute: 1,
363
+ values: applyOffset
364
+ });
365
+ }
366
+ let i;
367
+ const iLength = indices.length;
368
+ const newIndices = IndexDatatype_default.createTypedArray(
369
+ newPositions.length / 3,
370
+ (iLength + wallIndices.length) * 2
371
+ );
372
+ newIndices.set(indices);
373
+ let index = iLength;
374
+ for (i = 0; i < iLength; i += 2) {
375
+ const v0 = indices[i];
376
+ const v1 = indices[i + 1];
377
+ newIndices[index++] = v0 + length;
378
+ newIndices[index++] = v1 + length;
379
+ }
380
+ let UL, LL;
381
+ for (i = 0; i < wallIndices.length; i++) {
382
+ UL = wallIndices[i];
383
+ LL = UL + length;
384
+ newIndices[index++] = UL;
385
+ newIndices[index++] = LL;
386
+ }
387
+ return {
388
+ attributes,
389
+ indices: newIndices
390
+ };
391
+ }
392
+ function CorridorOutlineGeometry(options) {
393
+ options = options ?? Frozen_default.EMPTY_OBJECT;
394
+ const positions = options.positions;
395
+ const width = options.width;
396
+ Check_default.typeOf.object("options.positions", positions);
397
+ Check_default.typeOf.number("options.width", width);
398
+ const height = options.height ?? 0;
399
+ const extrudedHeight = options.extrudedHeight ?? height;
400
+ this._positions = positions;
401
+ this._ellipsoid = Ellipsoid_default.clone(options.ellipsoid ?? Ellipsoid_default.default);
402
+ this._width = width;
403
+ this._height = Math.max(height, extrudedHeight);
404
+ this._extrudedHeight = Math.min(height, extrudedHeight);
405
+ this._cornerType = options.cornerType ?? CornerType_default.ROUNDED;
406
+ this._granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
407
+ this._offsetAttribute = options.offsetAttribute;
408
+ this._workerName = "createCorridorOutlineGeometry";
409
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 6;
410
+ }
411
+ CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
412
+ Check_default.typeOf.object("value", value);
413
+ Check_default.typeOf.object("array", array);
414
+ startingIndex = startingIndex ?? 0;
415
+ const positions = value._positions;
416
+ const length = positions.length;
417
+ array[startingIndex++] = length;
418
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
419
+ Cartesian3_default.pack(positions[i], array, startingIndex);
420
+ }
421
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
422
+ startingIndex += Ellipsoid_default.packedLength;
423
+ array[startingIndex++] = value._width;
424
+ array[startingIndex++] = value._height;
425
+ array[startingIndex++] = value._extrudedHeight;
426
+ array[startingIndex++] = value._cornerType;
427
+ array[startingIndex++] = value._granularity;
428
+ array[startingIndex] = value._offsetAttribute ?? -1;
429
+ return array;
430
+ };
431
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
432
+ var scratchOptions = {
433
+ positions: void 0,
434
+ ellipsoid: scratchEllipsoid,
435
+ width: void 0,
436
+ height: void 0,
437
+ extrudedHeight: void 0,
438
+ cornerType: void 0,
439
+ granularity: void 0,
440
+ offsetAttribute: void 0
441
+ };
442
+ CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
443
+ Check_default.typeOf.object("array", array);
444
+ startingIndex = startingIndex ?? 0;
445
+ const length = array[startingIndex++];
446
+ const positions = new Array(length);
447
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
448
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
449
+ }
450
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
451
+ startingIndex += Ellipsoid_default.packedLength;
452
+ const width = array[startingIndex++];
453
+ const height = array[startingIndex++];
454
+ const extrudedHeight = array[startingIndex++];
455
+ const cornerType = array[startingIndex++];
456
+ const granularity = array[startingIndex++];
457
+ const offsetAttribute = array[startingIndex];
458
+ if (!defined_default(result)) {
459
+ scratchOptions.positions = positions;
460
+ scratchOptions.width = width;
461
+ scratchOptions.height = height;
462
+ scratchOptions.extrudedHeight = extrudedHeight;
463
+ scratchOptions.cornerType = cornerType;
464
+ scratchOptions.granularity = granularity;
465
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
466
+ return new CorridorOutlineGeometry(scratchOptions);
467
+ }
468
+ result._positions = positions;
469
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
470
+ result._width = width;
471
+ result._height = height;
472
+ result._extrudedHeight = extrudedHeight;
473
+ result._cornerType = cornerType;
474
+ result._granularity = granularity;
475
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
476
+ return result;
477
+ };
478
+ CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
479
+ let positions = corridorOutlineGeometry._positions;
480
+ const width = corridorOutlineGeometry._width;
481
+ const ellipsoid = corridorOutlineGeometry._ellipsoid;
482
+ positions = scaleToSurface(positions, ellipsoid);
483
+ const cleanPositions = arrayRemoveDuplicates_default(
484
+ positions,
485
+ Cartesian3_default.equalsEpsilon
486
+ );
487
+ if (cleanPositions.length < 2 || width <= 0) {
488
+ return;
489
+ }
490
+ const height = corridorOutlineGeometry._height;
491
+ const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
492
+ const extrude = !Math_default.equalsEpsilon(
493
+ height,
494
+ extrudedHeight,
495
+ 0,
496
+ Math_default.EPSILON2
497
+ );
498
+ const params = {
499
+ ellipsoid,
500
+ positions: cleanPositions,
501
+ width,
502
+ cornerType: corridorOutlineGeometry._cornerType,
503
+ granularity: corridorOutlineGeometry._granularity,
504
+ saveAttributes: false
505
+ };
506
+ let attr;
507
+ if (extrude) {
508
+ params.height = height;
509
+ params.extrudedHeight = extrudedHeight;
510
+ params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
511
+ attr = computePositionsExtruded(params);
512
+ } else {
513
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
514
+ attr = combine(computedPositions, params.cornerType);
515
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
516
+ attr.attributes.position.values,
517
+ height,
518
+ ellipsoid
519
+ );
520
+ if (defined_default(corridorOutlineGeometry._offsetAttribute)) {
521
+ const length = attr.attributes.position.values.length;
522
+ const offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
523
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
524
+ attr.attributes.applyOffset = new GeometryAttribute_default({
525
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
526
+ componentsPerAttribute: 1,
527
+ values: applyOffset
528
+ });
529
+ }
530
+ }
531
+ const attributes = attr.attributes;
532
+ const boundingSphere = BoundingSphere_default.fromVertices(
533
+ attributes.position.values,
534
+ void 0,
535
+ 3
536
+ );
537
+ return new Geometry_default({
538
+ attributes,
539
+ indices: attr.indices,
540
+ primitiveType: PrimitiveType_default.LINES,
541
+ boundingSphere,
542
+ offsetAttribute: corridorOutlineGeometry._offsetAttribute
543
+ });
544
+ };
545
+ var CorridorOutlineGeometry_default = CorridorOutlineGeometry;
546
+
547
+ // packages/engine/Source/Workers/createCorridorOutlineGeometry.js
548
+ function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
549
+ if (defined_default(offset)) {
550
+ corridorOutlineGeometry = CorridorOutlineGeometry_default.unpack(
551
+ corridorOutlineGeometry,
552
+ offset
553
+ );
554
+ }
555
+ corridorOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
556
+ corridorOutlineGeometry._ellipsoid
557
+ );
558
+ return CorridorOutlineGeometry_default.createGeometry(corridorOutlineGeometry);
559
+ }
560
+ var createCorridorOutlineGeometry_default = createCorridorOutlineGeometry;
561
+ export {
562
+ createCorridorOutlineGeometry_default as default
563
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.4
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
+ CylinderGeometry_default
28
+ } from "./chunk-JURLMTV2.js";
29
+ import "./chunk-E2CARZA7.js";
30
+ import "./chunk-J3FBVUY4.js";
31
+ import "./chunk-FJREGHFG.js";
32
+ import "./chunk-KBAGFNQ4.js";
33
+ import "./chunk-ZV42SJKS.js";
34
+ import "./chunk-2BLQ3B4Q.js";
35
+ import "./chunk-UOD5YNH3.js";
36
+ import "./chunk-5BIQOSBV.js";
37
+ import "./chunk-HAWJ7FMN.js";
38
+ import "./chunk-EISI2CR2.js";
39
+ import "./chunk-Z356SW7E.js";
40
+ import "./chunk-DEIMB3B5.js";
41
+ import "./chunk-HI6X33GO.js";
42
+ import "./chunk-F5LAPCFC.js";
43
+ import "./chunk-VR2L2Y4Z.js";
44
+ import "./chunk-WMGESUDW.js";
45
+ import "./chunk-HGIGANIQ.js";
46
+ import {
47
+ defined_default
48
+ } from "./chunk-BN4WA7LX.js";
49
+
50
+ // packages/engine/Source/Workers/createCylinderGeometry.js
51
+ function createCylinderGeometry(cylinderGeometry, offset) {
52
+ if (defined_default(offset)) {
53
+ cylinderGeometry = CylinderGeometry_default.unpack(cylinderGeometry, offset);
54
+ }
55
+ return CylinderGeometry_default.createGeometry(cylinderGeometry);
56
+ }
57
+ var createCylinderGeometry_default = createCylinderGeometry;
58
+ export {
59
+ createCylinderGeometry_default as default
60
+ };