deeptwins-engine-3d 0.1.76 → 0.2.1

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 (237) hide show
  1. package/dist/assets/Build/DeepTwins/Image/noise.png +0 -0
  2. package/dist/assets/Build/DeepTwins/Workers/CustomRasterClip.worker.js +1 -2
  3. package/dist/assets/Build/DeepTwins/Workers/MvtVector.worker.js +1 -1
  4. package/dist/assets/Build/Map3d/ThirdParty/Workers/zip-web-worker.js +640 -0
  5. package/dist/assets/Build/Map3d/ThirdParty/wasm_splats_bg.wasm +0 -0
  6. package/dist/assets/Build/Map3d/ThirdParty/zip-module.wasm +0 -0
  7. package/dist/assets/Build/Map3d/Workers/chunk-27NG6PQR.js +456 -0
  8. package/dist/assets/Build/Map3d/Workers/chunk-2JVMMMWT.js +353 -0
  9. package/dist/assets/Build/Map3d/Workers/chunk-2Y2XYQCS.js +1481 -0
  10. package/dist/assets/Build/Map3d/Workers/chunk-34RF3V5G.js +220 -0
  11. package/dist/assets/Build/Map3d/Workers/chunk-35H7BYLJ.js +1800 -0
  12. package/dist/assets/Build/Map3d/Workers/chunk-57OGEF5V.js +435 -0
  13. package/dist/assets/Build/Map3d/Workers/chunk-5PX3DYJA.js +196 -0
  14. package/dist/assets/Build/Map3d/Workers/chunk-7B5XGQRN.js +171 -0
  15. package/dist/assets/Build/Map3d/Workers/chunk-ATLWOZFF.js +39 -0
  16. package/dist/assets/Build/Map3d/Workers/chunk-BMSUECTA.js +1055 -0
  17. package/dist/assets/Build/Map3d/Workers/chunk-C6IA4TKW.js +476 -0
  18. package/dist/assets/Build/Map3d/Workers/chunk-CZ44I32U.js +157 -0
  19. package/dist/assets/Build/Map3d/Workers/chunk-DE6UV44R.js +122 -0
  20. package/dist/assets/Build/Map3d/Workers/chunk-DUCCKVOG.js +834 -0
  21. package/dist/assets/Build/Map3d/Workers/chunk-EBJBPIYX.js +239 -0
  22. package/dist/assets/Build/Map3d/Workers/chunk-EYSYQ2R6.js +138 -0
  23. package/dist/assets/Build/Map3d/Workers/chunk-FMCAAUQI.js +368 -0
  24. package/dist/assets/Build/Map3d/Workers/chunk-GMYZNRRQ.js +2717 -0
  25. package/dist/assets/Build/Map3d/Workers/chunk-GWPNZZV4.js +781 -0
  26. package/dist/assets/Build/Map3d/Workers/chunk-HLP2U4KW.js +758 -0
  27. package/dist/assets/Build/Map3d/Workers/chunk-HSJSUPQV.js +500 -0
  28. package/dist/assets/Build/Map3d/Workers/chunk-I73Q3AG7.js +58 -0
  29. package/dist/assets/Build/Map3d/Workers/chunk-IMZ4YIMV.js +511 -0
  30. package/dist/assets/Build/Map3d/Workers/chunk-IZSK4DVF.js +421 -0
  31. package/dist/assets/Build/Map3d/Workers/chunk-JKLMRPKK.js +75 -0
  32. package/dist/assets/Build/Map3d/Workers/chunk-KGM345JM.js +691 -0
  33. package/dist/assets/Build/Map3d/Workers/chunk-L4IR5U4G.js +102 -0
  34. package/dist/assets/Build/Map3d/Workers/chunk-MG4EVQH2.js +44 -0
  35. package/dist/assets/Build/Map3d/Workers/chunk-NXWEFAZJ.js +300 -0
  36. package/dist/assets/Build/Map3d/Workers/chunk-PDFAJISJ.js +59 -0
  37. package/dist/assets/Build/Map3d/Workers/chunk-PHWZFJR5.js +100 -0
  38. package/dist/assets/Build/Map3d/Workers/chunk-PLE7CHBE.js +101 -0
  39. package/dist/assets/Build/Map3d/Workers/chunk-PN3GIZ5Q.js +163 -0
  40. package/dist/assets/Build/Map3d/Workers/chunk-PXL5XLHV.js +1073 -0
  41. package/dist/assets/Build/Map3d/Workers/chunk-QYXOF5JC.js +959 -0
  42. package/dist/assets/Build/Map3d/Workers/chunk-R2LIFXV3.js +115 -0
  43. package/dist/assets/Build/Map3d/Workers/chunk-R4W6IRJZ.js +10357 -0
  44. package/dist/assets/Build/Map3d/Workers/chunk-R5PZXG56.js +1258 -0
  45. package/dist/assets/Build/Map3d/Workers/chunk-RZQLZIUI.js +629 -0
  46. package/dist/assets/Build/Map3d/Workers/chunk-SIBDD6Y4.js +390 -0
  47. package/dist/assets/Build/Map3d/Workers/chunk-U5NN6JTQ.js +398 -0
  48. package/dist/assets/Build/Map3d/Workers/chunk-UA5RPPP3.js +73 -0
  49. package/dist/assets/Build/Map3d/Workers/chunk-UXLKFS3C.js +305 -0
  50. package/dist/assets/Build/Map3d/Workers/chunk-VUX4BQIM.js +37 -0
  51. package/dist/assets/Build/Map3d/Workers/chunk-WJDUUUJS.js +684 -0
  52. package/dist/assets/Build/Map3d/Workers/chunk-XBJOJHWX.js +139 -0
  53. package/dist/assets/Build/Map3d/Workers/chunk-XJDMTNKD.js +634 -0
  54. package/dist/assets/Build/Map3d/Workers/chunk-XUCXZZE5.js +963 -0
  55. package/dist/assets/Build/Map3d/Workers/chunk-YIKGVMJ5.js +287 -0
  56. package/dist/assets/Build/Map3d/Workers/chunk-YTNCIBPQ.js +262 -0
  57. package/dist/assets/Build/Map3d/Workers/chunk-ZMDUYETO.js +55 -0
  58. package/dist/assets/Build/Map3d/Workers/chunk-ZW52HXFN.js +2857 -0
  59. package/dist/esm/analyze/LineOfSightAnalysis.js +1 -326
  60. package/dist/esm/analyze/SubmergenceAnalysis.js +1 -137
  61. package/dist/esm/analyze/SunLightAnalysis.js +1 -91
  62. package/dist/esm/analyze/TerrainExcavationAnalysis.js +1 -612
  63. package/dist/esm/analyze/ViewshedAnalysis.js +1 -292
  64. package/dist/esm/cameraControl/ModelRoamHistory.js +1 -639
  65. package/dist/esm/cameraControl/ModelRoamRealTime.js +1 -874
  66. package/dist/esm/cameraControl/Roam.js +1 -418
  67. package/dist/esm/cameraControl/Rotate.js +1 -134
  68. package/dist/esm/cameraControl/RotateInPlace.js +1 -99
  69. package/dist/esm/constant.d.ts +90 -0
  70. package/dist/esm/constant.js +1 -1287
  71. package/dist/esm/deepTwins/index.js +1 -121
  72. package/dist/esm/drawCommand/index.js +1 -3
  73. package/dist/esm/drawCommand/viewShed/Event.js +1 -142
  74. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +1 -1306
  75. package/dist/esm/drawCommand/viewShed/ViewShadowPrimitive.js +1 -66
  76. package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.js +1 -466
  77. package/dist/esm/drawCommand/viewShed/ViewShedMap.js +1 -1238
  78. package/dist/esm/drawCommand/viewShed/config.js +1 -21
  79. package/dist/esm/drawCommand/volumeCloud/GeometryPrimitive.js +1 -89
  80. package/dist/esm/drawCommand/volumeCloud/ImprovedNoise.js +1 -112
  81. package/dist/esm/drawCommand/volumeCloud/VolumeClouds.js +1 -91
  82. package/dist/esm/drawer/algorithm.js +1 -314
  83. package/dist/esm/drawer/common.js +1 -965
  84. package/dist/esm/drawer/coordinate.js +1 -184
  85. package/dist/esm/drawer/index.js +1 -688
  86. package/dist/esm/drawer/plotUtil.js +1 -266
  87. package/dist/esm/drawer/shape/Assemble.js +1 -415
  88. package/dist/esm/drawer/shape/AttackArrow.js +1 -442
  89. package/dist/esm/drawer/shape/BaseShape.js +1 -383
  90. package/dist/esm/drawer/shape/Bow.js +1 -375
  91. package/dist/esm/drawer/shape/Circle.js +1 -461
  92. package/dist/esm/drawer/shape/Curve.js +1 -386
  93. package/dist/esm/drawer/shape/DragPoint.js +1 -211
  94. package/dist/esm/drawer/shape/Elliptic.js +1 -491
  95. package/dist/esm/drawer/shape/Formation.js +1 -395
  96. package/dist/esm/drawer/shape/PincerArrow.js +1 -445
  97. package/dist/esm/drawer/shape/Point.js +1 -131
  98. package/dist/esm/drawer/shape/Polygon.js +1 -368
  99. package/dist/esm/drawer/shape/Polyline.js +1 -325
  100. package/dist/esm/drawer/shape/RegularPolygon.js +1 -468
  101. package/dist/esm/drawer/shape/RightAngleArrow.js +1 -423
  102. package/dist/esm/drawer/shape/Sector.js +1 -568
  103. package/dist/esm/drawer/shape/StraightArrow.js +1 -422
  104. package/dist/esm/drawer/shape/SwallowtailArrow.js +1 -438
  105. package/dist/esm/drawer/types.js +1 -11
  106. package/dist/esm/drawer/utils.js +1 -381
  107. package/dist/esm/global.css +22 -1
  108. package/dist/esm/graphicLayer/BaseEntity.js +1 -51
  109. package/dist/esm/graphicLayer/BaseLayer.js +1 -730
  110. package/dist/esm/graphicLayer/BasePointPrimitive.js +1 -45
  111. package/dist/esm/graphicLayer/BasePrimitive.js +1 -36
  112. package/dist/esm/graphicLayer/BasePrimitiveInstance.js +1 -37
  113. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  114. package/dist/esm/graphicLayer/BaseSource.js +1 -630
  115. package/dist/esm/graphicLayer/BillboardEntity.js +1 -106
  116. package/dist/esm/graphicLayer/BillboardPrimitive.js +1 -119
  117. package/dist/esm/graphicLayer/BoxEntity.js +1 -99
  118. package/dist/esm/graphicLayer/BoxPrimitive.js +1 -48
  119. package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +1 -91
  120. package/dist/esm/graphicLayer/EllipseEntity.js +1 -110
  121. package/dist/esm/graphicLayer/EllipsePrimitive.js +1 -47
  122. package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +1 -98
  123. package/dist/esm/graphicLayer/EllipsoidEntity.js +1 -118
  124. package/dist/esm/graphicLayer/EllipsoidPrimitive.js +1 -48
  125. package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +1 -113
  126. package/dist/esm/graphicLayer/GraphicLayerCollection.js +1 -491
  127. package/dist/esm/graphicLayer/HtmlEntity.d.ts +4 -0
  128. package/dist/esm/graphicLayer/HtmlEntity.js +1 -189
  129. package/dist/esm/graphicLayer/LabelEntity.js +1 -110
  130. package/dist/esm/graphicLayer/LabelPrimitive.js +1 -127
  131. package/dist/esm/graphicLayer/ModelEntity.js +1 -122
  132. package/dist/esm/graphicLayer/ModelPrimitive.js +1 -59
  133. package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +1 -86
  134. package/dist/esm/graphicLayer/PointEntity.js +1 -94
  135. package/dist/esm/graphicLayer/PointPrimitive.js +1 -107
  136. package/dist/esm/graphicLayer/PolygonEntity.js +1 -103
  137. package/dist/esm/graphicLayer/PolygonGroundPrimitive.js +1 -49
  138. package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +1 -87
  139. package/dist/esm/graphicLayer/PolygonPrimitive.js +1 -60
  140. package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +1 -84
  141. package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +1 -101
  142. package/dist/esm/graphicLayer/PolylineEntity.js +1 -96
  143. package/dist/esm/graphicLayer/PolylineGroundPrimitive.js +1 -55
  144. package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +1 -85
  145. package/dist/esm/graphicLayer/PolylinePrimitive.js +1 -53
  146. package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +1 -85
  147. package/dist/esm/graphicLayer/PolylineVolumeEntity.js +1 -105
  148. package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +1 -47
  149. package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +1 -94
  150. package/dist/esm/graphicLayer/WallEntity.js +1 -96
  151. package/dist/esm/graphicLayer/WallPrimitive.js +1 -47
  152. package/dist/esm/graphicLayer/WallPrimitiveInstance.js +1 -88
  153. package/dist/esm/index.d.ts +4 -0
  154. package/dist/esm/index.js +1 -175
  155. package/dist/esm/lowAltitude/BarrierLayer.js +1 -172
  156. package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -122
  157. package/dist/esm/lowAltitude/FactorLayer.js +1 -199
  158. package/dist/esm/lowAltitude/FlightPlanning.js +1 -411
  159. package/dist/esm/lowAltitude/FlightRiskEvaluation.js +1 -543
  160. package/dist/esm/lowAltitude/GridDraw.js +1 -137
  161. package/dist/esm/lowAltitude/PoiLayer.js +1 -74
  162. package/dist/esm/lowAltitude/RoutePlanning.js +1 -318
  163. package/dist/esm/lowAltitude/VisitLayer.js +1 -180
  164. package/dist/esm/map/Event.js +1 -377
  165. package/dist/esm/map/GroundSkyBox.js +1 -166
  166. package/dist/esm/map/Map.js +1 -881
  167. package/dist/esm/map/Property.js +1 -35
  168. package/dist/esm/material/AtmosphericDispersion.js +1 -569
  169. package/dist/esm/material/GlobalVolumetricCloud.js +1 -377
  170. package/dist/esm/material/VolumeCloud.js +1 -115
  171. package/dist/esm/material/WeatherEffects.js +1 -351
  172. package/dist/esm/material/entity/BaseMaterialProperty.js +1 -51
  173. package/dist/esm/material/entity/CircleWaveMaterialProperty.js +1 -101
  174. package/dist/esm/material/entity/DynamicWallMaterialProperty.js +1 -101
  175. package/dist/esm/material/entity/ImageGlowingMaterialProperty.js +1 -89
  176. package/dist/esm/material/entity/ImageMaterialProperty.js +1 -34
  177. package/dist/esm/material/entity/PolylineTrailLinkMaterialProperty.js +1 -132
  178. package/dist/esm/material/primitive/BaseMaterialAppearance.js +1 -28
  179. package/dist/esm/material/primitive/ImageGlowingMaterialAppearance.js +1 -77
  180. package/dist/esm/material/primitive/ImageMaterialAppearance.js +1 -77
  181. package/dist/esm/measure/Area.js +1 -220
  182. package/dist/esm/measure/BaseDraw.js +1 -105
  183. package/dist/esm/measure/Distance.js +1 -223
  184. package/dist/esm/measure/index.js +1 -266
  185. package/dist/esm/measure/types.js +1 -17
  186. package/dist/esm/measure/utils.js +1 -319
  187. package/dist/esm/particle/BaseParticle.js +1 -196
  188. package/dist/esm/particle/FireParticle.js +1 -65
  189. package/dist/esm/particle/FountainParticle.js +1 -80
  190. package/dist/esm/particle/SmokeParticle.js +1 -65
  191. package/dist/esm/particle/common.js +1 -23
  192. package/dist/esm/particle/index.js +1 -5
  193. package/dist/esm/property/PositionProperty.js +1 -56
  194. package/dist/esm/tileLayer/ArcGisLayer.js +1 -41
  195. package/dist/esm/tileLayer/CustomRasterClipWorkerClient.js +1 -147
  196. package/dist/esm/tileLayer/CustomRasterLayer.js +1 -1136
  197. package/dist/esm/tileLayer/ImageryLayer.js +1 -44
  198. package/dist/esm/tileLayer/MvtVectorLoad.js +1 -1549
  199. package/dist/esm/tileLayer/MvtVectorWorkerClient.js +1 -126
  200. package/dist/esm/tileLayer/RasterLayer.js +1 -23
  201. package/dist/esm/tileLayer/WmsLayer.js +1 -26
  202. package/dist/esm/tileLayer/WmtsLayer.js +1 -23
  203. package/dist/esm/tool/BuildClampedPolygonGrid.js +1 -278
  204. package/dist/esm/tool/Compass.js +1 -282
  205. package/dist/esm/tool/PrimitiveCluster.js +1 -706
  206. package/dist/esm/tool/TimerInterval.js +1 -58
  207. package/dist/esm/tool/common.js +1 -405
  208. package/dist/esm/tool/fetch.js +1 -222
  209. package/dist/esm/tool/heatmap.js +1 -631
  210. package/dist/esm/tool/utils.d.ts +1 -0
  211. package/dist/esm/tool/utils.js +1 -501
  212. package/dist/esm/toolTip/index.js +1 -79
  213. package/dist/esm/videoFusion/BaseVideo.d.ts +7 -0
  214. package/dist/esm/videoFusion/BaseVideo.js +1 -330
  215. package/dist/esm/videoFusion/VideoProject.js +1 -230
  216. package/dist/esm/videoFusion/VideoTexture.js +1 -163
  217. package/dist/esm/visualization/BaseHeatmap.js +1 -271
  218. package/dist/esm/visualization/BoundaryHighlight.d.ts +135 -0
  219. package/dist/esm/visualization/BoundaryHighlight.js +1 -0
  220. package/dist/esm/visualization/DynamicWater.js +1 -289
  221. package/dist/esm/visualization/Frustum.js +1 -248
  222. package/dist/esm/visualization/Heatmap2d.js +1 -97
  223. package/dist/esm/visualization/Heatmap3d.js +1 -281
  224. package/dist/esm/visualization/MigrationEffect.js +1 -397
  225. package/dist/esm/visualization/PointCluster.js +1 -220
  226. package/dist/esm/visualization/RadarScan.js +1 -333
  227. package/dist/esm/visualization/SampledTerrainRiver.d.ts +180 -0
  228. package/dist/esm/visualization/SampledTerrainRiver.js +1 -0
  229. package/dist/esm/visualization/SampledTerrainWater.d.ts +170 -0
  230. package/dist/esm/visualization/SampledTerrainWater.js +1 -0
  231. package/dist/esm/visualization/WindField.d.ts +72 -0
  232. package/dist/esm/visualization/WindField.js +1 -0
  233. package/dist/esm/visualization/windCore.d.ts +161 -0
  234. package/dist/esm/visualization/windCore.js +8 -0
  235. package/dist/umd/deeptwins-engine-3d.min.css +1 -1
  236. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  237. package/package.json +6 -4
