@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,374 @@
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
+ BoundingRectangle_default
28
+ } from "./chunk-64W2RXA4.js";
29
+ import {
30
+ GeometryPipeline_default
31
+ } from "./chunk-UUJXSLQ2.js";
32
+ import "./chunk-PHB5MRHM.js";
33
+ import "./chunk-MLFVICFZ.js";
34
+ import {
35
+ CornerType_default,
36
+ PolylineVolumeGeometryLibrary_default,
37
+ oneTimeWarning_default
38
+ } from "./chunk-XJKMLTSH.js";
39
+ import "./chunk-WLREXLZ7.js";
40
+ import "./chunk-JH27ZGLN.js";
41
+ import {
42
+ VertexFormat_default
43
+ } from "./chunk-FJREGHFG.js";
44
+ import "./chunk-3M5CRHSG.js";
45
+ import "./chunk-KXB3AARU.js";
46
+ import {
47
+ PolygonPipeline_default,
48
+ WindingOrder_default
49
+ } from "./chunk-3K2PK2OU.js";
50
+ import {
51
+ arrayRemoveDuplicates_default
52
+ } from "./chunk-OVPPHDU7.js";
53
+ import "./chunk-5QTPACZQ.js";
54
+ import "./chunk-HU5P7PMU.js";
55
+ import "./chunk-BXBGWQ3Z.js";
56
+ import {
57
+ IndexDatatype_default
58
+ } from "./chunk-KBAGFNQ4.js";
59
+ import {
60
+ GeometryAttributes_default
61
+ } from "./chunk-ZV42SJKS.js";
62
+ import {
63
+ GeometryAttribute_default,
64
+ Geometry_default,
65
+ PrimitiveType_default
66
+ } from "./chunk-2BLQ3B4Q.js";
67
+ import {
68
+ BoundingSphere_default
69
+ } from "./chunk-UOD5YNH3.js";
70
+ import "./chunk-5BIQOSBV.js";
71
+ import "./chunk-HAWJ7FMN.js";
72
+ import "./chunk-EISI2CR2.js";
73
+ import {
74
+ ComponentDatatype_default
75
+ } from "./chunk-Z356SW7E.js";
76
+ import "./chunk-DEIMB3B5.js";
77
+ import "./chunk-HI6X33GO.js";
78
+ import {
79
+ Cartesian2_default,
80
+ Ellipsoid_default
81
+ } from "./chunk-F5LAPCFC.js";
82
+ import {
83
+ Cartesian3_default,
84
+ Frozen_default
85
+ } from "./chunk-VR2L2Y4Z.js";
86
+ import {
87
+ Math_default
88
+ } from "./chunk-WMGESUDW.js";
89
+ import {
90
+ DeveloperError_default
91
+ } from "./chunk-HGIGANIQ.js";
92
+ import {
93
+ defined_default
94
+ } from "./chunk-BN4WA7LX.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
+ };
@@ -0,0 +1,272 @@
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
+ BoundingRectangle_default
28
+ } from "./chunk-64W2RXA4.js";
29
+ import {
30
+ CornerType_default,
31
+ PolylineVolumeGeometryLibrary_default
32
+ } from "./chunk-XJKMLTSH.js";
33
+ import "./chunk-WLREXLZ7.js";
34
+ import "./chunk-JH27ZGLN.js";
35
+ import "./chunk-3M5CRHSG.js";
36
+ import "./chunk-KXB3AARU.js";
37
+ import {
38
+ PolygonPipeline_default,
39
+ WindingOrder_default
40
+ } from "./chunk-3K2PK2OU.js";
41
+ import {
42
+ arrayRemoveDuplicates_default
43
+ } from "./chunk-OVPPHDU7.js";
44
+ import "./chunk-5QTPACZQ.js";
45
+ import "./chunk-HU5P7PMU.js";
46
+ import "./chunk-BXBGWQ3Z.js";
47
+ import {
48
+ IndexDatatype_default
49
+ } from "./chunk-KBAGFNQ4.js";
50
+ import {
51
+ GeometryAttributes_default
52
+ } from "./chunk-ZV42SJKS.js";
53
+ import {
54
+ GeometryAttribute_default,
55
+ Geometry_default,
56
+ PrimitiveType_default
57
+ } from "./chunk-2BLQ3B4Q.js";
58
+ import {
59
+ BoundingSphere_default
60
+ } from "./chunk-UOD5YNH3.js";
61
+ import "./chunk-5BIQOSBV.js";
62
+ import "./chunk-HAWJ7FMN.js";
63
+ import "./chunk-EISI2CR2.js";
64
+ import {
65
+ ComponentDatatype_default
66
+ } from "./chunk-Z356SW7E.js";
67
+ import "./chunk-DEIMB3B5.js";
68
+ import "./chunk-HI6X33GO.js";
69
+ import {
70
+ Cartesian2_default,
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
+ DeveloperError_default
82
+ } from "./chunk-HGIGANIQ.js";
83
+ import {
84
+ defined_default
85
+ } from "./chunk-BN4WA7LX.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
+ };