@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.
- package/README.md +152 -0
- package/dist/index.cjs +43 -0
- package/dist/pggis.min.css +1 -0
- package/dist/pggis.min.js +42 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/resources/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/resources/Assets/Images/cesium_credit.png +0 -0
- package/dist/resources/Assets/Images/google_earth_credit.png +0 -0
- package/dist/resources/Assets/Images/ion-credit.png +0 -0
- package/dist/resources/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/resources/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/resources/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/resources/Assets/Textures/maki/airfield.png +0 -0
- package/dist/resources/Assets/Textures/maki/airport.png +0 -0
- package/dist/resources/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/resources/Assets/Textures/maki/america-football.png +0 -0
- package/dist/resources/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/resources/Assets/Textures/maki/bakery.png +0 -0
- package/dist/resources/Assets/Textures/maki/bank.png +0 -0
- package/dist/resources/Assets/Textures/maki/bar.png +0 -0
- package/dist/resources/Assets/Textures/maki/baseball.png +0 -0
- package/dist/resources/Assets/Textures/maki/basketball.png +0 -0
- package/dist/resources/Assets/Textures/maki/beer.png +0 -0
- package/dist/resources/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/resources/Assets/Textures/maki/building.png +0 -0
- package/dist/resources/Assets/Textures/maki/bus.png +0 -0
- package/dist/resources/Assets/Textures/maki/cafe.png +0 -0
- package/dist/resources/Assets/Textures/maki/camera.png +0 -0
- package/dist/resources/Assets/Textures/maki/campsite.png +0 -0
- package/dist/resources/Assets/Textures/maki/car.png +0 -0
- package/dist/resources/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/resources/Assets/Textures/maki/cesium.png +0 -0
- package/dist/resources/Assets/Textures/maki/chemist.png +0 -0
- package/dist/resources/Assets/Textures/maki/cinema.png +0 -0
- package/dist/resources/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/circle.png +0 -0
- package/dist/resources/Assets/Textures/maki/city.png +0 -0
- package/dist/resources/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/resources/Assets/Textures/maki/college.png +0 -0
- package/dist/resources/Assets/Textures/maki/commercial.png +0 -0
- package/dist/resources/Assets/Textures/maki/cricket.png +0 -0
- package/dist/resources/Assets/Textures/maki/cross.png +0 -0
- package/dist/resources/Assets/Textures/maki/dam.png +0 -0
- package/dist/resources/Assets/Textures/maki/danger.png +0 -0
- package/dist/resources/Assets/Textures/maki/disability.png +0 -0
- package/dist/resources/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/resources/Assets/Textures/maki/embassy.png +0 -0
- package/dist/resources/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/entrance.png +0 -0
- package/dist/resources/Assets/Textures/maki/farm.png +0 -0
- package/dist/resources/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/resources/Assets/Textures/maki/ferry.png +0 -0
- package/dist/resources/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/resources/Assets/Textures/maki/fuel.png +0 -0
- package/dist/resources/Assets/Textures/maki/garden.png +0 -0
- package/dist/resources/Assets/Textures/maki/gift.png +0 -0
- package/dist/resources/Assets/Textures/maki/golf.png +0 -0
- package/dist/resources/Assets/Textures/maki/grocery.png +0 -0
- package/dist/resources/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/resources/Assets/Textures/maki/harbor.png +0 -0
- package/dist/resources/Assets/Textures/maki/heart.png +0 -0
- package/dist/resources/Assets/Textures/maki/heliport.png +0 -0
- package/dist/resources/Assets/Textures/maki/hospital.png +0 -0
- package/dist/resources/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/resources/Assets/Textures/maki/industrial.png +0 -0
- package/dist/resources/Assets/Textures/maki/land-use.png +0 -0
- package/dist/resources/Assets/Textures/maki/laundry.png +0 -0
- package/dist/resources/Assets/Textures/maki/library.png +0 -0
- package/dist/resources/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/lodging.png +0 -0
- package/dist/resources/Assets/Textures/maki/logging.png +0 -0
- package/dist/resources/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/resources/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/marker.png +0 -0
- package/dist/resources/Assets/Textures/maki/minefield.png +0 -0
- package/dist/resources/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/monument.png +0 -0
- package/dist/resources/Assets/Textures/maki/museum.png +0 -0
- package/dist/resources/Assets/Textures/maki/music.png +0 -0
- package/dist/resources/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/resources/Assets/Textures/maki/park.png +0 -0
- package/dist/resources/Assets/Textures/maki/park2.png +0 -0
- package/dist/resources/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/resources/Assets/Textures/maki/parking.png +0 -0
- package/dist/resources/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/resources/Assets/Textures/maki/pitch.png +0 -0
- package/dist/resources/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/resources/Assets/Textures/maki/playground.png +0 -0
- package/dist/resources/Assets/Textures/maki/police.png +0 -0
- package/dist/resources/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/resources/Assets/Textures/maki/post.png +0 -0
- package/dist/resources/Assets/Textures/maki/prison.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/resources/Assets/Textures/maki/rail.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/resources/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/resources/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/resources/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/resources/Assets/Textures/maki/rocket.png +0 -0
- package/dist/resources/Assets/Textures/maki/school.png +0 -0
- package/dist/resources/Assets/Textures/maki/scooter.png +0 -0
- package/dist/resources/Assets/Textures/maki/shop.png +0 -0
- package/dist/resources/Assets/Textures/maki/skiing.png +0 -0
- package/dist/resources/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/soccer.png +0 -0
- package/dist/resources/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/square.png +0 -0
- package/dist/resources/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/star.png +0 -0
- package/dist/resources/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/resources/Assets/Textures/maki/swimming.png +0 -0
- package/dist/resources/Assets/Textures/maki/telephone.png +0 -0
- package/dist/resources/Assets/Textures/maki/tennis.png +0 -0
- package/dist/resources/Assets/Textures/maki/theatre.png +0 -0
- package/dist/resources/Assets/Textures/maki/toilets.png +0 -0
- package/dist/resources/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/resources/Assets/Textures/maki/town.png +0 -0
- package/dist/resources/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/resources/Assets/Textures/maki/triangle.png +0 -0
- package/dist/resources/Assets/Textures/maki/village.png +0 -0
- package/dist/resources/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/resources/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/resources/Assets/Textures/maki/water.png +0 -0
- package/dist/resources/Assets/Textures/maki/wetland.png +0 -0
- package/dist/resources/Assets/Textures/maki/zoo.png +0 -0
- package/dist/resources/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/resources/Assets/Textures/pin.svg +1 -0
- package/dist/resources/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/resources/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/resources/Assets/approximateTerrainHeights.json +1 -0
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/dist/resources/ThirdParty/Workers/package.json +1 -0
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/resources/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/resources/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/dist/resources/Workers/chunk-3PW6ZBN4.js +2977 -0
- package/dist/resources/Workers/chunk-434ZTTFX.js +73 -0
- package/dist/resources/Workers/chunk-4KP73B43.js +73 -0
- package/dist/resources/Workers/chunk-52VSIKEA.js +2716 -0
- package/dist/resources/Workers/chunk-5GDBZTHX.js +1075 -0
- package/dist/resources/Workers/chunk-5HLGKKG3.js +163 -0
- package/dist/resources/Workers/chunk-5IRLXUTA.js +1258 -0
- package/dist/resources/Workers/chunk-5SK36PU4.js +430 -0
- package/dist/resources/Workers/chunk-ARPTYYKS.js +258 -0
- package/dist/resources/Workers/chunk-ATB2I7OS.js +55 -0
- package/dist/resources/Workers/chunk-AXFRNOVC.js +368 -0
- package/dist/resources/Workers/chunk-BP467WX3.js +501 -0
- package/dist/resources/Workers/chunk-BUZDZBUH.js +1007 -0
- package/dist/resources/Workers/chunk-CDGHUKQ4.js +1477 -0
- package/dist/resources/Workers/chunk-CSIZ3BGT.js +398 -0
- package/dist/resources/Workers/chunk-CWJQGBWT.js +39 -0
- package/dist/resources/Workers/chunk-DMCSY5BU.js +100 -0
- package/dist/resources/Workers/chunk-DR5XZ6K5.js +390 -0
- package/dist/resources/Workers/chunk-FWGNCYP6.js +476 -0
- package/dist/resources/Workers/chunk-GF5TNNKP.js +353 -0
- package/dist/resources/Workers/chunk-GVL5I7TC.js +1052 -0
- package/dist/resources/Workers/chunk-H5DUXHCV.js +421 -0
- package/dist/resources/Workers/chunk-HFKSAB5K.js +511 -0
- package/dist/resources/Workers/chunk-HOT2SNXP.js +8639 -0
- package/dist/resources/Workers/chunk-HPH5HSFE.js +1860 -0
- package/dist/resources/Workers/chunk-HPP4JLNH.js +218 -0
- package/dist/resources/Workers/chunk-HUPNRBWW.js +196 -0
- package/dist/resources/Workers/chunk-JGG36SQV.js +102 -0
- package/dist/resources/Workers/chunk-LGJUI2CE.js +2361 -0
- package/dist/resources/Workers/chunk-LGL4P5KL.js +171 -0
- package/dist/resources/Workers/chunk-LX6XV4DK.js +138 -0
- package/dist/resources/Workers/chunk-MN34FIF5.js +37 -0
- package/dist/resources/Workers/chunk-MW3CJYLX.js +101 -0
- package/dist/resources/Workers/chunk-NE4JNU6H.js +767 -0
- package/dist/resources/Workers/chunk-O43GWBSF.js +55 -0
- package/dist/resources/Workers/chunk-PIXK6KHB.js +44 -0
- package/dist/resources/Workers/chunk-PZ2WJWUG.js +634 -0
- package/dist/resources/Workers/chunk-QRBRVGZC.js +305 -0
- package/dist/resources/Workers/chunk-QTZQZY2C.js +669 -0
- package/dist/resources/Workers/chunk-R3HUGXBH.js +302 -0
- package/dist/resources/Workers/chunk-R4OZKBXH.js +456 -0
- package/dist/resources/Workers/chunk-RH4N2ONY.js +236 -0
- package/dist/resources/Workers/chunk-RIDPF7PO.js +58 -0
- package/dist/resources/Workers/chunk-SNN7WOC2.js +781 -0
- package/dist/resources/Workers/chunk-SQVTYRZY.js +122 -0
- package/dist/resources/Workers/chunk-SV7DDPAC.js +629 -0
- package/dist/resources/Workers/chunk-TIXXVKUY.js +834 -0
- package/dist/resources/Workers/chunk-TMPVBFJQ.js +289 -0
- package/dist/resources/Workers/chunk-XUTVA4K5.js +684 -0
- package/dist/resources/Workers/chunk-Y4OJ4B23.js +59 -0
- package/dist/resources/Workers/chunk-YBKFS53K.js +77 -0
- package/dist/resources/Workers/chunk-Z2SIPUKB.js +117 -0
- package/dist/resources/Workers/chunk-Z4JUBRHP.js +157 -0
- package/dist/resources/Workers/chunk-ZQRZBHYI.js +138 -0
- package/dist/resources/Workers/combineGeometry.js +67 -0
- package/dist/resources/Workers/createBoxGeometry.js +57 -0
- package/dist/resources/Workers/createBoxOutlineGeometry.js +234 -0
- package/dist/resources/Workers/createCircleGeometry.js +196 -0
- package/dist/resources/Workers/createCircleOutlineGeometry.js +146 -0
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +505 -0
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +224 -0
- package/dist/resources/Workers/createCorridorGeometry.js +1263 -0
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +568 -0
- package/dist/resources/Workers/createCylinderGeometry.js +59 -0
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +230 -0
- package/dist/resources/Workers/createEllipseGeometry.js +70 -0
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +63 -0
- package/dist/resources/Workers/createEllipsoidGeometry.js +58 -0
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +60 -0
- package/dist/resources/Workers/createFrustumGeometry.js +57 -0
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +234 -0
- package/dist/resources/Workers/createGeometry.js +150 -0
- package/dist/resources/Workers/createGroundPolylineGeometry.js +1607 -0
- package/dist/resources/Workers/createPlaneGeometry.js +223 -0
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +123 -0
- package/dist/resources/Workers/createPolygonGeometry.js +1545 -0
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +542 -0
- package/dist/resources/Workers/createPolylineGeometry.js +495 -0
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +380 -0
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +277 -0
- package/dist/resources/Workers/createRectangleGeometry.js +1273 -0
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +478 -0
- package/dist/resources/Workers/createSimplePolylineGeometry.js +399 -0
- package/dist/resources/Workers/createSphereGeometry.js +117 -0
- package/dist/resources/Workers/createSphereOutlineGeometry.js +117 -0
- package/dist/resources/Workers/createTaskProcessorWorker.js +32 -0
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +492 -0
- package/dist/resources/Workers/createVectorTileGeometries.js +386 -0
- package/dist/resources/Workers/createVectorTilePoints.js +112 -0
- package/dist/resources/Workers/createVectorTilePolygons.js +384 -0
- package/dist/resources/Workers/createVectorTilePolylines.js +262 -0
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -0
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2277 -0
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -0
- package/dist/resources/Workers/createWallGeometry.js +489 -0
- package/dist/resources/Workers/createWallOutlineGeometry.js +337 -0
- package/dist/resources/Workers/decodeDraco.js +369 -0
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -0
- package/dist/resources/Workers/decodeI3S.js +835 -0
- package/dist/resources/Workers/transcodeKTX2.js +3425 -0
- package/dist/resources/Workers/transferTypedArrayTest.js +41 -0
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +818 -0
- package/package.json +81 -0
|
@@ -0,0 +1,1052 @@
|
|
|
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
|
+
ArcType_default
|
|
28
|
+
} from "./chunk-O43GWBSF.js";
|
|
29
|
+
import {
|
|
30
|
+
GeometryPipeline_default
|
|
31
|
+
} from "./chunk-52VSIKEA.js";
|
|
32
|
+
import {
|
|
33
|
+
PolygonPipeline_default,
|
|
34
|
+
WindingOrder_default
|
|
35
|
+
} from "./chunk-BUZDZBUH.js";
|
|
36
|
+
import {
|
|
37
|
+
arrayRemoveDuplicates_default
|
|
38
|
+
} from "./chunk-DMCSY5BU.js";
|
|
39
|
+
import {
|
|
40
|
+
EllipsoidRhumbLine_default
|
|
41
|
+
} from "./chunk-R4OZKBXH.js";
|
|
42
|
+
import {
|
|
43
|
+
IntersectionTests_default
|
|
44
|
+
} from "./chunk-5IRLXUTA.js";
|
|
45
|
+
import {
|
|
46
|
+
Plane_default
|
|
47
|
+
} from "./chunk-LGL4P5KL.js";
|
|
48
|
+
import {
|
|
49
|
+
IndexDatatype_default
|
|
50
|
+
} from "./chunk-LX6XV4DK.js";
|
|
51
|
+
import {
|
|
52
|
+
GeometryAttributes_default
|
|
53
|
+
} from "./chunk-PIXK6KHB.js";
|
|
54
|
+
import {
|
|
55
|
+
GeometryAttribute_default,
|
|
56
|
+
Geometry_default,
|
|
57
|
+
PrimitiveType_default
|
|
58
|
+
} from "./chunk-R3HUGXBH.js";
|
|
59
|
+
import {
|
|
60
|
+
Quaternion_default
|
|
61
|
+
} from "./chunk-HOT2SNXP.js";
|
|
62
|
+
import {
|
|
63
|
+
ComponentDatatype_default
|
|
64
|
+
} from "./chunk-ARPTYYKS.js";
|
|
65
|
+
import {
|
|
66
|
+
Cartesian2_default,
|
|
67
|
+
Cartesian3_default,
|
|
68
|
+
Cartographic_default,
|
|
69
|
+
Ellipsoid_default,
|
|
70
|
+
Matrix3_default
|
|
71
|
+
} from "./chunk-LGJUI2CE.js";
|
|
72
|
+
import {
|
|
73
|
+
Math_default
|
|
74
|
+
} from "./chunk-BP467WX3.js";
|
|
75
|
+
import {
|
|
76
|
+
defaultValue_default
|
|
77
|
+
} from "./chunk-CWJQGBWT.js";
|
|
78
|
+
import {
|
|
79
|
+
defined_default
|
|
80
|
+
} from "./chunk-YBKFS53K.js";
|
|
81
|
+
|
|
82
|
+
// packages/engine/Source/Core/PolygonHierarchy.js
|
|
83
|
+
function PolygonHierarchy(positions, holes) {
|
|
84
|
+
this.positions = defined_default(positions) ? positions : [];
|
|
85
|
+
this.holes = defined_default(holes) ? holes : [];
|
|
86
|
+
}
|
|
87
|
+
var PolygonHierarchy_default = PolygonHierarchy;
|
|
88
|
+
|
|
89
|
+
// packages/engine/Source/Core/Queue.js
|
|
90
|
+
function Queue() {
|
|
91
|
+
this._array = [];
|
|
92
|
+
this._offset = 0;
|
|
93
|
+
this._length = 0;
|
|
94
|
+
}
|
|
95
|
+
Object.defineProperties(Queue.prototype, {
|
|
96
|
+
/**
|
|
97
|
+
* The length of the queue.
|
|
98
|
+
*
|
|
99
|
+
* @memberof Queue.prototype
|
|
100
|
+
*
|
|
101
|
+
* @type {number}
|
|
102
|
+
* @readonly
|
|
103
|
+
*/
|
|
104
|
+
length: {
|
|
105
|
+
get: function() {
|
|
106
|
+
return this._length;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Queue.prototype.enqueue = function(item) {
|
|
111
|
+
this._array.push(item);
|
|
112
|
+
this._length++;
|
|
113
|
+
};
|
|
114
|
+
Queue.prototype.dequeue = function() {
|
|
115
|
+
if (this._length === 0) {
|
|
116
|
+
return void 0;
|
|
117
|
+
}
|
|
118
|
+
const array = this._array;
|
|
119
|
+
let offset = this._offset;
|
|
120
|
+
const item = array[offset];
|
|
121
|
+
array[offset] = void 0;
|
|
122
|
+
offset++;
|
|
123
|
+
if (offset > 10 && offset * 2 > array.length) {
|
|
124
|
+
this._array = array.slice(offset);
|
|
125
|
+
offset = 0;
|
|
126
|
+
}
|
|
127
|
+
this._offset = offset;
|
|
128
|
+
this._length--;
|
|
129
|
+
return item;
|
|
130
|
+
};
|
|
131
|
+
Queue.prototype.peek = function() {
|
|
132
|
+
if (this._length === 0) {
|
|
133
|
+
return void 0;
|
|
134
|
+
}
|
|
135
|
+
return this._array[this._offset];
|
|
136
|
+
};
|
|
137
|
+
Queue.prototype.contains = function(item) {
|
|
138
|
+
return this._array.indexOf(item) !== -1;
|
|
139
|
+
};
|
|
140
|
+
Queue.prototype.clear = function() {
|
|
141
|
+
this._array.length = this._offset = this._length = 0;
|
|
142
|
+
};
|
|
143
|
+
Queue.prototype.sort = function(compareFunction) {
|
|
144
|
+
if (this._offset > 0) {
|
|
145
|
+
this._array = this._array.slice(this._offset);
|
|
146
|
+
this._offset = 0;
|
|
147
|
+
}
|
|
148
|
+
this._array.sort(compareFunction);
|
|
149
|
+
};
|
|
150
|
+
var Queue_default = Queue;
|
|
151
|
+
|
|
152
|
+
// packages/engine/Source/Core/PolygonGeometryLibrary.js
|
|
153
|
+
var PolygonGeometryLibrary = {};
|
|
154
|
+
PolygonGeometryLibrary.computeHierarchyPackedLength = function(polygonHierarchy, CartesianX) {
|
|
155
|
+
let numComponents = 0;
|
|
156
|
+
const stack = [polygonHierarchy];
|
|
157
|
+
while (stack.length > 0) {
|
|
158
|
+
const hierarchy = stack.pop();
|
|
159
|
+
if (!defined_default(hierarchy)) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
numComponents += 2;
|
|
163
|
+
const positions = hierarchy.positions;
|
|
164
|
+
const holes = hierarchy.holes;
|
|
165
|
+
if (defined_default(positions) && positions.length > 0) {
|
|
166
|
+
numComponents += positions.length * CartesianX.packedLength;
|
|
167
|
+
}
|
|
168
|
+
if (defined_default(holes)) {
|
|
169
|
+
const length = holes.length;
|
|
170
|
+
for (let i = 0; i < length; ++i) {
|
|
171
|
+
stack.push(holes[i]);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return numComponents;
|
|
176
|
+
};
|
|
177
|
+
PolygonGeometryLibrary.packPolygonHierarchy = function(polygonHierarchy, array, startingIndex, CartesianX) {
|
|
178
|
+
const stack = [polygonHierarchy];
|
|
179
|
+
while (stack.length > 0) {
|
|
180
|
+
const hierarchy = stack.pop();
|
|
181
|
+
if (!defined_default(hierarchy)) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
const positions = hierarchy.positions;
|
|
185
|
+
const holes = hierarchy.holes;
|
|
186
|
+
array[startingIndex++] = defined_default(positions) ? positions.length : 0;
|
|
187
|
+
array[startingIndex++] = defined_default(holes) ? holes.length : 0;
|
|
188
|
+
if (defined_default(positions)) {
|
|
189
|
+
const positionsLength = positions.length;
|
|
190
|
+
for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
|
|
191
|
+
CartesianX.pack(positions[i], array, startingIndex);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (defined_default(holes)) {
|
|
195
|
+
const holesLength = holes.length;
|
|
196
|
+
for (let j = 0; j < holesLength; ++j) {
|
|
197
|
+
stack.push(holes[j]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return startingIndex;
|
|
202
|
+
};
|
|
203
|
+
PolygonGeometryLibrary.unpackPolygonHierarchy = function(array, startingIndex, CartesianX) {
|
|
204
|
+
const positionsLength = array[startingIndex++];
|
|
205
|
+
const holesLength = array[startingIndex++];
|
|
206
|
+
const positions = new Array(positionsLength);
|
|
207
|
+
const holes = holesLength > 0 ? new Array(holesLength) : void 0;
|
|
208
|
+
for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
|
|
209
|
+
positions[i] = CartesianX.unpack(array, startingIndex);
|
|
210
|
+
}
|
|
211
|
+
for (let j = 0; j < holesLength; ++j) {
|
|
212
|
+
holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(
|
|
213
|
+
array,
|
|
214
|
+
startingIndex,
|
|
215
|
+
CartesianX
|
|
216
|
+
);
|
|
217
|
+
startingIndex = holes[j].startingIndex;
|
|
218
|
+
delete holes[j].startingIndex;
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
positions,
|
|
222
|
+
holes,
|
|
223
|
+
startingIndex
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
var distance2DScratch = new Cartesian2_default();
|
|
227
|
+
function getPointAtDistance2D(p0, p1, distance, length) {
|
|
228
|
+
Cartesian2_default.subtract(p1, p0, distance2DScratch);
|
|
229
|
+
Cartesian2_default.multiplyByScalar(
|
|
230
|
+
distance2DScratch,
|
|
231
|
+
distance / length,
|
|
232
|
+
distance2DScratch
|
|
233
|
+
);
|
|
234
|
+
Cartesian2_default.add(p0, distance2DScratch, distance2DScratch);
|
|
235
|
+
return [distance2DScratch.x, distance2DScratch.y];
|
|
236
|
+
}
|
|
237
|
+
var distanceScratch = new Cartesian3_default();
|
|
238
|
+
function getPointAtDistance(p0, p1, distance, length) {
|
|
239
|
+
Cartesian3_default.subtract(p1, p0, distanceScratch);
|
|
240
|
+
Cartesian3_default.multiplyByScalar(
|
|
241
|
+
distanceScratch,
|
|
242
|
+
distance / length,
|
|
243
|
+
distanceScratch
|
|
244
|
+
);
|
|
245
|
+
Cartesian3_default.add(p0, distanceScratch, distanceScratch);
|
|
246
|
+
return [distanceScratch.x, distanceScratch.y, distanceScratch.z];
|
|
247
|
+
}
|
|
248
|
+
PolygonGeometryLibrary.subdivideLineCount = function(p0, p1, minDistance) {
|
|
249
|
+
const distance = Cartesian3_default.distance(p0, p1);
|
|
250
|
+
const n = distance / minDistance;
|
|
251
|
+
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
252
|
+
return Math.pow(2, countDivide);
|
|
253
|
+
};
|
|
254
|
+
var scratchCartographic0 = new Cartographic_default();
|
|
255
|
+
var scratchCartographic1 = new Cartographic_default();
|
|
256
|
+
var scratchCartographic2 = new Cartographic_default();
|
|
257
|
+
var scratchCartesian0 = new Cartesian3_default();
|
|
258
|
+
var scratchRhumbLine = new EllipsoidRhumbLine_default();
|
|
259
|
+
PolygonGeometryLibrary.subdivideRhumbLineCount = function(ellipsoid, p0, p1, minDistance) {
|
|
260
|
+
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
261
|
+
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
262
|
+
const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
|
|
263
|
+
const n = rhumb.surfaceDistance / minDistance;
|
|
264
|
+
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
265
|
+
return Math.pow(2, countDivide);
|
|
266
|
+
};
|
|
267
|
+
PolygonGeometryLibrary.subdivideTexcoordLine = function(t0, t1, p0, p1, minDistance, result) {
|
|
268
|
+
const subdivisions = PolygonGeometryLibrary.subdivideLineCount(
|
|
269
|
+
p0,
|
|
270
|
+
p1,
|
|
271
|
+
minDistance
|
|
272
|
+
);
|
|
273
|
+
const length2D = Cartesian2_default.distance(t0, t1);
|
|
274
|
+
const distanceBetweenCoords = length2D / subdivisions;
|
|
275
|
+
const texcoords = result;
|
|
276
|
+
texcoords.length = subdivisions * 2;
|
|
277
|
+
let index = 0;
|
|
278
|
+
for (let i = 0; i < subdivisions; i++) {
|
|
279
|
+
const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
|
|
280
|
+
texcoords[index++] = t[0];
|
|
281
|
+
texcoords[index++] = t[1];
|
|
282
|
+
}
|
|
283
|
+
return texcoords;
|
|
284
|
+
};
|
|
285
|
+
PolygonGeometryLibrary.subdivideLine = function(p0, p1, minDistance, result) {
|
|
286
|
+
const numVertices = PolygonGeometryLibrary.subdivideLineCount(
|
|
287
|
+
p0,
|
|
288
|
+
p1,
|
|
289
|
+
minDistance
|
|
290
|
+
);
|
|
291
|
+
const length = Cartesian3_default.distance(p0, p1);
|
|
292
|
+
const distanceBetweenVertices = length / numVertices;
|
|
293
|
+
if (!defined_default(result)) {
|
|
294
|
+
result = [];
|
|
295
|
+
}
|
|
296
|
+
const positions = result;
|
|
297
|
+
positions.length = numVertices * 3;
|
|
298
|
+
let index = 0;
|
|
299
|
+
for (let i = 0; i < numVertices; i++) {
|
|
300
|
+
const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);
|
|
301
|
+
positions[index++] = p[0];
|
|
302
|
+
positions[index++] = p[1];
|
|
303
|
+
positions[index++] = p[2];
|
|
304
|
+
}
|
|
305
|
+
return positions;
|
|
306
|
+
};
|
|
307
|
+
PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function(t0, t1, ellipsoid, p0, p1, minDistance, result) {
|
|
308
|
+
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
309
|
+
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
310
|
+
scratchRhumbLine.setEndPoints(c0, c1);
|
|
311
|
+
const n = scratchRhumbLine.surfaceDistance / minDistance;
|
|
312
|
+
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
313
|
+
const subdivisions = Math.pow(2, countDivide);
|
|
314
|
+
const length2D = Cartesian2_default.distance(t0, t1);
|
|
315
|
+
const distanceBetweenCoords = length2D / subdivisions;
|
|
316
|
+
const texcoords = result;
|
|
317
|
+
texcoords.length = subdivisions * 2;
|
|
318
|
+
let index = 0;
|
|
319
|
+
for (let i = 0; i < subdivisions; i++) {
|
|
320
|
+
const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
|
|
321
|
+
texcoords[index++] = t[0];
|
|
322
|
+
texcoords[index++] = t[1];
|
|
323
|
+
}
|
|
324
|
+
return texcoords;
|
|
325
|
+
};
|
|
326
|
+
PolygonGeometryLibrary.subdivideRhumbLine = function(ellipsoid, p0, p1, minDistance, result) {
|
|
327
|
+
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
328
|
+
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
329
|
+
const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
|
|
330
|
+
const n = rhumb.surfaceDistance / minDistance;
|
|
331
|
+
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
332
|
+
const numVertices = Math.pow(2, countDivide);
|
|
333
|
+
const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;
|
|
334
|
+
if (!defined_default(result)) {
|
|
335
|
+
result = [];
|
|
336
|
+
}
|
|
337
|
+
const positions = result;
|
|
338
|
+
positions.length = numVertices * 3;
|
|
339
|
+
let index = 0;
|
|
340
|
+
for (let i = 0; i < numVertices; i++) {
|
|
341
|
+
const c = rhumb.interpolateUsingSurfaceDistance(
|
|
342
|
+
i * distanceBetweenVertices,
|
|
343
|
+
scratchCartographic2
|
|
344
|
+
);
|
|
345
|
+
const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);
|
|
346
|
+
positions[index++] = p.x;
|
|
347
|
+
positions[index++] = p.y;
|
|
348
|
+
positions[index++] = p.z;
|
|
349
|
+
}
|
|
350
|
+
return positions;
|
|
351
|
+
};
|
|
352
|
+
var scaleToGeodeticHeightN1 = new Cartesian3_default();
|
|
353
|
+
var scaleToGeodeticHeightN2 = new Cartesian3_default();
|
|
354
|
+
var scaleToGeodeticHeightP1 = new Cartesian3_default();
|
|
355
|
+
var scaleToGeodeticHeightP2 = new Cartesian3_default();
|
|
356
|
+
PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function(geometry, maxHeight, minHeight, ellipsoid, perPositionHeight) {
|
|
357
|
+
ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
|
|
358
|
+
const n1 = scaleToGeodeticHeightN1;
|
|
359
|
+
let n2 = scaleToGeodeticHeightN2;
|
|
360
|
+
const p = scaleToGeodeticHeightP1;
|
|
361
|
+
let p2 = scaleToGeodeticHeightP2;
|
|
362
|
+
if (defined_default(geometry) && defined_default(geometry.attributes) && defined_default(geometry.attributes.position)) {
|
|
363
|
+
const positions = geometry.attributes.position.values;
|
|
364
|
+
const length = positions.length / 2;
|
|
365
|
+
for (let i = 0; i < length; i += 3) {
|
|
366
|
+
Cartesian3_default.fromArray(positions, i, p);
|
|
367
|
+
ellipsoid.geodeticSurfaceNormal(p, n1);
|
|
368
|
+
p2 = ellipsoid.scaleToGeodeticSurface(p, p2);
|
|
369
|
+
n2 = Cartesian3_default.multiplyByScalar(n1, minHeight, n2);
|
|
370
|
+
n2 = Cartesian3_default.add(p2, n2, n2);
|
|
371
|
+
positions[i + length] = n2.x;
|
|
372
|
+
positions[i + 1 + length] = n2.y;
|
|
373
|
+
positions[i + 2 + length] = n2.z;
|
|
374
|
+
if (perPositionHeight) {
|
|
375
|
+
p2 = Cartesian3_default.clone(p, p2);
|
|
376
|
+
}
|
|
377
|
+
n2 = Cartesian3_default.multiplyByScalar(n1, maxHeight, n2);
|
|
378
|
+
n2 = Cartesian3_default.add(p2, n2, n2);
|
|
379
|
+
positions[i] = n2.x;
|
|
380
|
+
positions[i + 1] = n2.y;
|
|
381
|
+
positions[i + 2] = n2.z;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return geometry;
|
|
385
|
+
};
|
|
386
|
+
PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function(polygonHierarchy, scaleToEllipsoidSurface, ellipsoid) {
|
|
387
|
+
const polygons = [];
|
|
388
|
+
const queue = new Queue_default();
|
|
389
|
+
queue.enqueue(polygonHierarchy);
|
|
390
|
+
let i;
|
|
391
|
+
let j;
|
|
392
|
+
let length;
|
|
393
|
+
while (queue.length !== 0) {
|
|
394
|
+
const outerNode = queue.dequeue();
|
|
395
|
+
let outerRing = outerNode.positions;
|
|
396
|
+
if (scaleToEllipsoidSurface) {
|
|
397
|
+
length = outerRing.length;
|
|
398
|
+
for (i = 0; i < length; i++) {
|
|
399
|
+
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
outerRing = arrayRemoveDuplicates_default(
|
|
403
|
+
outerRing,
|
|
404
|
+
Cartesian3_default.equalsEpsilon,
|
|
405
|
+
true
|
|
406
|
+
);
|
|
407
|
+
if (outerRing.length < 3) {
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
const numChildren = outerNode.holes ? outerNode.holes.length : 0;
|
|
411
|
+
for (i = 0; i < numChildren; i++) {
|
|
412
|
+
const hole = outerNode.holes[i];
|
|
413
|
+
let holePositions = hole.positions;
|
|
414
|
+
if (scaleToEllipsoidSurface) {
|
|
415
|
+
length = holePositions.length;
|
|
416
|
+
for (j = 0; j < length; ++j) {
|
|
417
|
+
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
holePositions = arrayRemoveDuplicates_default(
|
|
421
|
+
holePositions,
|
|
422
|
+
Cartesian3_default.equalsEpsilon,
|
|
423
|
+
true
|
|
424
|
+
);
|
|
425
|
+
if (holePositions.length < 3) {
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
polygons.push(holePositions);
|
|
429
|
+
let numGrandchildren = 0;
|
|
430
|
+
if (defined_default(hole.holes)) {
|
|
431
|
+
numGrandchildren = hole.holes.length;
|
|
432
|
+
}
|
|
433
|
+
for (j = 0; j < numGrandchildren; j++) {
|
|
434
|
+
queue.enqueue(hole.holes[j]);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
polygons.push(outerRing);
|
|
438
|
+
}
|
|
439
|
+
return polygons;
|
|
440
|
+
};
|
|
441
|
+
var scratchRhumbIntersection = new Cartographic_default();
|
|
442
|
+
function computeEquatorIntersectionRhumb(start, end, ellipsoid) {
|
|
443
|
+
const c0 = ellipsoid.cartesianToCartographic(start, scratchCartographic0);
|
|
444
|
+
const c1 = ellipsoid.cartesianToCartographic(end, scratchCartographic1);
|
|
445
|
+
if (Math.sign(c0.latitude) === Math.sign(c1.latitude)) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
scratchRhumbLine.setEndPoints(c0, c1);
|
|
449
|
+
const intersection = scratchRhumbLine.findIntersectionWithLatitude(
|
|
450
|
+
0,
|
|
451
|
+
scratchRhumbIntersection
|
|
452
|
+
);
|
|
453
|
+
if (!defined_default(intersection)) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
let minLongitude = Math.min(c0.longitude, c1.longitude);
|
|
457
|
+
let maxLongitude = Math.max(c0.longitude, c1.longitude);
|
|
458
|
+
if (Math.abs(maxLongitude - minLongitude) > Math_default.PI) {
|
|
459
|
+
const swap = minLongitude;
|
|
460
|
+
minLongitude = maxLongitude;
|
|
461
|
+
maxLongitude = swap;
|
|
462
|
+
}
|
|
463
|
+
if (intersection.longitude < minLongitude || intersection.longitude > maxLongitude) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
return ellipsoid.cartographicToCartesian(intersection);
|
|
467
|
+
}
|
|
468
|
+
function computeEquatorIntersection(start, end, ellipsoid, arcType) {
|
|
469
|
+
if (arcType === ArcType_default.RHUMB) {
|
|
470
|
+
return computeEquatorIntersectionRhumb(start, end, ellipsoid);
|
|
471
|
+
}
|
|
472
|
+
const intersection = IntersectionTests_default.lineSegmentPlane(
|
|
473
|
+
start,
|
|
474
|
+
end,
|
|
475
|
+
Plane_default.ORIGIN_XY_PLANE
|
|
476
|
+
);
|
|
477
|
+
if (!defined_default(intersection)) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
return ellipsoid.scaleToGeodeticSurface(intersection, intersection);
|
|
481
|
+
}
|
|
482
|
+
var scratchCartographic = new Cartographic_default();
|
|
483
|
+
function computeEdgesOnPlane(positions, ellipsoid, arcType) {
|
|
484
|
+
const edgesOnPlane = [];
|
|
485
|
+
let startPoint, endPoint, type, next, intersection, i = 0;
|
|
486
|
+
while (i < positions.length) {
|
|
487
|
+
startPoint = positions[i];
|
|
488
|
+
endPoint = positions[(i + 1) % positions.length];
|
|
489
|
+
type = Math_default.sign(startPoint.z);
|
|
490
|
+
next = Math_default.sign(endPoint.z);
|
|
491
|
+
const getLongitude = (position) => {
|
|
492
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
493
|
+
position,
|
|
494
|
+
scratchCartographic
|
|
495
|
+
);
|
|
496
|
+
return cartographic.longitude;
|
|
497
|
+
};
|
|
498
|
+
if (type === 0) {
|
|
499
|
+
edgesOnPlane.push({
|
|
500
|
+
position: i,
|
|
501
|
+
type,
|
|
502
|
+
visited: false,
|
|
503
|
+
next,
|
|
504
|
+
theta: getLongitude(startPoint)
|
|
505
|
+
});
|
|
506
|
+
} else if (next !== 0) {
|
|
507
|
+
intersection = computeEquatorIntersection(
|
|
508
|
+
startPoint,
|
|
509
|
+
endPoint,
|
|
510
|
+
ellipsoid,
|
|
511
|
+
arcType
|
|
512
|
+
);
|
|
513
|
+
++i;
|
|
514
|
+
if (!defined_default(intersection)) {
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
positions.splice(i, 0, intersection);
|
|
518
|
+
edgesOnPlane.push({
|
|
519
|
+
position: i,
|
|
520
|
+
type,
|
|
521
|
+
visited: false,
|
|
522
|
+
next,
|
|
523
|
+
theta: getLongitude(intersection)
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
++i;
|
|
527
|
+
}
|
|
528
|
+
return edgesOnPlane;
|
|
529
|
+
}
|
|
530
|
+
function wirePolygon(polygons, polygonIndex, positions, edgesOnPlane, toDelete, startIndex, abovePlane) {
|
|
531
|
+
const polygon = [];
|
|
532
|
+
let i = startIndex;
|
|
533
|
+
const getMatchingEdge = (i2) => (edge) => edge.position === i2;
|
|
534
|
+
const polygonsToWire = [];
|
|
535
|
+
do {
|
|
536
|
+
const position = positions[i];
|
|
537
|
+
polygon.push(position);
|
|
538
|
+
const edgeIndex = edgesOnPlane.findIndex(getMatchingEdge(i));
|
|
539
|
+
const edge = edgesOnPlane[edgeIndex];
|
|
540
|
+
if (!defined_default(edge)) {
|
|
541
|
+
++i;
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
const { visited: hasBeenVisited, type, next } = edge;
|
|
545
|
+
edge.visited = true;
|
|
546
|
+
if (type === 0) {
|
|
547
|
+
if (next === 0) {
|
|
548
|
+
const previousEdge = edgesOnPlane[edgeIndex - (abovePlane ? 1 : -1)];
|
|
549
|
+
if (previousEdge?.position === i + 1) {
|
|
550
|
+
previousEdge.visited = true;
|
|
551
|
+
} else {
|
|
552
|
+
++i;
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (!hasBeenVisited && abovePlane && next > 0 || startIndex === i && !abovePlane && next < 0) {
|
|
557
|
+
++i;
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
const followEdge = abovePlane ? type >= 0 : type <= 0;
|
|
562
|
+
if (!followEdge) {
|
|
563
|
+
++i;
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
if (!hasBeenVisited) {
|
|
567
|
+
polygonsToWire.push(i);
|
|
568
|
+
}
|
|
569
|
+
const nextEdgeIndex = edgeIndex + (abovePlane ? 1 : -1);
|
|
570
|
+
const nextEdge = edgesOnPlane[nextEdgeIndex];
|
|
571
|
+
if (!defined_default(nextEdge)) {
|
|
572
|
+
++i;
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
i = nextEdge.position;
|
|
576
|
+
} while (i < positions.length && i >= 0 && i !== startIndex && polygon.length < positions.length);
|
|
577
|
+
polygons.splice(polygonIndex, toDelete, polygon);
|
|
578
|
+
for (const index of polygonsToWire) {
|
|
579
|
+
polygonIndex = wirePolygon(
|
|
580
|
+
polygons,
|
|
581
|
+
++polygonIndex,
|
|
582
|
+
positions,
|
|
583
|
+
edgesOnPlane,
|
|
584
|
+
0,
|
|
585
|
+
index,
|
|
586
|
+
!abovePlane
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
return polygonIndex;
|
|
590
|
+
}
|
|
591
|
+
PolygonGeometryLibrary.splitPolygonsOnEquator = function(outerRings, ellipsoid, arcType, result) {
|
|
592
|
+
if (!defined_default(result)) {
|
|
593
|
+
result = [];
|
|
594
|
+
}
|
|
595
|
+
result.splice(0, 0, ...outerRings);
|
|
596
|
+
result.length = outerRings.length;
|
|
597
|
+
let currentPolygon = 0;
|
|
598
|
+
while (currentPolygon < result.length) {
|
|
599
|
+
const outerRing = result[currentPolygon];
|
|
600
|
+
const positions = outerRing.slice();
|
|
601
|
+
if (outerRing.length < 3) {
|
|
602
|
+
result[currentPolygon] = positions;
|
|
603
|
+
++currentPolygon;
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
const edgesOnPlane = computeEdgesOnPlane(positions, ellipsoid, arcType);
|
|
607
|
+
if (positions.length === outerRing.length || edgesOnPlane.length <= 1) {
|
|
608
|
+
result[currentPolygon] = positions;
|
|
609
|
+
++currentPolygon;
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
edgesOnPlane.sort((a, b) => {
|
|
613
|
+
return a.theta - b.theta;
|
|
614
|
+
});
|
|
615
|
+
const north = positions[0].z >= 0;
|
|
616
|
+
currentPolygon = wirePolygon(
|
|
617
|
+
result,
|
|
618
|
+
currentPolygon,
|
|
619
|
+
positions,
|
|
620
|
+
edgesOnPlane,
|
|
621
|
+
1,
|
|
622
|
+
0,
|
|
623
|
+
north
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
return result;
|
|
627
|
+
};
|
|
628
|
+
PolygonGeometryLibrary.polygonsFromHierarchy = function(polygonHierarchy, keepDuplicates, projectPointsTo2D, scaleToEllipsoidSurface, ellipsoid, splitPolygons) {
|
|
629
|
+
const hierarchy = [];
|
|
630
|
+
const polygons = [];
|
|
631
|
+
const queue = new Queue_default();
|
|
632
|
+
queue.enqueue(polygonHierarchy);
|
|
633
|
+
let split = defined_default(splitPolygons);
|
|
634
|
+
while (queue.length !== 0) {
|
|
635
|
+
const outerNode = queue.dequeue();
|
|
636
|
+
let outerRing = outerNode.positions;
|
|
637
|
+
const holes = outerNode.holes;
|
|
638
|
+
let i;
|
|
639
|
+
let length;
|
|
640
|
+
if (scaleToEllipsoidSurface) {
|
|
641
|
+
length = outerRing.length;
|
|
642
|
+
for (i = 0; i < length; i++) {
|
|
643
|
+
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
if (!keepDuplicates) {
|
|
647
|
+
outerRing = arrayRemoveDuplicates_default(
|
|
648
|
+
outerRing,
|
|
649
|
+
Cartesian3_default.equalsEpsilon,
|
|
650
|
+
true
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
if (outerRing.length < 3) {
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
let positions2D = projectPointsTo2D(outerRing);
|
|
657
|
+
if (!defined_default(positions2D)) {
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
const holeIndices = [];
|
|
661
|
+
let originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
|
|
662
|
+
positions2D
|
|
663
|
+
);
|
|
664
|
+
if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
|
|
665
|
+
positions2D.reverse();
|
|
666
|
+
outerRing = outerRing.slice().reverse();
|
|
667
|
+
}
|
|
668
|
+
if (split) {
|
|
669
|
+
split = false;
|
|
670
|
+
let polygons2 = [outerRing];
|
|
671
|
+
polygons2 = splitPolygons(polygons2, polygons2);
|
|
672
|
+
if (polygons2.length > 1) {
|
|
673
|
+
for (const positions2 of polygons2) {
|
|
674
|
+
queue.enqueue(new PolygonHierarchy_default(positions2, holes));
|
|
675
|
+
}
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
let positions = outerRing.slice();
|
|
680
|
+
const numChildren = defined_default(holes) ? holes.length : 0;
|
|
681
|
+
const polygonHoles = [];
|
|
682
|
+
let j;
|
|
683
|
+
for (i = 0; i < numChildren; i++) {
|
|
684
|
+
const hole = holes[i];
|
|
685
|
+
let holePositions = hole.positions;
|
|
686
|
+
if (scaleToEllipsoidSurface) {
|
|
687
|
+
length = holePositions.length;
|
|
688
|
+
for (j = 0; j < length; ++j) {
|
|
689
|
+
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (!keepDuplicates) {
|
|
693
|
+
holePositions = arrayRemoveDuplicates_default(
|
|
694
|
+
holePositions,
|
|
695
|
+
Cartesian3_default.equalsEpsilon,
|
|
696
|
+
true
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
if (holePositions.length < 3) {
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
const holePositions2D = projectPointsTo2D(holePositions);
|
|
703
|
+
if (!defined_default(holePositions2D)) {
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
|
|
707
|
+
holePositions2D
|
|
708
|
+
);
|
|
709
|
+
if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
|
|
710
|
+
holePositions2D.reverse();
|
|
711
|
+
holePositions = holePositions.slice().reverse();
|
|
712
|
+
}
|
|
713
|
+
polygonHoles.push(holePositions);
|
|
714
|
+
holeIndices.push(positions.length);
|
|
715
|
+
positions = positions.concat(holePositions);
|
|
716
|
+
positions2D = positions2D.concat(holePositions2D);
|
|
717
|
+
let numGrandchildren = 0;
|
|
718
|
+
if (defined_default(hole.holes)) {
|
|
719
|
+
numGrandchildren = hole.holes.length;
|
|
720
|
+
}
|
|
721
|
+
for (j = 0; j < numGrandchildren; j++) {
|
|
722
|
+
queue.enqueue(hole.holes[j]);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
hierarchy.push({
|
|
726
|
+
outerRing,
|
|
727
|
+
holes: polygonHoles
|
|
728
|
+
});
|
|
729
|
+
polygons.push({
|
|
730
|
+
positions,
|
|
731
|
+
positions2D,
|
|
732
|
+
holes: holeIndices
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
hierarchy,
|
|
737
|
+
polygons
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
var computeBoundingRectangleCartesian2 = new Cartesian2_default();
|
|
741
|
+
var computeBoundingRectangleCartesian3 = new Cartesian3_default();
|
|
742
|
+
var computeBoundingRectangleQuaternion = new Quaternion_default();
|
|
743
|
+
var computeBoundingRectangleMatrix3 = new Matrix3_default();
|
|
744
|
+
PolygonGeometryLibrary.computeBoundingRectangle = function(planeNormal, projectPointTo2D, positions, angle, result) {
|
|
745
|
+
const rotation = Quaternion_default.fromAxisAngle(
|
|
746
|
+
planeNormal,
|
|
747
|
+
angle,
|
|
748
|
+
computeBoundingRectangleQuaternion
|
|
749
|
+
);
|
|
750
|
+
const textureMatrix = Matrix3_default.fromQuaternion(
|
|
751
|
+
rotation,
|
|
752
|
+
computeBoundingRectangleMatrix3
|
|
753
|
+
);
|
|
754
|
+
let minX = Number.POSITIVE_INFINITY;
|
|
755
|
+
let maxX = Number.NEGATIVE_INFINITY;
|
|
756
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
757
|
+
let maxY = Number.NEGATIVE_INFINITY;
|
|
758
|
+
const length = positions.length;
|
|
759
|
+
for (let i = 0; i < length; ++i) {
|
|
760
|
+
const p = Cartesian3_default.clone(
|
|
761
|
+
positions[i],
|
|
762
|
+
computeBoundingRectangleCartesian3
|
|
763
|
+
);
|
|
764
|
+
Matrix3_default.multiplyByVector(textureMatrix, p, p);
|
|
765
|
+
const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);
|
|
766
|
+
if (defined_default(st)) {
|
|
767
|
+
minX = Math.min(minX, st.x);
|
|
768
|
+
maxX = Math.max(maxX, st.x);
|
|
769
|
+
minY = Math.min(minY, st.y);
|
|
770
|
+
maxY = Math.max(maxY, st.y);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
result.x = minX;
|
|
774
|
+
result.y = minY;
|
|
775
|
+
result.width = maxX - minX;
|
|
776
|
+
result.height = maxY - minY;
|
|
777
|
+
return result;
|
|
778
|
+
};
|
|
779
|
+
PolygonGeometryLibrary.createGeometryFromPositions = function(ellipsoid, polygon, textureCoordinates, granularity, perPositionHeight, vertexFormat, arcType) {
|
|
780
|
+
let indices = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
|
|
781
|
+
if (indices.length < 3) {
|
|
782
|
+
indices = [0, 1, 2];
|
|
783
|
+
}
|
|
784
|
+
const positions = polygon.positions;
|
|
785
|
+
const hasTexcoords = defined_default(textureCoordinates);
|
|
786
|
+
const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
|
|
787
|
+
if (perPositionHeight) {
|
|
788
|
+
const length = positions.length;
|
|
789
|
+
const flattenedPositions = new Array(length * 3);
|
|
790
|
+
let index = 0;
|
|
791
|
+
for (let i = 0; i < length; i++) {
|
|
792
|
+
const p = positions[i];
|
|
793
|
+
flattenedPositions[index++] = p.x;
|
|
794
|
+
flattenedPositions[index++] = p.y;
|
|
795
|
+
flattenedPositions[index++] = p.z;
|
|
796
|
+
}
|
|
797
|
+
const geometryOptions = {
|
|
798
|
+
attributes: {
|
|
799
|
+
position: new GeometryAttribute_default({
|
|
800
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
801
|
+
componentsPerAttribute: 3,
|
|
802
|
+
values: flattenedPositions
|
|
803
|
+
})
|
|
804
|
+
},
|
|
805
|
+
indices,
|
|
806
|
+
primitiveType: PrimitiveType_default.TRIANGLES
|
|
807
|
+
};
|
|
808
|
+
if (hasTexcoords) {
|
|
809
|
+
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
810
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
811
|
+
componentsPerAttribute: 2,
|
|
812
|
+
values: Cartesian2_default.packArray(texcoords)
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
const geometry = new Geometry_default(geometryOptions);
|
|
816
|
+
if (vertexFormat.normal) {
|
|
817
|
+
return GeometryPipeline_default.computeNormal(geometry);
|
|
818
|
+
}
|
|
819
|
+
return geometry;
|
|
820
|
+
}
|
|
821
|
+
if (arcType === ArcType_default.GEODESIC) {
|
|
822
|
+
return PolygonPipeline_default.computeSubdivision(
|
|
823
|
+
ellipsoid,
|
|
824
|
+
positions,
|
|
825
|
+
indices,
|
|
826
|
+
texcoords,
|
|
827
|
+
granularity
|
|
828
|
+
);
|
|
829
|
+
} else if (arcType === ArcType_default.RHUMB) {
|
|
830
|
+
return PolygonPipeline_default.computeRhumbLineSubdivision(
|
|
831
|
+
ellipsoid,
|
|
832
|
+
positions,
|
|
833
|
+
indices,
|
|
834
|
+
texcoords,
|
|
835
|
+
granularity
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
var computeWallTexcoordsSubdivided = [];
|
|
840
|
+
var computeWallIndicesSubdivided = [];
|
|
841
|
+
var p1Scratch = new Cartesian3_default();
|
|
842
|
+
var p2Scratch = new Cartesian3_default();
|
|
843
|
+
PolygonGeometryLibrary.computeWallGeometry = function(positions, textureCoordinates, ellipsoid, granularity, perPositionHeight, arcType) {
|
|
844
|
+
let edgePositions;
|
|
845
|
+
let topEdgeLength;
|
|
846
|
+
let i;
|
|
847
|
+
let p1;
|
|
848
|
+
let p2;
|
|
849
|
+
let t1;
|
|
850
|
+
let t2;
|
|
851
|
+
let edgeTexcoords;
|
|
852
|
+
let topEdgeTexcoordLength;
|
|
853
|
+
let length = positions.length;
|
|
854
|
+
let index = 0;
|
|
855
|
+
let textureIndex = 0;
|
|
856
|
+
const hasTexcoords = defined_default(textureCoordinates);
|
|
857
|
+
const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
|
|
858
|
+
if (!perPositionHeight) {
|
|
859
|
+
const minDistance = Math_default.chordLength(
|
|
860
|
+
granularity,
|
|
861
|
+
ellipsoid.maximumRadius
|
|
862
|
+
);
|
|
863
|
+
let numVertices = 0;
|
|
864
|
+
if (arcType === ArcType_default.GEODESIC) {
|
|
865
|
+
for (i = 0; i < length; i++) {
|
|
866
|
+
numVertices += PolygonGeometryLibrary.subdivideLineCount(
|
|
867
|
+
positions[i],
|
|
868
|
+
positions[(i + 1) % length],
|
|
869
|
+
minDistance
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
} else if (arcType === ArcType_default.RHUMB) {
|
|
873
|
+
for (i = 0; i < length; i++) {
|
|
874
|
+
numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(
|
|
875
|
+
ellipsoid,
|
|
876
|
+
positions[i],
|
|
877
|
+
positions[(i + 1) % length],
|
|
878
|
+
minDistance
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
topEdgeLength = (numVertices + length) * 3;
|
|
883
|
+
edgePositions = new Array(topEdgeLength * 2);
|
|
884
|
+
if (hasTexcoords) {
|
|
885
|
+
topEdgeTexcoordLength = (numVertices + length) * 2;
|
|
886
|
+
edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
|
|
887
|
+
}
|
|
888
|
+
for (i = 0; i < length; i++) {
|
|
889
|
+
p1 = positions[i];
|
|
890
|
+
p2 = positions[(i + 1) % length];
|
|
891
|
+
let tempPositions;
|
|
892
|
+
let tempTexcoords;
|
|
893
|
+
if (hasTexcoords) {
|
|
894
|
+
t1 = texcoords[i];
|
|
895
|
+
t2 = texcoords[(i + 1) % length];
|
|
896
|
+
}
|
|
897
|
+
if (arcType === ArcType_default.GEODESIC) {
|
|
898
|
+
tempPositions = PolygonGeometryLibrary.subdivideLine(
|
|
899
|
+
p1,
|
|
900
|
+
p2,
|
|
901
|
+
minDistance,
|
|
902
|
+
computeWallIndicesSubdivided
|
|
903
|
+
);
|
|
904
|
+
if (hasTexcoords) {
|
|
905
|
+
tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(
|
|
906
|
+
t1,
|
|
907
|
+
t2,
|
|
908
|
+
p1,
|
|
909
|
+
p2,
|
|
910
|
+
minDistance,
|
|
911
|
+
computeWallTexcoordsSubdivided
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
} else if (arcType === ArcType_default.RHUMB) {
|
|
915
|
+
tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(
|
|
916
|
+
ellipsoid,
|
|
917
|
+
p1,
|
|
918
|
+
p2,
|
|
919
|
+
minDistance,
|
|
920
|
+
computeWallIndicesSubdivided
|
|
921
|
+
);
|
|
922
|
+
if (hasTexcoords) {
|
|
923
|
+
tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(
|
|
924
|
+
t1,
|
|
925
|
+
t2,
|
|
926
|
+
ellipsoid,
|
|
927
|
+
p1,
|
|
928
|
+
p2,
|
|
929
|
+
minDistance,
|
|
930
|
+
computeWallTexcoordsSubdivided
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
const tempPositionsLength = tempPositions.length;
|
|
935
|
+
for (let j = 0; j < tempPositionsLength; ++j, ++index) {
|
|
936
|
+
edgePositions[index] = tempPositions[j];
|
|
937
|
+
edgePositions[index + topEdgeLength] = tempPositions[j];
|
|
938
|
+
}
|
|
939
|
+
edgePositions[index] = p2.x;
|
|
940
|
+
edgePositions[index + topEdgeLength] = p2.x;
|
|
941
|
+
++index;
|
|
942
|
+
edgePositions[index] = p2.y;
|
|
943
|
+
edgePositions[index + topEdgeLength] = p2.y;
|
|
944
|
+
++index;
|
|
945
|
+
edgePositions[index] = p2.z;
|
|
946
|
+
edgePositions[index + topEdgeLength] = p2.z;
|
|
947
|
+
++index;
|
|
948
|
+
if (hasTexcoords) {
|
|
949
|
+
const tempTexcoordsLength = tempTexcoords.length;
|
|
950
|
+
for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {
|
|
951
|
+
edgeTexcoords[textureIndex] = tempTexcoords[k];
|
|
952
|
+
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = tempTexcoords[k];
|
|
953
|
+
}
|
|
954
|
+
edgeTexcoords[textureIndex] = t2.x;
|
|
955
|
+
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
|
|
956
|
+
++textureIndex;
|
|
957
|
+
edgeTexcoords[textureIndex] = t2.y;
|
|
958
|
+
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
|
|
959
|
+
++textureIndex;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
} else {
|
|
963
|
+
topEdgeLength = length * 3 * 2;
|
|
964
|
+
edgePositions = new Array(topEdgeLength * 2);
|
|
965
|
+
if (hasTexcoords) {
|
|
966
|
+
topEdgeTexcoordLength = length * 2 * 2;
|
|
967
|
+
edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
|
|
968
|
+
}
|
|
969
|
+
for (i = 0; i < length; i++) {
|
|
970
|
+
p1 = positions[i];
|
|
971
|
+
p2 = positions[(i + 1) % length];
|
|
972
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;
|
|
973
|
+
++index;
|
|
974
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;
|
|
975
|
+
++index;
|
|
976
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;
|
|
977
|
+
++index;
|
|
978
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;
|
|
979
|
+
++index;
|
|
980
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;
|
|
981
|
+
++index;
|
|
982
|
+
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;
|
|
983
|
+
++index;
|
|
984
|
+
if (hasTexcoords) {
|
|
985
|
+
t1 = texcoords[i];
|
|
986
|
+
t2 = texcoords[(i + 1) % length];
|
|
987
|
+
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.x;
|
|
988
|
+
++textureIndex;
|
|
989
|
+
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.y;
|
|
990
|
+
++textureIndex;
|
|
991
|
+
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
|
|
992
|
+
++textureIndex;
|
|
993
|
+
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
|
|
994
|
+
++textureIndex;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
length = edgePositions.length;
|
|
999
|
+
const indices = IndexDatatype_default.createTypedArray(
|
|
1000
|
+
length / 3,
|
|
1001
|
+
length - positions.length * 6
|
|
1002
|
+
);
|
|
1003
|
+
let edgeIndex = 0;
|
|
1004
|
+
length /= 6;
|
|
1005
|
+
for (i = 0; i < length; i++) {
|
|
1006
|
+
const UL = i;
|
|
1007
|
+
const UR = UL + 1;
|
|
1008
|
+
const LL = UL + length;
|
|
1009
|
+
const LR = LL + 1;
|
|
1010
|
+
p1 = Cartesian3_default.fromArray(edgePositions, UL * 3, p1Scratch);
|
|
1011
|
+
p2 = Cartesian3_default.fromArray(edgePositions, UR * 3, p2Scratch);
|
|
1012
|
+
if (Cartesian3_default.equalsEpsilon(
|
|
1013
|
+
p1,
|
|
1014
|
+
p2,
|
|
1015
|
+
Math_default.EPSILON10,
|
|
1016
|
+
Math_default.EPSILON10
|
|
1017
|
+
)) {
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
indices[edgeIndex++] = UL;
|
|
1021
|
+
indices[edgeIndex++] = LL;
|
|
1022
|
+
indices[edgeIndex++] = UR;
|
|
1023
|
+
indices[edgeIndex++] = UR;
|
|
1024
|
+
indices[edgeIndex++] = LL;
|
|
1025
|
+
indices[edgeIndex++] = LR;
|
|
1026
|
+
}
|
|
1027
|
+
const geometryOptions = {
|
|
1028
|
+
attributes: new GeometryAttributes_default({
|
|
1029
|
+
position: new GeometryAttribute_default({
|
|
1030
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
1031
|
+
componentsPerAttribute: 3,
|
|
1032
|
+
values: edgePositions
|
|
1033
|
+
})
|
|
1034
|
+
}),
|
|
1035
|
+
indices,
|
|
1036
|
+
primitiveType: PrimitiveType_default.TRIANGLES
|
|
1037
|
+
};
|
|
1038
|
+
if (hasTexcoords) {
|
|
1039
|
+
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
1040
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
1041
|
+
componentsPerAttribute: 2,
|
|
1042
|
+
values: edgeTexcoords
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
const geometry = new Geometry_default(geometryOptions);
|
|
1046
|
+
return geometry;
|
|
1047
|
+
};
|
|
1048
|
+
var PolygonGeometryLibrary_default = PolygonGeometryLibrary;
|
|
1049
|
+
|
|
1050
|
+
export {
|
|
1051
|
+
PolygonGeometryLibrary_default
|
|
1052
|
+
};
|