@pggis/pg-sdk 3.2.9

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 (320) hide show
  1. package/README.md +152 -0
  2. package/dist/index.cjs +43 -0
  3. package/dist/pggis.min.css +1 -0
  4. package/dist/pggis.min.js +42 -0
  5. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  6. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  7. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  8. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  9. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  10. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  11. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  12. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  13. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  14. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  15. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  16. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  17. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  18. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  19. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  20. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  21. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  22. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  23. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  24. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  25. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  26. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  27. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  28. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  29. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  30. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  31. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  32. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  33. package/dist/resources/Assets/Images/bing_maps_credit.png +0 -0
  34. package/dist/resources/Assets/Images/cesium_credit.png +0 -0
  35. package/dist/resources/Assets/Images/google_earth_credit.png +0 -0
  36. package/dist/resources/Assets/Images/ion-credit.png +0 -0
  37. package/dist/resources/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  38. package/dist/resources/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  39. package/dist/resources/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  40. package/dist/resources/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  41. package/dist/resources/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  42. package/dist/resources/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  43. package/dist/resources/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  44. package/dist/resources/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  45. package/dist/resources/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  46. package/dist/resources/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  47. package/dist/resources/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  48. package/dist/resources/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  49. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  50. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  51. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  52. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  53. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  54. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  55. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  56. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  57. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  58. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  59. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  60. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  61. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  62. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  63. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  64. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  65. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  66. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  67. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  68. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  69. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  70. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  71. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  72. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  73. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  74. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  75. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  76. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  77. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  78. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  79. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  80. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  81. package/dist/resources/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  82. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  83. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  84. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  85. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  86. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  87. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  88. package/dist/resources/Assets/Textures/maki/airfield.png +0 -0
  89. package/dist/resources/Assets/Textures/maki/airport.png +0 -0
  90. package/dist/resources/Assets/Textures/maki/alcohol-shop.png +0 -0
  91. package/dist/resources/Assets/Textures/maki/america-football.png +0 -0
  92. package/dist/resources/Assets/Textures/maki/art-gallery.png +0 -0
  93. package/dist/resources/Assets/Textures/maki/bakery.png +0 -0
  94. package/dist/resources/Assets/Textures/maki/bank.png +0 -0
  95. package/dist/resources/Assets/Textures/maki/bar.png +0 -0
  96. package/dist/resources/Assets/Textures/maki/baseball.png +0 -0
  97. package/dist/resources/Assets/Textures/maki/basketball.png +0 -0
  98. package/dist/resources/Assets/Textures/maki/beer.png +0 -0
  99. package/dist/resources/Assets/Textures/maki/bicycle.png +0 -0
  100. package/dist/resources/Assets/Textures/maki/building.png +0 -0
  101. package/dist/resources/Assets/Textures/maki/bus.png +0 -0
  102. package/dist/resources/Assets/Textures/maki/cafe.png +0 -0
  103. package/dist/resources/Assets/Textures/maki/camera.png +0 -0
  104. package/dist/resources/Assets/Textures/maki/campsite.png +0 -0
  105. package/dist/resources/Assets/Textures/maki/car.png +0 -0
  106. package/dist/resources/Assets/Textures/maki/cemetery.png +0 -0
  107. package/dist/resources/Assets/Textures/maki/cesium.png +0 -0
  108. package/dist/resources/Assets/Textures/maki/chemist.png +0 -0
  109. package/dist/resources/Assets/Textures/maki/cinema.png +0 -0
  110. package/dist/resources/Assets/Textures/maki/circle-stroked.png +0 -0
  111. package/dist/resources/Assets/Textures/maki/circle.png +0 -0
  112. package/dist/resources/Assets/Textures/maki/city.png +0 -0
  113. package/dist/resources/Assets/Textures/maki/clothing-store.png +0 -0
  114. package/dist/resources/Assets/Textures/maki/college.png +0 -0
  115. package/dist/resources/Assets/Textures/maki/commercial.png +0 -0
  116. package/dist/resources/Assets/Textures/maki/cricket.png +0 -0
  117. package/dist/resources/Assets/Textures/maki/cross.png +0 -0
  118. package/dist/resources/Assets/Textures/maki/dam.png +0 -0
  119. package/dist/resources/Assets/Textures/maki/danger.png +0 -0
  120. package/dist/resources/Assets/Textures/maki/disability.png +0 -0
  121. package/dist/resources/Assets/Textures/maki/dog-park.png +0 -0
  122. package/dist/resources/Assets/Textures/maki/embassy.png +0 -0
  123. package/dist/resources/Assets/Textures/maki/emergency-telephone.png +0 -0
  124. package/dist/resources/Assets/Textures/maki/entrance.png +0 -0
  125. package/dist/resources/Assets/Textures/maki/farm.png +0 -0
  126. package/dist/resources/Assets/Textures/maki/fast-food.png +0 -0
  127. package/dist/resources/Assets/Textures/maki/ferry.png +0 -0
  128. package/dist/resources/Assets/Textures/maki/fire-station.png +0 -0
  129. package/dist/resources/Assets/Textures/maki/fuel.png +0 -0
  130. package/dist/resources/Assets/Textures/maki/garden.png +0 -0
  131. package/dist/resources/Assets/Textures/maki/gift.png +0 -0
  132. package/dist/resources/Assets/Textures/maki/golf.png +0 -0
  133. package/dist/resources/Assets/Textures/maki/grocery.png +0 -0
  134. package/dist/resources/Assets/Textures/maki/hairdresser.png +0 -0
  135. package/dist/resources/Assets/Textures/maki/harbor.png +0 -0
  136. package/dist/resources/Assets/Textures/maki/heart.png +0 -0
  137. package/dist/resources/Assets/Textures/maki/heliport.png +0 -0
  138. package/dist/resources/Assets/Textures/maki/hospital.png +0 -0
  139. package/dist/resources/Assets/Textures/maki/ice-cream.png +0 -0
  140. package/dist/resources/Assets/Textures/maki/industrial.png +0 -0
  141. package/dist/resources/Assets/Textures/maki/land-use.png +0 -0
  142. package/dist/resources/Assets/Textures/maki/laundry.png +0 -0
  143. package/dist/resources/Assets/Textures/maki/library.png +0 -0
  144. package/dist/resources/Assets/Textures/maki/lighthouse.png +0 -0
  145. package/dist/resources/Assets/Textures/maki/lodging.png +0 -0
  146. package/dist/resources/Assets/Textures/maki/logging.png +0 -0
  147. package/dist/resources/Assets/Textures/maki/london-underground.png +0 -0
  148. package/dist/resources/Assets/Textures/maki/marker-stroked.png +0 -0
  149. package/dist/resources/Assets/Textures/maki/marker.png +0 -0
  150. package/dist/resources/Assets/Textures/maki/minefield.png +0 -0
  151. package/dist/resources/Assets/Textures/maki/mobilephone.png +0 -0
  152. package/dist/resources/Assets/Textures/maki/monument.png +0 -0
  153. package/dist/resources/Assets/Textures/maki/museum.png +0 -0
  154. package/dist/resources/Assets/Textures/maki/music.png +0 -0
  155. package/dist/resources/Assets/Textures/maki/oil-well.png +0 -0
  156. package/dist/resources/Assets/Textures/maki/park.png +0 -0
  157. package/dist/resources/Assets/Textures/maki/park2.png +0 -0
  158. package/dist/resources/Assets/Textures/maki/parking-garage.png +0 -0
  159. package/dist/resources/Assets/Textures/maki/parking.png +0 -0
  160. package/dist/resources/Assets/Textures/maki/pharmacy.png +0 -0
  161. package/dist/resources/Assets/Textures/maki/pitch.png +0 -0
  162. package/dist/resources/Assets/Textures/maki/place-of-worship.png +0 -0
  163. package/dist/resources/Assets/Textures/maki/playground.png +0 -0
  164. package/dist/resources/Assets/Textures/maki/police.png +0 -0
  165. package/dist/resources/Assets/Textures/maki/polling-place.png +0 -0
  166. package/dist/resources/Assets/Textures/maki/post.png +0 -0
  167. package/dist/resources/Assets/Textures/maki/prison.png +0 -0
  168. package/dist/resources/Assets/Textures/maki/rail-above.png +0 -0
  169. package/dist/resources/Assets/Textures/maki/rail-light.png +0 -0
  170. package/dist/resources/Assets/Textures/maki/rail-metro.png +0 -0
  171. package/dist/resources/Assets/Textures/maki/rail-underground.png +0 -0
  172. package/dist/resources/Assets/Textures/maki/rail.png +0 -0
  173. package/dist/resources/Assets/Textures/maki/religious-christian.png +0 -0
  174. package/dist/resources/Assets/Textures/maki/religious-jewish.png +0 -0
  175. package/dist/resources/Assets/Textures/maki/religious-muslim.png +0 -0
  176. package/dist/resources/Assets/Textures/maki/restaurant.png +0 -0
  177. package/dist/resources/Assets/Textures/maki/roadblock.png +0 -0
  178. package/dist/resources/Assets/Textures/maki/rocket.png +0 -0
  179. package/dist/resources/Assets/Textures/maki/school.png +0 -0
  180. package/dist/resources/Assets/Textures/maki/scooter.png +0 -0
  181. package/dist/resources/Assets/Textures/maki/shop.png +0 -0
  182. package/dist/resources/Assets/Textures/maki/skiing.png +0 -0
  183. package/dist/resources/Assets/Textures/maki/slaughterhouse.png +0 -0
  184. package/dist/resources/Assets/Textures/maki/soccer.png +0 -0
  185. package/dist/resources/Assets/Textures/maki/square-stroked.png +0 -0
  186. package/dist/resources/Assets/Textures/maki/square.png +0 -0
  187. package/dist/resources/Assets/Textures/maki/star-stroked.png +0 -0
  188. package/dist/resources/Assets/Textures/maki/star.png +0 -0
  189. package/dist/resources/Assets/Textures/maki/suitcase.png +0 -0
  190. package/dist/resources/Assets/Textures/maki/swimming.png +0 -0
  191. package/dist/resources/Assets/Textures/maki/telephone.png +0 -0
  192. package/dist/resources/Assets/Textures/maki/tennis.png +0 -0
  193. package/dist/resources/Assets/Textures/maki/theatre.png +0 -0
  194. package/dist/resources/Assets/Textures/maki/toilets.png +0 -0
  195. package/dist/resources/Assets/Textures/maki/town-hall.png +0 -0
  196. package/dist/resources/Assets/Textures/maki/town.png +0 -0
  197. package/dist/resources/Assets/Textures/maki/triangle-stroked.png +0 -0
  198. package/dist/resources/Assets/Textures/maki/triangle.png +0 -0
  199. package/dist/resources/Assets/Textures/maki/village.png +0 -0
  200. package/dist/resources/Assets/Textures/maki/warehouse.png +0 -0
  201. package/dist/resources/Assets/Textures/maki/waste-basket.png +0 -0
  202. package/dist/resources/Assets/Textures/maki/water.png +0 -0
  203. package/dist/resources/Assets/Textures/maki/wetland.png +0 -0
  204. package/dist/resources/Assets/Textures/maki/zoo.png +0 -0
  205. package/dist/resources/Assets/Textures/moonSmall.jpg +0 -0
  206. package/dist/resources/Assets/Textures/pin.svg +1 -0
  207. package/dist/resources/Assets/Textures/waterNormals.jpg +0 -0
  208. package/dist/resources/Assets/Textures/waterNormalsSmall.jpg +0 -0
  209. package/dist/resources/Assets/approximateTerrainHeights.json +1 -0
  210. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +21 -0
  211. package/dist/resources/ThirdParty/Workers/package.json +1 -0
  212. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +2 -0
  213. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +2 -0
  214. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -0
  215. package/dist/resources/ThirdParty/basis_transcoder.wasm +0 -0
  216. package/dist/resources/ThirdParty/draco_decoder.wasm +0 -0
  217. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  218. package/dist/resources/Workers/chunk-3PW6ZBN4.js +2977 -0
  219. package/dist/resources/Workers/chunk-434ZTTFX.js +73 -0
  220. package/dist/resources/Workers/chunk-4KP73B43.js +73 -0
  221. package/dist/resources/Workers/chunk-52VSIKEA.js +2716 -0
  222. package/dist/resources/Workers/chunk-5GDBZTHX.js +1075 -0
  223. package/dist/resources/Workers/chunk-5HLGKKG3.js +163 -0
  224. package/dist/resources/Workers/chunk-5IRLXUTA.js +1258 -0
  225. package/dist/resources/Workers/chunk-5SK36PU4.js +430 -0
  226. package/dist/resources/Workers/chunk-ARPTYYKS.js +258 -0
  227. package/dist/resources/Workers/chunk-ATB2I7OS.js +55 -0
  228. package/dist/resources/Workers/chunk-AXFRNOVC.js +368 -0
  229. package/dist/resources/Workers/chunk-BP467WX3.js +501 -0
  230. package/dist/resources/Workers/chunk-BUZDZBUH.js +1007 -0
  231. package/dist/resources/Workers/chunk-CDGHUKQ4.js +1477 -0
  232. package/dist/resources/Workers/chunk-CSIZ3BGT.js +398 -0
  233. package/dist/resources/Workers/chunk-CWJQGBWT.js +39 -0
  234. package/dist/resources/Workers/chunk-DMCSY5BU.js +100 -0
  235. package/dist/resources/Workers/chunk-DR5XZ6K5.js +390 -0
  236. package/dist/resources/Workers/chunk-FWGNCYP6.js +476 -0
  237. package/dist/resources/Workers/chunk-GF5TNNKP.js +353 -0
  238. package/dist/resources/Workers/chunk-GVL5I7TC.js +1052 -0
  239. package/dist/resources/Workers/chunk-H5DUXHCV.js +421 -0
  240. package/dist/resources/Workers/chunk-HFKSAB5K.js +511 -0
  241. package/dist/resources/Workers/chunk-HOT2SNXP.js +8639 -0
  242. package/dist/resources/Workers/chunk-HPH5HSFE.js +1860 -0
  243. package/dist/resources/Workers/chunk-HPP4JLNH.js +218 -0
  244. package/dist/resources/Workers/chunk-HUPNRBWW.js +196 -0
  245. package/dist/resources/Workers/chunk-JGG36SQV.js +102 -0
  246. package/dist/resources/Workers/chunk-LGJUI2CE.js +2361 -0
  247. package/dist/resources/Workers/chunk-LGL4P5KL.js +171 -0
  248. package/dist/resources/Workers/chunk-LX6XV4DK.js +138 -0
  249. package/dist/resources/Workers/chunk-MN34FIF5.js +37 -0
  250. package/dist/resources/Workers/chunk-MW3CJYLX.js +101 -0
  251. package/dist/resources/Workers/chunk-NE4JNU6H.js +767 -0
  252. package/dist/resources/Workers/chunk-O43GWBSF.js +55 -0
  253. package/dist/resources/Workers/chunk-PIXK6KHB.js +44 -0
  254. package/dist/resources/Workers/chunk-PZ2WJWUG.js +634 -0
  255. package/dist/resources/Workers/chunk-QRBRVGZC.js +305 -0
  256. package/dist/resources/Workers/chunk-QTZQZY2C.js +669 -0
  257. package/dist/resources/Workers/chunk-R3HUGXBH.js +302 -0
  258. package/dist/resources/Workers/chunk-R4OZKBXH.js +456 -0
  259. package/dist/resources/Workers/chunk-RH4N2ONY.js +236 -0
  260. package/dist/resources/Workers/chunk-RIDPF7PO.js +58 -0
  261. package/dist/resources/Workers/chunk-SNN7WOC2.js +781 -0
  262. package/dist/resources/Workers/chunk-SQVTYRZY.js +122 -0
  263. package/dist/resources/Workers/chunk-SV7DDPAC.js +629 -0
  264. package/dist/resources/Workers/chunk-TIXXVKUY.js +834 -0
  265. package/dist/resources/Workers/chunk-TMPVBFJQ.js +289 -0
  266. package/dist/resources/Workers/chunk-XUTVA4K5.js +684 -0
  267. package/dist/resources/Workers/chunk-Y4OJ4B23.js +59 -0
  268. package/dist/resources/Workers/chunk-YBKFS53K.js +77 -0
  269. package/dist/resources/Workers/chunk-Z2SIPUKB.js +117 -0
  270. package/dist/resources/Workers/chunk-Z4JUBRHP.js +157 -0
  271. package/dist/resources/Workers/chunk-ZQRZBHYI.js +138 -0
  272. package/dist/resources/Workers/combineGeometry.js +67 -0
  273. package/dist/resources/Workers/createBoxGeometry.js +57 -0
  274. package/dist/resources/Workers/createBoxOutlineGeometry.js +234 -0
  275. package/dist/resources/Workers/createCircleGeometry.js +196 -0
  276. package/dist/resources/Workers/createCircleOutlineGeometry.js +146 -0
  277. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +505 -0
  278. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +224 -0
  279. package/dist/resources/Workers/createCorridorGeometry.js +1263 -0
  280. package/dist/resources/Workers/createCorridorOutlineGeometry.js +568 -0
  281. package/dist/resources/Workers/createCylinderGeometry.js +59 -0
  282. package/dist/resources/Workers/createCylinderOutlineGeometry.js +230 -0
  283. package/dist/resources/Workers/createEllipseGeometry.js +70 -0
  284. package/dist/resources/Workers/createEllipseOutlineGeometry.js +63 -0
  285. package/dist/resources/Workers/createEllipsoidGeometry.js +58 -0
  286. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +60 -0
  287. package/dist/resources/Workers/createFrustumGeometry.js +57 -0
  288. package/dist/resources/Workers/createFrustumOutlineGeometry.js +234 -0
  289. package/dist/resources/Workers/createGeometry.js +150 -0
  290. package/dist/resources/Workers/createGroundPolylineGeometry.js +1607 -0
  291. package/dist/resources/Workers/createPlaneGeometry.js +223 -0
  292. package/dist/resources/Workers/createPlaneOutlineGeometry.js +123 -0
  293. package/dist/resources/Workers/createPolygonGeometry.js +1545 -0
  294. package/dist/resources/Workers/createPolygonOutlineGeometry.js +542 -0
  295. package/dist/resources/Workers/createPolylineGeometry.js +495 -0
  296. package/dist/resources/Workers/createPolylineVolumeGeometry.js +380 -0
  297. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +277 -0
  298. package/dist/resources/Workers/createRectangleGeometry.js +1273 -0
  299. package/dist/resources/Workers/createRectangleOutlineGeometry.js +478 -0
  300. package/dist/resources/Workers/createSimplePolylineGeometry.js +399 -0
  301. package/dist/resources/Workers/createSphereGeometry.js +117 -0
  302. package/dist/resources/Workers/createSphereOutlineGeometry.js +117 -0
  303. package/dist/resources/Workers/createTaskProcessorWorker.js +32 -0
  304. package/dist/resources/Workers/createVectorTileClampedPolylines.js +492 -0
  305. package/dist/resources/Workers/createVectorTileGeometries.js +386 -0
  306. package/dist/resources/Workers/createVectorTilePoints.js +112 -0
  307. package/dist/resources/Workers/createVectorTilePolygons.js +384 -0
  308. package/dist/resources/Workers/createVectorTilePolylines.js +262 -0
  309. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -0
  310. package/dist/resources/Workers/createVerticesFromHeightmap.js +2277 -0
  311. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -0
  312. package/dist/resources/Workers/createWallGeometry.js +489 -0
  313. package/dist/resources/Workers/createWallOutlineGeometry.js +337 -0
  314. package/dist/resources/Workers/decodeDraco.js +369 -0
  315. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -0
  316. package/dist/resources/Workers/decodeI3S.js +835 -0
  317. package/dist/resources/Workers/transcodeKTX2.js +3425 -0
  318. package/dist/resources/Workers/transferTypedArrayTest.js +41 -0
  319. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +818 -0
  320. package/package.json +81 -0
