@math.gl/geospatial 5.0.0-beta.8 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/crs/crs-descriptor-types.d.ts +2 -1
- package/dist/crs/crs-descriptor-types.d.ts.map +1 -1
- package/dist/crs/index.cjs +54 -0
- package/dist/crs/index.cjs.map +2 -2
- package/dist/crs/index.d.ts +1 -0
- package/dist/crs/index.d.ts.map +1 -1
- package/dist/crs/index.js +1 -0
- package/dist/crs/index.js.map +1 -1
- package/dist/crs/spatial-reference-metadata.d.ts +20 -0
- package/dist/crs/spatial-reference-metadata.d.ts.map +1 -0
- package/dist/crs/spatial-reference-metadata.js +86 -0
- package/dist/crs/spatial-reference-metadata.js.map +1 -0
- package/dist/ellipsoid-helpers/ellipsoid-transform.d.ts +1 -1
- package/dist/ellipsoid-helpers/ellipsoid-transform.d.ts.map +1 -1
- package/dist/ellipsoid-helpers/ellipsoid-transform.js +2 -2
- package/dist/ellipsoid-helpers/ellipsoid-transform.js.map +1 -1
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js +1 -1
- package/dist/ellipsoid-helpers/scale-to-geodetic-surface.js.map +1 -1
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts +1 -1
- package/dist/ellipsoid-helpers/tangent-plane-numerics.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.d.ts +2 -2
- package/dist/ellipsoid-tangent-plane.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.js +1 -1
- package/dist/ellipsoid-tangent-plane.js.map +1 -1
- package/dist/ellipsoid-transforms.d.ts +2 -2
- package/dist/ellipsoid-transforms.d.ts.map +1 -1
- package/dist/ellipsoid-transforms.js +1 -1
- package/dist/ellipsoid-transforms.js.map +1 -1
- package/dist/ellipsoid.d.ts +2 -2
- package/dist/ellipsoid.d.ts.map +1 -1
- package/dist/ellipsoid.js +2 -2
- package/dist/ellipsoid.js.map +1 -1
- package/dist/expressions.d.ts +1 -1
- package/dist/expressions.d.ts.map +1 -1
- package/dist/expressions.js +1 -1
- package/dist/expressions.js.map +1 -1
- package/dist/geodesic-buffer.d.ts +1 -1
- package/dist/geodesic-buffer.d.ts.map +1 -1
- package/dist/geodesic-path.d.ts +1 -1
- package/dist/geodesic-path.d.ts.map +1 -1
- package/dist/geometry-constructors.d.ts +6 -0
- package/dist/geometry-constructors.d.ts.map +1 -0
- package/dist/geometry-constructors.js +37 -0
- package/dist/geometry-constructors.js.map +1 -0
- package/dist/geometry-inspection.d.ts +8 -0
- package/dist/geometry-inspection.d.ts.map +1 -0
- package/dist/geometry-inspection.js +61 -0
- package/dist/geometry-inspection.js.map +1 -0
- package/dist/index.cjs +3773 -846
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +173 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -1
- package/dist/line-simplification.d.ts +4 -0
- package/dist/line-simplification.d.ts.map +1 -0
- package/dist/line-simplification.js +83 -0
- package/dist/line-simplification.js.map +1 -0
- package/dist/linear-referencing.d.ts +6 -0
- package/dist/linear-referencing.d.ts.map +1 -0
- package/dist/linear-referencing.js +74 -0
- package/dist/linear-referencing.js.map +1 -0
- package/dist/lng-lat-rectangle.d.ts +1 -1
- package/dist/lng-lat-rectangle.d.ts.map +1 -1
- package/dist/lng-lat-rectangle.js +1 -1
- package/dist/lng-lat-rectangle.js.map +1 -1
- package/dist/local-reference-frame.d.ts +3 -3
- package/dist/local-reference-frame.d.ts.map +1 -1
- package/dist/local-reference-frame.js +2 -2
- package/dist/local-reference-frame.js.map +1 -1
- package/dist/make-obb-from-region.d.ts +1 -1
- package/dist/make-obb-from-region.d.ts.map +1 -1
- package/dist/make-obb-from-region.js +1 -1
- package/dist/make-obb-from-region.js.map +1 -1
- package/dist/maps/air-ocean-mesh.js +1 -1
- package/dist/maps/air-ocean-mesh.js.map +1 -1
- package/dist/maps/myriahedral/unfold.d.ts +1 -1
- package/dist/maps/myriahedral/unfold.d.ts.map +1 -1
- package/dist/maps/myriahedral/unfold.js +1 -1
- package/dist/maps/myriahedral/unfold.js.map +1 -1
- package/dist/maps/presets.cjs +6 -6
- package/dist/maps/presets.cjs.map +2 -2
- package/dist/maps.cjs +6 -6
- package/dist/maps.cjs.map +2 -2
- package/dist/projection/deformation.cjs +5 -5
- package/dist/projection/deformation.cjs.map +2 -2
- package/dist/projection/experimental/core.cjs +8 -4
- package/dist/projection/experimental/core.cjs.map +1 -1
- package/dist/projection/experimental/crs/spatial-reference.d.ts.map +1 -1
- package/dist/projection/experimental/crs/spatial-reference.js.map +1 -1
- package/dist/projection/experimental/crs/types.d.ts +1 -1
- package/dist/projection/experimental/crs/types.d.ts.map +1 -1
- package/dist/projection/experimental/crs-rendering-scale.d.ts.map +1 -1
- package/dist/projection/experimental/crs-rendering-scale.js +13 -2
- package/dist/projection/experimental/crs-rendering-scale.js.map +1 -1
- package/dist/projection/experimental/datum.js +1 -1
- package/dist/projection/experimental/datum.js.map +1 -1
- package/dist/projection/experimental/entries/projections/geocent.cjs +3 -3
- package/dist/projection/experimental/entries/projections/geocent.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/aea.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/aea.js +4 -1
- package/dist/projection/experimental/lazy-projections/aea.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/bonne.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/bonne.js +4 -1
- package/dist/projection/experimental/lazy-projections/bonne.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/cass.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/cass.js +4 -1
- package/dist/projection/experimental/lazy-projections/cass.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eck6.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eck6.js +4 -1
- package/dist/projection/experimental/lazy-projections/eck6.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eqdc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqdc.js +4 -1
- package/dist/projection/experimental/lazy-projections/eqdc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/eqearth.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/eqearth.js +4 -1
- package/dist/projection/experimental/lazy-projections/eqearth.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/equi.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/equi.js +4 -1
- package/dist/projection/experimental/lazy-projections/equi.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/geocent.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/geocent.js +4 -1
- package/dist/projection/experimental/lazy-projections/geocent.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/geos.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/geos.js +4 -1
- package/dist/projection/experimental/lazy-projections/geos.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/gnom.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/gnom.js +4 -1
- package/dist/projection/experimental/lazy-projections/gnom.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/index.cjs +100 -27
- package/dist/projection/experimental/lazy-projections/index.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/krovak.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/krovak.js +4 -1
- package/dist/projection/experimental/lazy-projections/krovak.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/merc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/merc.js +4 -1
- package/dist/projection/experimental/lazy-projections/merc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/mill.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/mill.js +4 -1
- package/dist/projection/experimental/lazy-projections/mill.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/moll.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/moll.js +4 -1
- package/dist/projection/experimental/lazy-projections/moll.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/nzmg.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/nzmg.js +4 -1
- package/dist/projection/experimental/lazy-projections/nzmg.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/omerc.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/omerc.js +4 -1
- package/dist/projection/experimental/lazy-projections/omerc.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/ortho.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/ortho.js +4 -1
- package/dist/projection/experimental/lazy-projections/ortho.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/poly.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/poly.js +4 -1
- package/dist/projection/experimental/lazy-projections/poly.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/robin.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/robin.js +4 -1
- package/dist/projection/experimental/lazy-projections/robin.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/sinu.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/sinu.js +4 -1
- package/dist/projection/experimental/lazy-projections/sinu.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/stere.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/stere.js +4 -1
- package/dist/projection/experimental/lazy-projections/stere.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/tpers.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/tpers.js +4 -1
- package/dist/projection/experimental/lazy-projections/tpers.js.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.cjs +4 -1
- package/dist/projection/experimental/lazy-projections/vandg.cjs.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.d.ts.map +1 -1
- package/dist/projection/experimental/lazy-projections/vandg.js +4 -1
- package/dist/projection/experimental/lazy-projections/vandg.js.map +1 -1
- package/dist/projection/experimental/spatial-deformation.js +1 -1
- package/dist/projection/experimental/spatial-deformation.js.map +1 -1
- package/dist/projection/index.cjs +8 -4
- package/dist/projection/index.cjs.map +1 -1
- package/dist/projection/index.d.ts.map +1 -1
- package/dist/projection/index.js.map +1 -1
- package/dist/projection/lib/projection.js.map +1 -1
- package/dist/projection/pipeline.cjs +3 -3
- package/dist/projection/pipeline.cjs.map +1 -1
- package/dist/projection/temporal.cjs +5 -5
- package/dist/projection/temporal.cjs.map +2 -2
- package/dist/projection/transform-analysis.cjs +3 -3
- package/dist/projection/transform-analysis.cjs.map +1 -1
- package/dist/rhumb-path.d.ts +1 -1
- package/dist/rhumb-path.d.ts.map +1 -1
- package/dist/spatial-planar-intersects.d.ts +4 -0
- package/dist/spatial-planar-intersects.d.ts.map +1 -0
- package/dist/spatial-planar-intersects.js +108 -0
- package/dist/spatial-planar-intersects.js.map +1 -0
- package/dist/spatial-planar.d.ts +16 -0
- package/dist/spatial-planar.d.ts.map +1 -0
- package/dist/spatial-planar.js +240 -0
- package/dist/spatial-planar.js.map +1 -0
- package/dist/spatial-sql.d.ts +45 -0
- package/dist/spatial-sql.d.ts.map +1 -0
- package/dist/spatial-sql.js +192 -0
- package/dist/spatial-sql.js.map +1 -0
- package/dist/st-functions.cjs +1616 -0
- package/dist/st-functions.cjs.map +6 -0
- package/dist/st-functions.d.ts +307 -0
- package/dist/st-functions.d.ts.map +1 -0
- package/dist/st-functions.js +593 -0
- package/dist/st-functions.js.map +1 -0
- package/dist/subdivide-globe-mesh.js +1 -1
- package/dist/subdivide-globe-mesh.js.map +1 -1
- package/dist/tasks/index.cjs +1266 -155
- package/dist/tasks/index.cjs.map +3 -3
- package/dist/tasks/index.d.ts +12 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +26 -0
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/terrain-coverage-worker.d.ts +2 -0
- package/dist/tasks/terrain-coverage-worker.d.ts.map +1 -0
- package/dist/tasks/terrain-coverage-worker.js +7 -0
- package/dist/tasks/terrain-coverage-worker.js.map +1 -0
- package/dist/tasks/terrain-coverage.d.ts +25 -0
- package/dist/tasks/terrain-coverage.d.ts.map +1 -0
- package/dist/tasks/terrain-coverage.js +15 -0
- package/dist/tasks/terrain-coverage.js.map +1 -0
- package/dist/tasks/terrain-residency-worker.d.ts +2 -0
- package/dist/tasks/terrain-residency-worker.d.ts.map +1 -0
- package/dist/tasks/terrain-residency-worker.js +7 -0
- package/dist/tasks/terrain-residency-worker.js.map +1 -0
- package/dist/tasks/terrain-residency.d.ts +73 -0
- package/dist/tasks/terrain-residency.d.ts.map +1 -0
- package/dist/tasks/terrain-residency.js +203 -0
- package/dist/tasks/terrain-residency.js.map +1 -0
- package/dist/terrain/breakline-mesh.d.ts +18 -0
- package/dist/terrain/breakline-mesh.d.ts.map +1 -0
- package/dist/terrain/breakline-mesh.js +126 -0
- package/dist/terrain/breakline-mesh.js.map +1 -0
- package/dist/terrain/breakline-preprocess.d.ts +11 -0
- package/dist/terrain/breakline-preprocess.d.ts.map +1 -0
- package/dist/terrain/breakline-preprocess.js +94 -0
- package/dist/terrain/breakline-preprocess.js.map +1 -0
- package/dist/terrain/continuous-mesh-error.d.ts +34 -0
- package/dist/terrain/continuous-mesh-error.d.ts.map +1 -0
- package/dist/terrain/continuous-mesh-error.js +221 -0
- package/dist/terrain/continuous-mesh-error.js.map +1 -0
- package/dist/terrain/cutout-polygons.d.ts +21 -0
- package/dist/terrain/cutout-polygons.d.ts.map +1 -0
- package/dist/terrain/cutout-polygons.js +172 -0
- package/dist/terrain/cutout-polygons.js.map +1 -0
- package/dist/terrain/cutout-region.d.ts +34 -0
- package/dist/terrain/cutout-region.d.ts.map +1 -0
- package/dist/terrain/cutout-region.js +33 -0
- package/dist/terrain/cutout-region.js.map +1 -0
- package/dist/terrain/cutout-skirts.d.ts +34 -0
- package/dist/terrain/cutout-skirts.d.ts.map +1 -0
- package/dist/terrain/cutout-skirts.js +29 -0
- package/dist/terrain/cutout-skirts.js.map +1 -0
- package/dist/terrain/depression-fill.d.ts +25 -0
- package/dist/terrain/depression-fill.d.ts.map +1 -0
- package/dist/terrain/depression-fill.js +106 -0
- package/dist/terrain/depression-fill.js.map +1 -0
- package/dist/terrain/geographic-cutout.d.ts +38 -0
- package/dist/terrain/geographic-cutout.d.ts.map +1 -0
- package/dist/terrain/geographic-cutout.js +120 -0
- package/dist/terrain/geographic-cutout.js.map +1 -0
- package/dist/terrain/geographic-lod-seams.d.ts +10 -0
- package/dist/terrain/geographic-lod-seams.d.ts.map +1 -0
- package/dist/terrain/geographic-lod-seams.js +100 -0
- package/dist/terrain/geographic-lod-seams.js.map +1 -0
- package/dist/terrain/geographic-neighbor.d.ts +18 -0
- package/dist/terrain/geographic-neighbor.d.ts.map +1 -0
- package/dist/terrain/geographic-neighbor.js +44 -0
- package/dist/terrain/geographic-neighbor.js.map +1 -0
- package/dist/terrain/geographic-poles.d.ts +24 -0
- package/dist/terrain/geographic-poles.d.ts.map +1 -0
- package/dist/terrain/geographic-poles.js +34 -0
- package/dist/terrain/geographic-poles.js.map +1 -0
- package/dist/terrain/geographic-seam.d.ts +21 -0
- package/dist/terrain/geographic-seam.d.ts.map +1 -0
- package/dist/terrain/geographic-seam.js +52 -0
- package/dist/terrain/geographic-seam.js.map +1 -0
- package/dist/terrain/hydrology.d.ts +42 -0
- package/dist/terrain/hydrology.d.ts.map +1 -0
- package/dist/terrain/hydrology.js +112 -0
- package/dist/terrain/hydrology.js.map +1 -0
- package/dist/terrain/index.cjs +3158 -213
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +32 -0
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +30 -0
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/lod-screen-error.d.ts +28 -0
- package/dist/terrain/lod-screen-error.d.ts.map +1 -0
- package/dist/terrain/lod-screen-error.js +95 -0
- package/dist/terrain/lod-screen-error.js.map +1 -0
- package/dist/terrain/lod-select.d.ts +48 -0
- package/dist/terrain/lod-select.d.ts.map +1 -0
- package/dist/terrain/lod-select.js +73 -0
- package/dist/terrain/lod-select.js.map +1 -0
- package/dist/terrain/lod-stitch.d.ts +15 -0
- package/dist/terrain/lod-stitch.d.ts.map +1 -0
- package/dist/terrain/lod-stitch.js +64 -0
- package/dist/terrain/lod-stitch.js.map +1 -0
- package/dist/terrain/mesh-coverage.d.ts +35 -0
- package/dist/terrain/mesh-coverage.d.ts.map +1 -0
- package/dist/terrain/mesh-coverage.js +186 -0
- package/dist/terrain/mesh-coverage.js.map +1 -0
- package/dist/terrain/mesh-cutout.d.ts +45 -0
- package/dist/terrain/mesh-cutout.d.ts.map +1 -0
- package/dist/terrain/mesh-cutout.js +336 -0
- package/dist/terrain/mesh-cutout.js.map +1 -0
- package/dist/terrain/mesh-regions-data.d.ts +2 -2
- package/dist/terrain/mesh-regions-data.d.ts.map +1 -1
- package/dist/terrain/mesh-regions-data.js +20 -10
- package/dist/terrain/mesh-regions-data.js.map +1 -1
- package/dist/terrain/mesh-skirts.d.ts +8 -2
- package/dist/terrain/mesh-skirts.d.ts.map +1 -1
- package/dist/terrain/mesh-skirts.js +5 -4
- package/dist/terrain/mesh-skirts.js.map +1 -1
- package/dist/terrain/mixed-halo-update.d.ts.map +1 -1
- package/dist/terrain/mixed-halo-update.js +138 -26
- package/dist/terrain/mixed-halo-update.js.map +1 -1
- package/dist/terrain/mixed-vertex-halos.d.ts +34 -1
- package/dist/terrain/mixed-vertex-halos.d.ts.map +1 -1
- package/dist/terrain/mixed-vertex-halos.js +98 -43
- package/dist/terrain/mixed-vertex-halos.js.map +1 -1
- package/dist/terrain/regional-viewshed.d.ts +55 -0
- package/dist/terrain/regional-viewshed.d.ts.map +1 -0
- package/dist/terrain/regional-viewshed.js +119 -0
- package/dist/terrain/regional-viewshed.js.map +1 -0
- package/dist/terrain/surface.d.ts +1 -1
- package/dist/terrain/surface.d.ts.map +1 -1
- package/dist/terrain/surface.js +1 -1
- package/dist/terrain/surface.js.map +1 -1
- package/dist/terrain/sweep-capsule.d.ts +27 -0
- package/dist/terrain/sweep-capsule.d.ts.map +1 -0
- package/dist/terrain/sweep-capsule.js +104 -0
- package/dist/terrain/sweep-capsule.js.map +1 -0
- package/dist/terrain/sweep-cylinder.d.ts +16 -0
- package/dist/terrain/sweep-cylinder.d.ts.map +1 -0
- package/dist/terrain/sweep-cylinder.js +52 -0
- package/dist/terrain/sweep-cylinder.js.map +1 -0
- package/dist/terrain/sweep-plane.d.ts +9 -0
- package/dist/terrain/sweep-plane.d.ts.map +1 -0
- package/dist/terrain/sweep-plane.js +52 -0
- package/dist/terrain/sweep-plane.js.map +1 -0
- package/dist/terrain/sweep-polytope.d.ts +42 -0
- package/dist/terrain/sweep-polytope.d.ts.map +1 -0
- package/dist/terrain/sweep-polytope.js +189 -0
- package/dist/terrain/sweep-polytope.js.map +1 -0
- package/dist/terrain/sweep-rotating-capsule.d.ts +17 -0
- package/dist/terrain/sweep-rotating-capsule.d.ts.map +1 -0
- package/dist/terrain/sweep-rotating-capsule.js +118 -0
- package/dist/terrain/sweep-rotating-capsule.js.map +1 -0
- package/dist/terrain/sweep-rotation.d.ts +35 -0
- package/dist/terrain/sweep-rotation.d.ts.map +1 -0
- package/dist/terrain/sweep-rotation.js +114 -0
- package/dist/terrain/sweep-rotation.js.map +1 -0
- package/dist/terrain/sweep-sphere.d.ts +27 -0
- package/dist/terrain/sweep-sphere.d.ts.map +1 -0
- package/dist/terrain/sweep-sphere.js +69 -0
- package/dist/terrain/sweep-sphere.js.map +1 -0
- package/dist/terrain/tile-cutout-update.d.ts +73 -0
- package/dist/terrain/tile-cutout-update.d.ts.map +1 -0
- package/dist/terrain/tile-cutout-update.js +181 -0
- package/dist/terrain/tile-cutout-update.js.map +1 -0
- package/dist/terrain/tile-cutout.d.ts +33 -0
- package/dist/terrain/tile-cutout.d.ts.map +1 -0
- package/dist/terrain/tile-cutout.js +93 -0
- package/dist/terrain/tile-cutout.js.map +1 -0
- package/dist/terrain/valid-domain-mesh.d.ts +29 -0
- package/dist/terrain/valid-domain-mesh.d.ts.map +1 -0
- package/dist/terrain/valid-domain-mesh.js +183 -0
- package/dist/terrain/valid-domain-mesh.js.map +1 -0
- package/dist/terrain/valid-domain-regions.d.ts +16 -0
- package/dist/terrain/valid-domain-regions.d.ts.map +1 -0
- package/dist/terrain/valid-domain-regions.js +19 -0
- package/dist/terrain/valid-domain-regions.js.map +1 -0
- package/dist/terrain/watershed-accumulation.d.ts +20 -0
- package/dist/terrain/watershed-accumulation.d.ts.map +1 -0
- package/dist/terrain/watershed-accumulation.js +53 -0
- package/dist/terrain/watershed-accumulation.js.map +1 -0
- package/dist/triaxial.d.ts +1 -1
- package/dist/triaxial.d.ts.map +1 -1
- package/dist/turf-expressions.cjs +1997 -0
- package/dist/turf-expressions.cjs.map +6 -0
- package/dist/turf-expressions.d.ts +3 -0
- package/dist/turf-expressions.d.ts.map +1 -0
- package/dist/turf-expressions.js +7 -0
- package/dist/turf-expressions.js.map +1 -0
- package/dist/turf-functions.cjs +743 -0
- package/dist/turf-functions.cjs.map +6 -0
- package/dist/turf-functions.d.ts +90 -0
- package/dist/turf-functions.d.ts.map +1 -0
- package/dist/{turf/expressions.js → turf-functions.js} +51 -5
- package/dist/turf-functions.js.map +1 -0
- package/dist/turf.cjs +25 -25
- package/dist/turf.cjs.map +2 -2
- package/dist/turf.d.ts +1 -1
- package/dist/turf.d.ts.map +1 -1
- package/dist/turf.js +2 -2
- package/dist/turf.js.map +1 -1
- package/dist/type-utils.d.ts +1 -1
- package/dist/type-utils.d.ts.map +1 -1
- package/dist/type-utils.js +1 -1
- package/dist/type-utils.js.map +1 -1
- package/dist/web-mercator/assert.d.ts +2 -0
- package/dist/web-mercator/assert.d.ts.map +1 -0
- package/dist/web-mercator/assert.js +12 -0
- package/dist/web-mercator/assert.js.map +1 -0
- package/dist/web-mercator/fit-bounds.d.ts +52 -0
- package/dist/web-mercator/fit-bounds.d.ts.map +1 -0
- package/dist/web-mercator/fit-bounds.js +70 -0
- package/dist/web-mercator/fit-bounds.js.map +1 -0
- package/dist/web-mercator/fly-to-viewport.d.ts +19 -0
- package/dist/web-mercator/fly-to-viewport.d.ts.map +1 -0
- package/dist/web-mercator/fly-to-viewport.js +94 -0
- package/dist/web-mercator/fly-to-viewport.js.map +1 -0
- package/dist/web-mercator/get-bounds.d.ts +3 -0
- package/dist/web-mercator/get-bounds.d.ts.map +1 -0
- package/dist/web-mercator/get-bounds.js +56 -0
- package/dist/web-mercator/get-bounds.js.map +1 -0
- package/dist/web-mercator/index.cjs +705 -0
- package/dist/web-mercator/index.cjs.map +6 -0
- package/dist/web-mercator/index.d.ts +14 -0
- package/dist/web-mercator/index.d.ts.map +1 -0
- package/dist/web-mercator/index.js +14 -0
- package/dist/web-mercator/index.js.map +1 -0
- package/dist/web-mercator/math-utils.d.ts +7 -0
- package/dist/web-mercator/math-utils.d.ts.map +1 -0
- package/dist/web-mercator/math-utils.js +30 -0
- package/dist/web-mercator/math-utils.js.map +1 -0
- package/dist/web-mercator/mercator-meters.d.ts +29 -0
- package/dist/web-mercator/mercator-meters.d.ts.map +1 -0
- package/dist/web-mercator/mercator-meters.js +61 -0
- package/dist/web-mercator/mercator-meters.js.map +1 -0
- package/dist/web-mercator/normalize-viewport-props.d.ts +16 -0
- package/dist/web-mercator/normalize-viewport-props.d.ts.map +1 -0
- package/dist/web-mercator/normalize-viewport-props.js +45 -0
- package/dist/web-mercator/normalize-viewport-props.js.map +1 -0
- package/dist/web-mercator/web-mercator-utils.d.ts +192 -0
- package/dist/web-mercator/web-mercator-utils.d.ts.map +1 -0
- package/dist/web-mercator/web-mercator-utils.js +321 -0
- package/dist/web-mercator/web-mercator-utils.js.map +1 -0
- package/dist/web-mercator/web-mercator-viewport.d.ts +177 -0
- package/dist/web-mercator/web-mercator-viewport.d.ts.map +1 -0
- package/dist/web-mercator/web-mercator-viewport.js +276 -0
- package/dist/web-mercator/web-mercator-viewport.js.map +1 -0
- package/dist/web-mercator.d.ts +1 -1
- package/dist/web-mercator.d.ts.map +1 -1
- package/dist/web-mercator.js +1 -1
- package/dist/web-mercator.js.map +1 -1
- package/package.json +35 -462
- package/src/crs/crs-descriptor-types.ts +2 -1
- package/src/crs/index.ts +7 -0
- package/src/crs/spatial-reference-metadata.ts +118 -0
- package/src/ellipsoid-helpers/ellipsoid-transform.ts +3 -3
- package/src/ellipsoid-helpers/scale-to-geodetic-surface.ts +1 -1
- package/src/ellipsoid-helpers/tangent-plane-numerics.ts +1 -1
- package/src/ellipsoid-tangent-plane.ts +2 -2
- package/src/ellipsoid-transforms.ts +2 -2
- package/src/ellipsoid.ts +7 -3
- package/src/expressions.ts +2 -2
- package/src/geodesic-buffer.ts +1 -1
- package/src/geodesic-path.ts +1 -1
- package/src/geometry-constructors.ts +36 -0
- package/src/geometry-inspection.ts +66 -0
- package/src/index.ts +314 -4
- package/src/line-simplification.ts +97 -0
- package/src/linear-referencing.ts +94 -0
- package/src/lng-lat-rectangle.ts +1 -1
- package/src/local-reference-frame.ts +4 -4
- package/src/make-obb-from-region.ts +9 -1
- package/src/maps/air-ocean-mesh.ts +1 -1
- package/src/maps/myriahedral/unfold.ts +1 -1
- package/src/projection/experimental/crs/spatial-reference.ts +1 -6
- package/src/projection/experimental/crs/types.ts +2 -2
- package/src/projection/experimental/crs/wkt.ts +1 -1
- package/src/projection/experimental/crs-descriptor.ts +1 -1
- package/src/projection/experimental/crs-rendering-scale.ts +16 -4
- package/src/projection/experimental/datum.ts +1 -1
- package/src/projection/experimental/lazy-projections/aea.ts +4 -1
- package/src/projection/experimental/lazy-projections/bonne.ts +4 -1
- package/src/projection/experimental/lazy-projections/cass.ts +4 -1
- package/src/projection/experimental/lazy-projections/eck6.ts +4 -1
- package/src/projection/experimental/lazy-projections/eqdc.ts +4 -1
- package/src/projection/experimental/lazy-projections/eqearth.ts +4 -1
- package/src/projection/experimental/lazy-projections/equi.ts +4 -1
- package/src/projection/experimental/lazy-projections/geocent.ts +4 -1
- package/src/projection/experimental/lazy-projections/geos.ts +4 -1
- package/src/projection/experimental/lazy-projections/gnom.ts +4 -1
- package/src/projection/experimental/lazy-projections/krovak.ts +4 -1
- package/src/projection/experimental/lazy-projections/merc.ts +4 -1
- package/src/projection/experimental/lazy-projections/mill.ts +4 -1
- package/src/projection/experimental/lazy-projections/moll.ts +4 -1
- package/src/projection/experimental/lazy-projections/nzmg.ts +4 -1
- package/src/projection/experimental/lazy-projections/omerc.ts +4 -1
- package/src/projection/experimental/lazy-projections/ortho.ts +4 -1
- package/src/projection/experimental/lazy-projections/poly.ts +4 -1
- package/src/projection/experimental/lazy-projections/robin.ts +4 -1
- package/src/projection/experimental/lazy-projections/sinu.ts +4 -1
- package/src/projection/experimental/lazy-projections/stere.ts +4 -1
- package/src/projection/experimental/lazy-projections/tpers.ts +4 -1
- package/src/projection/experimental/lazy-projections/vandg.ts +4 -1
- package/src/projection/experimental/spatial-deformation.ts +1 -1
- package/src/projection/index.ts +1 -1
- package/src/projection/lib/projection.ts +1 -1
- package/src/rhumb-path.ts +1 -1
- package/src/spatial-planar-intersects.ts +134 -0
- package/src/spatial-planar.ts +266 -0
- package/src/spatial-sql.ts +276 -0
- package/src/st-functions.ts +852 -0
- package/src/subdivide-globe-mesh.ts +1 -1
- package/src/tasks/index.ts +34 -0
- package/src/tasks/terrain-coverage-worker.ts +6 -0
- package/src/tasks/terrain-coverage.ts +25 -0
- package/src/tasks/terrain-residency-worker.ts +6 -0
- package/src/tasks/terrain-residency.ts +250 -0
- package/src/terrain/breakline-mesh.ts +164 -0
- package/src/terrain/breakline-preprocess.ts +106 -0
- package/src/terrain/cdt2d.d.ts +10 -0
- package/src/terrain/continuous-mesh-error.ts +321 -0
- package/src/terrain/cutout-polygons.ts +202 -0
- package/src/terrain/cutout-region.ts +54 -0
- package/src/terrain/cutout-skirts.ts +52 -0
- package/src/terrain/depression-fill.ts +125 -0
- package/src/terrain/geographic-cutout.ts +154 -0
- package/src/terrain/geographic-lod-seams.ts +109 -0
- package/src/terrain/geographic-neighbor.ts +58 -0
- package/src/terrain/geographic-poles.ts +52 -0
- package/src/terrain/geographic-seam.ts +73 -0
- package/src/terrain/hydrology.ts +149 -0
- package/src/terrain/index.ts +160 -0
- package/src/terrain/lod-screen-error.ts +128 -0
- package/src/terrain/lod-select.ts +129 -0
- package/src/terrain/lod-stitch.ts +88 -0
- package/src/terrain/mesh-coverage.ts +215 -0
- package/src/terrain/mesh-cutout.ts +420 -0
- package/src/terrain/mesh-regions-data.ts +21 -13
- package/src/terrain/mesh-skirts.ts +10 -7
- package/src/terrain/mixed-halo-update.ts +147 -25
- package/src/terrain/mixed-vertex-halos.ts +125 -55
- package/src/terrain/regional-viewshed.ts +177 -0
- package/src/terrain/surface.ts +1 -1
- package/src/terrain/sweep-capsule.ts +148 -0
- package/src/terrain/sweep-cylinder.ts +64 -0
- package/src/terrain/sweep-plane.ts +61 -0
- package/src/terrain/sweep-polytope.ts +253 -0
- package/src/terrain/sweep-rotating-capsule.ts +139 -0
- package/src/terrain/sweep-rotation.ts +149 -0
- package/src/terrain/sweep-sphere.ts +100 -0
- package/src/terrain/tile-cutout-update.ts +293 -0
- package/src/terrain/tile-cutout.ts +123 -0
- package/src/terrain/valid-domain-mesh.ts +221 -0
- package/src/terrain/valid-domain-regions.ts +41 -0
- package/src/terrain/watershed-accumulation.ts +67 -0
- package/src/triaxial.ts +1 -1
- package/src/turf-expressions.ts +7 -0
- package/src/{turf/expressions.ts → turf-functions.ts} +121 -6
- package/src/turf.ts +3 -7
- package/src/type-utils.ts +2 -2
- package/src/web-mercator/assert.ts +11 -0
- package/src/web-mercator/fit-bounds.ts +132 -0
- package/src/web-mercator/fly-to-viewport.ts +157 -0
- package/src/web-mercator/get-bounds.ts +62 -0
- package/src/web-mercator/index.ts +49 -0
- package/src/web-mercator/math-utils.ts +35 -0
- package/src/web-mercator/mercator-meters.ts +83 -0
- package/src/web-mercator/normalize-viewport-props.ts +58 -0
- package/src/web-mercator/web-mercator-utils.ts +468 -0
- package/src/web-mercator/web-mercator-viewport.ts +406 -0
- package/src/web-mercator.ts +1 -1
- package/dist/projection/experimental/index.cjs +0 -11707
- package/dist/projection/experimental/index.cjs.map +0 -6
- package/dist/turf/expressions.cjs +0 -87
- package/dist/turf/expressions.cjs.map +0 -6
- package/dist/turf/expressions.d.ts +0 -24
- package/dist/turf/expressions.d.ts.map +0 -1
- package/dist/turf/expressions.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-rotation.js","sourceRoot":"","sources":["../../src/terrain/sweep-rotation.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,cAAc,EACd,oBAAoB,EAGrB,4BAAyB;AAkB1B;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAAgB,EAChB,QAAyB,EACzB,EAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAqB,EAClD,EAAC,OAAO,GAAG,MAAO,EAAE,iBAAiB,GAAG,IAAI,KAAoD,EAAE;IAElG,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,QAAQ,CA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,GAAG,EAAE,IAAI,iBAAiB,GAAG,CAAC;gBAAE,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,iBAAiB,GAAG,CAAC;gBAC9D,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,EAAC,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;AAC1F,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,MAAa,EACb,WAAkB,EAClB,MAA0B,EAC1B,OAAwD;IAExD,OAAO,4BAA4B,CACjC,OAAO,EACP,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TerrainCapsuleContact, TerrainSurface } from "./surface.js";
|
|
2
|
+
type Point = readonly [number, number, number];
|
|
3
|
+
export type TerrainSphereSweepOptions = {
|
|
4
|
+
/** Maximum width of the returned impact interval, in units of motion fraction. */
|
|
5
|
+
fractionTolerance?: number;
|
|
6
|
+
/** Total spatial index work across all probes. */
|
|
7
|
+
maxWork?: number;
|
|
8
|
+
};
|
|
9
|
+
export type TerrainSphereSweepResult = {
|
|
10
|
+
status: 'miss' | 'incomplete';
|
|
11
|
+
work: number;
|
|
12
|
+
} | {
|
|
13
|
+
status: 'hit';
|
|
14
|
+
work: number;
|
|
15
|
+
fraction: number;
|
|
16
|
+
lowerFraction: number;
|
|
17
|
+
contact: TerrainCapsuleContact;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Find the first impact of a translating sphere against the two-sided terrain sheet.
|
|
21
|
+
* Bisection tests entire motion prefixes, so a brief or grazing contact can be
|
|
22
|
+
* found even when neither endpoint intersects. The returned contact is a witness
|
|
23
|
+
* inside the impact interval. An exhausted work budget returns 'incomplete'.
|
|
24
|
+
*/
|
|
25
|
+
export declare function sweepTerrainSphere(surface: Pick<TerrainSurface, 'intersectCapsule'>, start: Point, end: Point, radius: number, { fractionTolerance, maxWork }?: TerrainSphereSweepOptions): TerrainSphereSweepResult;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=sweep-sphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-sphere.d.ts","sourceRoot":"","sources":["../../src/terrain/sweep-sphere.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,qBAAqB,EAAE,cAAc,EAAC,qBAAkB;AAErE,KAAK,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,yBAAyB,GAAG;IACtC,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC;IAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAC7C;IACE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,qBAAqB,CAAC;CAChC,CAAC;AAEN;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAkB,CAAC,EACjD,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,MAAM,EACd,EAAC,iBAAwB,EAAE,OAAiB,EAAC,GAAE,yBAA8B,GAC5E,wBAAwB,CA8D1B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* Find the first impact of a translating sphere against the two-sided terrain sheet.
|
|
6
|
+
* Bisection tests entire motion prefixes, so a brief or grazing contact can be
|
|
7
|
+
* found even when neither endpoint intersects. The returned contact is a witness
|
|
8
|
+
* inside the impact interval. An exhausted work budget returns 'incomplete'.
|
|
9
|
+
*/
|
|
10
|
+
export function sweepTerrainSphere(surface, start, end, radius, { fractionTolerance = 1e-6, maxWork = 100000 } = {}) {
|
|
11
|
+
if (!(fractionTolerance >= Number.EPSILON && fractionTolerance <= 1) ||
|
|
12
|
+
!Number.isSafeInteger(maxWork) ||
|
|
13
|
+
maxWork < 0)
|
|
14
|
+
throw new RangeError('Invalid terrain sphere sweep limits');
|
|
15
|
+
const delta = end.map((value, axis) => value - start[axis]);
|
|
16
|
+
if (start.length !== 3 ||
|
|
17
|
+
end.length !== 3 ||
|
|
18
|
+
!start.every(Number.isFinite) ||
|
|
19
|
+
!end.every(Number.isFinite) ||
|
|
20
|
+
!delta.every(Number.isFinite) ||
|
|
21
|
+
!Number.isFinite(radius) ||
|
|
22
|
+
radius < 0)
|
|
23
|
+
throw new RangeError('Invalid terrain sphere sweep motion or radius');
|
|
24
|
+
let work = 0;
|
|
25
|
+
let lower = 0;
|
|
26
|
+
let upper = 1;
|
|
27
|
+
const prefix = (fraction) => {
|
|
28
|
+
const endPoint = fraction === 0
|
|
29
|
+
? start
|
|
30
|
+
: fraction === 1
|
|
31
|
+
? end
|
|
32
|
+
: [
|
|
33
|
+
start[0] + delta[0] * fraction,
|
|
34
|
+
start[1] + delta[1] * fraction,
|
|
35
|
+
start[2] + delta[2] * fraction
|
|
36
|
+
];
|
|
37
|
+
const query = surface.intersectCapsule(start, endPoint, radius, {
|
|
38
|
+
maxWork: maxWork - work,
|
|
39
|
+
maxContacts: 1
|
|
40
|
+
});
|
|
41
|
+
work += query.work;
|
|
42
|
+
return query;
|
|
43
|
+
};
|
|
44
|
+
const initial = prefix(0);
|
|
45
|
+
if (initial.result[0])
|
|
46
|
+
return { status: 'hit', fraction: 0, lowerFraction: 0, contact: initial.result[0], work };
|
|
47
|
+
if (!initial.complete)
|
|
48
|
+
return { status: 'incomplete', work };
|
|
49
|
+
const full = prefix(1);
|
|
50
|
+
let contact = full.result[0];
|
|
51
|
+
if (!contact)
|
|
52
|
+
return { status: full.complete ? 'miss' : 'incomplete', work };
|
|
53
|
+
while (upper - lower > fractionTolerance) {
|
|
54
|
+
const middle = (lower + upper) / 2;
|
|
55
|
+
const query = prefix(middle);
|
|
56
|
+
if (query.result[0]) {
|
|
57
|
+
upper = middle;
|
|
58
|
+
contact = query.result[0];
|
|
59
|
+
}
|
|
60
|
+
else if (query.complete) {
|
|
61
|
+
lower = middle;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return { status: 'incomplete', work };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return { status: 'hit', fraction: upper, lowerFraction: lower, contact, work };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=sweep-sphere.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-sphere.js","sourceRoot":"","sources":["../../src/terrain/sweep-sphere.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;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M,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACpB,KAAK,GAAG,MAAM,CAAC;YACf,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,GAAG,MAAM,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type TerrainCutoutRegion } from "./cutout-region.js";
|
|
2
|
+
import { type TerrainCutout, type TerrainCutoutInput, type TerrainCutoutOptions } from "./mesh-cutout.js";
|
|
3
|
+
/** Stable resident identity and an explicit revision for in-place buffer edits. */
|
|
4
|
+
export type TerrainCutoutResident = {
|
|
5
|
+
/** Unique resident tile ID. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Nonnegative safe integer; increment after changing any mesh buffer. */
|
|
8
|
+
revision: number;
|
|
9
|
+
/** Conforming terrain in one shared Cartesian frame. Treat as immutable within a revision. */
|
|
10
|
+
mesh: TerrainCutoutInput;
|
|
11
|
+
};
|
|
12
|
+
/** Per-tile clipping limits plus bounds on resident-set reconciliation. */
|
|
13
|
+
export type TerrainTileCutoutUpdateOptions = TerrainCutoutOptions & {
|
|
14
|
+
/** Maximum residents. Default 512. */
|
|
15
|
+
maxTiles?: number;
|
|
16
|
+
/** Maximum tile-pair broad-phase checks per update. Default 131072. */
|
|
17
|
+
maxPairChecks?: number;
|
|
18
|
+
/** Maximum exposed piece edges across all residents. Default 1000000. */
|
|
19
|
+
maxBoundaryEdges?: number;
|
|
20
|
+
};
|
|
21
|
+
/** Directed boundary edge with exact coordinate keys and local vertex IDs. */
|
|
22
|
+
type Boundary = {
|
|
23
|
+
/** Incident face polygon index; remainder faces use the Uint32 sentinel 0xffffffff. */
|
|
24
|
+
polygon: number;
|
|
25
|
+
key: string;
|
|
26
|
+
start: string;
|
|
27
|
+
end: string;
|
|
28
|
+
a: number;
|
|
29
|
+
b: number;
|
|
30
|
+
side: 0 | 1;
|
|
31
|
+
};
|
|
32
|
+
/** Cached clipping and boundary summaries for one immutable tile revision. */
|
|
33
|
+
type Entry = {
|
|
34
|
+
resident: TerrainCutoutResident;
|
|
35
|
+
split: TerrainCutout;
|
|
36
|
+
displayed: TerrainCutout;
|
|
37
|
+
bounds: readonly [number, number, number, number];
|
|
38
|
+
edges: Boundary[];
|
|
39
|
+
};
|
|
40
|
+
/** Private cache brand; the cache is local to this module instance. */
|
|
41
|
+
declare const CACHE: unique symbol;
|
|
42
|
+
/** Opaque reusable cache. Do not mutate cached results or resident buffers without a new revision. */
|
|
43
|
+
export type TerrainTileCutoutCache = {
|
|
44
|
+
readonly [CACHE]: {
|
|
45
|
+
polygon: TerrainCutoutRegion;
|
|
46
|
+
options: Required<TerrainTileCutoutUpdateOptions>;
|
|
47
|
+
entries: ReadonlyMap<string, Entry>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/** Detached update result, with unchanged surface buffers retained by identity. */
|
|
51
|
+
export type TerrainTileCutoutUpdate = {
|
|
52
|
+
/** Pass to the next update; no state is committed if an update throws. */
|
|
53
|
+
cache: TerrainTileCutoutCache;
|
|
54
|
+
/** Resident cuts. Source triangle references are local to the corresponding input tile. */
|
|
55
|
+
tiles: ReadonlyMap<string, TerrainCutout>;
|
|
56
|
+
/** Tiles whose surfaces or exposed cut edges changed. */
|
|
57
|
+
changed: string[];
|
|
58
|
+
/** Tiles removed from the previous resident set. */
|
|
59
|
+
removed: string[];
|
|
60
|
+
/** Tiles actually clipped in this update; unchanged tiles are not reclipped. */
|
|
61
|
+
rebuilt: string[];
|
|
62
|
+
};
|
|
63
|
+
/** Clip changed tiles independently and pair their exposed boundaries.
|
|
64
|
+
* Mixed-level inputs must already be reconciled. Cached source buffers and
|
|
65
|
+
* returned arrays are read-only by contract. Change revision after in-place
|
|
66
|
+
* edits; replacing the mesh object also invalidates its cache. Polygon or
|
|
67
|
+
* option changes invalidate all clips. Limits maxWork/maxVertices/maxTriangles
|
|
68
|
+
* apply per clip and per adjacent-pair validation, not to the entire update.
|
|
69
|
+
* Arrival/eviction can change a neighbor's cutEdges without rebuilding its mesh.
|
|
70
|
+
*/
|
|
71
|
+
export declare function updateTerrainTileCutouts(residents: readonly TerrainCutoutResident[], polygon: TerrainCutoutRegion, previous?: TerrainTileCutoutCache, options?: TerrainTileCutoutUpdateOptions): TerrainTileCutoutUpdate;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=tile-cutout-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-cutout-update.d.ts","sourceRoot":"","sources":["../../src/terrain/tile-cutout-update.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,mBAAmB,EACzB,2BAAwB;AAEzB,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAE1B,yBAAsB;AAGvB,mFAAmF;AACnF,MAAM,MAAM,qBAAqB,GAAG;IAClC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AACF,2EAA2E;AAC3E,MAAM,MAAM,8BAA8B,GAAG,oBAAoB,GAAG;IAClE,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEA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CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,qBAAqB,EAAE,EAC3C,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,sBAAsB,EACjC,OAAO,GAAE,8BAAmC,GAC3C,uBAAuB,CA2IzB"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { copyTerrainCutoutRegion, sameTerrainCutoutRegion } from "./cutout-region.js";
|
|
5
|
+
import { splitTerrainMesh, validateTerrainCutoutTopology } from "./mesh-cutout.js";
|
|
6
|
+
import { assembleTerrainCutoutTiles } from "./tile-cutout.js";
|
|
7
|
+
/** Private cache brand; the cache is local to this module instance. */
|
|
8
|
+
const CACHE = Symbol('terrain-cutout-cache');
|
|
9
|
+
/** Clip changed tiles independently and pair their exposed boundaries.
|
|
10
|
+
* Mixed-level inputs must already be reconciled. Cached source buffers and
|
|
11
|
+
* returned arrays are read-only by contract. Change revision after in-place
|
|
12
|
+
* edits; replacing the mesh object also invalidates its cache. Polygon or
|
|
13
|
+
* option changes invalidate all clips. Limits maxWork/maxVertices/maxTriangles
|
|
14
|
+
* apply per clip and per adjacent-pair validation, not to the entire update.
|
|
15
|
+
* Arrival/eviction can change a neighbor's cutEdges without rebuilding its mesh.
|
|
16
|
+
*/
|
|
17
|
+
export function updateTerrainTileCutouts(residents, polygon, previous, options = {}) {
|
|
18
|
+
const limits = {
|
|
19
|
+
maxTiles: options.maxTiles ?? 512,
|
|
20
|
+
maxPairChecks: options.maxPairChecks ?? 131072,
|
|
21
|
+
maxBoundaryEdges: options.maxBoundaryEdges ?? 1000000,
|
|
22
|
+
maxWork: options.maxWork ?? 4000000,
|
|
23
|
+
maxVertices: options.maxVertices ?? 500000,
|
|
24
|
+
maxTriangles: options.maxTriangles ?? 500000
|
|
25
|
+
};
|
|
26
|
+
if (Object.values(limits).some(n => !Number.isSafeInteger(n) || n < 0) ||
|
|
27
|
+
limits.maxVertices > 0xffffffff ||
|
|
28
|
+
limits.maxTriangles > 0xffffffff ||
|
|
29
|
+
residents.length > limits.maxTiles)
|
|
30
|
+
throw new RangeError('Invalid terrain cutout update limits');
|
|
31
|
+
const prior = previous?.[CACHE];
|
|
32
|
+
const compatible = prior &&
|
|
33
|
+
sameTerrainCutoutRegion(prior.polygon, polygon) &&
|
|
34
|
+
Object.keys(limits).every(key => prior.options[key] === limits[key]);
|
|
35
|
+
// Validate the ring even for an empty resident set.
|
|
36
|
+
if (!compatible)
|
|
37
|
+
splitTerrainMesh({ positions: new Float64Array(), indices: new Uint32Array() }, polygon, limits);
|
|
38
|
+
const entries = new Map();
|
|
39
|
+
const rebuilt = [];
|
|
40
|
+
let boundaryCount = 0;
|
|
41
|
+
for (const resident of residents) {
|
|
42
|
+
if (!resident.id ||
|
|
43
|
+
typeof resident.id !== 'string' ||
|
|
44
|
+
entries.has(resident.id) ||
|
|
45
|
+
!Number.isSafeInteger(resident.revision) ||
|
|
46
|
+
resident.revision < 0)
|
|
47
|
+
throw new RangeError('Invalid or duplicate terrain cutout resident');
|
|
48
|
+
const old = compatible ? prior.entries.get(resident.id) : undefined;
|
|
49
|
+
let entry;
|
|
50
|
+
if (old && old.resident.mesh === resident.mesh && old.resident.revision === resident.revision)
|
|
51
|
+
entry = old;
|
|
52
|
+
else {
|
|
53
|
+
const split = splitTerrainMesh(resident.mesh, polygon, limits);
|
|
54
|
+
const edges = [...boundaryEdges(split.patch, 0), ...boundaryEdges(split.remainder, 1)];
|
|
55
|
+
const bounds = [Infinity, Infinity, -Infinity, -Infinity];
|
|
56
|
+
for (const id of resident.mesh.indices) {
|
|
57
|
+
const x = resident.mesh.positions[id * 3], y = resident.mesh.positions[id * 3 + 1];
|
|
58
|
+
bounds[0] = Math.min(bounds[0], x);
|
|
59
|
+
bounds[1] = Math.min(bounds[1], y);
|
|
60
|
+
bounds[2] = Math.max(bounds[2], x);
|
|
61
|
+
bounds[3] = Math.max(bounds[3], y);
|
|
62
|
+
}
|
|
63
|
+
entry = { resident: { ...resident }, split, displayed: split, bounds, edges };
|
|
64
|
+
rebuilt.push(resident.id);
|
|
65
|
+
}
|
|
66
|
+
boundaryCount += entry.edges.length;
|
|
67
|
+
if (boundaryCount > limits.maxBoundaryEdges)
|
|
68
|
+
throw new RangeError('Terrain cutout boundary budget exceeded');
|
|
69
|
+
entries.set(resident.id, entry);
|
|
70
|
+
}
|
|
71
|
+
const values = [...entries.values()];
|
|
72
|
+
let pairs = 0;
|
|
73
|
+
for (let i = 0; i < values.length; i++)
|
|
74
|
+
for (let j = i + 1; j < values.length; j++) {
|
|
75
|
+
if (++pairs > limits.maxPairChecks)
|
|
76
|
+
throw new RangeError('Terrain cutout pair budget exceeded');
|
|
77
|
+
const a = values[i], b = values[j];
|
|
78
|
+
if (a.bounds[2] < b.bounds[0] ||
|
|
79
|
+
b.bounds[2] < a.bounds[0] ||
|
|
80
|
+
a.bounds[3] < b.bounds[1] ||
|
|
81
|
+
b.bounds[3] < a.bounds[1])
|
|
82
|
+
continue;
|
|
83
|
+
if (compatible &&
|
|
84
|
+
prior.entries.get(a.resident.id) === a &&
|
|
85
|
+
prior.entries.get(b.resident.id) === b)
|
|
86
|
+
continue;
|
|
87
|
+
const combined = assembleTerrainCutoutTiles([a.resident.mesh, b.resident.mesh], limits);
|
|
88
|
+
validateTerrainCutoutTopology(combined.mesh, combined.remainingWork);
|
|
89
|
+
}
|
|
90
|
+
const boundaries = new Map();
|
|
91
|
+
const cutKeys = new Map();
|
|
92
|
+
for (let tile = 0; tile < values.length; tile++)
|
|
93
|
+
for (const edge of values[tile].edges) {
|
|
94
|
+
const other = boundaries.get(edge.key);
|
|
95
|
+
if (!other) {
|
|
96
|
+
boundaries.set(edge.key, { edge, paired: false });
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (other.paired || other.edge.start !== edge.end || other.edge.end !== edge.start)
|
|
100
|
+
throw new RangeError('Nonconforming terrain cutout tile boundary');
|
|
101
|
+
other.paired = true;
|
|
102
|
+
if (other.edge.side !== edge.side) {
|
|
103
|
+
cutKeys.set(edge.key, edge.side === 0 ? edge.polygon : other.edge.polygon);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const tiles = new Map();
|
|
107
|
+
const changed = [];
|
|
108
|
+
for (let i = 0; i < values.length; i++) {
|
|
109
|
+
const entry = values[i];
|
|
110
|
+
const old = prior?.entries.get(entry.resident.id);
|
|
111
|
+
// Emit in cached tile-local order, independent of resident visitation order.
|
|
112
|
+
const cuts = [[], []];
|
|
113
|
+
const polygons = [[], []];
|
|
114
|
+
for (const edge of entry.edges) {
|
|
115
|
+
const polygonIndex = cutKeys.get(edge.key);
|
|
116
|
+
if (polygonIndex !== undefined) {
|
|
117
|
+
cuts[edge.side].push(edge.a, edge.b);
|
|
118
|
+
polygons[edge.side].push(polygonIndex);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const patch = withEdges(entry.split.patch, cuts[0], polygons[0], old?.displayed.patch);
|
|
122
|
+
const remainder = withEdges(entry.split.remainder, cuts[1], polygons[1], old?.displayed.remainder);
|
|
123
|
+
const displayed = old && patch === old.displayed.patch && remainder === old.displayed.remainder
|
|
124
|
+
? old.displayed
|
|
125
|
+
: { patch, remainder };
|
|
126
|
+
if (displayed !== old?.displayed)
|
|
127
|
+
changed.push(entry.resident.id);
|
|
128
|
+
entries.set(entry.resident.id, displayed === entry.displayed ? entry : { ...entry, displayed });
|
|
129
|
+
tiles.set(entry.resident.id, displayed);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
cache: { [CACHE]: { polygon: copyTerrainCutoutRegion(polygon), options: limits, entries } },
|
|
133
|
+
tiles,
|
|
134
|
+
changed,
|
|
135
|
+
rebuilt,
|
|
136
|
+
removed: prior ? [...prior.entries.keys()].filter(id => !entries.has(id)) : []
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** Reuse surface buffers and unchanged boundary descriptors. */
|
|
140
|
+
function withEdges(piece, edges, polygons, old) {
|
|
141
|
+
const same = old &&
|
|
142
|
+
old.positions === piece.positions &&
|
|
143
|
+
old.cutEdges.length === edges.length &&
|
|
144
|
+
old.cutEdges.every((id, i) => id === edges[i]) &&
|
|
145
|
+
old.cutPolygonIndices.every((id, i) => id === polygons[i]);
|
|
146
|
+
return same
|
|
147
|
+
? old
|
|
148
|
+
: { ...piece, cutEdges: Uint32Array.from(edges), cutPolygonIndices: Uint32Array.from(polygons) };
|
|
149
|
+
}
|
|
150
|
+
/** Cache only exposed edges; interior triangulation edges never become walls. */
|
|
151
|
+
function boundaryEdges(piece, side) {
|
|
152
|
+
const edges = new Map();
|
|
153
|
+
for (let i = 0; i < piece.indices.length; i += 3)
|
|
154
|
+
for (let j = 0; j < 3; j++) {
|
|
155
|
+
const a = piece.indices[i + j], b = piece.indices[i + ((j + 1) % 3)];
|
|
156
|
+
const key = a < b ? `${a},${b}` : `${b},${a}`;
|
|
157
|
+
const old = edges.get(key);
|
|
158
|
+
if (old)
|
|
159
|
+
old.count++;
|
|
160
|
+
else
|
|
161
|
+
edges.set(key, { a, b, count: 1, polygon: piece.polygonIndices[i / 3] });
|
|
162
|
+
}
|
|
163
|
+
const result = [];
|
|
164
|
+
/** Encode exact XYZ; no snapping or tolerance-based topology decisions. */
|
|
165
|
+
const point = (id) => `${piece.positions[id * 3]},${piece.positions[id * 3 + 1]},${piece.positions[id * 3 + 2]}`;
|
|
166
|
+
for (const { a, b, count, polygon } of edges.values())
|
|
167
|
+
if (count === 1) {
|
|
168
|
+
const start = point(a), end = point(b);
|
|
169
|
+
result.push({
|
|
170
|
+
polygon,
|
|
171
|
+
a,
|
|
172
|
+
b,
|
|
173
|
+
side,
|
|
174
|
+
start,
|
|
175
|
+
end,
|
|
176
|
+
key: start < end ? `${start}/${end}` : `${end}/${start}`
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=tile-cutout-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-cutout-update.js","sourceRoot":"","sources":["../../src/terrain/tile-cutout-update.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAExB,2BAAwB;AAEzB,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAK9B,yBAAsB;AACvB,OAAO,EAAC,0BAA0B,EAAC,yBAAsB;AAuCzD,uEAAuE;AACvE,MAAM,KAAK,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAuB7C;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAA2C,EAC3C,OAA4B,EAC5B,QAAiC,EACjC,UAA0C,EAAE;IAE5C,MAAM,MAAM,GAA6C;QACvD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,GAAG;QACjC,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,MAAM;QAC9C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,OAAO;QACrD,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO;QACnC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,MAAM;QAC1C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,MAAM;KAC7C,CAAC;IACF,IACE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClE,MAAM,CAAC,WAAW,GAAG,UAAU;QAC/B,MAAM,CAAC,YAAY,GAAG,UAAU;QAChC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ;QAElC,MAAM,IAAI,UAAU,CAAC,sCAA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AC,GAAG,GAAG,IAAI,KAAK,EAAE;aACzD,CAAC,CAAC;QACL,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TerrainCutoutRegion } from "./cutout-region.js";
|
|
2
|
+
import { type TerrainCutout, type TerrainCutoutInput, type TerrainCutoutOptions } from "./mesh-cutout.js";
|
|
3
|
+
/** A resident tile expressed in the same local Cartesian frame as its neighbors. */
|
|
4
|
+
export type TerrainCutoutTile = TerrainCutoutInput;
|
|
5
|
+
/** A resident-set cut and its input-face provenance. */
|
|
6
|
+
export type TerrainTileCutout = TerrainCutout & {
|
|
7
|
+
/** Tile-array index for each input face referenced by either piece. */
|
|
8
|
+
sourceTiles: Uint32Array;
|
|
9
|
+
/** Original tile triangle index for each input face referenced by either piece. */
|
|
10
|
+
sourceTileFaces: Uint32Array;
|
|
11
|
+
};
|
|
12
|
+
/** Split a conforming resident tile set, with paired walls only along the cut.
|
|
13
|
+
*
|
|
14
|
+
* Vertices with identical XYZ are welded before clipping. Mixed-level neighbors
|
|
15
|
+
* must first be reconciled with stitchTerrainMeshEdges or stitchTerrainLodCut;
|
|
16
|
+
* hanging vertices, overlapping tiles and conflicting elevations are rejected.
|
|
17
|
+
* No snapping, height adjustment, missing-tile filling or tile caching occurs.
|
|
18
|
+
* Recompute from the new resident set after arrival or eviction. Source triangle
|
|
19
|
+
* and barycentric references retain the original tile face's corner order.
|
|
20
|
+
* Limits apply to the total input (including duplicate vertices) and the splitter.
|
|
21
|
+
*/
|
|
22
|
+
export declare function splitTerrainMeshTiles(tiles: readonly TerrainCutoutTile[], polygon: TerrainCutoutRegion, options?: TerrainCutoutOptions): TerrainTileCutout;
|
|
23
|
+
/** @internal Assemble a bounded, exact-welded mesh without clipping it. */
|
|
24
|
+
export declare function assembleTerrainCutoutTiles(tiles: readonly TerrainCutoutInput[], options?: TerrainCutoutOptions): {
|
|
25
|
+
mesh: {
|
|
26
|
+
positions: Float64Array<ArrayBuffer>;
|
|
27
|
+
indices: Uint32Array<ArrayBuffer>;
|
|
28
|
+
};
|
|
29
|
+
sourceTiles: Uint32Array<ArrayBuffer>;
|
|
30
|
+
sourceTileFaces: Uint32Array<ArrayBuffer>;
|
|
31
|
+
remainingWork: number;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=tile-cutout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-cutout.d.ts","sourceRoot":"","sources":["../../src/terrain/tile-cutout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAC,2BAAwB;AAEzD,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,yBAAsB;AAEvB,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEnD,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,uEAAuE;IACvE,WAAW,EAAE,WAAW,CAAC;IACzB,mFAAmF;IACnF,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,oBAAyB,GACjC,iBAAiB,CAOnB;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,OAAO,GAAE,oBAAyB;;;;;;;;EAwEnC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { splitTerrainMesh } from "./mesh-cutout.js";
|
|
5
|
+
/** Split a conforming resident tile set, with paired walls only along the cut.
|
|
6
|
+
*
|
|
7
|
+
* Vertices with identical XYZ are welded before clipping. Mixed-level neighbors
|
|
8
|
+
* must first be reconciled with stitchTerrainMeshEdges or stitchTerrainLodCut;
|
|
9
|
+
* hanging vertices, overlapping tiles and conflicting elevations are rejected.
|
|
10
|
+
* No snapping, height adjustment, missing-tile filling or tile caching occurs.
|
|
11
|
+
* Recompute from the new resident set after arrival or eviction. Source triangle
|
|
12
|
+
* and barycentric references retain the original tile face's corner order.
|
|
13
|
+
* Limits apply to the total input (including duplicate vertices) and the splitter.
|
|
14
|
+
*/
|
|
15
|
+
export function splitTerrainMeshTiles(tiles, polygon, options = {}) {
|
|
16
|
+
const assembled = assembleTerrainCutoutTiles(tiles, options);
|
|
17
|
+
return {
|
|
18
|
+
...splitTerrainMesh(assembled.mesh, polygon, { ...options, maxWork: assembled.remainingWork }),
|
|
19
|
+
sourceTiles: assembled.sourceTiles,
|
|
20
|
+
sourceTileFaces: assembled.sourceTileFaces
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** @internal Assemble a bounded, exact-welded mesh without clipping it. */
|
|
24
|
+
export function assembleTerrainCutoutTiles(tiles, options = {}) {
|
|
25
|
+
const maxVertices = options.maxVertices ?? 500000;
|
|
26
|
+
const maxTriangles = options.maxTriangles ?? 500000;
|
|
27
|
+
const maxWork = options.maxWork ?? 4000000;
|
|
28
|
+
if (![maxVertices, maxTriangles, maxWork].every(n => Number.isSafeInteger(n) && n >= 0) ||
|
|
29
|
+
maxVertices > 0xffffffff ||
|
|
30
|
+
maxTriangles > 0xffffffff)
|
|
31
|
+
throw new RangeError('Invalid terrain tile cutout limits');
|
|
32
|
+
let vertexCount = 0;
|
|
33
|
+
let faceCount = 0;
|
|
34
|
+
let work = 0;
|
|
35
|
+
for (const tile of tiles) {
|
|
36
|
+
if (!(tile.positions instanceof Float32Array || tile.positions instanceof Float64Array) ||
|
|
37
|
+
!(tile.indices instanceof Uint16Array || tile.indices instanceof Uint32Array) ||
|
|
38
|
+
tile.positions.length % 3 ||
|
|
39
|
+
tile.indices.length % 3)
|
|
40
|
+
throw new RangeError('Invalid terrain tile cutout mesh');
|
|
41
|
+
vertexCount += tile.positions.length / 3;
|
|
42
|
+
faceCount += tile.indices.length / 3;
|
|
43
|
+
work += 1 + tile.positions.length / 3 + tile.indices.length;
|
|
44
|
+
if (vertexCount > maxVertices || faceCount > maxTriangles || work > maxWork)
|
|
45
|
+
throw new RangeError('Terrain tile cutout input budget exceeded');
|
|
46
|
+
}
|
|
47
|
+
const positions = new Float64Array(vertexCount * 3);
|
|
48
|
+
const indices = new Uint32Array(faceCount * 3);
|
|
49
|
+
const sourceTiles = new Uint32Array(faceCount);
|
|
50
|
+
const sourceTileFaces = new Uint32Array(faceCount);
|
|
51
|
+
const vertices = new Map();
|
|
52
|
+
let vertexOffset = 0;
|
|
53
|
+
let faceOffset = 0;
|
|
54
|
+
for (let tileIndex = 0; tileIndex < tiles.length; tileIndex++) {
|
|
55
|
+
const tile = tiles[tileIndex];
|
|
56
|
+
const remap = new Uint32Array(tile.positions.length / 3);
|
|
57
|
+
for (let i = 0; i < remap.length; i++) {
|
|
58
|
+
const x = tile.positions[i * 3];
|
|
59
|
+
const y = tile.positions[i * 3 + 1];
|
|
60
|
+
const z = tile.positions[i * 3 + 2];
|
|
61
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z))
|
|
62
|
+
throw new RangeError('Invalid terrain tile cutout coordinate');
|
|
63
|
+
const key = `${x},${y},${z}`;
|
|
64
|
+
let id = vertices.get(key);
|
|
65
|
+
if (id === undefined) {
|
|
66
|
+
id = vertexOffset++;
|
|
67
|
+
vertices.set(key, id);
|
|
68
|
+
positions[id * 3] = x;
|
|
69
|
+
positions[id * 3 + 1] = y;
|
|
70
|
+
positions[id * 3 + 2] = z;
|
|
71
|
+
}
|
|
72
|
+
remap[i] = id;
|
|
73
|
+
}
|
|
74
|
+
for (let i = 0; i < tile.indices.length; i++) {
|
|
75
|
+
const id = tile.indices[i];
|
|
76
|
+
if (id >= remap.length)
|
|
77
|
+
throw new RangeError('Invalid terrain tile cutout index');
|
|
78
|
+
indices[faceOffset * 3 + i] = remap[id];
|
|
79
|
+
}
|
|
80
|
+
for (let i = 0; i < tile.indices.length / 3; i++) {
|
|
81
|
+
sourceTiles[faceOffset + i] = tileIndex;
|
|
82
|
+
sourceTileFaces[faceOffset + i] = i;
|
|
83
|
+
}
|
|
84
|
+
faceOffset += tile.indices.length / 3;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
mesh: { positions: positions.subarray(0, vertexOffset * 3), indices },
|
|
88
|
+
sourceTiles,
|
|
89
|
+
sourceTileFaces,
|
|
90
|
+
remainingWork: maxWork - work
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=tile-cutout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-cutout.js","sourceRoot":"","sources":["../../src/terrain/tile-cutout.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,OAAO,EACL,gBAAgB,EAIjB,yBAAsB;AAavB;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAmC,EACnC,OAA4B,EAC5B,UAAgC,EAAE;IAElC,MAAM,SAAS,GAAG,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO;QACL,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAC,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,aAAa,EAAC,CAAC;QAC5F,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,eAAe,EAAE,SAAS,CAAC,eAAe;KAC3C,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,0BAA0B,CACxC,KAAoC,EACpC,UAAgC,EAAE;IAElC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,MAAO,CAAC;IACnD,MAAM,YAAY,GAAG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AAC,MAAM,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO;QACL,IAAI,EAAE,EAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,EAAE,OAAO,EAAC;QACnE,WAAW;QACX,eAAe;QACf,aAAa,EAAE,OAAO,GAAG,IAAI;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HeightField } from "./height-field.js";
|
|
2
|
+
import type { TerrainMeshOptions } from "./mesh-data.js";
|
|
3
|
+
export type ValidDomainMeshOptions = TerrainMeshOptions & {
|
|
4
|
+
maxError: number;
|
|
5
|
+
maxSamples?: number;
|
|
6
|
+
maxTriangles?: number;
|
|
7
|
+
maxSampleTests?: number;
|
|
8
|
+
};
|
|
9
|
+
export type ValidDomainTerrainMesh = {
|
|
10
|
+
positions: Float64Array;
|
|
11
|
+
gridCoordinates: Float64Array;
|
|
12
|
+
indices: Uint32Array;
|
|
13
|
+
origin: readonly [number, number, number];
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
heightReference: string;
|
|
17
|
+
maxSampleError: number;
|
|
18
|
+
certifiedSamples: number;
|
|
19
|
+
};
|
|
20
|
+
export type Edge = [number, number];
|
|
21
|
+
/** Adaptively mesh precisely the union of valid regular triangles. */
|
|
22
|
+
export declare function createValidDomainTerrainMesh(field: HeightField, options: ValidDomainMeshOptions): ValidDomainTerrainMesh;
|
|
23
|
+
export type DomainConstraints = (points: [number, number][], heights: number[], edges: Edge[], selected: Int32Array, originZ: number) => {
|
|
24
|
+
edges: Edge[];
|
|
25
|
+
excluded: Set<number>;
|
|
26
|
+
fixedSamples: Set<number>;
|
|
27
|
+
};
|
|
28
|
+
export declare function meshValidDomain(field: HeightField, options: ValidDomainMeshOptions, constraints?: DomainConstraints): ValidDomainTerrainMesh;
|
|
29
|
+
//# sourceMappingURL=valid-domain-mesh.d.ts.map
|
|
@@ -0,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