create-swdg-frontend 0.1.7 → 0.2.0

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 (440) hide show
  1. package/README.md +31 -13
  2. package/bin/index.js +3 -244
  3. package/lib/argv.js +43 -0
  4. package/lib/cli.js +141 -0
  5. package/lib/constants.js +24 -0
  6. package/lib/gis.js +92 -0
  7. package/lib/manifest.js +23 -0
  8. package/lib/prompts.js +55 -0
  9. package/lib/scaffold.js +118 -0
  10. package/package.json +6 -2
  11. package/scripts/sync-template.js +120 -0
  12. package/scripts/validate-template.mjs +74 -0
  13. package/stubs/tsconfig.node.json +11 -0
  14. package/stubs/types-env.d.ts +9 -0
  15. package/stubs/vite.config.ts +64 -0
  16. package/template/.env.example +6 -0
  17. package/template/.github/workflows/ci.yml +23 -0
  18. package/template/.github/workflows/release.yml +69 -0
  19. package/template/.stylelintrc.json +7 -1
  20. package/template/README.md +95 -32
  21. package/template/auto-imports.d.ts +10 -0
  22. package/template/docs/MAINTAINER.md +77 -0
  23. package/template/docs/ONBOARDING.md +284 -0
  24. package/template/docs/TESTING.md +104 -0
  25. package/template/package.json +48 -41
  26. package/template/pnpm-lock.yaml +6360 -0
  27. package/template/scripts/gen-api.cjs +20 -7
  28. package/template/scripts/release.mjs +22 -28
  29. package/template/scripts/set-release-version.mjs +46 -0
  30. package/template/scripts/test-pipeline.mjs +85 -0
  31. package/template/scripts/test-scaffold.mjs +197 -0
  32. package/template/scripts/test-template.mjs +52 -0
  33. package/template/scripts/verify.mjs +28 -0
  34. package/template/scripts/vite-plugin-cesium-dev.ts +56 -0
  35. package/template/src/api/README.md +4 -0
  36. package/template/src/components/Body/index.vue +65 -35
  37. package/template/src/components/CesiumViewer/index.vue +36 -0
  38. package/template/src/components/Header/index.vue +16 -5
  39. package/template/src/components/OnboardingDeck/index.vue +449 -0
  40. package/template/src/data/onboardingSlides.ts +208 -0
  41. package/template/src/main.ts +1 -0
  42. package/template/src/router/index.ts +20 -14
  43. package/template/src/router/routeUtils.ts +13 -0
  44. package/template/src/styles/shell.css +232 -0
  45. package/template/src/utils/axios-middleware.js +1 -1
  46. package/template/src/utils/cesium/index.ts +71 -0
  47. package/template/src/utils/composables/useFeatureGis.ts +24 -0
  48. package/template/src/views/examples/cesium/index.vue +85 -0
  49. package/template/src/views/examples/guide/index.vue +42 -0
  50. package/template/src/views/examples/test/index.vue +63 -0
  51. package/template/src/views/index.vue +2 -3
  52. package/template/tests/README.md +1 -0
  53. package/template/tests/unit/onboardingSlides.test.ts +20 -0
  54. package/template/tests/unit/router.utils.test.ts +21 -0
  55. package/template/tests/unit/scaffold.lib.test.ts +44 -0
  56. package/template/tests/unit/useFeatureGis.test.ts +14 -0
  57. package/template/tsconfig.json +17 -17
  58. package/template/tsconfig.node.json +1 -1
  59. package/template/types/env.d.ts +13 -0
  60. package/template/vite.config.ts +26 -5
  61. package/template/vitest.config.ts +13 -0
  62. package/template/.env +0 -1
  63. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1012
  64. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1012
  65. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1012
  66. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1012
  67. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1012
  68. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1012
  69. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1012
  70. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1012
  71. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1012
  72. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1012
  73. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1012
  74. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1012
  75. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1012
  76. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1012
  77. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1012
  78. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1012
  79. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1012
  80. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1012
  81. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1012
  82. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1012
  83. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -438
  84. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1012
  85. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1012
  86. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1012
  87. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1012
  88. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1012
  89. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1012
  90. package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1012
  91. package/template/public/Cesium1.119/Assets/Images/bing_maps_credit.png +0 -0
  92. package/template/public/Cesium1.119/Assets/Images/cesium_credit.png +0 -0
  93. package/template/public/Cesium1.119/Assets/Images/google_earth_credit.png +0 -0
  94. package/template/public/Cesium1.119/Assets/Images/ion-credit.png +0 -0
  95. package/template/public/Cesium1.119/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  96. package/template/public/Cesium1.119/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  97. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  98. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  99. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  100. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  101. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  102. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  103. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  104. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  105. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  106. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  107. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  108. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  109. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  110. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  111. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  112. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  113. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  114. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  115. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  116. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  117. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  118. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  119. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  120. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  121. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  122. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  123. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  124. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  125. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  126. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  127. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  128. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  129. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  130. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  131. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  132. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  133. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  134. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  135. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  136. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  137. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  138. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  139. package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
  140. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  141. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  142. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  143. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  144. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  145. package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  146. package/template/public/Cesium1.119/Assets/Textures/maki/airfield.png +0 -0
  147. package/template/public/Cesium1.119/Assets/Textures/maki/airport.png +0 -0
  148. package/template/public/Cesium1.119/Assets/Textures/maki/alcohol-shop.png +0 -0
  149. package/template/public/Cesium1.119/Assets/Textures/maki/america-football.png +0 -0
  150. package/template/public/Cesium1.119/Assets/Textures/maki/art-gallery.png +0 -0
  151. package/template/public/Cesium1.119/Assets/Textures/maki/bakery.png +0 -0
  152. package/template/public/Cesium1.119/Assets/Textures/maki/bank.png +0 -0
  153. package/template/public/Cesium1.119/Assets/Textures/maki/bar.png +0 -0
  154. package/template/public/Cesium1.119/Assets/Textures/maki/baseball.png +0 -0
  155. package/template/public/Cesium1.119/Assets/Textures/maki/basketball.png +0 -0
  156. package/template/public/Cesium1.119/Assets/Textures/maki/beer.png +0 -0
  157. package/template/public/Cesium1.119/Assets/Textures/maki/bicycle.png +0 -0
  158. package/template/public/Cesium1.119/Assets/Textures/maki/building.png +0 -0
  159. package/template/public/Cesium1.119/Assets/Textures/maki/bus.png +0 -0
  160. package/template/public/Cesium1.119/Assets/Textures/maki/cafe.png +0 -0
  161. package/template/public/Cesium1.119/Assets/Textures/maki/camera.png +0 -0
  162. package/template/public/Cesium1.119/Assets/Textures/maki/campsite.png +0 -0
  163. package/template/public/Cesium1.119/Assets/Textures/maki/car.png +0 -0
  164. package/template/public/Cesium1.119/Assets/Textures/maki/cemetery.png +0 -0
  165. package/template/public/Cesium1.119/Assets/Textures/maki/cesium.png +0 -0
  166. package/template/public/Cesium1.119/Assets/Textures/maki/chemist.png +0 -0
  167. package/template/public/Cesium1.119/Assets/Textures/maki/cinema.png +0 -0
  168. package/template/public/Cesium1.119/Assets/Textures/maki/circle-stroked.png +0 -0
  169. package/template/public/Cesium1.119/Assets/Textures/maki/circle.png +0 -0
  170. package/template/public/Cesium1.119/Assets/Textures/maki/city.png +0 -0
  171. package/template/public/Cesium1.119/Assets/Textures/maki/clothing-store.png +0 -0
  172. package/template/public/Cesium1.119/Assets/Textures/maki/college.png +0 -0
  173. package/template/public/Cesium1.119/Assets/Textures/maki/commercial.png +0 -0
  174. package/template/public/Cesium1.119/Assets/Textures/maki/cricket.png +0 -0
  175. package/template/public/Cesium1.119/Assets/Textures/maki/cross.png +0 -0
  176. package/template/public/Cesium1.119/Assets/Textures/maki/dam.png +0 -0
  177. package/template/public/Cesium1.119/Assets/Textures/maki/danger.png +0 -0
  178. package/template/public/Cesium1.119/Assets/Textures/maki/disability.png +0 -0
  179. package/template/public/Cesium1.119/Assets/Textures/maki/dog-park.png +0 -0
  180. package/template/public/Cesium1.119/Assets/Textures/maki/embassy.png +0 -0
  181. package/template/public/Cesium1.119/Assets/Textures/maki/emergency-telephone.png +0 -0
  182. package/template/public/Cesium1.119/Assets/Textures/maki/entrance.png +0 -0
  183. package/template/public/Cesium1.119/Assets/Textures/maki/farm.png +0 -0
  184. package/template/public/Cesium1.119/Assets/Textures/maki/fast-food.png +0 -0
  185. package/template/public/Cesium1.119/Assets/Textures/maki/ferry.png +0 -0
  186. package/template/public/Cesium1.119/Assets/Textures/maki/fire-station.png +0 -0
  187. package/template/public/Cesium1.119/Assets/Textures/maki/fuel.png +0 -0
  188. package/template/public/Cesium1.119/Assets/Textures/maki/garden.png +0 -0
  189. package/template/public/Cesium1.119/Assets/Textures/maki/gift.png +0 -0
  190. package/template/public/Cesium1.119/Assets/Textures/maki/golf.png +0 -0
  191. package/template/public/Cesium1.119/Assets/Textures/maki/grocery.png +0 -0
  192. package/template/public/Cesium1.119/Assets/Textures/maki/hairdresser.png +0 -0
  193. package/template/public/Cesium1.119/Assets/Textures/maki/harbor.png +0 -0
  194. package/template/public/Cesium1.119/Assets/Textures/maki/heart.png +0 -0
  195. package/template/public/Cesium1.119/Assets/Textures/maki/heliport.png +0 -0
  196. package/template/public/Cesium1.119/Assets/Textures/maki/hospital.png +0 -0
  197. package/template/public/Cesium1.119/Assets/Textures/maki/ice-cream.png +0 -0
  198. package/template/public/Cesium1.119/Assets/Textures/maki/industrial.png +0 -0
  199. package/template/public/Cesium1.119/Assets/Textures/maki/land-use.png +0 -0
  200. package/template/public/Cesium1.119/Assets/Textures/maki/laundry.png +0 -0
  201. package/template/public/Cesium1.119/Assets/Textures/maki/library.png +0 -0
  202. package/template/public/Cesium1.119/Assets/Textures/maki/lighthouse.png +0 -0
  203. package/template/public/Cesium1.119/Assets/Textures/maki/lodging.png +0 -0
  204. package/template/public/Cesium1.119/Assets/Textures/maki/logging.png +0 -0
  205. package/template/public/Cesium1.119/Assets/Textures/maki/london-underground.png +0 -0
  206. package/template/public/Cesium1.119/Assets/Textures/maki/marker-stroked.png +0 -0
  207. package/template/public/Cesium1.119/Assets/Textures/maki/marker.png +0 -0
  208. package/template/public/Cesium1.119/Assets/Textures/maki/minefield.png +0 -0
  209. package/template/public/Cesium1.119/Assets/Textures/maki/mobilephone.png +0 -0
  210. package/template/public/Cesium1.119/Assets/Textures/maki/monument.png +0 -0
  211. package/template/public/Cesium1.119/Assets/Textures/maki/museum.png +0 -0
  212. package/template/public/Cesium1.119/Assets/Textures/maki/music.png +0 -0
  213. package/template/public/Cesium1.119/Assets/Textures/maki/oil-well.png +0 -0
  214. package/template/public/Cesium1.119/Assets/Textures/maki/park.png +0 -0
  215. package/template/public/Cesium1.119/Assets/Textures/maki/park2.png +0 -0
  216. package/template/public/Cesium1.119/Assets/Textures/maki/parking-garage.png +0 -0
  217. package/template/public/Cesium1.119/Assets/Textures/maki/parking.png +0 -0
  218. package/template/public/Cesium1.119/Assets/Textures/maki/pharmacy.png +0 -0
  219. package/template/public/Cesium1.119/Assets/Textures/maki/pitch.png +0 -0
  220. package/template/public/Cesium1.119/Assets/Textures/maki/place-of-worship.png +0 -0
  221. package/template/public/Cesium1.119/Assets/Textures/maki/playground.png +0 -0
  222. package/template/public/Cesium1.119/Assets/Textures/maki/police.png +0 -0
  223. package/template/public/Cesium1.119/Assets/Textures/maki/polling-place.png +0 -0
  224. package/template/public/Cesium1.119/Assets/Textures/maki/post.png +0 -0
  225. package/template/public/Cesium1.119/Assets/Textures/maki/prison.png +0 -0
  226. package/template/public/Cesium1.119/Assets/Textures/maki/rail-above.png +0 -0
  227. package/template/public/Cesium1.119/Assets/Textures/maki/rail-light.png +0 -0
  228. package/template/public/Cesium1.119/Assets/Textures/maki/rail-metro.png +0 -0
  229. package/template/public/Cesium1.119/Assets/Textures/maki/rail-underground.png +0 -0
  230. package/template/public/Cesium1.119/Assets/Textures/maki/rail.png +0 -0
  231. package/template/public/Cesium1.119/Assets/Textures/maki/religious-christian.png +0 -0
  232. package/template/public/Cesium1.119/Assets/Textures/maki/religious-jewish.png +0 -0
  233. package/template/public/Cesium1.119/Assets/Textures/maki/religious-muslim.png +0 -0
  234. package/template/public/Cesium1.119/Assets/Textures/maki/restaurant.png +0 -0
  235. package/template/public/Cesium1.119/Assets/Textures/maki/roadblock.png +0 -0
  236. package/template/public/Cesium1.119/Assets/Textures/maki/rocket.png +0 -0
  237. package/template/public/Cesium1.119/Assets/Textures/maki/school.png +0 -0
  238. package/template/public/Cesium1.119/Assets/Textures/maki/scooter.png +0 -0
  239. package/template/public/Cesium1.119/Assets/Textures/maki/shop.png +0 -0
  240. package/template/public/Cesium1.119/Assets/Textures/maki/skiing.png +0 -0
  241. package/template/public/Cesium1.119/Assets/Textures/maki/slaughterhouse.png +0 -0
  242. package/template/public/Cesium1.119/Assets/Textures/maki/soccer.png +0 -0
  243. package/template/public/Cesium1.119/Assets/Textures/maki/square-stroked.png +0 -0
  244. package/template/public/Cesium1.119/Assets/Textures/maki/square.png +0 -0
  245. package/template/public/Cesium1.119/Assets/Textures/maki/star-stroked.png +0 -0
  246. package/template/public/Cesium1.119/Assets/Textures/maki/star.png +0 -0
  247. package/template/public/Cesium1.119/Assets/Textures/maki/suitcase.png +0 -0
  248. package/template/public/Cesium1.119/Assets/Textures/maki/swimming.png +0 -0
  249. package/template/public/Cesium1.119/Assets/Textures/maki/telephone.png +0 -0
  250. package/template/public/Cesium1.119/Assets/Textures/maki/tennis.png +0 -0
  251. package/template/public/Cesium1.119/Assets/Textures/maki/theatre.png +0 -0
  252. package/template/public/Cesium1.119/Assets/Textures/maki/toilets.png +0 -0
  253. package/template/public/Cesium1.119/Assets/Textures/maki/town-hall.png +0 -0
  254. package/template/public/Cesium1.119/Assets/Textures/maki/town.png +0 -0
  255. package/template/public/Cesium1.119/Assets/Textures/maki/triangle-stroked.png +0 -0
  256. package/template/public/Cesium1.119/Assets/Textures/maki/triangle.png +0 -0
  257. package/template/public/Cesium1.119/Assets/Textures/maki/village.png +0 -0
  258. package/template/public/Cesium1.119/Assets/Textures/maki/warehouse.png +0 -0
  259. package/template/public/Cesium1.119/Assets/Textures/maki/waste-basket.png +0 -0
  260. package/template/public/Cesium1.119/Assets/Textures/maki/water.png +0 -0
  261. package/template/public/Cesium1.119/Assets/Textures/maki/wetland.png +0 -0
  262. package/template/public/Cesium1.119/Assets/Textures/maki/zoo.png +0 -0
  263. package/template/public/Cesium1.119/Assets/Textures/moonSmall.jpg +0 -0
  264. package/template/public/Cesium1.119/Assets/Textures/pin.svg +0 -1
  265. package/template/public/Cesium1.119/Assets/Textures/waterNormals.jpg +0 -0
  266. package/template/public/Cesium1.119/Assets/Textures/waterNormalsSmall.jpg +0 -0
  267. package/template/public/Cesium1.119/Assets/approximateTerrainHeights.json +0 -10924
  268. package/template/public/Cesium1.119/Cesium.js +0 -185772
  269. package/template/public/Cesium1.119/ThirdParty/Workers/package.json +0 -3
  270. package/template/public/Cesium1.119/ThirdParty/Workers/pako_deflate.min.js +0 -1681
  271. package/template/public/Cesium1.119/ThirdParty/Workers/pako_inflate.min.js +0 -1489
  272. package/template/public/Cesium1.119/ThirdParty/Workers/z-worker-pako.js +0 -1070
  273. package/template/public/Cesium1.119/ThirdParty/basis_transcoder.wasm +0 -0
  274. package/template/public/Cesium1.119/ThirdParty/draco_decoder.wasm +0 -0
  275. package/template/public/Cesium1.119/ThirdParty/google-earth-dbroot-parser.js +0 -11424
  276. package/template/public/Cesium1.119/Widgets/Animation/Animation.css +0 -127
  277. package/template/public/Cesium1.119/Widgets/Animation/lighter.css +0 -78
  278. package/template/public/Cesium1.119/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -112
  279. package/template/public/Cesium1.119/Widgets/BaseLayerPicker/lighter.css +0 -28
  280. package/template/public/Cesium1.119/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -104
  281. package/template/public/Cesium1.119/Widgets/CesiumInspector/CesiumInspector.css +0 -115
  282. package/template/public/Cesium1.119/Widgets/CesiumWidget/CesiumWidget.css +0 -119
  283. package/template/public/Cesium1.119/Widgets/CesiumWidget/lighter.css +0 -14
  284. package/template/public/Cesium1.119/Widgets/FullscreenButton/FullscreenButton.css +0 -8
  285. package/template/public/Cesium1.119/Widgets/Geocoder/Geocoder.css +0 -72
  286. package/template/public/Cesium1.119/Widgets/Geocoder/lighter.css +0 -17
  287. package/template/public/Cesium1.119/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
  288. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  289. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  290. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  291. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  292. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  293. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  294. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  295. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  296. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  297. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  298. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  299. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  300. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  301. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  302. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  303. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  304. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  305. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  306. package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  307. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
  308. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
  309. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
  310. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
  311. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Touch.svg +0 -120
  312. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
  313. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
  314. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
  315. package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
  316. package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  317. package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  318. package/template/public/Cesium1.119/Widgets/Images/TimelineIcons.png +0 -0
  319. package/template/public/Cesium1.119/Widgets/Images/info-loading.gif +0 -0
  320. package/template/public/Cesium1.119/Widgets/InfoBox/InfoBox.css +0 -94
  321. package/template/public/Cesium1.119/Widgets/InfoBox/InfoBoxDescription.css +0 -178
  322. package/template/public/Cesium1.119/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -95
  323. package/template/public/Cesium1.119/Widgets/NavigationHelpButton/lighter.css +0 -38
  324. package/template/public/Cesium1.119/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
  325. package/template/public/Cesium1.119/Widgets/ProjectionPicker/ProjectionPicker.css +0 -46
  326. package/template/public/Cesium1.119/Widgets/SceneModePicker/SceneModePicker.css +0 -72
  327. package/template/public/Cesium1.119/Widgets/SelectionIndicator/SelectionIndicator.css +0 -22
  328. package/template/public/Cesium1.119/Widgets/Timeline/Timeline.css +0 -103
  329. package/template/public/Cesium1.119/Widgets/Timeline/lighter.css +0 -18
  330. package/template/public/Cesium1.119/Widgets/VRButton/VRButton.css +0 -8
  331. package/template/public/Cesium1.119/Widgets/Viewer/Viewer.css +0 -107
  332. package/template/public/Cesium1.119/Widgets/VoxelInspector/VoxelInspector.css +0 -18
  333. package/template/public/Cesium1.119/Widgets/lighter.css +0 -246
  334. package/template/public/Cesium1.119/Widgets/lighterShared.css +0 -46
  335. package/template/public/Cesium1.119/Widgets/shared.css +0 -103
  336. package/template/public/Cesium1.119/Widgets/widgets.css +0 -1376
  337. package/template/public/Cesium1.119/Workers/chunk-3C7WC463.js +0 -611
  338. package/template/public/Cesium1.119/Workers/chunk-3JW36LZF.js +0 -166
  339. package/template/public/Cesium1.119/Workers/chunk-4BTGX3WJ.js +0 -264
  340. package/template/public/Cesium1.119/Workers/chunk-4WRMLZA7.js +0 -128
  341. package/template/public/Cesium1.119/Workers/chunk-7Z5IIKOJ.js +0 -8046
  342. package/template/public/Cesium1.119/Workers/chunk-ABGXSJNX.js +0 -341
  343. package/template/public/Cesium1.119/Workers/chunk-AMQUWUD4.js +0 -269
  344. package/template/public/Cesium1.119/Workers/chunk-ATPDRNKI.js +0 -28
  345. package/template/public/Cesium1.119/Workers/chunk-BMHPVZ4H.js +0 -199
  346. package/template/public/Cesium1.119/Workers/chunk-CBEO3SHS.js +0 -1102
  347. package/template/public/Cesium1.119/Workers/chunk-CV7DLCWG.js +0 -485
  348. package/template/public/Cesium1.119/Workers/chunk-DQO6B4EQ.js +0 -76
  349. package/template/public/Cesium1.119/Workers/chunk-ED3TLP6D.js +0 -91
  350. package/template/public/Cesium1.119/Workers/chunk-EFZKO5RU.js +0 -42
  351. package/template/public/Cesium1.119/Workers/chunk-F5IHREXR.js +0 -2678
  352. package/template/public/Cesium1.119/Workers/chunk-FKRG4HDY.js +0 -516
  353. package/template/public/Cesium1.119/Workers/chunk-FYOYUPXG.js +0 -399
  354. package/template/public/Cesium1.119/Workers/chunk-GFN7NNSJ.js +0 -65
  355. package/template/public/Cesium1.119/Workers/chunk-HEEMUCG6.js +0 -92
  356. package/template/public/Cesium1.119/Workers/chunk-HSWA4OEL.js +0 -672
  357. package/template/public/Cesium1.119/Workers/chunk-IAC5XVZV.js +0 -287
  358. package/template/public/Cesium1.119/Workers/chunk-II4VNKYR.js +0 -50
  359. package/template/public/Cesium1.119/Workers/chunk-ILGBPNP6.js +0 -28
  360. package/template/public/Cesium1.119/Workers/chunk-IRH46BDL.js +0 -124
  361. package/template/public/Cesium1.119/Workers/chunk-IUA6FAOZ.js +0 -31
  362. package/template/public/Cesium1.119/Workers/chunk-K4ASOM65.js +0 -331
  363. package/template/public/Cesium1.119/Workers/chunk-KCIZBVXL.js +0 -258
  364. package/template/public/Cesium1.119/Workers/chunk-KF5NF354.js +0 -162
  365. package/template/public/Cesium1.119/Workers/chunk-KRKI6AAO.js +0 -773
  366. package/template/public/Cesium1.119/Workers/chunk-KZNJOCYU.js +0 -162
  367. package/template/public/Cesium1.119/Workers/chunk-O5IJ3OGP.js +0 -857
  368. package/template/public/Cesium1.119/Workers/chunk-OO23RBLX.js +0 -183
  369. package/template/public/Cesium1.119/Workers/chunk-P37AI2DW.js +0 -85
  370. package/template/public/Cesium1.119/Workers/chunk-PDMQLSBL.js +0 -108
  371. package/template/public/Cesium1.119/Workers/chunk-PEYJTJPE.js +0 -73
  372. package/template/public/Cesium1.119/Workers/chunk-POASMU2N.js +0 -2372
  373. package/template/public/Cesium1.119/Workers/chunk-PXCJYT2S.js +0 -73
  374. package/template/public/Cesium1.119/Workers/chunk-Q6L7X3LP.js +0 -538
  375. package/template/public/Cesium1.119/Workers/chunk-QB3MDM4J.js +0 -1670
  376. package/template/public/Cesium1.119/Workers/chunk-R6KGAEF6.js +0 -392
  377. package/template/public/Cesium1.119/Workers/chunk-RXTBM4OI.js +0 -57
  378. package/template/public/Cesium1.119/Workers/chunk-SB224QGV.js +0 -72
  379. package/template/public/Cesium1.119/Workers/chunk-T6BE4RZK.js +0 -37
  380. package/template/public/Cesium1.119/Workers/chunk-TAMCUKAR.js +0 -814
  381. package/template/public/Cesium1.119/Workers/chunk-TMSETF7M.js +0 -579
  382. package/template/public/Cesium1.119/Workers/chunk-TOGHF3VN.js +0 -376
  383. package/template/public/Cesium1.119/Workers/chunk-UH2WFNTA.js +0 -111
  384. package/template/public/Cesium1.119/Workers/chunk-V7JEDBOE.js +0 -573
  385. package/template/public/Cesium1.119/Workers/chunk-VBIROZR5.js +0 -633
  386. package/template/public/Cesium1.119/Workers/chunk-W23CU777.js +0 -271
  387. package/template/public/Cesium1.119/Workers/chunk-X5IHHI6X.js +0 -173
  388. package/template/public/Cesium1.119/Workers/chunk-XHX2UPDO.js +0 -217
  389. package/template/public/Cesium1.119/Workers/combineGeometry.js +0 -53
  390. package/template/public/Cesium1.119/Workers/createBoxGeometry.js +0 -45
  391. package/template/public/Cesium1.119/Workers/createBoxOutlineGeometry.js +0 -189
  392. package/template/public/Cesium1.119/Workers/createCircleGeometry.js +0 -148
  393. package/template/public/Cesium1.119/Workers/createCircleOutlineGeometry.js +0 -105
  394. package/template/public/Cesium1.119/Workers/createCoplanarPolygonGeometry.js +0 -293
  395. package/template/public/Cesium1.119/Workers/createCoplanarPolygonOutlineGeometry.js +0 -143
  396. package/template/public/Cesium1.119/Workers/createCorridorGeometry.js +0 -830
  397. package/template/public/Cesium1.119/Workers/createCorridorOutlineGeometry.js +0 -417
  398. package/template/public/Cesium1.119/Workers/createCylinderGeometry.js +0 -47
  399. package/template/public/Cesium1.119/Workers/createCylinderOutlineGeometry.js +0 -170
  400. package/template/public/Cesium1.119/Workers/createEllipseGeometry.js +0 -58
  401. package/template/public/Cesium1.119/Workers/createEllipseOutlineGeometry.js +0 -51
  402. package/template/public/Cesium1.119/Workers/createEllipsoidGeometry.js +0 -46
  403. package/template/public/Cesium1.119/Workers/createEllipsoidOutlineGeometry.js +0 -45
  404. package/template/public/Cesium1.119/Workers/createFrustumGeometry.js +0 -45
  405. package/template/public/Cesium1.119/Workers/createFrustumOutlineGeometry.js +0 -164
  406. package/template/public/Cesium1.119/Workers/createGeometry.js +0 -159
  407. package/template/public/Cesium1.119/Workers/createGroundPolylineGeometry.js +0 -911
  408. package/template/public/Cesium1.119/Workers/createPlaneGeometry.js +0 -185
  409. package/template/public/Cesium1.119/Workers/createPlaneOutlineGeometry.js +0 -93
  410. package/template/public/Cesium1.119/Workers/createPolygonGeometry.js +0 -884
  411. package/template/public/Cesium1.119/Workers/createPolygonOutlineGeometry.js +0 -359
  412. package/template/public/Cesium1.119/Workers/createPolylineGeometry.js +0 -349
  413. package/template/public/Cesium1.119/Workers/createPolylineVolumeGeometry.js +0 -262
  414. package/template/public/Cesium1.119/Workers/createPolylineVolumeOutlineGeometry.js +0 -177
  415. package/template/public/Cesium1.119/Workers/createRectangleGeometry.js +0 -787
  416. package/template/public/Cesium1.119/Workers/createRectangleOutlineGeometry.js +0 -299
  417. package/template/public/Cesium1.119/Workers/createSimplePolylineGeometry.js +0 -294
  418. package/template/public/Cesium1.119/Workers/createSphereGeometry.js +0 -84
  419. package/template/public/Cesium1.119/Workers/createSphereOutlineGeometry.js +0 -83
  420. package/template/public/Cesium1.119/Workers/createTaskProcessorWorker.js +0 -28
  421. package/template/public/Cesium1.119/Workers/createVectorTileClampedPolylines.js +0 -289
  422. package/template/public/Cesium1.119/Workers/createVectorTileGeometries.js +0 -258
  423. package/template/public/Cesium1.119/Workers/createVectorTilePoints.js +0 -79
  424. package/template/public/Cesium1.119/Workers/createVectorTilePolygons.js +0 -275
  425. package/template/public/Cesium1.119/Workers/createVectorTilePolylines.js +0 -176
  426. package/template/public/Cesium1.119/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -375
  427. package/template/public/Cesium1.119/Workers/createVerticesFromHeightmap.js +0 -1772
  428. package/template/public/Cesium1.119/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -425
  429. package/template/public/Cesium1.119/Workers/createWallGeometry.js +0 -320
  430. package/template/public/Cesium1.119/Workers/createWallOutlineGeometry.js +0 -229
  431. package/template/public/Cesium1.119/Workers/decodeDraco.js +0 -227
  432. package/template/public/Cesium1.119/Workers/decodeGoogleEarthEnterprisePacket.js +0 -1836
  433. package/template/public/Cesium1.119/Workers/decodeI3S.js +0 -924
  434. package/template/public/Cesium1.119/Workers/transcodeKTX2.js +0 -3180
  435. package/template/public/Cesium1.119/Workers/transferTypedArrayTest.js +0 -34
  436. package/template/public/Cesium1.119/Workers/upsampleQuantizedTerrainMesh.js +0 -534
  437. package/template/public/Cesium1.119/index.cjs +0 -185632
  438. package/template/public/Cesium1.119/index.js +0 -182874
  439. package/template/src/views/Test/index.vue +0 -56
  440. package/template/tests/unit/example.test.ts +0 -7