@@ -0,0 +1,1263 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.113
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-FWGNCYP6.js";
29
+ import {
30
+ CornerType_default
31
+ } from "./chunk-QTZQZY2C.js";
32
+ import "./chunk-ATB2I7OS.js";
33
+ import "./chunk-H5DUXHCV.js";
34
+ import "./chunk-GF5TNNKP.js";
35
+ import {
36
+ GeometryOffsetAttribute_default
37
+ } from "./chunk-MN34FIF5.js";
38
+ import {
39
+ VertexFormat_default
40
+ } from "./chunk-ZQRZBHYI.js";
41
+ import "./chunk-TMPVBFJQ.js";
42
+ import "./chunk-Z4JUBRHP.js";
43
+ import {
44
+ PolygonPipeline_default
45
+ } from "./chunk-BUZDZBUH.js";
46
+ import {
47
+ arrayRemoveDuplicates_default
48
+ } from "./chunk-DMCSY5BU.js";
49
+ import "./chunk-R4OZKBXH.js";
50
+ import "./chunk-5IRLXUTA.js";
51
+ import "./chunk-LGL4P5KL.js";
52
+ import {
53
+ IndexDatatype_default
54
+ } from "./chunk-LX6XV4DK.js";
55
+ import {
56
+ GeometryAttributes_default
57
+ } from "./chunk-PIXK6KHB.js";
58
+ import {
59
+ GeometryAttribute_default,
60
+ Geometry_default,
61
+ PrimitiveType_default
62
+ } from "./chunk-R3HUGXBH.js";
63
+ import {
64
+ BoundingSphere_default
65
+ } from "./chunk-HOT2SNXP.js";
66
+ import "./chunk-4KP73B43.js";
67
+ import {
68
+ Rectangle_default
69
+ } from "./chunk-3PW6ZBN4.js";
70
+ import {
71
+ ComponentDatatype_default
72
+ } from "./chunk-ARPTYYKS.js";
73
+ import {
74
+ Cartesian3_default,
75
+ Cartographic_default,
76
+ Ellipsoid_default
77
+ } from "./chunk-LGJUI2CE.js";
78
+ import {
79
+ Math_default
80
+ } from "./chunk-BP467WX3.js";
81
+ import "./chunk-SV7DDPAC.js";
82
+ import "./chunk-RIDPF7PO.js";
83
+ import {
84
+ defaultValue_default
85
+ } from "./chunk-CWJQGBWT.js";
86
+ import {
87
+ Check_default
88
+ } from "./chunk-5HLGKKG3.js";
89
+ import {
90
+ defined_default
91
+ } from "./chunk-YBKFS53K.js";
92
+
93
+ // packages/engine/Source/Core/CorridorGeometry.js
94
+ var cartesian1 = new Cartesian3_default();
95
+ var cartesian2 = new Cartesian3_default();
96
+ var cartesian3 = new Cartesian3_default();
97
+ var cartesian4 = new Cartesian3_default();
98
+ var cartesian5 = new Cartesian3_default();
99
+ var cartesian6 = new Cartesian3_default();
100
+ var scratch1 = new Cartesian3_default();
101
+ var scratch2 = new Cartesian3_default();
102
+ function scaleToSurface(positions, ellipsoid) {
103
+ for (let i = 0; i < positions.length; i++) {
104
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
105
+ }
106
+ return positions;
107
+ }
108
+ function addNormals(attr, normal, left, front, back, vertexFormat) {
109
+ const normals = attr.normals;
110
+ const tangents = attr.tangents;
111
+ const bitangents = attr.bitangents;
112
+ const forward = Cartesian3_default.normalize(
113
+ Cartesian3_default.cross(left, normal, scratch1),
114
+ scratch1
115
+ );
116
+ if (vertexFormat.normal) {
117
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, front, back);
118
+ }
119
+ if (vertexFormat.tangent) {
120
+ CorridorGeometryLibrary_default.addAttribute(tangents, forward, front, back);
121
+ }
122
+ if (vertexFormat.bitangent) {
123
+ CorridorGeometryLibrary_default.addAttribute(bitangents, left, front, back);
124
+ }
125
+ }
126
+ function combine(computedPositions, vertexFormat, ellipsoid) {
127
+ const positions = computedPositions.positions;
128
+ const corners = computedPositions.corners;
129
+ const endPositions = computedPositions.endPositions;
130
+ const computedLefts = computedPositions.lefts;
131
+ const computedNormals = computedPositions.normals;
132
+ const attributes = new GeometryAttributes_default();
133
+ let corner;
134
+ let leftCount = 0;
135
+ let rightCount = 0;
136
+ let i;
137
+ let indicesLength = 0;
138
+ let length;
139
+ for (i = 0; i < positions.length; i += 2) {
140
+ length = positions[i].length - 3;
141
+ leftCount += length;
142
+ indicesLength += length * 2;
143
+ rightCount += positions[i + 1].length - 3;
144
+ }
145
+ leftCount += 3;
146
+ rightCount += 3;
147
+ for (i = 0; i < corners.length; i++) {
148
+ corner = corners[i];
149
+ const leftSide = corners[i].leftPositions;
150
+ if (defined_default(leftSide)) {
151
+ length = leftSide.length;
152
+ leftCount += length;
153
+ indicesLength += length;
154
+ } else {
155
+ length = corners[i].rightPositions.length;
156
+ rightCount += length;
157
+ indicesLength += length;
158
+ }
159
+ }
160
+ const addEndPositions = defined_default(endPositions);
161
+ let endPositionLength;
162
+ if (addEndPositions) {
163
+ endPositionLength = endPositions[0].length - 3;
164
+ leftCount += endPositionLength;
165
+ rightCount += endPositionLength;
166
+ endPositionLength /= 3;
167
+ indicesLength += endPositionLength * 6;
168
+ }
169
+ const size = leftCount + rightCount;
170
+ const finalPositions = new Float64Array(size);
171
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
172
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
173
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
174
+ const attr = {
175
+ normals,
176
+ tangents,
177
+ bitangents
178
+ };
179
+ let front = 0;
180
+ let back = size - 1;
181
+ let UL, LL, UR, LR;
182
+ let normal = cartesian1;
183
+ let left = cartesian2;
184
+ let rightPos, leftPos;
185
+ const halfLength = endPositionLength / 2;
186
+ const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength);
187
+ let index = 0;
188
+ if (addEndPositions) {
189
+ leftPos = cartesian3;
190
+ rightPos = cartesian4;
191
+ const firstEndPositions = endPositions[0];
192
+ normal = Cartesian3_default.fromArray(computedNormals, 0, normal);
193
+ left = Cartesian3_default.fromArray(computedLefts, 0, left);
194
+ for (i = 0; i < halfLength; i++) {
195
+ leftPos = Cartesian3_default.fromArray(
196
+ firstEndPositions,
197
+ (halfLength - 1 - i) * 3,
198
+ leftPos
199
+ );
200
+ rightPos = Cartesian3_default.fromArray(
201
+ firstEndPositions,
202
+ (halfLength + i) * 3,
203
+ rightPos
204
+ );
205
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
206
+ CorridorGeometryLibrary_default.addAttribute(
207
+ finalPositions,
208
+ leftPos,
209
+ void 0,
210
+ back
211
+ );
212
+ addNormals(attr, normal, left, front, back, vertexFormat);
213
+ LL = front / 3;
214
+ LR = LL + 1;
215
+ UL = (back - 2) / 3;
216
+ UR = UL - 1;
217
+ indices[index++] = UL;
218
+ indices[index++] = LL;
219
+ indices[index++] = UR;
220
+ indices[index++] = UR;
221
+ indices[index++] = LL;
222
+ indices[index++] = LR;
223
+ front += 3;
224
+ back -= 3;
225
+ }
226
+ }
227
+ let posIndex = 0;
228
+ let compIndex = 0;
229
+ let rightEdge = positions[posIndex++];
230
+ let leftEdge = positions[posIndex++];
231
+ finalPositions.set(rightEdge, front);
232
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
233
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
234
+ let rightNormal;
235
+ let leftNormal;
236
+ length = leftEdge.length - 3;
237
+ for (i = 0; i < length; i += 3) {
238
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
239
+ Cartesian3_default.fromArray(rightEdge, i, scratch1),
240
+ scratch1
241
+ );
242
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
243
+ Cartesian3_default.fromArray(leftEdge, length - i, scratch2),
244
+ scratch2
245
+ );
246
+ normal = Cartesian3_default.normalize(
247
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
248
+ normal
249
+ );
250
+ addNormals(attr, normal, left, front, back, vertexFormat);
251
+ LL = front / 3;
252
+ LR = LL + 1;
253
+ UL = (back - 2) / 3;
254
+ UR = UL - 1;
255
+ indices[index++] = UL;
256
+ indices[index++] = LL;
257
+ indices[index++] = UR;
258
+ indices[index++] = UR;
259
+ indices[index++] = LL;
260
+ indices[index++] = LR;
261
+ front += 3;
262
+ back -= 3;
263
+ }
264
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
265
+ Cartesian3_default.fromArray(rightEdge, length, scratch1),
266
+ scratch1
267
+ );
268
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
269
+ Cartesian3_default.fromArray(leftEdge, length, scratch2),
270
+ scratch2
271
+ );
272
+ normal = Cartesian3_default.normalize(
273
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
274
+ normal
275
+ );
276
+ compIndex += 3;
277
+ for (i = 0; i < corners.length; i++) {
278
+ let j;
279
+ corner = corners[i];
280
+ const l = corner.leftPositions;
281
+ const r = corner.rightPositions;
282
+ let pivot;
283
+ let start;
284
+ let outsidePoint = cartesian6;
285
+ let previousPoint = cartesian3;
286
+ let nextPoint = cartesian4;
287
+ normal = Cartesian3_default.fromArray(computedNormals, compIndex, normal);
288
+ if (defined_default(l)) {
289
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
290
+ back -= 3;
291
+ pivot = LR;
292
+ start = UR;
293
+ for (j = 0; j < l.length / 3; j++) {
294
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
295
+ indices[index++] = pivot;
296
+ indices[index++] = start - j - 1;
297
+ indices[index++] = start - j;
298
+ CorridorGeometryLibrary_default.addAttribute(
299
+ finalPositions,
300
+ outsidePoint,
301
+ void 0,
302
+ back
303
+ );
304
+ previousPoint = Cartesian3_default.fromArray(
305
+ finalPositions,
306
+ (start - j - 1) * 3,
307
+ previousPoint
308
+ );
309
+ nextPoint = Cartesian3_default.fromArray(finalPositions, pivot * 3, nextPoint);
310
+ left = Cartesian3_default.normalize(
311
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
312
+ left
313
+ );
314
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
315
+ back -= 3;
316
+ }
317
+ outsidePoint = Cartesian3_default.fromArray(
318
+ finalPositions,
319
+ pivot * 3,
320
+ outsidePoint
321
+ );
322
+ previousPoint = Cartesian3_default.subtract(
323
+ Cartesian3_default.fromArray(finalPositions, start * 3, previousPoint),
324
+ outsidePoint,
325
+ previousPoint
326
+ );
327
+ nextPoint = Cartesian3_default.subtract(
328
+ Cartesian3_default.fromArray(finalPositions, (start - j) * 3, nextPoint),
329
+ outsidePoint,
330
+ nextPoint
331
+ );
332
+ left = Cartesian3_default.normalize(
333
+ Cartesian3_default.add(previousPoint, nextPoint, left),
334
+ left
335
+ );
336
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
337
+ front += 3;
338
+ } else {
339
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
340
+ front += 3;
341
+ pivot = UR;
342
+ start = LR;
343
+ for (j = 0; j < r.length / 3; j++) {
344
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
345
+ indices[index++] = pivot;
346
+ indices[index++] = start + j;
347
+ indices[index++] = start + j + 1;
348
+ CorridorGeometryLibrary_default.addAttribute(
349
+ finalPositions,
350
+ outsidePoint,
351
+ front
352
+ );
353
+ previousPoint = Cartesian3_default.fromArray(
354
+ finalPositions,
355
+ pivot * 3,
356
+ previousPoint
357
+ );
358
+ nextPoint = Cartesian3_default.fromArray(
359
+ finalPositions,
360
+ (start + j) * 3,
361
+ nextPoint
362
+ );
363
+ left = Cartesian3_default.normalize(
364
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
365
+ left
366
+ );
367
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
368
+ front += 3;
369
+ }
370
+ outsidePoint = Cartesian3_default.fromArray(
371
+ finalPositions,
372
+ pivot * 3,
373
+ outsidePoint
374
+ );
375
+ previousPoint = Cartesian3_default.subtract(
376
+ Cartesian3_default.fromArray(finalPositions, (start + j) * 3, previousPoint),
377
+ outsidePoint,
378
+ previousPoint
379
+ );
380
+ nextPoint = Cartesian3_default.subtract(
381
+ Cartesian3_default.fromArray(finalPositions, start * 3, nextPoint),
382
+ outsidePoint,
383
+ nextPoint
384
+ );
385
+ left = Cartesian3_default.normalize(
386
+ Cartesian3_default.negate(Cartesian3_default.add(nextPoint, previousPoint, left), left),
387
+ left
388
+ );
389
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
390
+ back -= 3;
391
+ }
392
+ rightEdge = positions[posIndex++];
393
+ leftEdge = positions[posIndex++];
394
+ rightEdge.splice(0, 3);
395
+ leftEdge.splice(leftEdge.length - 3, 3);
396
+ finalPositions.set(rightEdge, front);
397
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
398
+ length = leftEdge.length - 3;
399
+ compIndex += 3;
400
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
401
+ for (j = 0; j < leftEdge.length; j += 3) {
402
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
403
+ Cartesian3_default.fromArray(rightEdge, j, scratch1),
404
+ scratch1
405
+ );
406
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
407
+ Cartesian3_default.fromArray(leftEdge, length - j, scratch2),
408
+ scratch2
409
+ );
410
+ normal = Cartesian3_default.normalize(
411
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
412
+ normal
413
+ );
414
+ addNormals(attr, normal, left, front, back, vertexFormat);
415
+ LR = front / 3;
416
+ LL = LR - 1;
417
+ UR = (back - 2) / 3;
418
+ UL = UR + 1;
419
+ indices[index++] = UL;
420
+ indices[index++] = LL;
421
+ indices[index++] = UR;
422
+ indices[index++] = UR;
423
+ indices[index++] = LL;
424
+ indices[index++] = LR;
425
+ front += 3;
426
+ back -= 3;
427
+ }
428
+ front -= 3;
429
+ back += 3;
430
+ }
431
+ normal = Cartesian3_default.fromArray(
432
+ computedNormals,
433
+ computedNormals.length - 3,
434
+ normal
435
+ );
436
+ addNormals(attr, normal, left, front, back, vertexFormat);
437
+ if (addEndPositions) {
438
+ front += 3;
439
+ back -= 3;
440
+ leftPos = cartesian3;
441
+ rightPos = cartesian4;
442
+ const lastEndPositions = endPositions[1];
443
+ for (i = 0; i < halfLength; i++) {
444
+ leftPos = Cartesian3_default.fromArray(
445
+ lastEndPositions,
446
+ (endPositionLength - i - 1) * 3,
447
+ leftPos
448
+ );
449
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
450
+ CorridorGeometryLibrary_default.addAttribute(
451
+ finalPositions,
452
+ leftPos,
453
+ void 0,
454
+ back
455
+ );
456
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
457
+ addNormals(attr, normal, left, front, back, vertexFormat);
458
+ LR = front / 3;
459
+ LL = LR - 1;
460
+ UR = (back - 2) / 3;
461
+ UL = UR + 1;
462
+ indices[index++] = UL;
463
+ indices[index++] = LL;
464
+ indices[index++] = UR;
465
+ indices[index++] = UR;
466
+ indices[index++] = LL;
467
+ indices[index++] = LR;
468
+ front += 3;
469
+ back -= 3;
470
+ }
471
+ }
472
+ attributes.position = new GeometryAttribute_default({
473
+ componentDatatype: ComponentDatatype_default.DOUBLE,
474
+ componentsPerAttribute: 3,
475
+ values: finalPositions
476
+ });
477
+ if (vertexFormat.st) {
478
+ const st = new Float32Array(size / 3 * 2);
479
+ let rightSt;
480
+ let leftSt;
481
+ let stIndex = 0;
482
+ if (addEndPositions) {
483
+ leftCount /= 3;
484
+ rightCount /= 3;
485
+ const theta = Math.PI / (endPositionLength + 1);
486
+ leftSt = 1 / (leftCount - endPositionLength + 1);
487
+ rightSt = 1 / (rightCount - endPositionLength + 1);
488
+ let a;
489
+ const halfEndPos = endPositionLength / 2;
490
+ for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
491
+ a = Math_default.PI_OVER_TWO + theta * i;
492
+ st[stIndex++] = rightSt * (1 + Math.cos(a));
493
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
494
+ }
495
+ for (i = 1; i < rightCount - endPositionLength + 1; i++) {
496
+ st[stIndex++] = i * rightSt;
497
+ st[stIndex++] = 0;
498
+ }
499
+ for (i = endPositionLength; i > halfEndPos; i--) {
500
+ a = Math_default.PI_OVER_TWO - i * theta;
501
+ st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
502
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
503
+ }
504
+ for (i = halfEndPos; i > 0; i--) {
505
+ a = Math_default.PI_OVER_TWO - theta * i;
506
+ st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
507
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
508
+ }
509
+ for (i = leftCount - endPositionLength; i > 0; i--) {
510
+ st[stIndex++] = i * leftSt;
511
+ st[stIndex++] = 1;
512
+ }
513
+ for (i = 1; i < halfEndPos + 1; i++) {
514
+ a = Math_default.PI_OVER_TWO + theta * i;
515
+ st[stIndex++] = leftSt * (1 + Math.cos(a));
516
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
517
+ }
518
+ } else {
519
+ leftCount /= 3;
520
+ rightCount /= 3;
521
+ leftSt = 1 / (leftCount - 1);
522
+ rightSt = 1 / (rightCount - 1);
523
+ for (i = 0; i < rightCount; i++) {
524
+ st[stIndex++] = i * rightSt;
525
+ st[stIndex++] = 0;
526
+ }
527
+ for (i = leftCount; i > 0; i--) {
528
+ st[stIndex++] = (i - 1) * leftSt;
529
+ st[stIndex++] = 1;
530
+ }
531
+ }
532
+ attributes.st = new GeometryAttribute_default({
533
+ componentDatatype: ComponentDatatype_default.FLOAT,
534
+ componentsPerAttribute: 2,
535
+ values: st
536
+ });
537
+ }
538
+ if (vertexFormat.normal) {
539
+ attributes.normal = new GeometryAttribute_default({
540
+ componentDatatype: ComponentDatatype_default.FLOAT,
541
+ componentsPerAttribute: 3,
542
+ values: attr.normals
543
+ });
544
+ }
545
+ if (vertexFormat.tangent) {
546
+ attributes.tangent = new GeometryAttribute_default({
547
+ componentDatatype: ComponentDatatype_default.FLOAT,
548
+ componentsPerAttribute: 3,
549
+ values: attr.tangents
550
+ });
551
+ }
552
+ if (vertexFormat.bitangent) {
553
+ attributes.bitangent = new GeometryAttribute_default({
554
+ componentDatatype: ComponentDatatype_default.FLOAT,
555
+ componentsPerAttribute: 3,
556
+ values: attr.bitangents
557
+ });
558
+ }
559
+ return {
560
+ attributes,
561
+ indices
562
+ };
563
+ }
564
+ function extrudedAttributes(attributes, vertexFormat) {
565
+ if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) {
566
+ return attributes;
567
+ }
568
+ const positions = attributes.position.values;
569
+ let topNormals;
570
+ let topBitangents;
571
+ if (vertexFormat.normal || vertexFormat.bitangent) {
572
+ topNormals = attributes.normal.values;
573
+ topBitangents = attributes.bitangent.values;
574
+ }
575
+ const size = attributes.position.values.length / 18;
576
+ const threeSize = size * 3;
577
+ const twoSize = size * 2;
578
+ const sixSize = threeSize * 2;
579
+ let i;
580
+ if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
581
+ const normals = vertexFormat.normal ? new Float32Array(threeSize * 6) : void 0;
582
+ const tangents = vertexFormat.tangent ? new Float32Array(threeSize * 6) : void 0;
583
+ const bitangents = vertexFormat.bitangent ? new Float32Array(threeSize * 6) : void 0;
584
+ let topPosition = cartesian1;
585
+ let bottomPosition = cartesian2;
586
+ let previousPosition = cartesian3;
587
+ let normal = cartesian4;
588
+ let tangent = cartesian5;
589
+ let bitangent = cartesian6;
590
+ let attrIndex = sixSize;
591
+ for (i = 0; i < threeSize; i += 3) {
592
+ const attrIndexOffset = attrIndex + sixSize;
593
+ topPosition = Cartesian3_default.fromArray(positions, i, topPosition);
594
+ bottomPosition = Cartesian3_default.fromArray(
595
+ positions,
596
+ i + threeSize,
597
+ bottomPosition
598
+ );
599
+ previousPosition = Cartesian3_default.fromArray(
600
+ positions,
601
+ (i + 3) % threeSize,
602
+ previousPosition
603
+ );
604
+ bottomPosition = Cartesian3_default.subtract(
605
+ bottomPosition,
606
+ topPosition,
607
+ bottomPosition
608
+ );
609
+ previousPosition = Cartesian3_default.subtract(
610
+ previousPosition,
611
+ topPosition,
612
+ previousPosition
613
+ );
614
+ normal = Cartesian3_default.normalize(
615
+ Cartesian3_default.cross(bottomPosition, previousPosition, normal),
616
+ normal
617
+ );
618
+ if (vertexFormat.normal) {
619
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndexOffset);
620
+ CorridorGeometryLibrary_default.addAttribute(
621
+ normals,
622
+ normal,
623
+ attrIndexOffset + 3
624
+ );
625
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex);
626
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex + 3);
627
+ }
628
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
629
+ bitangent = Cartesian3_default.fromArray(topNormals, i, bitangent);
630
+ if (vertexFormat.bitangent) {
631
+ CorridorGeometryLibrary_default.addAttribute(
632
+ bitangents,
633
+ bitangent,
634
+ attrIndexOffset
635
+ );
636
+ CorridorGeometryLibrary_default.addAttribute(
637
+ bitangents,
638
+ bitangent,
639
+ attrIndexOffset + 3
640
+ );
641
+ CorridorGeometryLibrary_default.addAttribute(
642
+ bitangents,
643
+ bitangent,
644
+ attrIndex
645
+ );
646
+ CorridorGeometryLibrary_default.addAttribute(
647
+ bitangents,
648
+ bitangent,
649
+ attrIndex + 3
650
+ );
651
+ }
652
+ if (vertexFormat.tangent) {
653
+ tangent = Cartesian3_default.normalize(
654
+ Cartesian3_default.cross(bitangent, normal, tangent),
655
+ tangent
656
+ );
657
+ CorridorGeometryLibrary_default.addAttribute(
658
+ tangents,
659
+ tangent,
660
+ attrIndexOffset
661
+ );
662
+ CorridorGeometryLibrary_default.addAttribute(
663
+ tangents,
664
+ tangent,
665
+ attrIndexOffset + 3
666
+ );
667
+ CorridorGeometryLibrary_default.addAttribute(tangents, tangent, attrIndex);
668
+ CorridorGeometryLibrary_default.addAttribute(
669
+ tangents,
670
+ tangent,
671
+ attrIndex + 3
672
+ );
673
+ }
674
+ }
675
+ attrIndex += 6;
676
+ }
677
+ if (vertexFormat.normal) {
678
+ normals.set(topNormals);
679
+ for (i = 0; i < threeSize; i += 3) {
680
+ normals[i + threeSize] = -topNormals[i];
681
+ normals[i + threeSize + 1] = -topNormals[i + 1];
682
+ normals[i + threeSize + 2] = -topNormals[i + 2];
683
+ }
684
+ attributes.normal.values = normals;
685
+ } else {
686
+ attributes.normal = void 0;
687
+ }
688
+ if (vertexFormat.bitangent) {
689
+ bitangents.set(topBitangents);
690
+ bitangents.set(topBitangents, threeSize);
691
+ attributes.bitangent.values = bitangents;
692
+ } else {
693
+ attributes.bitangent = void 0;
694
+ }
695
+ if (vertexFormat.tangent) {
696
+ const topTangents = attributes.tangent.values;
697
+ tangents.set(topTangents);
698
+ tangents.set(topTangents, threeSize);
699
+ attributes.tangent.values = tangents;
700
+ }
701
+ }
702
+ if (vertexFormat.st) {
703
+ const topSt = attributes.st.values;
704
+ const st = new Float32Array(twoSize * 6);
705
+ st.set(topSt);
706
+ st.set(topSt, twoSize);
707
+ let index = twoSize * 2;
708
+ for (let j = 0; j < 2; j++) {
709
+ st[index++] = topSt[0];
710
+ st[index++] = topSt[1];
711
+ for (i = 2; i < twoSize; i += 2) {
712
+ const s = topSt[i];
713
+ const t = topSt[i + 1];
714
+ st[index++] = s;
715
+ st[index++] = t;
716
+ st[index++] = s;
717
+ st[index++] = t;
718
+ }
719
+ st[index++] = topSt[0];
720
+ st[index++] = topSt[1];
721
+ }
722
+ attributes.st.values = st;
723
+ }
724
+ return attributes;
725
+ }
726
+ function addWallPositions(positions, index, wallPositions) {
727
+ wallPositions[index++] = positions[0];
728
+ wallPositions[index++] = positions[1];
729
+ wallPositions[index++] = positions[2];
730
+ for (let i = 3; i < positions.length; i += 3) {
731
+ const x = positions[i];
732
+ const y = positions[i + 1];
733
+ const z = positions[i + 2];
734
+ wallPositions[index++] = x;
735
+ wallPositions[index++] = y;
736
+ wallPositions[index++] = z;
737
+ wallPositions[index++] = x;
738
+ wallPositions[index++] = y;
739
+ wallPositions[index++] = z;
740
+ }
741
+ wallPositions[index++] = positions[0];
742
+ wallPositions[index++] = positions[1];
743
+ wallPositions[index++] = positions[2];
744
+ return wallPositions;
745
+ }
746
+ function computePositionsExtruded(params, vertexFormat) {
747
+ const topVertexFormat = new VertexFormat_default({
748
+ position: vertexFormat.position,
749
+ normal: vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
750
+ tangent: vertexFormat.tangent,
751
+ bitangent: vertexFormat.normal || vertexFormat.bitangent,
752
+ st: vertexFormat.st
753
+ });
754
+ const ellipsoid = params.ellipsoid;
755
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
756
+ const attr = combine(computedPositions, topVertexFormat, ellipsoid);
757
+ const height = params.height;
758
+ const extrudedHeight = params.extrudedHeight;
759
+ let attributes = attr.attributes;
760
+ const indices = attr.indices;
761
+ let positions = attributes.position.values;
762
+ let length = positions.length;
763
+ const newPositions = new Float64Array(length * 6);
764
+ let extrudedPositions = new Float64Array(length);
765
+ extrudedPositions.set(positions);
766
+ let wallPositions = new Float64Array(length * 4);
767
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
768
+ positions,
769
+ height,
770
+ ellipsoid
771
+ );
772
+ wallPositions = addWallPositions(positions, 0, wallPositions);
773
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
774
+ extrudedPositions,
775
+ extrudedHeight,
776
+ ellipsoid
777
+ );
778
+ wallPositions = addWallPositions(
779
+ extrudedPositions,
780
+ length * 2,
781
+ wallPositions
782
+ );
783
+ newPositions.set(positions);
784
+ newPositions.set(extrudedPositions, length);
785
+ newPositions.set(wallPositions, length * 2);
786
+ attributes.position.values = newPositions;
787
+ attributes = extrudedAttributes(attributes, vertexFormat);
788
+ let i;
789
+ const size = length / 3;
790
+ if (params.shadowVolume) {
791
+ const topNormals = attributes.normal.values;
792
+ length = topNormals.length;
793
+ let extrudeNormals = new Float32Array(length * 6);
794
+ for (i = 0; i < length; i++) {
795
+ topNormals[i] = -topNormals[i];
796
+ }
797
+ extrudeNormals.set(topNormals, length);
798
+ extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals);
799
+ attributes.extrudeDirection = new GeometryAttribute_default({
800
+ componentDatatype: ComponentDatatype_default.FLOAT,
801
+ componentsPerAttribute: 3,
802
+ values: extrudeNormals
803
+ });
804
+ if (!vertexFormat.normal) {
805
+ attributes.normal = void 0;
806
+ }
807
+ }
808
+ if (defined_default(params.offsetAttribute)) {
809
+ let applyOffset = new Uint8Array(size * 6);
810
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
811
+ applyOffset = applyOffset.fill(1, 0, size).fill(1, size * 2, size * 4);
812
+ } else {
813
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
814
+ applyOffset = applyOffset.fill(applyOffsetValue);
815
+ }
816
+ attributes.applyOffset = new GeometryAttribute_default({
817
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
818
+ componentsPerAttribute: 1,
819
+ values: applyOffset
820
+ });
821
+ }
822
+ const iLength = indices.length;
823
+ const twoSize = size + size;
824
+ const newIndices = IndexDatatype_default.createTypedArray(
825
+ newPositions.length / 3,
826
+ iLength * 2 + twoSize * 3
827
+ );
828
+ newIndices.set(indices);
829
+ let index = iLength;
830
+ for (i = 0; i < iLength; i += 3) {
831
+ const v0 = indices[i];
832
+ const v1 = indices[i + 1];
833
+ const v2 = indices[i + 2];
834
+ newIndices[index++] = v2 + size;
835
+ newIndices[index++] = v1 + size;
836
+ newIndices[index++] = v0 + size;
837
+ }
838
+ let UL, LL, UR, LR;
839
+ for (i = 0; i < twoSize; i += 2) {
840
+ UL = i + twoSize;
841
+ LL = UL + twoSize;
842
+ UR = UL + 1;
843
+ LR = LL + 1;
844
+ newIndices[index++] = UL;
845
+ newIndices[index++] = LL;
846
+ newIndices[index++] = UR;
847
+ newIndices[index++] = UR;
848
+ newIndices[index++] = LL;
849
+ newIndices[index++] = LR;
850
+ }
851
+ return {
852
+ attributes,
853
+ indices: newIndices
854
+ };
855
+ }
856
+ var scratchCartesian1 = new Cartesian3_default();
857
+ var scratchCartesian2 = new Cartesian3_default();
858
+ var scratchCartographic = new Cartographic_default();
859
+ function computeOffsetPoints(position1, position2, ellipsoid, halfWidth, min, max) {
860
+ const direction = Cartesian3_default.subtract(
861
+ position2,
862
+ position1,
863
+ scratchCartesian1
864
+ );
865
+ Cartesian3_default.normalize(direction, direction);
866
+ const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
867
+ const offsetDirection = Cartesian3_default.cross(
868
+ direction,
869
+ normal,
870
+ scratchCartesian1
871
+ );
872
+ Cartesian3_default.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
873
+ let minLat = min.latitude;
874
+ let minLon = min.longitude;
875
+ let maxLat = max.latitude;
876
+ let maxLon = max.longitude;
877
+ Cartesian3_default.add(position1, offsetDirection, scratchCartesian2);
878
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
879
+ let lat = scratchCartographic.latitude;
880
+ let lon = scratchCartographic.longitude;
881
+ minLat = Math.min(minLat, lat);
882
+ minLon = Math.min(minLon, lon);
883
+ maxLat = Math.max(maxLat, lat);
884
+ maxLon = Math.max(maxLon, lon);
885
+ Cartesian3_default.subtract(position1, offsetDirection, scratchCartesian2);
886
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
887
+ lat = scratchCartographic.latitude;
888
+ lon = scratchCartographic.longitude;
889
+ minLat = Math.min(minLat, lat);
890
+ minLon = Math.min(minLon, lon);
891
+ maxLat = Math.max(maxLat, lat);
892
+ maxLon = Math.max(maxLon, lon);
893
+ min.latitude = minLat;
894
+ min.longitude = minLon;
895
+ max.latitude = maxLat;
896
+ max.longitude = maxLon;
897
+ }
898
+ var scratchCartesianOffset = new Cartesian3_default();
899
+ var scratchCartesianEnds = new Cartesian3_default();
900
+ var scratchCartographicMin = new Cartographic_default();
901
+ var scratchCartographicMax = new Cartographic_default();
902
+ function computeRectangle(positions, ellipsoid, width, cornerType, result) {
903
+ positions = scaleToSurface(positions, ellipsoid);
904
+ const cleanPositions = arrayRemoveDuplicates_default(
905
+ positions,
906
+ Cartesian3_default.equalsEpsilon
907
+ );
908
+ const length = cleanPositions.length;
909
+ if (length < 2 || width <= 0) {
910
+ return new Rectangle_default();
911
+ }
912
+ const halfWidth = width * 0.5;
913
+ scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
914
+ scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
915
+ scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
916
+ scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
917
+ let lat, lon;
918
+ if (cornerType === CornerType_default.ROUNDED) {
919
+ const first = cleanPositions[0];
920
+ Cartesian3_default.subtract(first, cleanPositions[1], scratchCartesianOffset);
921
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
922
+ Cartesian3_default.multiplyByScalar(
923
+ scratchCartesianOffset,
924
+ halfWidth,
925
+ scratchCartesianOffset
926
+ );
927
+ Cartesian3_default.add(first, scratchCartesianOffset, scratchCartesianEnds);
928
+ ellipsoid.cartesianToCartographic(
929
+ scratchCartesianEnds,
930
+ scratchCartographic
931
+ );
932
+ lat = scratchCartographic.latitude;
933
+ lon = scratchCartographic.longitude;
934
+ scratchCartographicMin.latitude = Math.min(
935
+ scratchCartographicMin.latitude,
936
+ lat
937
+ );
938
+ scratchCartographicMin.longitude = Math.min(
939
+ scratchCartographicMin.longitude,
940
+ lon
941
+ );
942
+ scratchCartographicMax.latitude = Math.max(
943
+ scratchCartographicMax.latitude,
944
+ lat
945
+ );
946
+ scratchCartographicMax.longitude = Math.max(
947
+ scratchCartographicMax.longitude,
948
+ lon
949
+ );
950
+ }
951
+ for (let i = 0; i < length - 1; ++i) {
952
+ computeOffsetPoints(
953
+ cleanPositions[i],
954
+ cleanPositions[i + 1],
955
+ ellipsoid,
956
+ halfWidth,
957
+ scratchCartographicMin,
958
+ scratchCartographicMax
959
+ );
960
+ }
961
+ const last = cleanPositions[length - 1];
962
+ Cartesian3_default.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
963
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
964
+ Cartesian3_default.multiplyByScalar(
965
+ scratchCartesianOffset,
966
+ halfWidth,
967
+ scratchCartesianOffset
968
+ );
969
+ Cartesian3_default.add(last, scratchCartesianOffset, scratchCartesianEnds);
970
+ computeOffsetPoints(
971
+ last,
972
+ scratchCartesianEnds,
973
+ ellipsoid,
974
+ halfWidth,
975
+ scratchCartographicMin,
976
+ scratchCartographicMax
977
+ );
978
+ if (cornerType === CornerType_default.ROUNDED) {
979
+ ellipsoid.cartesianToCartographic(
980
+ scratchCartesianEnds,
981
+ scratchCartographic
982
+ );
983
+ lat = scratchCartographic.latitude;
984
+ lon = scratchCartographic.longitude;
985
+ scratchCartographicMin.latitude = Math.min(
986
+ scratchCartographicMin.latitude,
987
+ lat
988
+ );
989
+ scratchCartographicMin.longitude = Math.min(
990
+ scratchCartographicMin.longitude,
991
+ lon
992
+ );
993
+ scratchCartographicMax.latitude = Math.max(
994
+ scratchCartographicMax.latitude,
995
+ lat
996
+ );
997
+ scratchCartographicMax.longitude = Math.max(
998
+ scratchCartographicMax.longitude,
999
+ lon
1000
+ );
1001
+ }
1002
+ const rectangle = defined_default(result) ? result : new Rectangle_default();
1003
+ rectangle.north = scratchCartographicMax.latitude;
1004
+ rectangle.south = scratchCartographicMin.latitude;
1005
+ rectangle.east = scratchCartographicMax.longitude;
1006
+ rectangle.west = scratchCartographicMin.longitude;
1007
+ return rectangle;
1008
+ }
1009
+ function CorridorGeometry(options) {
1010
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1011
+ const positions = options.positions;
1012
+ const width = options.width;
1013
+ Check_default.defined("options.positions", positions);
1014
+ Check_default.defined("options.width", width);
1015
+ const height = defaultValue_default(options.height, 0);
1016
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
1017
+ this._positions = positions;
1018
+ this._ellipsoid = Ellipsoid_default.clone(
1019
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
1020
+ );
1021
+ this._vertexFormat = VertexFormat_default.clone(
1022
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
1023
+ );
1024
+ this._width = width;
1025
+ this._height = Math.max(height, extrudedHeight);
1026
+ this._extrudedHeight = Math.min(height, extrudedHeight);
1027
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1028
+ this._granularity = defaultValue_default(
1029
+ options.granularity,
1030
+ Math_default.RADIANS_PER_DEGREE
1031
+ );
1032
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
1033
+ this._workerName = "createCorridorGeometry";
1034
+ this._offsetAttribute = options.offsetAttribute;
1035
+ this._rectangle = void 0;
1036
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
1037
+ }
1038
+ CorridorGeometry.pack = function(value, array, startingIndex) {
1039
+ Check_default.defined("value", value);
1040
+ Check_default.defined("array", array);
1041
+ startingIndex = defaultValue_default(startingIndex, 0);
1042
+ const positions = value._positions;
1043
+ const length = positions.length;
1044
+ array[startingIndex++] = length;
1045
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1046
+ Cartesian3_default.pack(positions[i], array, startingIndex);
1047
+ }
1048
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
1049
+ startingIndex += Ellipsoid_default.packedLength;
1050
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
1051
+ startingIndex += VertexFormat_default.packedLength;
1052
+ array[startingIndex++] = value._width;
1053
+ array[startingIndex++] = value._height;
1054
+ array[startingIndex++] = value._extrudedHeight;
1055
+ array[startingIndex++] = value._cornerType;
1056
+ array[startingIndex++] = value._granularity;
1057
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
1058
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
1059
+ return array;
1060
+ };
1061
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
1062
+ var scratchVertexFormat = new VertexFormat_default();
1063
+ var scratchOptions = {
1064
+ positions: void 0,
1065
+ ellipsoid: scratchEllipsoid,
1066
+ vertexFormat: scratchVertexFormat,
1067
+ width: void 0,
1068
+ height: void 0,
1069
+ extrudedHeight: void 0,
1070
+ cornerType: void 0,
1071
+ granularity: void 0,
1072
+ shadowVolume: void 0,
1073
+ offsetAttribute: void 0
1074
+ };
1075
+ CorridorGeometry.unpack = function(array, startingIndex, result) {
1076
+ Check_default.defined("array", array);
1077
+ startingIndex = defaultValue_default(startingIndex, 0);
1078
+ const length = array[startingIndex++];
1079
+ const positions = new Array(length);
1080
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1081
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
1082
+ }
1083
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
1084
+ startingIndex += Ellipsoid_default.packedLength;
1085
+ const vertexFormat = VertexFormat_default.unpack(
1086
+ array,
1087
+ startingIndex,
1088
+ scratchVertexFormat
1089
+ );
1090
+ startingIndex += VertexFormat_default.packedLength;
1091
+ const width = array[startingIndex++];
1092
+ const height = array[startingIndex++];
1093
+ const extrudedHeight = array[startingIndex++];
1094
+ const cornerType = array[startingIndex++];
1095
+ const granularity = array[startingIndex++];
1096
+ const shadowVolume = array[startingIndex++] === 1;
1097
+ const offsetAttribute = array[startingIndex];
1098
+ if (!defined_default(result)) {
1099
+ scratchOptions.positions = positions;
1100
+ scratchOptions.width = width;
1101
+ scratchOptions.height = height;
1102
+ scratchOptions.extrudedHeight = extrudedHeight;
1103
+ scratchOptions.cornerType = cornerType;
1104
+ scratchOptions.granularity = granularity;
1105
+ scratchOptions.shadowVolume = shadowVolume;
1106
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1107
+ return new CorridorGeometry(scratchOptions);
1108
+ }
1109
+ result._positions = positions;
1110
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
1111
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
1112
+ result._width = width;
1113
+ result._height = height;
1114
+ result._extrudedHeight = extrudedHeight;
1115
+ result._cornerType = cornerType;
1116
+ result._granularity = granularity;
1117
+ result._shadowVolume = shadowVolume;
1118
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1119
+ return result;
1120
+ };
1121
+ CorridorGeometry.computeRectangle = function(options, result) {
1122
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1123
+ const positions = options.positions;
1124
+ const width = options.width;
1125
+ Check_default.defined("options.positions", positions);
1126
+ Check_default.defined("options.width", width);
1127
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
1128
+ const cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1129
+ return computeRectangle(positions, ellipsoid, width, cornerType, result);
1130
+ };
1131
+ CorridorGeometry.createGeometry = function(corridorGeometry) {
1132
+ let positions = corridorGeometry._positions;
1133
+ const width = corridorGeometry._width;
1134
+ const ellipsoid = corridorGeometry._ellipsoid;
1135
+ positions = scaleToSurface(positions, ellipsoid);
1136
+ const cleanPositions = arrayRemoveDuplicates_default(
1137
+ positions,
1138
+ Cartesian3_default.equalsEpsilon
1139
+ );
1140
+ if (cleanPositions.length < 2 || width <= 0) {
1141
+ return;
1142
+ }
1143
+ const height = corridorGeometry._height;
1144
+ const extrudedHeight = corridorGeometry._extrudedHeight;
1145
+ const extrude = !Math_default.equalsEpsilon(
1146
+ height,
1147
+ extrudedHeight,
1148
+ 0,
1149
+ Math_default.EPSILON2
1150
+ );
1151
+ const vertexFormat = corridorGeometry._vertexFormat;
1152
+ const params = {
1153
+ ellipsoid,
1154
+ positions: cleanPositions,
1155
+ width,
1156
+ cornerType: corridorGeometry._cornerType,
1157
+ granularity: corridorGeometry._granularity,
1158
+ saveAttributes: true
1159
+ };
1160
+ let attr;
1161
+ if (extrude) {
1162
+ params.height = height;
1163
+ params.extrudedHeight = extrudedHeight;
1164
+ params.shadowVolume = corridorGeometry._shadowVolume;
1165
+ params.offsetAttribute = corridorGeometry._offsetAttribute;
1166
+ attr = computePositionsExtruded(params, vertexFormat);
1167
+ } else {
1168
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
1169
+ attr = combine(computedPositions, vertexFormat, ellipsoid);
1170
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1171
+ attr.attributes.position.values,
1172
+ height,
1173
+ ellipsoid
1174
+ );
1175
+ if (defined_default(corridorGeometry._offsetAttribute)) {
1176
+ const applyOffsetValue = corridorGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1177
+ const length = attr.attributes.position.values.length;
1178
+ const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
1179
+ attr.attributes.applyOffset = new GeometryAttribute_default({
1180
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1181
+ componentsPerAttribute: 1,
1182
+ values: applyOffset
1183
+ });
1184
+ }
1185
+ }
1186
+ const attributes = attr.attributes;
1187
+ const boundingSphere = BoundingSphere_default.fromVertices(
1188
+ attributes.position.values,
1189
+ void 0,
1190
+ 3
1191
+ );
1192
+ if (!vertexFormat.position) {
1193
+ attr.attributes.position.values = void 0;
1194
+ }
1195
+ return new Geometry_default({
1196
+ attributes,
1197
+ indices: attr.indices,
1198
+ primitiveType: PrimitiveType_default.TRIANGLES,
1199
+ boundingSphere,
1200
+ offsetAttribute: corridorGeometry._offsetAttribute
1201
+ });
1202
+ };
1203
+ CorridorGeometry.createShadowVolume = function(corridorGeometry, minHeightFunc, maxHeightFunc) {
1204
+ const granularity = corridorGeometry._granularity;
1205
+ const ellipsoid = corridorGeometry._ellipsoid;
1206
+ const minHeight = minHeightFunc(granularity, ellipsoid);
1207
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
1208
+ return new CorridorGeometry({
1209
+ positions: corridorGeometry._positions,
1210
+ width: corridorGeometry._width,
1211
+ cornerType: corridorGeometry._cornerType,
1212
+ ellipsoid,
1213
+ granularity,
1214
+ extrudedHeight: minHeight,
1215
+ height: maxHeight,
1216
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
1217
+ shadowVolume: true
1218
+ });
1219
+ };
1220
+ Object.defineProperties(CorridorGeometry.prototype, {
1221
+ /**
1222
+ * @private
1223
+ */
1224
+ rectangle: {
1225
+ get: function() {
1226
+ if (!defined_default(this._rectangle)) {
1227
+ this._rectangle = computeRectangle(
1228
+ this._positions,
1229
+ this._ellipsoid,
1230
+ this._width,
1231
+ this._cornerType
1232
+ );
1233
+ }
1234
+ return this._rectangle;
1235
+ }
1236
+ },
1237
+ /**
1238
+ * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
1239
+ *
1240
+ * Corridors don't support stRotation,
1241
+ * so just return the corners of the original system.
1242
+ * @private
1243
+ */
1244
+ textureCoordinateRotationPoints: {
1245
+ get: function() {
1246
+ return [0, 0, 0, 1, 1, 0];
1247
+ }
1248
+ }
1249
+ });
1250
+ var CorridorGeometry_default = CorridorGeometry;
1251
+
1252
+ // packages/engine/Source/Workers/createCorridorGeometry.js
1253
+ function createCorridorGeometry(corridorGeometry, offset) {
1254
+ if (defined_default(offset)) {
1255
+ corridorGeometry = CorridorGeometry_default.unpack(corridorGeometry, offset);
1256
+ }
1257
+ corridorGeometry._ellipsoid = Ellipsoid_default.clone(corridorGeometry._ellipsoid);
1258
+ return CorridorGeometry_default.createGeometry(corridorGeometry);
1259
+ }
1260
+ var createCorridorGeometry_default = createCorridorGeometry;
1261
+ export {
1262
+ createCorridorGeometry_default as default
1263
+ };