@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,1007 @@
|
|
|
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
|
+
EllipsoidRhumbLine_default
|
|
28
|
+
} from "./chunk-R4OZKBXH.js";
|
|
29
|
+
import {
|
|
30
|
+
GeometryAttribute_default,
|
|
31
|
+
Geometry_default,
|
|
32
|
+
PrimitiveType_default
|
|
33
|
+
} from "./chunk-R3HUGXBH.js";
|
|
34
|
+
import {
|
|
35
|
+
ComponentDatatype_default
|
|
36
|
+
} from "./chunk-ARPTYYKS.js";
|
|
37
|
+
import {
|
|
38
|
+
Cartesian2_default,
|
|
39
|
+
Cartesian3_default,
|
|
40
|
+
Cartographic_default,
|
|
41
|
+
Ellipsoid_default
|
|
42
|
+
} from "./chunk-LGJUI2CE.js";
|
|
43
|
+
import {
|
|
44
|
+
Math_default
|
|
45
|
+
} from "./chunk-BP467WX3.js";
|
|
46
|
+
import {
|
|
47
|
+
WebGLConstants_default
|
|
48
|
+
} from "./chunk-SV7DDPAC.js";
|
|
49
|
+
import {
|
|
50
|
+
defaultValue_default
|
|
51
|
+
} from "./chunk-CWJQGBWT.js";
|
|
52
|
+
import {
|
|
53
|
+
Check_default
|
|
54
|
+
} from "./chunk-5HLGKKG3.js";
|
|
55
|
+
import {
|
|
56
|
+
__commonJS,
|
|
57
|
+
__toESM,
|
|
58
|
+
defined_default
|
|
59
|
+
} from "./chunk-YBKFS53K.js";
|
|
60
|
+
|
|
61
|
+
// node_modules/earcut/src/earcut.js
|
|
62
|
+
var require_earcut = __commonJS({
|
|
63
|
+
"node_modules/earcut/src/earcut.js"(exports, module) {
|
|
64
|
+
"use strict";
|
|
65
|
+
module.exports = earcut2;
|
|
66
|
+
module.exports.default = earcut2;
|
|
67
|
+
function earcut2(data, holeIndices, dim) {
|
|
68
|
+
dim = dim || 2;
|
|
69
|
+
var hasHoles = holeIndices && holeIndices.length, outerLen = hasHoles ? holeIndices[0] * dim : data.length, outerNode = linkedList(data, 0, outerLen, dim, true), triangles = [];
|
|
70
|
+
if (!outerNode || outerNode.next === outerNode.prev)
|
|
71
|
+
return triangles;
|
|
72
|
+
var minX, minY, maxX, maxY, x, y, invSize;
|
|
73
|
+
if (hasHoles)
|
|
74
|
+
outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
|
|
75
|
+
if (data.length > 80 * dim) {
|
|
76
|
+
minX = maxX = data[0];
|
|
77
|
+
minY = maxY = data[1];
|
|
78
|
+
for (var i = dim; i < outerLen; i += dim) {
|
|
79
|
+
x = data[i];
|
|
80
|
+
y = data[i + 1];
|
|
81
|
+
if (x < minX)
|
|
82
|
+
minX = x;
|
|
83
|
+
if (y < minY)
|
|
84
|
+
minY = y;
|
|
85
|
+
if (x > maxX)
|
|
86
|
+
maxX = x;
|
|
87
|
+
if (y > maxY)
|
|
88
|
+
maxY = y;
|
|
89
|
+
}
|
|
90
|
+
invSize = Math.max(maxX - minX, maxY - minY);
|
|
91
|
+
invSize = invSize !== 0 ? 32767 / invSize : 0;
|
|
92
|
+
}
|
|
93
|
+
earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
|
|
94
|
+
return triangles;
|
|
95
|
+
}
|
|
96
|
+
function linkedList(data, start, end, dim, clockwise) {
|
|
97
|
+
var i, last;
|
|
98
|
+
if (clockwise === signedArea(data, start, end, dim) > 0) {
|
|
99
|
+
for (i = start; i < end; i += dim)
|
|
100
|
+
last = insertNode(i, data[i], data[i + 1], last);
|
|
101
|
+
} else {
|
|
102
|
+
for (i = end - dim; i >= start; i -= dim)
|
|
103
|
+
last = insertNode(i, data[i], data[i + 1], last);
|
|
104
|
+
}
|
|
105
|
+
if (last && equals(last, last.next)) {
|
|
106
|
+
removeNode(last);
|
|
107
|
+
last = last.next;
|
|
108
|
+
}
|
|
109
|
+
return last;
|
|
110
|
+
}
|
|
111
|
+
function filterPoints(start, end) {
|
|
112
|
+
if (!start)
|
|
113
|
+
return start;
|
|
114
|
+
if (!end)
|
|
115
|
+
end = start;
|
|
116
|
+
var p = start, again;
|
|
117
|
+
do {
|
|
118
|
+
again = false;
|
|
119
|
+
if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
|
|
120
|
+
removeNode(p);
|
|
121
|
+
p = end = p.prev;
|
|
122
|
+
if (p === p.next)
|
|
123
|
+
break;
|
|
124
|
+
again = true;
|
|
125
|
+
} else {
|
|
126
|
+
p = p.next;
|
|
127
|
+
}
|
|
128
|
+
} while (again || p !== end);
|
|
129
|
+
return end;
|
|
130
|
+
}
|
|
131
|
+
function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
|
|
132
|
+
if (!ear)
|
|
133
|
+
return;
|
|
134
|
+
if (!pass && invSize)
|
|
135
|
+
indexCurve(ear, minX, minY, invSize);
|
|
136
|
+
var stop = ear, prev, next;
|
|
137
|
+
while (ear.prev !== ear.next) {
|
|
138
|
+
prev = ear.prev;
|
|
139
|
+
next = ear.next;
|
|
140
|
+
if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
|
|
141
|
+
triangles.push(prev.i / dim | 0);
|
|
142
|
+
triangles.push(ear.i / dim | 0);
|
|
143
|
+
triangles.push(next.i / dim | 0);
|
|
144
|
+
removeNode(ear);
|
|
145
|
+
ear = next.next;
|
|
146
|
+
stop = next.next;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
ear = next;
|
|
150
|
+
if (ear === stop) {
|
|
151
|
+
if (!pass) {
|
|
152
|
+
earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
|
|
153
|
+
} else if (pass === 1) {
|
|
154
|
+
ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
|
|
155
|
+
earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
|
|
156
|
+
} else if (pass === 2) {
|
|
157
|
+
splitEarcut(ear, triangles, dim, minX, minY, invSize);
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function isEar(ear) {
|
|
164
|
+
var a = ear.prev, b = ear, c = ear.next;
|
|
165
|
+
if (area(a, b, c) >= 0)
|
|
166
|
+
return false;
|
|
167
|
+
var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
|
|
168
|
+
var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
|
|
169
|
+
var p = c.next;
|
|
170
|
+
while (p !== a) {
|
|
171
|
+
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
|
|
172
|
+
return false;
|
|
173
|
+
p = p.next;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
function isEarHashed(ear, minX, minY, invSize) {
|
|
178
|
+
var a = ear.prev, b = ear, c = ear.next;
|
|
179
|
+
if (area(a, b, c) >= 0)
|
|
180
|
+
return false;
|
|
181
|
+
var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
|
|
182
|
+
var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
|
|
183
|
+
var minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize);
|
|
184
|
+
var p = ear.prevZ, n = ear.nextZ;
|
|
185
|
+
while (p && p.z >= minZ && n && n.z <= maxZ) {
|
|
186
|
+
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
|
|
187
|
+
return false;
|
|
188
|
+
p = p.prevZ;
|
|
189
|
+
if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0)
|
|
190
|
+
return false;
|
|
191
|
+
n = n.nextZ;
|
|
192
|
+
}
|
|
193
|
+
while (p && p.z >= minZ) {
|
|
194
|
+
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
|
|
195
|
+
return false;
|
|
196
|
+
p = p.prevZ;
|
|
197
|
+
}
|
|
198
|
+
while (n && n.z <= maxZ) {
|
|
199
|
+
if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0)
|
|
200
|
+
return false;
|
|
201
|
+
n = n.nextZ;
|
|
202
|
+
}
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
function cureLocalIntersections(start, triangles, dim) {
|
|
206
|
+
var p = start;
|
|
207
|
+
do {
|
|
208
|
+
var a = p.prev, b = p.next.next;
|
|
209
|
+
if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
|
|
210
|
+
triangles.push(a.i / dim | 0);
|
|
211
|
+
triangles.push(p.i / dim | 0);
|
|
212
|
+
triangles.push(b.i / dim | 0);
|
|
213
|
+
removeNode(p);
|
|
214
|
+
removeNode(p.next);
|
|
215
|
+
p = start = b;
|
|
216
|
+
}
|
|
217
|
+
p = p.next;
|
|
218
|
+
} while (p !== start);
|
|
219
|
+
return filterPoints(p);
|
|
220
|
+
}
|
|
221
|
+
function splitEarcut(start, triangles, dim, minX, minY, invSize) {
|
|
222
|
+
var a = start;
|
|
223
|
+
do {
|
|
224
|
+
var b = a.next.next;
|
|
225
|
+
while (b !== a.prev) {
|
|
226
|
+
if (a.i !== b.i && isValidDiagonal(a, b)) {
|
|
227
|
+
var c = splitPolygon(a, b);
|
|
228
|
+
a = filterPoints(a, a.next);
|
|
229
|
+
c = filterPoints(c, c.next);
|
|
230
|
+
earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
|
|
231
|
+
earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
b = b.next;
|
|
235
|
+
}
|
|
236
|
+
a = a.next;
|
|
237
|
+
} while (a !== start);
|
|
238
|
+
}
|
|
239
|
+
function eliminateHoles(data, holeIndices, outerNode, dim) {
|
|
240
|
+
var queue = [], i, len, start, end, list;
|
|
241
|
+
for (i = 0, len = holeIndices.length; i < len; i++) {
|
|
242
|
+
start = holeIndices[i] * dim;
|
|
243
|
+
end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
|
|
244
|
+
list = linkedList(data, start, end, dim, false);
|
|
245
|
+
if (list === list.next)
|
|
246
|
+
list.steiner = true;
|
|
247
|
+
queue.push(getLeftmost(list));
|
|
248
|
+
}
|
|
249
|
+
queue.sort(compareX);
|
|
250
|
+
for (i = 0; i < queue.length; i++) {
|
|
251
|
+
outerNode = eliminateHole(queue[i], outerNode);
|
|
252
|
+
}
|
|
253
|
+
return outerNode;
|
|
254
|
+
}
|
|
255
|
+
function compareX(a, b) {
|
|
256
|
+
return a.x - b.x;
|
|
257
|
+
}
|
|
258
|
+
function eliminateHole(hole, outerNode) {
|
|
259
|
+
var bridge = findHoleBridge(hole, outerNode);
|
|
260
|
+
if (!bridge) {
|
|
261
|
+
return outerNode;
|
|
262
|
+
}
|
|
263
|
+
var bridgeReverse = splitPolygon(bridge, hole);
|
|
264
|
+
filterPoints(bridgeReverse, bridgeReverse.next);
|
|
265
|
+
return filterPoints(bridge, bridge.next);
|
|
266
|
+
}
|
|
267
|
+
function findHoleBridge(hole, outerNode) {
|
|
268
|
+
var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m;
|
|
269
|
+
do {
|
|
270
|
+
if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
|
|
271
|
+
var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
|
|
272
|
+
if (x <= hx && x > qx) {
|
|
273
|
+
qx = x;
|
|
274
|
+
m = p.x < p.next.x ? p : p.next;
|
|
275
|
+
if (x === hx)
|
|
276
|
+
return m;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
p = p.next;
|
|
280
|
+
} while (p !== outerNode);
|
|
281
|
+
if (!m)
|
|
282
|
+
return null;
|
|
283
|
+
var stop = m, mx = m.x, my = m.y, tanMin = Infinity, tan;
|
|
284
|
+
p = m;
|
|
285
|
+
do {
|
|
286
|
+
if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
|
|
287
|
+
tan = Math.abs(hy - p.y) / (hx - p.x);
|
|
288
|
+
if (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) {
|
|
289
|
+
m = p;
|
|
290
|
+
tanMin = tan;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
p = p.next;
|
|
294
|
+
} while (p !== stop);
|
|
295
|
+
return m;
|
|
296
|
+
}
|
|
297
|
+
function sectorContainsSector(m, p) {
|
|
298
|
+
return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
|
|
299
|
+
}
|
|
300
|
+
function indexCurve(start, minX, minY, invSize) {
|
|
301
|
+
var p = start;
|
|
302
|
+
do {
|
|
303
|
+
if (p.z === 0)
|
|
304
|
+
p.z = zOrder(p.x, p.y, minX, minY, invSize);
|
|
305
|
+
p.prevZ = p.prev;
|
|
306
|
+
p.nextZ = p.next;
|
|
307
|
+
p = p.next;
|
|
308
|
+
} while (p !== start);
|
|
309
|
+
p.prevZ.nextZ = null;
|
|
310
|
+
p.prevZ = null;
|
|
311
|
+
sortLinked(p);
|
|
312
|
+
}
|
|
313
|
+
function sortLinked(list) {
|
|
314
|
+
var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1;
|
|
315
|
+
do {
|
|
316
|
+
p = list;
|
|
317
|
+
list = null;
|
|
318
|
+
tail = null;
|
|
319
|
+
numMerges = 0;
|
|
320
|
+
while (p) {
|
|
321
|
+
numMerges++;
|
|
322
|
+
q = p;
|
|
323
|
+
pSize = 0;
|
|
324
|
+
for (i = 0; i < inSize; i++) {
|
|
325
|
+
pSize++;
|
|
326
|
+
q = q.nextZ;
|
|
327
|
+
if (!q)
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
qSize = inSize;
|
|
331
|
+
while (pSize > 0 || qSize > 0 && q) {
|
|
332
|
+
if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
|
|
333
|
+
e = p;
|
|
334
|
+
p = p.nextZ;
|
|
335
|
+
pSize--;
|
|
336
|
+
} else {
|
|
337
|
+
e = q;
|
|
338
|
+
q = q.nextZ;
|
|
339
|
+
qSize--;
|
|
340
|
+
}
|
|
341
|
+
if (tail)
|
|
342
|
+
tail.nextZ = e;
|
|
343
|
+
else
|
|
344
|
+
list = e;
|
|
345
|
+
e.prevZ = tail;
|
|
346
|
+
tail = e;
|
|
347
|
+
}
|
|
348
|
+
p = q;
|
|
349
|
+
}
|
|
350
|
+
tail.nextZ = null;
|
|
351
|
+
inSize *= 2;
|
|
352
|
+
} while (numMerges > 1);
|
|
353
|
+
return list;
|
|
354
|
+
}
|
|
355
|
+
function zOrder(x, y, minX, minY, invSize) {
|
|
356
|
+
x = (x - minX) * invSize | 0;
|
|
357
|
+
y = (y - minY) * invSize | 0;
|
|
358
|
+
x = (x | x << 8) & 16711935;
|
|
359
|
+
x = (x | x << 4) & 252645135;
|
|
360
|
+
x = (x | x << 2) & 858993459;
|
|
361
|
+
x = (x | x << 1) & 1431655765;
|
|
362
|
+
y = (y | y << 8) & 16711935;
|
|
363
|
+
y = (y | y << 4) & 252645135;
|
|
364
|
+
y = (y | y << 2) & 858993459;
|
|
365
|
+
y = (y | y << 1) & 1431655765;
|
|
366
|
+
return x | y << 1;
|
|
367
|
+
}
|
|
368
|
+
function getLeftmost(start) {
|
|
369
|
+
var p = start, leftmost = start;
|
|
370
|
+
do {
|
|
371
|
+
if (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y)
|
|
372
|
+
leftmost = p;
|
|
373
|
+
p = p.next;
|
|
374
|
+
} while (p !== start);
|
|
375
|
+
return leftmost;
|
|
376
|
+
}
|
|
377
|
+
function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
|
|
378
|
+
return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
|
|
379
|
+
}
|
|
380
|
+
function isValidDiagonal(a, b) {
|
|
381
|
+
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
|
|
382
|
+
(locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
|
|
383
|
+
(area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
|
|
384
|
+
equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
|
|
385
|
+
}
|
|
386
|
+
function area(p, q, r) {
|
|
387
|
+
return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
|
|
388
|
+
}
|
|
389
|
+
function equals(p1, p2) {
|
|
390
|
+
return p1.x === p2.x && p1.y === p2.y;
|
|
391
|
+
}
|
|
392
|
+
function intersects(p1, q1, p2, q2) {
|
|
393
|
+
var o1 = sign(area(p1, q1, p2));
|
|
394
|
+
var o2 = sign(area(p1, q1, q2));
|
|
395
|
+
var o3 = sign(area(p2, q2, p1));
|
|
396
|
+
var o4 = sign(area(p2, q2, q1));
|
|
397
|
+
if (o1 !== o2 && o3 !== o4)
|
|
398
|
+
return true;
|
|
399
|
+
if (o1 === 0 && onSegment(p1, p2, q1))
|
|
400
|
+
return true;
|
|
401
|
+
if (o2 === 0 && onSegment(p1, q2, q1))
|
|
402
|
+
return true;
|
|
403
|
+
if (o3 === 0 && onSegment(p2, p1, q2))
|
|
404
|
+
return true;
|
|
405
|
+
if (o4 === 0 && onSegment(p2, q1, q2))
|
|
406
|
+
return true;
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
function onSegment(p, q, r) {
|
|
410
|
+
return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
|
|
411
|
+
}
|
|
412
|
+
function sign(num) {
|
|
413
|
+
return num > 0 ? 1 : num < 0 ? -1 : 0;
|
|
414
|
+
}
|
|
415
|
+
function intersectsPolygon(a, b) {
|
|
416
|
+
var p = a;
|
|
417
|
+
do {
|
|
418
|
+
if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b))
|
|
419
|
+
return true;
|
|
420
|
+
p = p.next;
|
|
421
|
+
} while (p !== a);
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
function locallyInside(a, b) {
|
|
425
|
+
return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
|
|
426
|
+
}
|
|
427
|
+
function middleInside(a, b) {
|
|
428
|
+
var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2;
|
|
429
|
+
do {
|
|
430
|
+
if (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)
|
|
431
|
+
inside = !inside;
|
|
432
|
+
p = p.next;
|
|
433
|
+
} while (p !== a);
|
|
434
|
+
return inside;
|
|
435
|
+
}
|
|
436
|
+
function splitPolygon(a, b) {
|
|
437
|
+
var a2 = new Node(a.i, a.x, a.y), b2 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev;
|
|
438
|
+
a.next = b;
|
|
439
|
+
b.prev = a;
|
|
440
|
+
a2.next = an;
|
|
441
|
+
an.prev = a2;
|
|
442
|
+
b2.next = a2;
|
|
443
|
+
a2.prev = b2;
|
|
444
|
+
bp.next = b2;
|
|
445
|
+
b2.prev = bp;
|
|
446
|
+
return b2;
|
|
447
|
+
}
|
|
448
|
+
function insertNode(i, x, y, last) {
|
|
449
|
+
var p = new Node(i, x, y);
|
|
450
|
+
if (!last) {
|
|
451
|
+
p.prev = p;
|
|
452
|
+
p.next = p;
|
|
453
|
+
} else {
|
|
454
|
+
p.next = last.next;
|
|
455
|
+
p.prev = last;
|
|
456
|
+
last.next.prev = p;
|
|
457
|
+
last.next = p;
|
|
458
|
+
}
|
|
459
|
+
return p;
|
|
460
|
+
}
|
|
461
|
+
function removeNode(p) {
|
|
462
|
+
p.next.prev = p.prev;
|
|
463
|
+
p.prev.next = p.next;
|
|
464
|
+
if (p.prevZ)
|
|
465
|
+
p.prevZ.nextZ = p.nextZ;
|
|
466
|
+
if (p.nextZ)
|
|
467
|
+
p.nextZ.prevZ = p.prevZ;
|
|
468
|
+
}
|
|
469
|
+
function Node(i, x, y) {
|
|
470
|
+
this.i = i;
|
|
471
|
+
this.x = x;
|
|
472
|
+
this.y = y;
|
|
473
|
+
this.prev = null;
|
|
474
|
+
this.next = null;
|
|
475
|
+
this.z = 0;
|
|
476
|
+
this.prevZ = null;
|
|
477
|
+
this.nextZ = null;
|
|
478
|
+
this.steiner = false;
|
|
479
|
+
}
|
|
480
|
+
earcut2.deviation = function(data, holeIndices, dim, triangles) {
|
|
481
|
+
var hasHoles = holeIndices && holeIndices.length;
|
|
482
|
+
var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
|
|
483
|
+
var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
|
|
484
|
+
if (hasHoles) {
|
|
485
|
+
for (var i = 0, len = holeIndices.length; i < len; i++) {
|
|
486
|
+
var start = holeIndices[i] * dim;
|
|
487
|
+
var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
|
|
488
|
+
polygonArea -= Math.abs(signedArea(data, start, end, dim));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
var trianglesArea = 0;
|
|
492
|
+
for (i = 0; i < triangles.length; i += 3) {
|
|
493
|
+
var a = triangles[i] * dim;
|
|
494
|
+
var b = triangles[i + 1] * dim;
|
|
495
|
+
var c = triangles[i + 2] * dim;
|
|
496
|
+
trianglesArea += Math.abs(
|
|
497
|
+
(data[a] - data[c]) * (data[b + 1] - data[a + 1]) - (data[a] - data[b]) * (data[c + 1] - data[a + 1])
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea);
|
|
501
|
+
};
|
|
502
|
+
function signedArea(data, start, end, dim) {
|
|
503
|
+
var sum = 0;
|
|
504
|
+
for (var i = start, j = end - dim; i < end; i += dim) {
|
|
505
|
+
sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
|
|
506
|
+
j = i;
|
|
507
|
+
}
|
|
508
|
+
return sum;
|
|
509
|
+
}
|
|
510
|
+
earcut2.flatten = function(data) {
|
|
511
|
+
var dim = data[0][0].length, result = { vertices: [], holes: [], dimensions: dim }, holeIndex = 0;
|
|
512
|
+
for (var i = 0; i < data.length; i++) {
|
|
513
|
+
for (var j = 0; j < data[i].length; j++) {
|
|
514
|
+
for (var d = 0; d < dim; d++)
|
|
515
|
+
result.vertices.push(data[i][j][d]);
|
|
516
|
+
}
|
|
517
|
+
if (i > 0) {
|
|
518
|
+
holeIndex += data[i - 1].length;
|
|
519
|
+
result.holes.push(holeIndex);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return result;
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// packages/engine/Source/Core/WindingOrder.js
|
|
528
|
+
var WindingOrder = {
|
|
529
|
+
/**
|
|
530
|
+
* Vertices are in clockwise order.
|
|
531
|
+
*
|
|
532
|
+
* @type {number}
|
|
533
|
+
* @constant
|
|
534
|
+
*/
|
|
535
|
+
CLOCKWISE: WebGLConstants_default.CW,
|
|
536
|
+
/**
|
|
537
|
+
* Vertices are in counter-clockwise order.
|
|
538
|
+
*
|
|
539
|
+
* @type {number}
|
|
540
|
+
* @constant
|
|
541
|
+
*/
|
|
542
|
+
COUNTER_CLOCKWISE: WebGLConstants_default.CCW
|
|
543
|
+
};
|
|
544
|
+
WindingOrder.validate = function(windingOrder) {
|
|
545
|
+
return windingOrder === WindingOrder.CLOCKWISE || windingOrder === WindingOrder.COUNTER_CLOCKWISE;
|
|
546
|
+
};
|
|
547
|
+
var WindingOrder_default = Object.freeze(WindingOrder);
|
|
548
|
+
|
|
549
|
+
// packages/engine/Source/Core/PolygonPipeline.js
|
|
550
|
+
var import_earcut = __toESM(require_earcut(), 1);
|
|
551
|
+
var scaleToGeodeticHeightN = new Cartesian3_default();
|
|
552
|
+
var scaleToGeodeticHeightP = new Cartesian3_default();
|
|
553
|
+
var PolygonPipeline = {};
|
|
554
|
+
PolygonPipeline.computeArea2D = function(positions) {
|
|
555
|
+
Check_default.defined("positions", positions);
|
|
556
|
+
Check_default.typeOf.number.greaterThanOrEquals(
|
|
557
|
+
"positions.length",
|
|
558
|
+
positions.length,
|
|
559
|
+
3
|
|
560
|
+
);
|
|
561
|
+
const length = positions.length;
|
|
562
|
+
let area = 0;
|
|
563
|
+
for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {
|
|
564
|
+
const v0 = positions[i0];
|
|
565
|
+
const v1 = positions[i1];
|
|
566
|
+
area += v0.x * v1.y - v1.x * v0.y;
|
|
567
|
+
}
|
|
568
|
+
return area * 0.5;
|
|
569
|
+
};
|
|
570
|
+
PolygonPipeline.computeWindingOrder2D = function(positions) {
|
|
571
|
+
const area = PolygonPipeline.computeArea2D(positions);
|
|
572
|
+
return area > 0 ? WindingOrder_default.COUNTER_CLOCKWISE : WindingOrder_default.CLOCKWISE;
|
|
573
|
+
};
|
|
574
|
+
PolygonPipeline.triangulate = function(positions, holes) {
|
|
575
|
+
Check_default.defined("positions", positions);
|
|
576
|
+
const flattenedPositions = Cartesian2_default.packArray(positions);
|
|
577
|
+
return (0, import_earcut.default)(flattenedPositions, holes, 2);
|
|
578
|
+
};
|
|
579
|
+
var subdivisionV0Scratch = new Cartesian3_default();
|
|
580
|
+
var subdivisionV1Scratch = new Cartesian3_default();
|
|
581
|
+
var subdivisionV2Scratch = new Cartesian3_default();
|
|
582
|
+
var subdivisionS0Scratch = new Cartesian3_default();
|
|
583
|
+
var subdivisionS1Scratch = new Cartesian3_default();
|
|
584
|
+
var subdivisionS2Scratch = new Cartesian3_default();
|
|
585
|
+
var subdivisionMidScratch = new Cartesian3_default();
|
|
586
|
+
var subdivisionT0Scratch = new Cartesian2_default();
|
|
587
|
+
var subdivisionT1Scratch = new Cartesian2_default();
|
|
588
|
+
var subdivisionT2Scratch = new Cartesian2_default();
|
|
589
|
+
var subdivisionTexcoordMidScratch = new Cartesian2_default();
|
|
590
|
+
PolygonPipeline.computeSubdivision = function(ellipsoid, positions, indices, texcoords, granularity) {
|
|
591
|
+
granularity = defaultValue_default(granularity, Math_default.RADIANS_PER_DEGREE);
|
|
592
|
+
const hasTexcoords = defined_default(texcoords);
|
|
593
|
+
Check_default.typeOf.object("ellipsoid", ellipsoid);
|
|
594
|
+
Check_default.defined("positions", positions);
|
|
595
|
+
Check_default.defined("indices", indices);
|
|
596
|
+
Check_default.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
|
|
597
|
+
Check_default.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
|
|
598
|
+
Check_default.typeOf.number.greaterThan("granularity", granularity, 0);
|
|
599
|
+
const triangles = indices.slice(0);
|
|
600
|
+
let i;
|
|
601
|
+
const length = positions.length;
|
|
602
|
+
const subdividedPositions = new Array(length * 3);
|
|
603
|
+
const subdividedTexcoords = new Array(length * 2);
|
|
604
|
+
let q = 0;
|
|
605
|
+
let p = 0;
|
|
606
|
+
for (i = 0; i < length; i++) {
|
|
607
|
+
const item = positions[i];
|
|
608
|
+
subdividedPositions[q++] = item.x;
|
|
609
|
+
subdividedPositions[q++] = item.y;
|
|
610
|
+
subdividedPositions[q++] = item.z;
|
|
611
|
+
if (hasTexcoords) {
|
|
612
|
+
const texcoordItem = texcoords[i];
|
|
613
|
+
subdividedTexcoords[p++] = texcoordItem.x;
|
|
614
|
+
subdividedTexcoords[p++] = texcoordItem.y;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
const subdividedIndices = [];
|
|
618
|
+
const edges = {};
|
|
619
|
+
const radius = ellipsoid.maximumRadius;
|
|
620
|
+
const minDistance = Math_default.chordLength(granularity, radius);
|
|
621
|
+
const minDistanceSqrd = minDistance * minDistance;
|
|
622
|
+
while (triangles.length > 0) {
|
|
623
|
+
const i2 = triangles.pop();
|
|
624
|
+
const i1 = triangles.pop();
|
|
625
|
+
const i0 = triangles.pop();
|
|
626
|
+
const v0 = Cartesian3_default.fromArray(
|
|
627
|
+
subdividedPositions,
|
|
628
|
+
i0 * 3,
|
|
629
|
+
subdivisionV0Scratch
|
|
630
|
+
);
|
|
631
|
+
const v1 = Cartesian3_default.fromArray(
|
|
632
|
+
subdividedPositions,
|
|
633
|
+
i1 * 3,
|
|
634
|
+
subdivisionV1Scratch
|
|
635
|
+
);
|
|
636
|
+
const v2 = Cartesian3_default.fromArray(
|
|
637
|
+
subdividedPositions,
|
|
638
|
+
i2 * 3,
|
|
639
|
+
subdivisionV2Scratch
|
|
640
|
+
);
|
|
641
|
+
let t0, t1, t2;
|
|
642
|
+
if (hasTexcoords) {
|
|
643
|
+
t0 = Cartesian2_default.fromArray(
|
|
644
|
+
subdividedTexcoords,
|
|
645
|
+
i0 * 2,
|
|
646
|
+
subdivisionT0Scratch
|
|
647
|
+
);
|
|
648
|
+
t1 = Cartesian2_default.fromArray(
|
|
649
|
+
subdividedTexcoords,
|
|
650
|
+
i1 * 2,
|
|
651
|
+
subdivisionT1Scratch
|
|
652
|
+
);
|
|
653
|
+
t2 = Cartesian2_default.fromArray(
|
|
654
|
+
subdividedTexcoords,
|
|
655
|
+
i2 * 2,
|
|
656
|
+
subdivisionT2Scratch
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
const s0 = Cartesian3_default.multiplyByScalar(
|
|
660
|
+
Cartesian3_default.normalize(v0, subdivisionS0Scratch),
|
|
661
|
+
radius,
|
|
662
|
+
subdivisionS0Scratch
|
|
663
|
+
);
|
|
664
|
+
const s1 = Cartesian3_default.multiplyByScalar(
|
|
665
|
+
Cartesian3_default.normalize(v1, subdivisionS1Scratch),
|
|
666
|
+
radius,
|
|
667
|
+
subdivisionS1Scratch
|
|
668
|
+
);
|
|
669
|
+
const s2 = Cartesian3_default.multiplyByScalar(
|
|
670
|
+
Cartesian3_default.normalize(v2, subdivisionS2Scratch),
|
|
671
|
+
radius,
|
|
672
|
+
subdivisionS2Scratch
|
|
673
|
+
);
|
|
674
|
+
const g0 = Cartesian3_default.magnitudeSquared(
|
|
675
|
+
Cartesian3_default.subtract(s0, s1, subdivisionMidScratch)
|
|
676
|
+
);
|
|
677
|
+
const g1 = Cartesian3_default.magnitudeSquared(
|
|
678
|
+
Cartesian3_default.subtract(s1, s2, subdivisionMidScratch)
|
|
679
|
+
);
|
|
680
|
+
const g2 = Cartesian3_default.magnitudeSquared(
|
|
681
|
+
Cartesian3_default.subtract(s2, s0, subdivisionMidScratch)
|
|
682
|
+
);
|
|
683
|
+
const max = Math.max(g0, g1, g2);
|
|
684
|
+
let edge;
|
|
685
|
+
let mid;
|
|
686
|
+
let midTexcoord;
|
|
687
|
+
if (max > minDistanceSqrd) {
|
|
688
|
+
if (g0 === max) {
|
|
689
|
+
edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
|
|
690
|
+
i = edges[edge];
|
|
691
|
+
if (!defined_default(i)) {
|
|
692
|
+
mid = Cartesian3_default.add(v0, v1, subdivisionMidScratch);
|
|
693
|
+
Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
|
|
694
|
+
subdividedPositions.push(mid.x, mid.y, mid.z);
|
|
695
|
+
i = subdividedPositions.length / 3 - 1;
|
|
696
|
+
edges[edge] = i;
|
|
697
|
+
if (hasTexcoords) {
|
|
698
|
+
midTexcoord = Cartesian2_default.add(t0, t1, subdivisionTexcoordMidScratch);
|
|
699
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
700
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
triangles.push(i0, i, i2);
|
|
704
|
+
triangles.push(i, i1, i2);
|
|
705
|
+
} else if (g1 === max) {
|
|
706
|
+
edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
|
|
707
|
+
i = edges[edge];
|
|
708
|
+
if (!defined_default(i)) {
|
|
709
|
+
mid = Cartesian3_default.add(v1, v2, subdivisionMidScratch);
|
|
710
|
+
Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
|
|
711
|
+
subdividedPositions.push(mid.x, mid.y, mid.z);
|
|
712
|
+
i = subdividedPositions.length / 3 - 1;
|
|
713
|
+
edges[edge] = i;
|
|
714
|
+
if (hasTexcoords) {
|
|
715
|
+
midTexcoord = Cartesian2_default.add(t1, t2, subdivisionTexcoordMidScratch);
|
|
716
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
717
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
triangles.push(i1, i, i0);
|
|
721
|
+
triangles.push(i, i2, i0);
|
|
722
|
+
} else if (g2 === max) {
|
|
723
|
+
edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
|
|
724
|
+
i = edges[edge];
|
|
725
|
+
if (!defined_default(i)) {
|
|
726
|
+
mid = Cartesian3_default.add(v2, v0, subdivisionMidScratch);
|
|
727
|
+
Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
|
|
728
|
+
subdividedPositions.push(mid.x, mid.y, mid.z);
|
|
729
|
+
i = subdividedPositions.length / 3 - 1;
|
|
730
|
+
edges[edge] = i;
|
|
731
|
+
if (hasTexcoords) {
|
|
732
|
+
midTexcoord = Cartesian2_default.add(t2, t0, subdivisionTexcoordMidScratch);
|
|
733
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
734
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
triangles.push(i2, i, i1);
|
|
738
|
+
triangles.push(i, i0, i1);
|
|
739
|
+
}
|
|
740
|
+
} else {
|
|
741
|
+
subdividedIndices.push(i0);
|
|
742
|
+
subdividedIndices.push(i1);
|
|
743
|
+
subdividedIndices.push(i2);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
const geometryOptions = {
|
|
747
|
+
attributes: {
|
|
748
|
+
position: new GeometryAttribute_default({
|
|
749
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
750
|
+
componentsPerAttribute: 3,
|
|
751
|
+
values: subdividedPositions
|
|
752
|
+
})
|
|
753
|
+
},
|
|
754
|
+
indices: subdividedIndices,
|
|
755
|
+
primitiveType: PrimitiveType_default.TRIANGLES
|
|
756
|
+
};
|
|
757
|
+
if (hasTexcoords) {
|
|
758
|
+
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
759
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
760
|
+
componentsPerAttribute: 2,
|
|
761
|
+
values: subdividedTexcoords
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
return new Geometry_default(geometryOptions);
|
|
765
|
+
};
|
|
766
|
+
var subdivisionC0Scratch = new Cartographic_default();
|
|
767
|
+
var subdivisionC1Scratch = new Cartographic_default();
|
|
768
|
+
var subdivisionC2Scratch = new Cartographic_default();
|
|
769
|
+
var subdivisionCartographicScratch = new Cartographic_default();
|
|
770
|
+
PolygonPipeline.computeRhumbLineSubdivision = function(ellipsoid, positions, indices, texcoords, granularity) {
|
|
771
|
+
granularity = defaultValue_default(granularity, Math_default.RADIANS_PER_DEGREE);
|
|
772
|
+
const hasTexcoords = defined_default(texcoords);
|
|
773
|
+
Check_default.typeOf.object("ellipsoid", ellipsoid);
|
|
774
|
+
Check_default.defined("positions", positions);
|
|
775
|
+
Check_default.defined("indices", indices);
|
|
776
|
+
Check_default.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
|
|
777
|
+
Check_default.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
|
|
778
|
+
Check_default.typeOf.number.greaterThan("granularity", granularity, 0);
|
|
779
|
+
const triangles = indices.slice(0);
|
|
780
|
+
let i;
|
|
781
|
+
const length = positions.length;
|
|
782
|
+
const subdividedPositions = new Array(length * 3);
|
|
783
|
+
const subdividedTexcoords = new Array(length * 2);
|
|
784
|
+
let q = 0;
|
|
785
|
+
let p = 0;
|
|
786
|
+
for (i = 0; i < length; i++) {
|
|
787
|
+
const item = positions[i];
|
|
788
|
+
subdividedPositions[q++] = item.x;
|
|
789
|
+
subdividedPositions[q++] = item.y;
|
|
790
|
+
subdividedPositions[q++] = item.z;
|
|
791
|
+
if (hasTexcoords) {
|
|
792
|
+
const texcoordItem = texcoords[i];
|
|
793
|
+
subdividedTexcoords[p++] = texcoordItem.x;
|
|
794
|
+
subdividedTexcoords[p++] = texcoordItem.y;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
const subdividedIndices = [];
|
|
798
|
+
const edges = {};
|
|
799
|
+
const radius = ellipsoid.maximumRadius;
|
|
800
|
+
const minDistance = Math_default.chordLength(granularity, radius);
|
|
801
|
+
const rhumb0 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
|
|
802
|
+
const rhumb1 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
|
|
803
|
+
const rhumb2 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
|
|
804
|
+
while (triangles.length > 0) {
|
|
805
|
+
const i2 = triangles.pop();
|
|
806
|
+
const i1 = triangles.pop();
|
|
807
|
+
const i0 = triangles.pop();
|
|
808
|
+
const v0 = Cartesian3_default.fromArray(
|
|
809
|
+
subdividedPositions,
|
|
810
|
+
i0 * 3,
|
|
811
|
+
subdivisionV0Scratch
|
|
812
|
+
);
|
|
813
|
+
const v1 = Cartesian3_default.fromArray(
|
|
814
|
+
subdividedPositions,
|
|
815
|
+
i1 * 3,
|
|
816
|
+
subdivisionV1Scratch
|
|
817
|
+
);
|
|
818
|
+
const v2 = Cartesian3_default.fromArray(
|
|
819
|
+
subdividedPositions,
|
|
820
|
+
i2 * 3,
|
|
821
|
+
subdivisionV2Scratch
|
|
822
|
+
);
|
|
823
|
+
let t0, t1, t2;
|
|
824
|
+
if (hasTexcoords) {
|
|
825
|
+
t0 = Cartesian2_default.fromArray(
|
|
826
|
+
subdividedTexcoords,
|
|
827
|
+
i0 * 2,
|
|
828
|
+
subdivisionT0Scratch
|
|
829
|
+
);
|
|
830
|
+
t1 = Cartesian2_default.fromArray(
|
|
831
|
+
subdividedTexcoords,
|
|
832
|
+
i1 * 2,
|
|
833
|
+
subdivisionT1Scratch
|
|
834
|
+
);
|
|
835
|
+
t2 = Cartesian2_default.fromArray(
|
|
836
|
+
subdividedTexcoords,
|
|
837
|
+
i2 * 2,
|
|
838
|
+
subdivisionT2Scratch
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);
|
|
842
|
+
const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);
|
|
843
|
+
const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);
|
|
844
|
+
rhumb0.setEndPoints(c0, c1);
|
|
845
|
+
const g0 = rhumb0.surfaceDistance;
|
|
846
|
+
rhumb1.setEndPoints(c1, c2);
|
|
847
|
+
const g1 = rhumb1.surfaceDistance;
|
|
848
|
+
rhumb2.setEndPoints(c2, c0);
|
|
849
|
+
const g2 = rhumb2.surfaceDistance;
|
|
850
|
+
const max = Math.max(g0, g1, g2);
|
|
851
|
+
let edge;
|
|
852
|
+
let mid;
|
|
853
|
+
let midHeight;
|
|
854
|
+
let midCartesian3;
|
|
855
|
+
let midTexcoord;
|
|
856
|
+
if (max > minDistance) {
|
|
857
|
+
if (g0 === max) {
|
|
858
|
+
edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
|
|
859
|
+
i = edges[edge];
|
|
860
|
+
if (!defined_default(i)) {
|
|
861
|
+
mid = rhumb0.interpolateUsingFraction(
|
|
862
|
+
0.5,
|
|
863
|
+
subdivisionCartographicScratch
|
|
864
|
+
);
|
|
865
|
+
midHeight = (c0.height + c1.height) * 0.5;
|
|
866
|
+
midCartesian3 = Cartesian3_default.fromRadians(
|
|
867
|
+
mid.longitude,
|
|
868
|
+
mid.latitude,
|
|
869
|
+
midHeight,
|
|
870
|
+
ellipsoid,
|
|
871
|
+
subdivisionMidScratch
|
|
872
|
+
);
|
|
873
|
+
subdividedPositions.push(
|
|
874
|
+
midCartesian3.x,
|
|
875
|
+
midCartesian3.y,
|
|
876
|
+
midCartesian3.z
|
|
877
|
+
);
|
|
878
|
+
i = subdividedPositions.length / 3 - 1;
|
|
879
|
+
edges[edge] = i;
|
|
880
|
+
if (hasTexcoords) {
|
|
881
|
+
midTexcoord = Cartesian2_default.add(t0, t1, subdivisionTexcoordMidScratch);
|
|
882
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
883
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
triangles.push(i0, i, i2);
|
|
887
|
+
triangles.push(i, i1, i2);
|
|
888
|
+
} else if (g1 === max) {
|
|
889
|
+
edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
|
|
890
|
+
i = edges[edge];
|
|
891
|
+
if (!defined_default(i)) {
|
|
892
|
+
mid = rhumb1.interpolateUsingFraction(
|
|
893
|
+
0.5,
|
|
894
|
+
subdivisionCartographicScratch
|
|
895
|
+
);
|
|
896
|
+
midHeight = (c1.height + c2.height) * 0.5;
|
|
897
|
+
midCartesian3 = Cartesian3_default.fromRadians(
|
|
898
|
+
mid.longitude,
|
|
899
|
+
mid.latitude,
|
|
900
|
+
midHeight,
|
|
901
|
+
ellipsoid,
|
|
902
|
+
subdivisionMidScratch
|
|
903
|
+
);
|
|
904
|
+
subdividedPositions.push(
|
|
905
|
+
midCartesian3.x,
|
|
906
|
+
midCartesian3.y,
|
|
907
|
+
midCartesian3.z
|
|
908
|
+
);
|
|
909
|
+
i = subdividedPositions.length / 3 - 1;
|
|
910
|
+
edges[edge] = i;
|
|
911
|
+
if (hasTexcoords) {
|
|
912
|
+
midTexcoord = Cartesian2_default.add(t1, t2, subdivisionTexcoordMidScratch);
|
|
913
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
914
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
triangles.push(i1, i, i0);
|
|
918
|
+
triangles.push(i, i2, i0);
|
|
919
|
+
} else if (g2 === max) {
|
|
920
|
+
edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
|
|
921
|
+
i = edges[edge];
|
|
922
|
+
if (!defined_default(i)) {
|
|
923
|
+
mid = rhumb2.interpolateUsingFraction(
|
|
924
|
+
0.5,
|
|
925
|
+
subdivisionCartographicScratch
|
|
926
|
+
);
|
|
927
|
+
midHeight = (c2.height + c0.height) * 0.5;
|
|
928
|
+
midCartesian3 = Cartesian3_default.fromRadians(
|
|
929
|
+
mid.longitude,
|
|
930
|
+
mid.latitude,
|
|
931
|
+
midHeight,
|
|
932
|
+
ellipsoid,
|
|
933
|
+
subdivisionMidScratch
|
|
934
|
+
);
|
|
935
|
+
subdividedPositions.push(
|
|
936
|
+
midCartesian3.x,
|
|
937
|
+
midCartesian3.y,
|
|
938
|
+
midCartesian3.z
|
|
939
|
+
);
|
|
940
|
+
i = subdividedPositions.length / 3 - 1;
|
|
941
|
+
edges[edge] = i;
|
|
942
|
+
if (hasTexcoords) {
|
|
943
|
+
midTexcoord = Cartesian2_default.add(t2, t0, subdivisionTexcoordMidScratch);
|
|
944
|
+
Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
|
|
945
|
+
subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
triangles.push(i2, i, i1);
|
|
949
|
+
triangles.push(i, i0, i1);
|
|
950
|
+
}
|
|
951
|
+
} else {
|
|
952
|
+
subdividedIndices.push(i0);
|
|
953
|
+
subdividedIndices.push(i1);
|
|
954
|
+
subdividedIndices.push(i2);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
const geometryOptions = {
|
|
958
|
+
attributes: {
|
|
959
|
+
position: new GeometryAttribute_default({
|
|
960
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
961
|
+
componentsPerAttribute: 3,
|
|
962
|
+
values: subdividedPositions
|
|
963
|
+
})
|
|
964
|
+
},
|
|
965
|
+
indices: subdividedIndices,
|
|
966
|
+
primitiveType: PrimitiveType_default.TRIANGLES
|
|
967
|
+
};
|
|
968
|
+
if (hasTexcoords) {
|
|
969
|
+
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
970
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
971
|
+
componentsPerAttribute: 2,
|
|
972
|
+
values: subdividedTexcoords
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
return new Geometry_default(geometryOptions);
|
|
976
|
+
};
|
|
977
|
+
PolygonPipeline.scaleToGeodeticHeight = function(positions, height, ellipsoid, scaleToSurface) {
|
|
978
|
+
ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
|
|
979
|
+
let n = scaleToGeodeticHeightN;
|
|
980
|
+
let p = scaleToGeodeticHeightP;
|
|
981
|
+
height = defaultValue_default(height, 0);
|
|
982
|
+
scaleToSurface = defaultValue_default(scaleToSurface, true);
|
|
983
|
+
if (defined_default(positions)) {
|
|
984
|
+
const length = positions.length;
|
|
985
|
+
for (let i = 0; i < length; i += 3) {
|
|
986
|
+
Cartesian3_default.fromArray(positions, i, p);
|
|
987
|
+
if (scaleToSurface) {
|
|
988
|
+
p = ellipsoid.scaleToGeodeticSurface(p, p);
|
|
989
|
+
}
|
|
990
|
+
if (height !== 0) {
|
|
991
|
+
n = ellipsoid.geodeticSurfaceNormal(p, n);
|
|
992
|
+
Cartesian3_default.multiplyByScalar(n, height, n);
|
|
993
|
+
Cartesian3_default.add(p, n, p);
|
|
994
|
+
}
|
|
995
|
+
positions[i] = p.x;
|
|
996
|
+
positions[i + 1] = p.y;
|
|
997
|
+
positions[i + 2] = p.z;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return positions;
|
|
1001
|
+
};
|
|
1002
|
+
var PolygonPipeline_default = PolygonPipeline;
|
|
1003
|
+
|
|
1004
|
+
export {
|
|
1005
|
+
WindingOrder_default,
|
|
1006
|
+
PolygonPipeline_default
|
|
1007
|
+
};
|