@@ -1,1670 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.119
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 { a as et } from "./chunk-ABGXSJNX.js";
27
- import { a as jt } from "./chunk-DQO6B4EQ.js";
28
- import { b as Lt } from "./chunk-TAMCUKAR.js";
29
- import { a as Et } from "./chunk-PDMQLSBL.js";
30
- import { a as j } from "./chunk-P37AI2DW.js";
31
- import { a as mt, b as D, c as B, d as U } from "./chunk-X5IHHI6X.js";
32
- import { a as _t, b as Ut, d as rt } from "./chunk-TMSETF7M.js";
33
- import { a as dt, b as H } from "./chunk-7Z5IIKOJ.js";
34
- import { a as k } from "./chunk-KZNJOCYU.js";
35
- import { a as r, b as Mt, c as R, e as Ot } from "./chunk-POASMU2N.js";
36
- import { a as N } from "./chunk-R6KGAEF6.js";
37
- import { a as K } from "./chunk-IUA6FAOZ.js";
38
- import { a as I, b as pt } from "./chunk-UH2WFNTA.js";
39
- import { e as f } from "./chunk-PEYJTJPE.js";
40
- var Yt = new r(),
41
- Zt = new r(),
42
- Xt = new r();
43
- function pe(t, e, n, s, i) {
44
- (pt.defined("point", t),
45
- pt.defined("p0", e),
46
- pt.defined("p1", n),
47
- pt.defined("p2", s),
48
- f(i) || (i = new r()));
49
- let c, o, a, p, u, d, m, l;
50
- if (f(e.z)) {
51
- if (r.equalsEpsilon(t, e, N.EPSILON14)) return r.clone(r.UNIT_X, i);
52
- if (r.equalsEpsilon(t, n, N.EPSILON14)) return r.clone(r.UNIT_Y, i);
53
- if (r.equalsEpsilon(t, s, N.EPSILON14)) return r.clone(r.UNIT_Z, i);
54
- ((c = r.subtract(n, e, Yt)),
55
- (o = r.subtract(s, e, Zt)),
56
- (a = r.subtract(t, e, Xt)),
57
- (p = r.dot(c, c)),
58
- (u = r.dot(c, o)),
59
- (d = r.dot(c, a)),
60
- (m = r.dot(o, o)),
61
- (l = r.dot(o, a)));
62
- } else {
63
- if (R.equalsEpsilon(t, e, N.EPSILON14)) return r.clone(r.UNIT_X, i);
64
- if (R.equalsEpsilon(t, n, N.EPSILON14)) return r.clone(r.UNIT_Y, i);
65
- if (R.equalsEpsilon(t, s, N.EPSILON14)) return r.clone(r.UNIT_Z, i);
66
- ((c = R.subtract(n, e, Yt)),
67
- (o = R.subtract(s, e, Zt)),
68
- (a = R.subtract(t, e, Xt)),
69
- (p = R.dot(c, c)),
70
- (u = R.dot(c, o)),
71
- (d = R.dot(c, a)),
72
- (m = R.dot(o, o)),
73
- (l = R.dot(o, a)));
74
- }
75
- ((i.y = m * d - u * l), (i.z = p * l - u * d));
76
- let h = p * m - u * u;
77
- if (h !== 0) return ((i.y /= h), (i.z /= h), (i.x = 1 - i.y - i.z), i);
78
- }
79
- var Ht = pe;
80
- var Nt = {};
81
- Nt.calculateACMR = function (t) {
82
- t = K(t, K.EMPTY_OBJECT);
83
- let e = t.indices,
84
- n = t.maximumIndex,
85
- s = K(t.cacheSize, 24);
86
- if (!f(e)) throw new I("indices is required.");
87
- let i = e.length;
88
- if (i < 3 || i % 3 !== 0)
89
- throw new I("indices length must be a multiple of three.");
90
- if (n <= 0) throw new I("maximumIndex must be greater than zero.");
91
- if (s < 3) throw new I("cacheSize must be greater than two.");
92
- if (!f(n)) {
93
- n = 0;
94
- let a = 0,
95
- p = e[a];
96
- for (; a < i; ) (p > n && (n = p), ++a, (p = e[a]));
97
- }
98
- let c = [];
99
- for (let a = 0; a < n + 1; a++) c[a] = 0;
100
- let o = s + 1;
101
- for (let a = 0; a < i; ++a) o - c[e[a]] > s && ((c[e[a]] = o), ++o);
102
- return (o - s + 1) / (i / 3);
103
- };
104
- Nt.tipsify = function (t) {
105
- t = K(t, K.EMPTY_OBJECT);
106
- let e = t.indices,
107
- n = t.maximumIndex,
108
- s = K(t.cacheSize, 24),
109
- i;
110
- function c(C, z, q, V) {
111
- for (; z.length >= 1; ) {
112
- let G = z[z.length - 1];
113
- if ((z.splice(z.length - 1, 1), C[G].numLiveTriangles > 0)) return G;
114
- }
115
- for (; i < V; ) {
116
- if (C[i].numLiveTriangles > 0) return (++i, i - 1);
117
- ++i;
118
- }
119
- return -1;
120
- }
121
- function o(C, z, q, V, G, M, J) {
122
- let Y = -1,
123
- _,
124
- Pt = -1,
125
- gt = 0;
126
- for (; gt < q.length; ) {
127
- let ft = q[gt];
128
- (V[ft].numLiveTriangles &&
129
- ((_ = 0),
130
- G - V[ft].timeStamp + 2 * V[ft].numLiveTriangles <= z &&
131
- (_ = G - V[ft].timeStamp),
132
- (_ > Pt || Pt === -1) && ((Pt = _), (Y = ft))),
133
- ++gt);
134
- }
135
- return Y === -1 ? c(V, M, C, J) : Y;
136
- }
137
- if (!f(e)) throw new I("indices is required.");
138
- let a = e.length;
139
- if (a < 3 || a % 3 !== 0)
140
- throw new I("indices length must be a multiple of three.");
141
- if (n <= 0) throw new I("maximumIndex must be greater than zero.");
142
- if (s < 3) throw new I("cacheSize must be greater than two.");
143
- let p = 0,
144
- u = 0,
145
- d = e[u],
146
- m = a;
147
- if (f(n)) p = n + 1;
148
- else {
149
- for (; u < m; ) (d > p && (p = d), ++u, (d = e[u]));
150
- if (p === -1) return 0;
151
- ++p;
152
- }
153
- let l = [],
154
- h;
155
- for (h = 0; h < p; h++)
156
- l[h] = { numLiveTriangles: 0, timeStamp: 0, vertexTriangles: [] };
157
- u = 0;
158
- let y = 0;
159
- for (; u < m; )
160
- (l[e[u]].vertexTriangles.push(y),
161
- ++l[e[u]].numLiveTriangles,
162
- l[e[u + 1]].vertexTriangles.push(y),
163
- ++l[e[u + 1]].numLiveTriangles,
164
- l[e[u + 2]].vertexTriangles.push(y),
165
- ++l[e[u + 2]].numLiveTriangles,
166
- ++y,
167
- (u += 3));
168
- let v = 0,
169
- b = s + 1;
170
- i = 1;
171
- let S = [],
172
- x = [],
173
- w,
174
- A,
175
- E = 0,
176
- P = [],
177
- O = a / 3,
178
- L = [];
179
- for (h = 0; h < O; h++) L[h] = !1;
180
- let g, T;
181
- for (; v !== -1; ) {
182
- ((S = []), (A = l[v]), (T = A.vertexTriangles.length));
183
- for (let C = 0; C < T; ++C)
184
- if (((y = A.vertexTriangles[C]), !L[y])) {
185
- ((L[y] = !0), (u = y + y + y));
186
- for (let z = 0; z < 3; ++z)
187
- ((g = e[u]),
188
- S.push(g),
189
- x.push(g),
190
- (P[E] = g),
191
- ++E,
192
- (w = l[g]),
193
- --w.numLiveTriangles,
194
- b - w.timeStamp > s && ((w.timeStamp = b), ++b),
195
- ++u);
196
- }
197
- v = o(e, s, S, l, b, x, p);
198
- }
199
- return P;
200
- };
201
- var Wt = Nt;
202
- var F = {};
203
- function St(t, e, n, s, i) {
204
- ((t[e++] = n),
205
- (t[e++] = s),
206
- (t[e++] = s),
207
- (t[e++] = i),
208
- (t[e++] = i),
209
- (t[e] = n));
210
- }
211
- function de(t) {
212
- let e = t.length,
213
- n = (e / 3) * 6,
214
- s = j.createTypedArray(e, n),
215
- i = 0;
216
- for (let c = 0; c < e; c += 3, i += 6) St(s, i, t[c], t[c + 1], t[c + 2]);
217
- return s;
218
- }
219
- function me(t) {
220
- let e = t.length;
221
- if (e >= 3) {
222
- let n = (e - 2) * 6,
223
- s = j.createTypedArray(e, n);
224
- St(s, 0, t[0], t[1], t[2]);
225
- let i = 6;
226
- for (let c = 3; c < e; ++c, i += 6) St(s, i, t[c - 1], t[c], t[c - 2]);
227
- return s;
228
- }
229
- return new Uint16Array();
230
- }
231
- function he(t) {
232
- if (t.length > 0) {
233
- let e = t.length - 1,
234
- n = (e - 1) * 6,
235
- s = j.createTypedArray(e, n),
236
- i = t[0],
237
- c = 0;
238
- for (let o = 1; o < e; ++o, c += 6) St(s, c, i, t[o], t[o + 1]);
239
- return s;
240
- }
241
- return new Uint16Array();
242
- }
243
- F.toWireframe = function (t) {
244
- if (!f(t)) throw new I("geometry is required.");
245
- let e = t.indices;
246
- if (f(e)) {
247
- switch (t.primitiveType) {
248
- case D.TRIANGLES:
249
- t.indices = de(e);
250
- break;
251
- case D.TRIANGLE_STRIP:
252
- t.indices = me(e);
253
- break;
254
- case D.TRIANGLE_FAN:
255
- t.indices = he(e);
256
- break;
257
- default:
258
- throw new I(
259
- "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.",
260
- );
261
- }
262
- t.primitiveType = D.LINES;
263
- }
264
- return t;
265
- };
266
- F.createLineSegmentsForVectors = function (t, e, n) {
267
- if (((e = K(e, "normal")), !f(t))) throw new I("geometry is required.");
268
- if (!f(t.attributes.position))
269
- throw new I("geometry.attributes.position is required.");
270
- if (!f(t.attributes[e]))
271
- throw new I(
272
- `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`,
273
- );
274
- n = K(n, 1e4);
275
- let s = t.attributes.position.values,
276
- i = t.attributes[e].values,
277
- c = s.length,
278
- o = new Float64Array(2 * c),
279
- a = 0;
280
- for (let d = 0; d < c; d += 3)
281
- ((o[a++] = s[d]),
282
- (o[a++] = s[d + 1]),
283
- (o[a++] = s[d + 2]),
284
- (o[a++] = s[d] + i[d] * n),
285
- (o[a++] = s[d + 1] + i[d + 1] * n),
286
- (o[a++] = s[d + 2] + i[d + 2] * n));
287
- let p,
288
- u = t.boundingSphere;
289
- return (
290
- f(u) && (p = new rt(u.center, u.radius + n)),
291
- new B({
292
- attributes: {
293
- position: new U({
294
- componentDatatype: k.DOUBLE,
295
- componentsPerAttribute: 3,
296
- values: o,
297
- }),
298
- },
299
- primitiveType: D.LINES,
300
- boundingSphere: p,
301
- })
302
- );
303
- };
304
- F.createAttributeLocations = function (t) {
305
- if (!f(t)) throw new I("geometry is required.");
306
- let e = [
307
- "position",
308
- "positionHigh",
309
- "positionLow",
310
- "position3DHigh",
311
- "position3DLow",
312
- "position2DHigh",
313
- "position2DLow",
314
- "pickColor",
315
- "normal",
316
- "st",
317
- "tangent",
318
- "bitangent",
319
- "extrudeDirection",
320
- "compressedAttributes",
321
- ],
322
- n = t.attributes,
323
- s = {},
324
- i = 0,
325
- c,
326
- o = e.length;
327
- for (c = 0; c < o; ++c) {
328
- let a = e[c];
329
- f(n[a]) && (s[a] = i++);
330
- }
331
- for (let a in n) n.hasOwnProperty(a) && !f(s[a]) && (s[a] = i++);
332
- return s;
333
- };
334
- F.reorderForPreVertexCache = function (t) {
335
- if (!f(t)) throw new I("geometry is required.");
336
- let e = B.computeNumberOfVertices(t),
337
- n = t.indices;
338
- if (f(n)) {
339
- let s = new Int32Array(e);
340
- for (let l = 0; l < e; l++) s[l] = -1;
341
- let i = n,
342
- c = i.length,
343
- o = j.createTypedArray(e, c),
344
- a = 0,
345
- p = 0,
346
- u = 0,
347
- d;
348
- for (; a < c; )
349
- ((d = s[i[a]]),
350
- d !== -1 ? (o[p] = d) : ((d = i[a]), (s[d] = u), (o[p] = u), ++u),
351
- ++a,
352
- ++p);
353
- t.indices = o;
354
- let m = t.attributes;
355
- for (let l in m)
356
- if (m.hasOwnProperty(l) && f(m[l]) && f(m[l].values)) {
357
- let h = m[l],
358
- y = h.values,
359
- v = 0,
360
- b = h.componentsPerAttribute,
361
- S = k.createTypedArray(h.componentDatatype, u * b);
362
- for (; v < e; ) {
363
- let x = s[v];
364
- if (x !== -1) for (let w = 0; w < b; w++) S[b * x + w] = y[b * v + w];
365
- ++v;
366
- }
367
- h.values = S;
368
- }
369
- }
370
- return t;
371
- };
372
- F.reorderForPostVertexCache = function (t, e) {
373
- if (!f(t)) throw new I("geometry is required.");
374
- let n = t.indices;
375
- if (t.primitiveType === D.TRIANGLES && f(n)) {
376
- let s = n.length,
377
- i = 0;
378
- for (let c = 0; c < s; c++) n[c] > i && (i = n[c]);
379
- t.indices = Wt.tipsify({ indices: n, maximumIndex: i, cacheSize: e });
380
- }
381
- return t;
382
- };
383
- function $t(t) {
384
- let e = {};
385
- for (let n in t)
386
- if (t.hasOwnProperty(n) && f(t[n]) && f(t[n].values)) {
387
- let s = t[n];
388
- e[n] = new U({
389
- componentDatatype: s.componentDatatype,
390
- componentsPerAttribute: s.componentsPerAttribute,
391
- normalize: s.normalize,
392
- values: [],
393
- });
394
- }
395
- return e;
396
- }
397
- function be(t, e, n) {
398
- for (let s in e)
399
- if (e.hasOwnProperty(s) && f(e[s]) && f(e[s].values)) {
400
- let i = e[s];
401
- for (let c = 0; c < i.componentsPerAttribute; ++c)
402
- t[s].values.push(i.values[n * i.componentsPerAttribute + c]);
403
- }
404
- }
405
- F.fitToUnsignedShortIndices = function (t) {
406
- if (!f(t)) throw new I("geometry is required.");
407
- if (
408
- f(t.indices) &&
409
- t.primitiveType !== D.TRIANGLES &&
410
- t.primitiveType !== D.LINES &&
411
- t.primitiveType !== D.POINTS
412
- )
413
- throw new I(
414
- "geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.",
415
- );
416
- let e = [],
417
- n = B.computeNumberOfVertices(t);
418
- if (f(t.indices) && n >= N.SIXTY_FOUR_KILOBYTES) {
419
- let s = [],
420
- i = [],
421
- c = 0,
422
- o = $t(t.attributes),
423
- a = t.indices,
424
- p = a.length,
425
- u;
426
- t.primitiveType === D.TRIANGLES
427
- ? (u = 3)
428
- : t.primitiveType === D.LINES
429
- ? (u = 2)
430
- : t.primitiveType === D.POINTS && (u = 1);
431
- for (let d = 0; d < p; d += u) {
432
- for (let m = 0; m < u; ++m) {
433
- let l = a[d + m],
434
- h = s[l];
435
- (f(h) || ((h = c++), (s[l] = h), be(o, t.attributes, l)), i.push(h));
436
- }
437
- c + u >= N.SIXTY_FOUR_KILOBYTES &&
438
- (e.push(
439
- new B({
440
- attributes: o,
441
- indices: i,
442
- primitiveType: t.primitiveType,
443
- boundingSphere: t.boundingSphere,
444
- boundingSphereCV: t.boundingSphereCV,
445
- }),
446
- ),
447
- (s = []),
448
- (i = []),
449
- (c = 0),
450
- (o = $t(t.attributes)));
451
- }
452
- i.length !== 0 &&
453
- e.push(
454
- new B({
455
- attributes: o,
456
- indices: i,
457
- primitiveType: t.primitiveType,
458
- boundingSphere: t.boundingSphere,
459
- boundingSphereCV: t.boundingSphereCV,
460
- }),
461
- );
462
- } else e.push(t);
463
- return e;
464
- };
465
- var Jt = new r(),
466
- we = new Mt();
467
- F.projectTo2D = function (t, e, n, s, i) {
468
- if (!f(t)) throw new I("geometry is required.");
469
- if (!f(e)) throw new I("attributeName is required.");
470
- if (!f(n)) throw new I("attributeName3D is required.");
471
- if (!f(s)) throw new I("attributeName2D is required.");
472
- if (!f(t.attributes[e]))
473
- throw new I(
474
- `geometry must have attribute matching the attributeName argument: ${e}.`,
475
- );
476
- if (t.attributes[e].componentDatatype !== k.DOUBLE)
477
- throw new I(
478
- "The attribute componentDatatype must be ComponentDatatype.DOUBLE.",
479
- );
480
- let c = t.attributes[e];
481
- i = f(i) ? i : new _t();
482
- let o = i.ellipsoid,
483
- a = c.values,
484
- p = new Float64Array(a.length),
485
- u = 0;
486
- for (let d = 0; d < a.length; d += 3) {
487
- let m = r.fromArray(a, d, Jt),
488
- l = o.cartesianToCartographic(m, we);
489
- if (!f(l))
490
- throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);
491
- let h = i.project(l, Jt);
492
- ((p[u++] = h.x), (p[u++] = h.y), (p[u++] = h.z));
493
- }
494
- return (
495
- (t.attributes[n] = c),
496
- (t.attributes[s] = new U({
497
- componentDatatype: k.DOUBLE,
498
- componentsPerAttribute: 3,
499
- values: p,
500
- })),
501
- delete t.attributes[e],
502
- t
503
- );
504
- };
505
- var zt = { high: 0, low: 0 };
506
- F.encodeAttribute = function (t, e, n, s) {
507
- if (!f(t)) throw new I("geometry is required.");
508
- if (!f(e)) throw new I("attributeName is required.");
509
- if (!f(n)) throw new I("attributeHighName is required.");
510
- if (!f(s)) throw new I("attributeLowName is required.");
511
- if (!f(t.attributes[e]))
512
- throw new I(
513
- `geometry must have attribute matching the attributeName argument: ${e}.`,
514
- );
515
- if (t.attributes[e].componentDatatype !== k.DOUBLE)
516
- throw new I(
517
- "The attribute componentDatatype must be ComponentDatatype.DOUBLE.",
518
- );
519
- let i = t.attributes[e],
520
- c = i.values,
521
- o = c.length,
522
- a = new Float32Array(o),
523
- p = new Float32Array(o);
524
- for (let d = 0; d < o; ++d)
525
- (jt.encode(c[d], zt), (a[d] = zt.high), (p[d] = zt.low));
526
- let u = i.componentsPerAttribute;
527
- return (
528
- (t.attributes[n] = new U({
529
- componentDatatype: k.FLOAT,
530
- componentsPerAttribute: u,
531
- values: a,
532
- })),
533
- (t.attributes[s] = new U({
534
- componentDatatype: k.FLOAT,
535
- componentsPerAttribute: u,
536
- values: p,
537
- })),
538
- delete t.attributes[e],
539
- t
540
- );
541
- };
542
- var $ = new r();
543
- function Dt(t, e) {
544
- if (f(e)) {
545
- let n = e.values,
546
- s = n.length;
547
- for (let i = 0; i < s; i += 3)
548
- (r.unpack(n, i, $), H.multiplyByPoint(t, $, $), r.pack($, n, i));
549
- }
550
- }
551
- function qt(t, e) {
552
- if (f(e)) {
553
- let n = e.values,
554
- s = n.length;
555
- for (let i = 0; i < s; i += 3)
556
- (r.unpack(n, i, $),
557
- Ot.multiplyByVector(t, $, $),
558
- ($ = r.normalize($, $)),
559
- r.pack($, n, i));
560
- }
561
- }
562
- var vt = new H(),
563
- yt = new Ot();
564
- F.transformToWorldCoordinates = function (t) {
565
- if (!f(t)) throw new I("instance is required.");
566
- let e = t.modelMatrix;
567
- if (H.equals(e, H.IDENTITY)) return t;
568
- let n = t.geometry.attributes;
569
- (Dt(e, n.position),
570
- Dt(e, n.prevPosition),
571
- Dt(e, n.nextPosition),
572
- (f(n.normal) || f(n.tangent) || f(n.bitangent)) &&
573
- (H.inverse(e, vt),
574
- H.transpose(vt, vt),
575
- H.getMatrix3(vt, yt),
576
- qt(yt, n.normal),
577
- qt(yt, n.tangent),
578
- qt(yt, n.bitangent)));
579
- let s = t.geometry.boundingSphere;
580
- return (
581
- f(s) && (t.geometry.boundingSphere = rt.transform(s, e, s)),
582
- (t.modelMatrix = H.clone(H.IDENTITY)),
583
- t
584
- );
585
- };
586
- function ve(t, e) {
587
- let n = t.length,
588
- s = {},
589
- i = t[0][e].attributes,
590
- c;
591
- for (c in i)
592
- if (i.hasOwnProperty(c) && f(i[c]) && f(i[c].values)) {
593
- let o = i[c],
594
- a = o.values.length,
595
- p = !0;
596
- for (let u = 1; u < n; ++u) {
597
- let d = t[u][e].attributes[c];
598
- if (
599
- !f(d) ||
600
- o.componentDatatype !== d.componentDatatype ||
601
- o.componentsPerAttribute !== d.componentsPerAttribute ||
602
- o.normalize !== d.normalize
603
- ) {
604
- p = !1;
605
- break;
606
- }
607
- a += d.values.length;
608
- }
609
- p &&
610
- (s[c] = new U({
611
- componentDatatype: o.componentDatatype,
612
- componentsPerAttribute: o.componentsPerAttribute,
613
- normalize: o.normalize,
614
- values: k.createTypedArray(o.componentDatatype, a),
615
- }));
616
- }
617
- return s;
618
- }
619
- var ye = new r();
620
- function Vt(t, e) {
621
- let n = t.length,
622
- s,
623
- i,
624
- c,
625
- o,
626
- a = t[0].modelMatrix,
627
- p = f(t[0][e].indices),
628
- u = t[0][e].primitiveType;
629
- for (i = 1; i < n; ++i) {
630
- if (!H.equals(t[i].modelMatrix, a))
631
- throw new I("All instances must have the same modelMatrix.");
632
- if (f(t[i][e].indices) !== p)
633
- throw new I(
634
- "All instance geometries must have an indices or not have one.",
635
- );
636
- if (t[i][e].primitiveType !== u)
637
- throw new I("All instance geometries must have the same primitiveType.");
638
- }
639
- let d = ve(t, e),
640
- m,
641
- l,
642
- h;
643
- for (s in d)
644
- if (d.hasOwnProperty(s))
645
- for (m = d[s].values, o = 0, i = 0; i < n; ++i)
646
- for (l = t[i][e].attributes[s].values, h = l.length, c = 0; c < h; ++c)
647
- m[o++] = l[c];
648
- let y;
649
- if (p) {
650
- let x = 0;
651
- for (i = 0; i < n; ++i) x += t[i][e].indices.length;
652
- let w = B.computeNumberOfVertices(
653
- new B({ attributes: d, primitiveType: D.POINTS }),
654
- ),
655
- A = j.createTypedArray(w, x),
656
- E = 0,
657
- P = 0;
658
- for (i = 0; i < n; ++i) {
659
- let O = t[i][e].indices,
660
- L = O.length;
661
- for (o = 0; o < L; ++o) A[E++] = P + O[o];
662
- P += B.computeNumberOfVertices(t[i][e]);
663
- }
664
- y = A;
665
- }
666
- let v = new r(),
667
- b = 0,
668
- S;
669
- for (i = 0; i < n; ++i) {
670
- if (((S = t[i][e].boundingSphere), !f(S))) {
671
- v = void 0;
672
- break;
673
- }
674
- r.add(S.center, v, v);
675
- }
676
- if (f(v))
677
- for (r.divideByScalar(v, n, v), i = 0; i < n; ++i) {
678
- S = t[i][e].boundingSphere;
679
- let x = r.magnitude(r.subtract(S.center, v, ye)) + S.radius;
680
- x > b && (b = x);
681
- }
682
- return new B({
683
- attributes: d,
684
- indices: y,
685
- primitiveType: u,
686
- boundingSphere: f(v) ? new rt(v, b) : void 0,
687
- });
688
- }
689
- F.combineInstances = function (t) {
690
- if (!f(t) || t.length < 1)
691
- throw new I(
692
- "instances is required and must have length greater than zero.",
693
- );
694
- let e = [],
695
- n = [],
696
- s = t.length;
697
- for (let c = 0; c < s; ++c) {
698
- let o = t[c];
699
- f(o.geometry)
700
- ? e.push(o)
701
- : f(o.westHemisphereGeometry) && f(o.eastHemisphereGeometry) && n.push(o);
702
- }
703
- let i = [];
704
- return (
705
- e.length > 0 && i.push(Vt(e, "geometry")),
706
- n.length > 0 &&
707
- (i.push(Vt(n, "westHemisphereGeometry")),
708
- i.push(Vt(n, "eastHemisphereGeometry"))),
709
- i
710
- );
711
- };
712
- var Z = new r(),
713
- ht = new r(),
714
- ct = new r(),
715
- at = new r();
716
- F.computeNormal = function (t) {
717
- if (!f(t)) throw new I("geometry is required.");
718
- if (!f(t.attributes.position) || !f(t.attributes.position.values))
719
- throw new I("geometry.attributes.position.values is required.");
720
- if (!f(t.indices)) throw new I("geometry.indices is required.");
721
- if (t.indices.length < 2 || t.indices.length % 3 !== 0)
722
- throw new I(
723
- "geometry.indices length must be greater than 0 and be a multiple of 3.",
724
- );
725
- if (t.primitiveType !== D.TRIANGLES)
726
- throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");
727
- let e = t.indices,
728
- n = t.attributes,
729
- s = n.position.values,
730
- i = n.position.values.length / 3,
731
- c = e.length,
732
- o = new Array(i),
733
- a = new Array(c / 3),
734
- p = new Array(c),
735
- u;
736
- for (u = 0; u < i; u++) o[u] = { indexOffset: 0, count: 0, currentCount: 0 };
737
- let d = 0;
738
- for (u = 0; u < c; u += 3) {
739
- let y = e[u],
740
- v = e[u + 1],
741
- b = e[u + 2],
742
- S = y * 3,
743
- x = v * 3,
744
- w = b * 3;
745
- ((ht.x = s[S]),
746
- (ht.y = s[S + 1]),
747
- (ht.z = s[S + 2]),
748
- (ct.x = s[x]),
749
- (ct.y = s[x + 1]),
750
- (ct.z = s[x + 2]),
751
- (at.x = s[w]),
752
- (at.y = s[w + 1]),
753
- (at.z = s[w + 2]),
754
- o[y].count++,
755
- o[v].count++,
756
- o[b].count++,
757
- r.subtract(ct, ht, ct),
758
- r.subtract(at, ht, at),
759
- (a[d] = r.cross(ct, at, new r())),
760
- d++);
761
- }
762
- let m = 0;
763
- for (u = 0; u < i; u++) ((o[u].indexOffset += m), (m += o[u].count));
764
- d = 0;
765
- let l;
766
- for (u = 0; u < c; u += 3) {
767
- l = o[e[u]];
768
- let y = l.indexOffset + l.currentCount;
769
- ((p[y] = d),
770
- l.currentCount++,
771
- (l = o[e[u + 1]]),
772
- (y = l.indexOffset + l.currentCount),
773
- (p[y] = d),
774
- l.currentCount++,
775
- (l = o[e[u + 2]]),
776
- (y = l.indexOffset + l.currentCount),
777
- (p[y] = d),
778
- l.currentCount++,
779
- d++);
780
- }
781
- let h = new Float32Array(i * 3);
782
- for (u = 0; u < i; u++) {
783
- let y = u * 3;
784
- if (((l = o[u]), r.clone(r.ZERO, Z), l.count > 0)) {
785
- for (d = 0; d < l.count; d++) r.add(Z, a[p[l.indexOffset + d]], Z);
786
- r.equalsEpsilon(r.ZERO, Z, N.EPSILON10) &&
787
- r.clone(a[p[l.indexOffset]], Z);
788
- }
789
- (r.equalsEpsilon(r.ZERO, Z, N.EPSILON10) && (Z.z = 1),
790
- r.normalize(Z, Z),
791
- (h[y] = Z.x),
792
- (h[y + 1] = Z.y),
793
- (h[y + 2] = Z.z));
794
- }
795
- return (
796
- (t.attributes.normal = new U({
797
- componentDatatype: k.FLOAT,
798
- componentsPerAttribute: 3,
799
- values: h,
800
- })),
801
- t
802
- );
803
- };
804
- var xe = new r(),
805
- Kt = new r(),
806
- Te = new r();
807
- F.computeTangentAndBitangent = function (t) {
808
- if (!f(t)) throw new I("geometry is required.");
809
- let e = t.attributes,
810
- n = t.indices;
811
- if (!f(e.position) || !f(e.position.values))
812
- throw new I("geometry.attributes.position.values is required.");
813
- if (!f(e.normal) || !f(e.normal.values))
814
- throw new I("geometry.attributes.normal.values is required.");
815
- if (!f(e.st) || !f(e.st.values))
816
- throw new I("geometry.attributes.st.values is required.");
817
- if (!f(n)) throw new I("geometry.indices is required.");
818
- if (n.length < 2 || n.length % 3 !== 0)
819
- throw new I(
820
- "geometry.indices length must be greater than 0 and be a multiple of 3.",
821
- );
822
- if (t.primitiveType !== D.TRIANGLES)
823
- throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");
824
- let s = t.attributes.position.values,
825
- i = t.attributes.normal.values,
826
- c = t.attributes.st.values,
827
- o = t.attributes.position.values.length / 3,
828
- a = n.length,
829
- p = new Array(o * 3),
830
- u;
831
- for (u = 0; u < p.length; u++) p[u] = 0;
832
- let d, m, l;
833
- for (u = 0; u < a; u += 3) {
834
- let v = n[u],
835
- b = n[u + 1],
836
- S = n[u + 2];
837
- ((d = v * 3), (m = b * 3), (l = S * 3));
838
- let x = v * 2,
839
- w = b * 2,
840
- A = S * 2,
841
- E = s[d],
842
- P = s[d + 1],
843
- O = s[d + 2],
844
- L = c[x],
845
- g = c[x + 1],
846
- T = c[w + 1] - g,
847
- C = c[A + 1] - g,
848
- z = 1 / ((c[w] - L) * C - (c[A] - L) * T),
849
- q = (C * (s[m] - E) - T * (s[l] - E)) * z,
850
- V = (C * (s[m + 1] - P) - T * (s[l + 1] - P)) * z,
851
- G = (C * (s[m + 2] - O) - T * (s[l + 2] - O)) * z;
852
- ((p[d] += q),
853
- (p[d + 1] += V),
854
- (p[d + 2] += G),
855
- (p[m] += q),
856
- (p[m + 1] += V),
857
- (p[m + 2] += G),
858
- (p[l] += q),
859
- (p[l + 1] += V),
860
- (p[l + 2] += G));
861
- }
862
- let h = new Float32Array(o * 3),
863
- y = new Float32Array(o * 3);
864
- for (u = 0; u < o; u++) {
865
- ((d = u * 3), (m = d + 1), (l = d + 2));
866
- let v = r.fromArray(i, d, xe),
867
- b = r.fromArray(p, d, Te),
868
- S = r.dot(v, b);
869
- (r.multiplyByScalar(v, S, Kt),
870
- r.normalize(r.subtract(b, Kt, b), b),
871
- (h[d] = b.x),
872
- (h[m] = b.y),
873
- (h[l] = b.z),
874
- r.normalize(r.cross(v, b, b), b),
875
- (y[d] = b.x),
876
- (y[m] = b.y),
877
- (y[l] = b.z));
878
- }
879
- return (
880
- (t.attributes.tangent = new U({
881
- componentDatatype: k.FLOAT,
882
- componentsPerAttribute: 3,
883
- values: h,
884
- })),
885
- (t.attributes.bitangent = new U({
886
- componentDatatype: k.FLOAT,
887
- componentsPerAttribute: 3,
888
- values: y,
889
- })),
890
- t
891
- );
892
- };
893
- var bt = new R(),
894
- W = new r(),
895
- Qt = new r(),
896
- te = new r(),
897
- xt = new R();
898
- F.compressVertices = function (t) {
899
- if (!f(t)) throw new I("geometry is required.");
900
- let e = t.attributes.extrudeDirection,
901
- n,
902
- s;
903
- if (f(e)) {
904
- let P = e.values;
905
- s = P.length / 3;
906
- let O = new Float32Array(s * 2),
907
- L = 0;
908
- for (n = 0; n < s; ++n) {
909
- if ((r.fromArray(P, n * 3, W), r.equals(W, r.ZERO))) {
910
- L += 2;
911
- continue;
912
- }
913
- ((xt = et.octEncodeInRange(W, 65535, xt)),
914
- (O[L++] = xt.x),
915
- (O[L++] = xt.y));
916
- }
917
- return (
918
- (t.attributes.compressedAttributes = new U({
919
- componentDatatype: k.FLOAT,
920
- componentsPerAttribute: 2,
921
- values: O,
922
- })),
923
- delete t.attributes.extrudeDirection,
924
- t
925
- );
926
- }
927
- let i = t.attributes.normal,
928
- c = t.attributes.st,
929
- o = f(i),
930
- a = f(c);
931
- if (!o && !a) return t;
932
- let p = t.attributes.tangent,
933
- u = t.attributes.bitangent,
934
- d = f(p),
935
- m = f(u),
936
- l,
937
- h,
938
- y,
939
- v;
940
- (o && (l = i.values),
941
- a && (h = c.values),
942
- d && (y = p.values),
943
- m && (v = u.values),
944
- (s = (o ? l.length : h.length) / (o ? 3 : 2)));
945
- let x = s,
946
- w = a && o ? 2 : 1;
947
- ((w += d || m ? 1 : 0), (x *= w));
948
- let A = new Float32Array(x),
949
- E = 0;
950
- for (n = 0; n < s; ++n) {
951
- a &&
952
- (R.fromArray(h, n * 2, bt), (A[E++] = et.compressTextureCoordinates(bt)));
953
- let P = n * 3;
954
- o && f(y) && f(v)
955
- ? (r.fromArray(l, P, W),
956
- r.fromArray(y, P, Qt),
957
- r.fromArray(v, P, te),
958
- et.octPack(W, Qt, te, bt),
959
- (A[E++] = bt.x),
960
- (A[E++] = bt.y))
961
- : (o && (r.fromArray(l, P, W), (A[E++] = et.octEncodeFloat(W))),
962
- d && (r.fromArray(y, P, W), (A[E++] = et.octEncodeFloat(W))),
963
- m && (r.fromArray(v, P, W), (A[E++] = et.octEncodeFloat(W))));
964
- }
965
- return (
966
- (t.attributes.compressedAttributes = new U({
967
- componentDatatype: k.FLOAT,
968
- componentsPerAttribute: w,
969
- values: A,
970
- })),
971
- o && delete t.attributes.normal,
972
- a && delete t.attributes.st,
973
- m && delete t.attributes.bitangent,
974
- d && delete t.attributes.tangent,
975
- t
976
- );
977
- };
978
- function Ae(t) {
979
- if (f(t.indices)) return t;
980
- let e = B.computeNumberOfVertices(t);
981
- if (e < 3) throw new I("The number of vertices must be at least three.");
982
- if (e % 3 !== 0)
983
- throw new I("The number of vertices must be a multiple of three.");
984
- let n = j.createTypedArray(e, e);
985
- for (let s = 0; s < e; ++s) n[s] = s;
986
- return ((t.indices = n), t);
987
- }
988
- function Ie(t) {
989
- let e = B.computeNumberOfVertices(t);
990
- if (e < 3) throw new I("The number of vertices must be at least three.");
991
- let n = j.createTypedArray(e, (e - 2) * 3);
992
- ((n[0] = 1), (n[1] = 0), (n[2] = 2));
993
- let s = 3;
994
- for (let i = 3; i < e; ++i) ((n[s++] = i - 1), (n[s++] = 0), (n[s++] = i));
995
- return ((t.indices = n), (t.primitiveType = D.TRIANGLES), t);
996
- }
997
- function Se(t) {
998
- let e = B.computeNumberOfVertices(t);
999
- if (e < 3) throw new I("The number of vertices must be at least 3.");
1000
- let n = j.createTypedArray(e, (e - 2) * 3);
1001
- ((n[0] = 0),
1002
- (n[1] = 1),
1003
- (n[2] = 2),
1004
- e > 3 && ((n[3] = 0), (n[4] = 2), (n[5] = 3)));
1005
- let s = 6;
1006
- for (let i = 3; i < e - 1; i += 2)
1007
- ((n[s++] = i),
1008
- (n[s++] = i - 1),
1009
- (n[s++] = i + 1),
1010
- i + 2 < e && ((n[s++] = i), (n[s++] = i + 1), (n[s++] = i + 2)));
1011
- return ((t.indices = n), (t.primitiveType = D.TRIANGLES), t);
1012
- }
1013
- function Pe(t) {
1014
- if (f(t.indices)) return t;
1015
- let e = B.computeNumberOfVertices(t);
1016
- if (e < 2) throw new I("The number of vertices must be at least two.");
1017
- if (e % 2 !== 0)
1018
- throw new I("The number of vertices must be a multiple of 2.");
1019
- let n = j.createTypedArray(e, e);
1020
- for (let s = 0; s < e; ++s) n[s] = s;
1021
- return ((t.indices = n), t);
1022
- }
1023
- function ge(t) {
1024
- let e = B.computeNumberOfVertices(t);
1025
- if (e < 2) throw new I("The number of vertices must be at least two.");
1026
- let n = j.createTypedArray(e, (e - 1) * 2);
1027
- ((n[0] = 0), (n[1] = 1));
1028
- let s = 2;
1029
- for (let i = 2; i < e; ++i) ((n[s++] = i - 1), (n[s++] = i));
1030
- return ((t.indices = n), (t.primitiveType = D.LINES), t);
1031
- }
1032
- function Oe(t) {
1033
- let e = B.computeNumberOfVertices(t);
1034
- if (e < 2) throw new I("The number of vertices must be at least two.");
1035
- let n = j.createTypedArray(e, e * 2);
1036
- ((n[0] = 0), (n[1] = 1));
1037
- let s = 2;
1038
- for (let i = 2; i < e; ++i) ((n[s++] = i - 1), (n[s++] = i));
1039
- return (
1040
- (n[s++] = e - 1),
1041
- (n[s] = 0),
1042
- (t.indices = n),
1043
- (t.primitiveType = D.LINES),
1044
- t
1045
- );
1046
- }
1047
- function Le(t) {
1048
- switch (t.primitiveType) {
1049
- case D.TRIANGLE_FAN:
1050
- return Ie(t);
1051
- case D.TRIANGLE_STRIP:
1052
- return Se(t);
1053
- case D.TRIANGLES:
1054
- return Ae(t);
1055
- case D.LINE_STRIP:
1056
- return ge(t);
1057
- case D.LINE_LOOP:
1058
- return Oe(t);
1059
- case D.LINES:
1060
- return Pe(t);
1061
- }
1062
- return t;
1063
- }
1064
- function tt(t, e) {
1065
- Math.abs(t.y) < N.EPSILON6 && (e ? (t.y = -N.EPSILON6) : (t.y = N.EPSILON6));
1066
- }
1067
- function Ee(t, e, n) {
1068
- if (t.y !== 0 && e.y !== 0 && n.y !== 0) {
1069
- (tt(t, t.y < 0), tt(e, e.y < 0), tt(n, n.y < 0));
1070
- return;
1071
- }
1072
- let s = Math.abs(t.y),
1073
- i = Math.abs(e.y),
1074
- c = Math.abs(n.y),
1075
- o;
1076
- s > i
1077
- ? s > c
1078
- ? (o = N.sign(t.y))
1079
- : (o = N.sign(n.y))
1080
- : i > c
1081
- ? (o = N.sign(e.y))
1082
- : (o = N.sign(n.y));
1083
- let a = o < 0;
1084
- (tt(t, a), tt(e, a), tt(n, a));
1085
- }
1086
- var ee = new r();
1087
- function X(t, e, n, s) {
1088
- (r.add(t, r.multiplyByScalar(r.subtract(e, t, ee), t.y / (t.y - e.y), ee), n),
1089
- r.clone(n, s),
1090
- tt(n, !0),
1091
- tt(s, !1));
1092
- }
1093
- var nt = new r(),
1094
- it = new r(),
1095
- st = new r(),
1096
- ot = new r(),
1097
- Rt = { positions: new Array(7), indices: new Array(3 * 3) };
1098
- function Ne(t, e, n) {
1099
- if (t.x >= 0 || e.x >= 0 || n.x >= 0) return;
1100
- Ee(t, e, n);
1101
- let s = t.y < 0,
1102
- i = e.y < 0,
1103
- c = n.y < 0,
1104
- o = 0;
1105
- ((o += s ? 1 : 0), (o += i ? 1 : 0), (o += c ? 1 : 0));
1106
- let a = Rt.indices;
1107
- o === 1
1108
- ? ((a[1] = 3),
1109
- (a[2] = 4),
1110
- (a[5] = 6),
1111
- (a[7] = 6),
1112
- (a[8] = 5),
1113
- s
1114
- ? (X(t, e, nt, st),
1115
- X(t, n, it, ot),
1116
- (a[0] = 0),
1117
- (a[3] = 1),
1118
- (a[4] = 2),
1119
- (a[6] = 1))
1120
- : i
1121
- ? (X(e, n, nt, st),
1122
- X(e, t, it, ot),
1123
- (a[0] = 1),
1124
- (a[3] = 2),
1125
- (a[4] = 0),
1126
- (a[6] = 2))
1127
- : c &&
1128
- (X(n, t, nt, st),
1129
- X(n, e, it, ot),
1130
- (a[0] = 2),
1131
- (a[3] = 0),
1132
- (a[4] = 1),
1133
- (a[6] = 0)))
1134
- : o === 2 &&
1135
- ((a[2] = 4),
1136
- (a[4] = 4),
1137
- (a[5] = 3),
1138
- (a[7] = 5),
1139
- (a[8] = 6),
1140
- s
1141
- ? i
1142
- ? c ||
1143
- (X(n, t, nt, st),
1144
- X(n, e, it, ot),
1145
- (a[0] = 0),
1146
- (a[1] = 1),
1147
- (a[3] = 0),
1148
- (a[6] = 2))
1149
- : (X(e, n, nt, st),
1150
- X(e, t, it, ot),
1151
- (a[0] = 2),
1152
- (a[1] = 0),
1153
- (a[3] = 2),
1154
- (a[6] = 1))
1155
- : (X(t, e, nt, st),
1156
- X(t, n, it, ot),
1157
- (a[0] = 1),
1158
- (a[1] = 2),
1159
- (a[3] = 1),
1160
- (a[6] = 0)));
1161
- let p = Rt.positions;
1162
- return (
1163
- (p[0] = t),
1164
- (p[1] = e),
1165
- (p[2] = n),
1166
- (p.length = 3),
1167
- (o === 1 || o === 2) &&
1168
- ((p[3] = nt), (p[4] = it), (p[5] = st), (p[6] = ot), (p.length = 7)),
1169
- Rt
1170
- );
1171
- }
1172
- function ne(t, e) {
1173
- let n = t.attributes;
1174
- if (n.position.values.length === 0) return;
1175
- for (let i in n)
1176
- if (n.hasOwnProperty(i) && f(n[i]) && f(n[i].values)) {
1177
- let c = n[i];
1178
- c.values = k.createTypedArray(c.componentDatatype, c.values);
1179
- }
1180
- let s = B.computeNumberOfVertices(t);
1181
- return (
1182
- (t.indices = j.createTypedArray(s, t.indices)),
1183
- e && (t.boundingSphere = rt.fromVertices(n.position.values)),
1184
- t
1185
- );
1186
- }
1187
- function lt(t) {
1188
- let e = t.attributes,
1189
- n = {};
1190
- for (let s in e)
1191
- if (e.hasOwnProperty(s) && f(e[s]) && f(e[s].values)) {
1192
- let i = e[s];
1193
- n[s] = new U({
1194
- componentDatatype: i.componentDatatype,
1195
- componentsPerAttribute: i.componentsPerAttribute,
1196
- normalize: i.normalize,
1197
- values: [],
1198
- });
1199
- }
1200
- return new B({ attributes: n, indices: [], primitiveType: t.primitiveType });
1201
- }
1202
- function kt(t, e, n) {
1203
- let s = f(t.geometry.boundingSphere);
1204
- ((e = ne(e, s)),
1205
- (n = ne(n, s)),
1206
- f(n) && !f(e)
1207
- ? (t.geometry = n)
1208
- : !f(n) && f(e)
1209
- ? (t.geometry = e)
1210
- : ((t.westHemisphereGeometry = e),
1211
- (t.eastHemisphereGeometry = n),
1212
- (t.geometry = void 0)));
1213
- }
1214
- function Ft(t, e) {
1215
- let n = new t(),
1216
- s = new t(),
1217
- i = new t();
1218
- return function (c, o, a, p, u, d, m, l) {
1219
- let h = t.fromArray(u, c * e, n),
1220
- y = t.fromArray(u, o * e, s),
1221
- v = t.fromArray(u, a * e, i);
1222
- (t.multiplyByScalar(h, p.x, h),
1223
- t.multiplyByScalar(y, p.y, y),
1224
- t.multiplyByScalar(v, p.z, v));
1225
- let b = t.add(h, y, h);
1226
- (t.add(b, v, b), l && t.normalize(b, b), t.pack(b, d, m * e));
1227
- };
1228
- }
1229
- var ze = Ft(dt, 4),
1230
- It = Ft(r, 3),
1231
- ae = Ft(R, 2),
1232
- De = function (t, e, n, s, i, c, o) {
1233
- let a = i[t] * s.x,
1234
- p = i[e] * s.y,
1235
- u = i[n] * s.z;
1236
- c[o] = a + p + u > N.EPSILON6 ? 1 : 0;
1237
- },
1238
- wt = new r(),
1239
- Gt = new r(),
1240
- Ct = new r(),
1241
- qe = new r();
1242
- function Tt(t, e, n, s, i, c, o, a, p, u, d, m, l, h, y, v) {
1243
- if (!f(c) && !f(o) && !f(a) && !f(p) && !f(u) && h === 0) return;
1244
- let b = r.fromArray(i, t * 3, wt),
1245
- S = r.fromArray(i, e * 3, Gt),
1246
- x = r.fromArray(i, n * 3, Ct),
1247
- w = Ht(s, b, S, x, qe);
1248
- if (f(w)) {
1249
- if ((f(c) && It(t, e, n, w, c, m.normal.values, v, !0), f(u))) {
1250
- let A = r.fromArray(u, t * 3, wt),
1251
- E = r.fromArray(u, e * 3, Gt),
1252
- P = r.fromArray(u, n * 3, Ct);
1253
- (r.multiplyByScalar(A, w.x, A),
1254
- r.multiplyByScalar(E, w.y, E),
1255
- r.multiplyByScalar(P, w.z, P));
1256
- let O;
1257
- (!r.equals(A, r.ZERO) || !r.equals(E, r.ZERO) || !r.equals(P, r.ZERO)
1258
- ? ((O = r.add(A, E, A)), r.add(O, P, O), r.normalize(O, O))
1259
- : ((O = wt), (O.x = 0), (O.y = 0), (O.z = 0)),
1260
- r.pack(O, m.extrudeDirection.values, v * 3));
1261
- }
1262
- if (
1263
- (f(d) && De(t, e, n, w, d, m.applyOffset.values, v),
1264
- f(o) && It(t, e, n, w, o, m.tangent.values, v, !0),
1265
- f(a) && It(t, e, n, w, a, m.bitangent.values, v, !0),
1266
- f(p) && ae(t, e, n, w, p, m.st.values, v),
1267
- h > 0)
1268
- )
1269
- for (let A = 0; A < h; A++) {
1270
- let E = l[A];
1271
- Ve(t, e, n, w, v, y[E], m[E]);
1272
- }
1273
- }
1274
- }
1275
- function Ve(t, e, n, s, i, c, o) {
1276
- let a = c.componentsPerAttribute,
1277
- p = c.values,
1278
- u = o.values;
1279
- switch (a) {
1280
- case 4:
1281
- ze(t, e, n, s, p, u, i, !1);
1282
- break;
1283
- case 3:
1284
- It(t, e, n, s, p, u, i, !1);
1285
- break;
1286
- case 2:
1287
- ae(t, e, n, s, p, u, i, !1);
1288
- break;
1289
- default:
1290
- u[i] = p[t] * s.x + p[e] * s.y + p[n] * s.z;
1291
- }
1292
- }
1293
- function Q(t, e, n, s, i, c) {
1294
- let o = t.position.values.length / 3;
1295
- if (i !== -1) {
1296
- let a = s[i],
1297
- p = n[a];
1298
- return p === -1
1299
- ? ((n[a] = o), t.position.values.push(c.x, c.y, c.z), e.push(o), o)
1300
- : (e.push(p), p);
1301
- }
1302
- return (t.position.values.push(c.x, c.y, c.z), e.push(o), o);
1303
- }
1304
- var Re = {
1305
- position: !0,
1306
- normal: !0,
1307
- bitangent: !0,
1308
- tangent: !0,
1309
- st: !0,
1310
- extrudeDirection: !0,
1311
- applyOffset: !0,
1312
- };
1313
- function ie(t) {
1314
- let e = t.geometry,
1315
- n = e.attributes,
1316
- s = n.position.values,
1317
- i = f(n.normal) ? n.normal.values : void 0,
1318
- c = f(n.bitangent) ? n.bitangent.values : void 0,
1319
- o = f(n.tangent) ? n.tangent.values : void 0,
1320
- a = f(n.st) ? n.st.values : void 0,
1321
- p = f(n.extrudeDirection) ? n.extrudeDirection.values : void 0,
1322
- u = f(n.applyOffset) ? n.applyOffset.values : void 0,
1323
- d = e.indices,
1324
- m = [];
1325
- for (let O in n) n.hasOwnProperty(O) && !Re[O] && f(n[O]) && m.push(O);
1326
- let l = m.length,
1327
- h = lt(e),
1328
- y = lt(e),
1329
- v,
1330
- b,
1331
- S,
1332
- x,
1333
- w,
1334
- A = [];
1335
- A.length = s.length / 3;
1336
- let E = [];
1337
- for (E.length = s.length / 3, w = 0; w < A.length; ++w)
1338
- ((A[w] = -1), (E[w] = -1));
1339
- let P = d.length;
1340
- for (w = 0; w < P; w += 3) {
1341
- let O = d[w],
1342
- L = d[w + 1],
1343
- g = d[w + 2],
1344
- T = r.fromArray(s, O * 3),
1345
- C = r.fromArray(s, L * 3),
1346
- z = r.fromArray(s, g * 3),
1347
- q = Ne(T, C, z);
1348
- if (f(q) && q.positions.length > 3) {
1349
- let V = q.positions,
1350
- G = q.indices,
1351
- M = G.length;
1352
- for (let J = 0; J < M; ++J) {
1353
- let Y = G[J],
1354
- _ = V[Y];
1355
- (_.y < 0
1356
- ? ((v = y.attributes), (b = y.indices), (S = A))
1357
- : ((v = h.attributes), (b = h.indices), (S = E)),
1358
- (x = Q(v, b, S, d, Y < 3 ? w + Y : -1, _)),
1359
- Tt(O, L, g, _, s, i, o, c, a, p, u, v, m, l, n, x));
1360
- }
1361
- } else
1362
- (f(q) &&
1363
- ((T = q.positions[0]), (C = q.positions[1]), (z = q.positions[2])),
1364
- T.y < 0
1365
- ? ((v = y.attributes), (b = y.indices), (S = A))
1366
- : ((v = h.attributes), (b = h.indices), (S = E)),
1367
- (x = Q(v, b, S, d, w, T)),
1368
- Tt(O, L, g, T, s, i, o, c, a, p, u, v, m, l, n, x),
1369
- (x = Q(v, b, S, d, w + 1, C)),
1370
- Tt(O, L, g, C, s, i, o, c, a, p, u, v, m, l, n, x),
1371
- (x = Q(v, b, S, d, w + 2, z)),
1372
- Tt(O, L, g, z, s, i, o, c, a, p, u, v, m, l, n, x));
1373
- }
1374
- kt(t, y, h);
1375
- }
1376
- var ue = Et.fromPointNormal(r.ZERO, r.UNIT_Y),
1377
- Ge = new r(),
1378
- Ce = new r();
1379
- function ut(t, e, n, s, i, c, o) {
1380
- if (!f(o)) return;
1381
- let a = r.fromArray(s, t * 3, wt);
1382
- r.equalsEpsilon(a, n, N.EPSILON10)
1383
- ? (c.applyOffset.values[i] = o[t])
1384
- : (c.applyOffset.values[i] = o[e]);
1385
- }
1386
- function se(t) {
1387
- let e = t.geometry,
1388
- n = e.attributes,
1389
- s = n.position.values,
1390
- i = f(n.applyOffset) ? n.applyOffset.values : void 0,
1391
- c = e.indices,
1392
- o = lt(e),
1393
- a = lt(e),
1394
- p,
1395
- u = c.length,
1396
- d = [];
1397
- d.length = s.length / 3;
1398
- let m = [];
1399
- for (m.length = s.length / 3, p = 0; p < d.length; ++p)
1400
- ((d[p] = -1), (m[p] = -1));
1401
- for (p = 0; p < u; p += 2) {
1402
- let l = c[p],
1403
- h = c[p + 1],
1404
- y = r.fromArray(s, l * 3, wt),
1405
- v = r.fromArray(s, h * 3, Gt),
1406
- b;
1407
- (Math.abs(y.y) < N.EPSILON6 &&
1408
- (y.y < 0 ? (y.y = -N.EPSILON6) : (y.y = N.EPSILON6)),
1409
- Math.abs(v.y) < N.EPSILON6 &&
1410
- (v.y < 0 ? (v.y = -N.EPSILON6) : (v.y = N.EPSILON6)));
1411
- let S = o.attributes,
1412
- x = o.indices,
1413
- w = m,
1414
- A = a.attributes,
1415
- E = a.indices,
1416
- P = d,
1417
- O = Lt.lineSegmentPlane(y, v, ue, Ct);
1418
- if (f(O)) {
1419
- let L = r.multiplyByScalar(r.UNIT_Y, 5 * N.EPSILON9, Ge);
1420
- y.y < 0 &&
1421
- (r.negate(L, L),
1422
- (S = a.attributes),
1423
- (x = a.indices),
1424
- (w = d),
1425
- (A = o.attributes),
1426
- (E = o.indices),
1427
- (P = m));
1428
- let g = r.add(O, L, Ce);
1429
- ((b = Q(S, x, w, c, p, y)),
1430
- ut(l, h, y, s, b, S, i),
1431
- (b = Q(S, x, w, c, -1, g)),
1432
- ut(l, h, g, s, b, S, i),
1433
- r.negate(L, L),
1434
- r.add(O, L, g),
1435
- (b = Q(A, E, P, c, -1, g)),
1436
- ut(l, h, g, s, b, A, i),
1437
- (b = Q(A, E, P, c, p + 1, v)),
1438
- ut(l, h, v, s, b, A, i));
1439
- } else {
1440
- let L, g, T;
1441
- (y.y < 0
1442
- ? ((L = a.attributes), (g = a.indices), (T = d))
1443
- : ((L = o.attributes), (g = o.indices), (T = m)),
1444
- (b = Q(L, g, T, c, p, y)),
1445
- ut(l, h, y, s, b, L, i),
1446
- (b = Q(L, g, T, c, p + 1, v)),
1447
- ut(l, h, v, s, b, L, i));
1448
- }
1449
- }
1450
- kt(t, a, o);
1451
- }
1452
- var oe = new R(),
1453
- Be = new R(),
1454
- le = new r(),
1455
- fe = new r(),
1456
- Bt = new r(),
1457
- ke = new r(),
1458
- Fe = new r(),
1459
- Me = new r(),
1460
- re = new dt();
1461
- function ce(t) {
1462
- let e = t.attributes,
1463
- n = e.position.values,
1464
- s = e.prevPosition.values,
1465
- i = e.nextPosition.values,
1466
- c = n.length;
1467
- for (let o = 0; o < c; o += 3) {
1468
- let a = r.unpack(n, o, le);
1469
- if (a.x > 0) continue;
1470
- let p = r.unpack(s, o, fe);
1471
- ((a.y < 0 && p.y > 0) || (a.y > 0 && p.y < 0)) &&
1472
- (o - 3 > 0
1473
- ? ((s[o] = n[o - 3]), (s[o + 1] = n[o - 2]), (s[o + 2] = n[o - 1]))
1474
- : r.pack(a, s, o));
1475
- let u = r.unpack(i, o, Bt);
1476
- ((a.y < 0 && u.y > 0) || (a.y > 0 && u.y < 0)) &&
1477
- (o + 3 < c
1478
- ? ((i[o] = n[o + 3]), (i[o + 1] = n[o + 4]), (i[o + 2] = n[o + 5]))
1479
- : r.pack(a, i, o));
1480
- }
1481
- }
1482
- var _e = 5 * N.EPSILON9,
1483
- At = N.EPSILON6;
1484
- function Ue(t) {
1485
- let e = t.geometry,
1486
- n = e.attributes,
1487
- s = n.position.values,
1488
- i = n.prevPosition.values,
1489
- c = n.nextPosition.values,
1490
- o = n.expandAndWidth.values,
1491
- a = f(n.st) ? n.st.values : void 0,
1492
- p = f(n.color) ? n.color.values : void 0,
1493
- u = lt(e),
1494
- d = lt(e),
1495
- m,
1496
- l,
1497
- h,
1498
- y = !1,
1499
- v = s.length / 3;
1500
- for (m = 0; m < v; m += 4) {
1501
- let b = m,
1502
- S = m + 2,
1503
- x = r.fromArray(s, b * 3, le),
1504
- w = r.fromArray(s, S * 3, fe);
1505
- if (Math.abs(x.y) < At)
1506
- for (
1507
- x.y = At * (w.y < 0 ? -1 : 1),
1508
- s[m * 3 + 1] = x.y,
1509
- s[(m + 1) * 3 + 1] = x.y,
1510
- l = b * 3;
1511
- l < b * 3 + 4 * 3;
1512
- l += 3
1513
- )
1514
- ((i[l] = s[m * 3]),
1515
- (i[l + 1] = s[m * 3 + 1]),
1516
- (i[l + 2] = s[m * 3 + 2]));
1517
- if (Math.abs(w.y) < At)
1518
- for (
1519
- w.y = At * (x.y < 0 ? -1 : 1),
1520
- s[(m + 2) * 3 + 1] = w.y,
1521
- s[(m + 3) * 3 + 1] = w.y,
1522
- l = b * 3;
1523
- l < b * 3 + 4 * 3;
1524
- l += 3
1525
- )
1526
- ((c[l] = s[(m + 2) * 3]),
1527
- (c[l + 1] = s[(m + 2) * 3 + 1]),
1528
- (c[l + 2] = s[(m + 2) * 3 + 2]));
1529
- let A = u.attributes,
1530
- E = u.indices,
1531
- P = d.attributes,
1532
- O = d.indices,
1533
- L = Lt.lineSegmentPlane(x, w, ue, ke);
1534
- if (f(L)) {
1535
- y = !0;
1536
- let g = r.multiplyByScalar(r.UNIT_Y, _e, Fe);
1537
- x.y < 0 &&
1538
- (r.negate(g, g),
1539
- (A = d.attributes),
1540
- (E = d.indices),
1541
- (P = u.attributes),
1542
- (O = u.indices));
1543
- let T = r.add(L, g, Me);
1544
- (A.position.values.push(x.x, x.y, x.z, x.x, x.y, x.z),
1545
- A.position.values.push(T.x, T.y, T.z),
1546
- A.position.values.push(T.x, T.y, T.z),
1547
- A.prevPosition.values.push(i[b * 3], i[b * 3 + 1], i[b * 3 + 2]),
1548
- A.prevPosition.values.push(i[b * 3 + 3], i[b * 3 + 4], i[b * 3 + 5]),
1549
- A.prevPosition.values.push(x.x, x.y, x.z, x.x, x.y, x.z),
1550
- A.nextPosition.values.push(T.x, T.y, T.z),
1551
- A.nextPosition.values.push(T.x, T.y, T.z),
1552
- A.nextPosition.values.push(T.x, T.y, T.z),
1553
- A.nextPosition.values.push(T.x, T.y, T.z),
1554
- r.negate(g, g),
1555
- r.add(L, g, T),
1556
- P.position.values.push(T.x, T.y, T.z),
1557
- P.position.values.push(T.x, T.y, T.z),
1558
- P.position.values.push(w.x, w.y, w.z, w.x, w.y, w.z),
1559
- P.prevPosition.values.push(T.x, T.y, T.z),
1560
- P.prevPosition.values.push(T.x, T.y, T.z),
1561
- P.prevPosition.values.push(T.x, T.y, T.z),
1562
- P.prevPosition.values.push(T.x, T.y, T.z),
1563
- P.nextPosition.values.push(w.x, w.y, w.z, w.x, w.y, w.z),
1564
- P.nextPosition.values.push(c[S * 3], c[S * 3 + 1], c[S * 3 + 2]),
1565
- P.nextPosition.values.push(c[S * 3 + 3], c[S * 3 + 4], c[S * 3 + 5]));
1566
- let C = R.fromArray(o, b * 2, oe),
1567
- z = Math.abs(C.y);
1568
- (A.expandAndWidth.values.push(-1, z, 1, z),
1569
- A.expandAndWidth.values.push(-1, -z, 1, -z),
1570
- P.expandAndWidth.values.push(-1, z, 1, z),
1571
- P.expandAndWidth.values.push(-1, -z, 1, -z));
1572
- let q = r.magnitudeSquared(r.subtract(L, x, Bt));
1573
- if (((q /= r.magnitudeSquared(r.subtract(w, x, Bt))), f(p))) {
1574
- let V = dt.fromArray(p, b * 4, re),
1575
- G = dt.fromArray(p, S * 4, re),
1576
- M = N.lerp(V.x, G.x, q),
1577
- J = N.lerp(V.y, G.y, q),
1578
- Y = N.lerp(V.z, G.z, q),
1579
- _ = N.lerp(V.w, G.w, q);
1580
- for (l = b * 4; l < b * 4 + 2 * 4; ++l) A.color.values.push(p[l]);
1581
- for (
1582
- A.color.values.push(M, J, Y, _),
1583
- A.color.values.push(M, J, Y, _),
1584
- P.color.values.push(M, J, Y, _),
1585
- P.color.values.push(M, J, Y, _),
1586
- l = S * 4;
1587
- l < S * 4 + 2 * 4;
1588
- ++l
1589
- )
1590
- P.color.values.push(p[l]);
1591
- }
1592
- if (f(a)) {
1593
- let V = R.fromArray(a, b * 2, oe),
1594
- G = R.fromArray(a, (m + 3) * 2, Be),
1595
- M = N.lerp(V.x, G.x, q);
1596
- for (l = b * 2; l < b * 2 + 2 * 2; ++l) A.st.values.push(a[l]);
1597
- for (
1598
- A.st.values.push(M, V.y),
1599
- A.st.values.push(M, G.y),
1600
- P.st.values.push(M, V.y),
1601
- P.st.values.push(M, G.y),
1602
- l = S * 2;
1603
- l < S * 2 + 2 * 2;
1604
- ++l
1605
- )
1606
- P.st.values.push(a[l]);
1607
- }
1608
- ((h = A.position.values.length / 3 - 4),
1609
- E.push(h, h + 2, h + 1),
1610
- E.push(h + 1, h + 2, h + 3),
1611
- (h = P.position.values.length / 3 - 4),
1612
- O.push(h, h + 2, h + 1),
1613
- O.push(h + 1, h + 2, h + 3));
1614
- } else {
1615
- let g, T;
1616
- for (
1617
- x.y < 0
1618
- ? ((g = d.attributes), (T = d.indices))
1619
- : ((g = u.attributes), (T = u.indices)),
1620
- g.position.values.push(x.x, x.y, x.z),
1621
- g.position.values.push(x.x, x.y, x.z),
1622
- g.position.values.push(w.x, w.y, w.z),
1623
- g.position.values.push(w.x, w.y, w.z),
1624
- l = m * 3;
1625
- l < m * 3 + 4 * 3;
1626
- ++l
1627
- )
1628
- (g.prevPosition.values.push(i[l]), g.nextPosition.values.push(c[l]));
1629
- for (l = m * 2; l < m * 2 + 4 * 2; ++l)
1630
- (g.expandAndWidth.values.push(o[l]), f(a) && g.st.values.push(a[l]));
1631
- if (f(p))
1632
- for (l = m * 4; l < m * 4 + 4 * 4; ++l) g.color.values.push(p[l]);
1633
- ((h = g.position.values.length / 3 - 4),
1634
- T.push(h, h + 2, h + 1),
1635
- T.push(h + 1, h + 2, h + 3));
1636
- }
1637
- }
1638
- (y && (ce(d), ce(u)), kt(t, d, u));
1639
- }
1640
- F.splitLongitude = function (t) {
1641
- if (!f(t)) throw new I("instance is required.");
1642
- let e = t.geometry,
1643
- n = e.boundingSphere;
1644
- if (
1645
- f(n) &&
1646
- (n.center.x - n.radius > 0 ||
1647
- rt.intersectPlane(n, Et.ORIGIN_ZX_PLANE) !== Ut.INTERSECTING)
1648
- )
1649
- return t;
1650
- if (e.geometryType !== mt.NONE)
1651
- switch (e.geometryType) {
1652
- case mt.POLYLINES:
1653
- Ue(t);
1654
- break;
1655
- case mt.TRIANGLES:
1656
- ie(t);
1657
- break;
1658
- case mt.LINES:
1659
- se(t);
1660
- break;
1661
- }
1662
- else
1663
- (Le(e),
1664
- e.primitiveType === D.TRIANGLES
1665
- ? ie(t)
1666
- : e.primitiveType === D.LINES && se(t));
1667
- return t;
1668
- };
1669
- var gn = F;
1670
- export { gn as a };