@@ -0,0 +1,398 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.42
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
+ CylinderGeometryLibrary_default
28
+ } from "./chunk-UA5RPPP3.js";
29
+ import {
30
+ GeometryOffsetAttribute_default
31
+ } from "./chunk-VUX4BQIM.js";
32
+ import {
33
+ VertexFormat_default
34
+ } from "./chunk-EYSYQ2R6.js";
35
+ import {
36
+ IndexDatatype_default
37
+ } from "./chunk-XBJOJHWX.js";
38
+ import {
39
+ GeometryAttributes_default
40
+ } from "./chunk-MG4EVQH2.js";
41
+ import {
42
+ GeometryAttribute_default,
43
+ Geometry_default,
44
+ PrimitiveType_default
45
+ } from "./chunk-NXWEFAZJ.js";
46
+ import {
47
+ BoundingSphere_default
48
+ } from "./chunk-XUCXZZE5.js";
49
+ import {
50
+ ComponentDatatype_default
51
+ } from "./chunk-YTNCIBPQ.js";
52
+ import {
53
+ Cartesian2_default,
54
+ Cartesian3_default
55
+ } from "./chunk-ZW52HXFN.js";
56
+ import {
57
+ Math_default
58
+ } from "./chunk-HSJSUPQV.js";
59
+ import {
60
+ defaultValue_default
61
+ } from "./chunk-ATLWOZFF.js";
62
+ import {
63
+ DeveloperError_default
64
+ } from "./chunk-PN3GIZ5Q.js";
65
+ import {
66
+ defined_default
67
+ } from "./chunk-JKLMRPKK.js";
68
+
69
+ // packages/engine/Source/Core/CylinderGeometry.js
70
+ var radiusScratch = new Cartesian2_default();
71
+ var normalScratch = new Cartesian3_default();
72
+ var bitangentScratch = new Cartesian3_default();
73
+ var tangentScratch = new Cartesian3_default();
74
+ var positionScratch = new Cartesian3_default();
75
+ function CylinderGeometry(options) {
76
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
77
+ const length = options.length;
78
+ const topRadius = options.topRadius;
79
+ const bottomRadius = options.bottomRadius;
80
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
81
+ const slices = defaultValue_default(options.slices, 128);
82
+ if (!defined_default(length)) {
83
+ throw new DeveloperError_default("options.length must be defined.");
84
+ }
85
+ if (!defined_default(topRadius)) {
86
+ throw new DeveloperError_default("options.topRadius must be defined.");
87
+ }
88
+ if (!defined_default(bottomRadius)) {
89
+ throw new DeveloperError_default("options.bottomRadius must be defined.");
90
+ }
91
+ if (slices < 3) {
92
+ throw new DeveloperError_default(
93
+ "options.slices must be greater than or equal to 3."
94
+ );
95
+ }
96
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
97
+ throw new DeveloperError_default(
98
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
99
+ );
100
+ }
101
+ this._length = length;
102
+ this._topRadius = topRadius;
103
+ this._bottomRadius = bottomRadius;
104
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
105
+ this._slices = slices;
106
+ this._offsetAttribute = options.offsetAttribute;
107
+ this._workerName = "createCylinderGeometry";
108
+ }
109
+ CylinderGeometry.packedLength = VertexFormat_default.packedLength + 5;
110
+ CylinderGeometry.pack = function(value, array, startingIndex) {
111
+ if (!defined_default(value)) {
112
+ throw new DeveloperError_default("value is required");
113
+ }
114
+ if (!defined_default(array)) {
115
+ throw new DeveloperError_default("array is required");
116
+ }
117
+ startingIndex = defaultValue_default(startingIndex, 0);
118
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
119
+ startingIndex += VertexFormat_default.packedLength;
120
+ array[startingIndex++] = value._length;
121
+ array[startingIndex++] = value._topRadius;
122
+ array[startingIndex++] = value._bottomRadius;
123
+ array[startingIndex++] = value._slices;
124
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
125
+ return array;
126
+ };
127
+ var scratchVertexFormat = new VertexFormat_default();
128
+ var scratchOptions = {
129
+ vertexFormat: scratchVertexFormat,
130
+ length: void 0,
131
+ topRadius: void 0,
132
+ bottomRadius: void 0,
133
+ slices: void 0,
134
+ offsetAttribute: void 0
135
+ };
136
+ CylinderGeometry.unpack = function(array, startingIndex, result) {
137
+ if (!defined_default(array)) {
138
+ throw new DeveloperError_default("array is required");
139
+ }
140
+ startingIndex = defaultValue_default(startingIndex, 0);
141
+ const vertexFormat = VertexFormat_default.unpack(
142
+ array,
143
+ startingIndex,
144
+ scratchVertexFormat
145
+ );
146
+ startingIndex += VertexFormat_default.packedLength;
147
+ const length = array[startingIndex++];
148
+ const topRadius = array[startingIndex++];
149
+ const bottomRadius = array[startingIndex++];
150
+ const slices = array[startingIndex++];
151
+ const offsetAttribute = array[startingIndex];
152
+ if (!defined_default(result)) {
153
+ scratchOptions.length = length;
154
+ scratchOptions.topRadius = topRadius;
155
+ scratchOptions.bottomRadius = bottomRadius;
156
+ scratchOptions.slices = slices;
157
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
158
+ return new CylinderGeometry(scratchOptions);
159
+ }
160
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
161
+ result._length = length;
162
+ result._topRadius = topRadius;
163
+ result._bottomRadius = bottomRadius;
164
+ result._slices = slices;
165
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
166
+ return result;
167
+ };
168
+ CylinderGeometry.createGeometry = function(cylinderGeometry) {
169
+ let length = cylinderGeometry._length;
170
+ const topRadius = cylinderGeometry._topRadius;
171
+ const bottomRadius = cylinderGeometry._bottomRadius;
172
+ const vertexFormat = cylinderGeometry._vertexFormat;
173
+ const slices = cylinderGeometry._slices;
174
+ if (length <= 0 || topRadius < 0 || bottomRadius < 0 || topRadius === 0 && bottomRadius === 0) {
175
+ return;
176
+ }
177
+ const twoSlices = slices + slices;
178
+ const threeSlices = slices + twoSlices;
179
+ const numVertices = twoSlices + twoSlices;
180
+ const positions = CylinderGeometryLibrary_default.computePositions(
181
+ length,
182
+ topRadius,
183
+ bottomRadius,
184
+ slices,
185
+ true
186
+ );
187
+ const st = vertexFormat.st ? new Float32Array(numVertices * 2) : void 0;
188
+ const normals = vertexFormat.normal ? new Float32Array(numVertices * 3) : void 0;
189
+ const tangents = vertexFormat.tangent ? new Float32Array(numVertices * 3) : void 0;
190
+ const bitangents = vertexFormat.bitangent ? new Float32Array(numVertices * 3) : void 0;
191
+ let i;
192
+ const computeNormal = vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;
193
+ if (computeNormal) {
194
+ const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;
195
+ let normalIndex = 0;
196
+ let tangentIndex = 0;
197
+ let bitangentIndex = 0;
198
+ const theta = Math.atan2(bottomRadius - topRadius, length);
199
+ const normal = normalScratch;
200
+ normal.z = Math.sin(theta);
201
+ const normalScale = Math.cos(theta);
202
+ let tangent = tangentScratch;
203
+ let bitangent = bitangentScratch;
204
+ for (i = 0; i < slices; i++) {
205
+ const angle = i / slices * Math_default.TWO_PI;
206
+ const x = normalScale * Math.cos(angle);
207
+ const y = normalScale * Math.sin(angle);
208
+ if (computeNormal) {
209
+ normal.x = x;
210
+ normal.y = y;
211
+ if (computeTangent) {
212
+ tangent = Cartesian3_default.normalize(
213
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent),
214
+ tangent
215
+ );
216
+ }
217
+ if (vertexFormat.normal) {
218
+ normals[normalIndex++] = normal.x;
219
+ normals[normalIndex++] = normal.y;
220
+ normals[normalIndex++] = normal.z;
221
+ normals[normalIndex++] = normal.x;
222
+ normals[normalIndex++] = normal.y;
223
+ normals[normalIndex++] = normal.z;
224
+ }
225
+ if (vertexFormat.tangent) {
226
+ tangents[tangentIndex++] = tangent.x;
227
+ tangents[tangentIndex++] = tangent.y;
228
+ tangents[tangentIndex++] = tangent.z;
229
+ tangents[tangentIndex++] = tangent.x;
230
+ tangents[tangentIndex++] = tangent.y;
231
+ tangents[tangentIndex++] = tangent.z;
232
+ }
233
+ if (vertexFormat.bitangent) {
234
+ bitangent = Cartesian3_default.normalize(
235
+ Cartesian3_default.cross(normal, tangent, bitangent),
236
+ bitangent
237
+ );
238
+ bitangents[bitangentIndex++] = bitangent.x;
239
+ bitangents[bitangentIndex++] = bitangent.y;
240
+ bitangents[bitangentIndex++] = bitangent.z;
241
+ bitangents[bitangentIndex++] = bitangent.x;
242
+ bitangents[bitangentIndex++] = bitangent.y;
243
+ bitangents[bitangentIndex++] = bitangent.z;
244
+ }
245
+ }
246
+ }
247
+ for (i = 0; i < slices; i++) {
248
+ if (vertexFormat.normal) {
249
+ normals[normalIndex++] = 0;
250
+ normals[normalIndex++] = 0;
251
+ normals[normalIndex++] = -1;
252
+ }
253
+ if (vertexFormat.tangent) {
254
+ tangents[tangentIndex++] = 1;
255
+ tangents[tangentIndex++] = 0;
256
+ tangents[tangentIndex++] = 0;
257
+ }
258
+ if (vertexFormat.bitangent) {
259
+ bitangents[bitangentIndex++] = 0;
260
+ bitangents[bitangentIndex++] = -1;
261
+ bitangents[bitangentIndex++] = 0;
262
+ }
263
+ }
264
+ for (i = 0; i < slices; i++) {
265
+ if (vertexFormat.normal) {
266
+ normals[normalIndex++] = 0;
267
+ normals[normalIndex++] = 0;
268
+ normals[normalIndex++] = 1;
269
+ }
270
+ if (vertexFormat.tangent) {
271
+ tangents[tangentIndex++] = 1;
272
+ tangents[tangentIndex++] = 0;
273
+ tangents[tangentIndex++] = 0;
274
+ }
275
+ if (vertexFormat.bitangent) {
276
+ bitangents[bitangentIndex++] = 0;
277
+ bitangents[bitangentIndex++] = 1;
278
+ bitangents[bitangentIndex++] = 0;
279
+ }
280
+ }
281
+ }
282
+ const numIndices = 12 * slices - 12;
283
+ const indices = IndexDatatype_default.createTypedArray(numVertices, numIndices);
284
+ let index = 0;
285
+ let j = 0;
286
+ for (i = 0; i < slices - 1; i++) {
287
+ indices[index++] = j;
288
+ indices[index++] = j + 2;
289
+ indices[index++] = j + 3;
290
+ indices[index++] = j;
291
+ indices[index++] = j + 3;
292
+ indices[index++] = j + 1;
293
+ j += 2;
294
+ }
295
+ indices[index++] = twoSlices - 2;
296
+ indices[index++] = 0;
297
+ indices[index++] = 1;
298
+ indices[index++] = twoSlices - 2;
299
+ indices[index++] = 1;
300
+ indices[index++] = twoSlices - 1;
301
+ for (i = 1; i < slices - 1; i++) {
302
+ indices[index++] = twoSlices + i + 1;
303
+ indices[index++] = twoSlices + i;
304
+ indices[index++] = twoSlices;
305
+ }
306
+ for (i = 1; i < slices - 1; i++) {
307
+ indices[index++] = threeSlices;
308
+ indices[index++] = threeSlices + i;
309
+ indices[index++] = threeSlices + i + 1;
310
+ }
311
+ let textureCoordIndex = 0;
312
+ if (vertexFormat.st) {
313
+ const rad = Math.max(topRadius, bottomRadius);
314
+ for (i = 0; i < numVertices; i++) {
315
+ const position = Cartesian3_default.fromArray(positions, i * 3, positionScratch);
316
+ st[textureCoordIndex++] = (position.x + rad) / (2 * rad);
317
+ st[textureCoordIndex++] = (position.y + rad) / (2 * rad);
318
+ }
319
+ }
320
+ const attributes = new GeometryAttributes_default();
321
+ if (vertexFormat.position) {
322
+ attributes.position = new GeometryAttribute_default({
323
+ componentDatatype: ComponentDatatype_default.DOUBLE,
324
+ componentsPerAttribute: 3,
325
+ values: positions
326
+ });
327
+ }
328
+ if (vertexFormat.normal) {
329
+ attributes.normal = new GeometryAttribute_default({
330
+ componentDatatype: ComponentDatatype_default.FLOAT,
331
+ componentsPerAttribute: 3,
332
+ values: normals
333
+ });
334
+ }
335
+ if (vertexFormat.tangent) {
336
+ attributes.tangent = new GeometryAttribute_default({
337
+ componentDatatype: ComponentDatatype_default.FLOAT,
338
+ componentsPerAttribute: 3,
339
+ values: tangents
340
+ });
341
+ }
342
+ if (vertexFormat.bitangent) {
343
+ attributes.bitangent = new GeometryAttribute_default({
344
+ componentDatatype: ComponentDatatype_default.FLOAT,
345
+ componentsPerAttribute: 3,
346
+ values: bitangents
347
+ });
348
+ }
349
+ if (vertexFormat.st) {
350
+ attributes.st = new GeometryAttribute_default({
351
+ componentDatatype: ComponentDatatype_default.FLOAT,
352
+ componentsPerAttribute: 2,
353
+ values: st
354
+ });
355
+ }
356
+ radiusScratch.x = length * 0.5;
357
+ radiusScratch.y = Math.max(bottomRadius, topRadius);
358
+ const boundingSphere = new BoundingSphere_default(
359
+ Cartesian3_default.ZERO,
360
+ Cartesian2_default.magnitude(radiusScratch)
361
+ );
362
+ if (defined_default(cylinderGeometry._offsetAttribute)) {
363
+ length = positions.length;
364
+ const offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
365
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
366
+ attributes.applyOffset = new GeometryAttribute_default({
367
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
368
+ componentsPerAttribute: 1,
369
+ values: applyOffset
370
+ });
371
+ }
372
+ return new Geometry_default({
373
+ attributes,
374
+ indices,
375
+ primitiveType: PrimitiveType_default.TRIANGLES,
376
+ boundingSphere,
377
+ offsetAttribute: cylinderGeometry._offsetAttribute
378
+ });
379
+ };
380
+ var unitCylinderGeometry;
381
+ CylinderGeometry.getUnitCylinder = function() {
382
+ if (!defined_default(unitCylinderGeometry)) {
383
+ unitCylinderGeometry = CylinderGeometry.createGeometry(
384
+ new CylinderGeometry({
385
+ topRadius: 1,
386
+ bottomRadius: 1,
387
+ length: 1,
388
+ vertexFormat: VertexFormat_default.POSITION_ONLY
389
+ })
390
+ );
391
+ }
392
+ return unitCylinderGeometry;
393
+ };
394
+ var CylinderGeometry_default = CylinderGeometry;
395
+
396
+ export {
397
+ CylinderGeometry_default
398
+ };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.42
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
+ Math_default
28
+ } from "./chunk-HSJSUPQV.js";
29
+
30
+ // packages/engine/Source/Core/CylinderGeometryLibrary.js
31
+ var CylinderGeometryLibrary = {};
32
+ CylinderGeometryLibrary.computePositions = function(length, topRadius, bottomRadius, slices, fill) {
33
+ const topZ = length * 0.5;
34
+ const bottomZ = -topZ;
35
+ const twoSlice = slices + slices;
36
+ const size = fill ? 2 * twoSlice : twoSlice;
37
+ const positions = new Float64Array(size * 3);
38
+ let i;
39
+ let index = 0;
40
+ let tbIndex = 0;
41
+ const bottomOffset = fill ? twoSlice * 3 : 0;
42
+ const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;
43
+ for (i = 0; i < slices; i++) {
44
+ const angle = i / slices * Math_default.TWO_PI;
45
+ const x = Math.cos(angle);
46
+ const y = Math.sin(angle);
47
+ const bottomX = x * bottomRadius;
48
+ const bottomY = y * bottomRadius;
49
+ const topX = x * topRadius;
50
+ const topY = y * topRadius;
51
+ positions[tbIndex + bottomOffset] = bottomX;
52
+ positions[tbIndex + bottomOffset + 1] = bottomY;
53
+ positions[tbIndex + bottomOffset + 2] = bottomZ;
54
+ positions[tbIndex + topOffset] = topX;
55
+ positions[tbIndex + topOffset + 1] = topY;
56
+ positions[tbIndex + topOffset + 2] = topZ;
57
+ tbIndex += 3;
58
+ if (fill) {
59
+ positions[index++] = bottomX;
60
+ positions[index++] = bottomY;
61
+ positions[index++] = bottomZ;
62
+ positions[index++] = topX;
63
+ positions[index++] = topY;
64
+ positions[index++] = topZ;
65
+ }
66
+ }
67
+ return positions;
68
+ };
69
+ var CylinderGeometryLibrary_default = CylinderGeometryLibrary;
70
+
71
+ export {
72
+ CylinderGeometryLibrary_default
73
+ };