gps-plus-slam-app-framework 1.11.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -14
- package/dist/{app-selectors-DG0ZqaeI.d.ts → app-selectors-DBUgwomp.d.ts} +1 -1
- package/dist/ar/ar-crash-isolation.d.ts +1 -1
- package/dist/ar/bresenham3d.d.ts +1 -1
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/capability-checker.d.ts +1 -1
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/capture-motion-gate.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
- package/dist/ar/depth-grid-lookup.d.ts +1 -1
- package/dist/ar/depth-occluder.d.ts +1 -1
- package/dist/ar/depth-sampler.d.ts +3 -3
- package/dist/ar/depth-sampler.js +28 -1
- package/dist/ar/depth-unprojection.d.ts +1 -1
- package/dist/ar/enable-gps-ar.d.ts +1 -1
- package/dist/ar/enable-gps-ar.js +20 -5
- package/dist/ar/frame-loop.d.ts +1 -1
- package/dist/ar/hit-test-reticle-driver.d.ts +2 -0
- package/dist/ar/hit-test-reticle-driver.js +122 -0
- package/dist/ar/image-capture.d.ts +1 -1
- package/dist/ar/image-capture.js +1 -1
- package/dist/ar/image-quality.d.ts +1 -1
- package/dist/ar/index.d.ts +35 -34
- package/dist/ar/index.js +5 -4
- package/dist/ar/occlusion-mesh-worker.d.ts +2 -2
- package/dist/ar/occlusion-mesh-worker.js +6 -4
- package/dist/ar/occupancy-grid.d.ts +2 -2
- package/dist/ar/occupancy-grid.js +191 -11
- package/dist/ar/occupancy-mesher.d.ts +1 -1
- package/dist/ar/occupancy-mesher.js +1 -636
- package/dist/ar/qr/index.d.ts +10 -10
- package/dist/ar/qr/planar-pnp.d.ts +1 -1
- package/dist/ar/qr/qr-debug-view.d.ts +1 -1
- package/dist/ar/qr/qr-derived-pose.d.ts +1 -1
- package/dist/ar/qr/qr-detection-controller.d.ts +1 -1
- package/dist/ar/qr/qr-frontend.d.ts +1 -1
- package/dist/ar/qr/qr-pose.d.ts +1 -1
- package/dist/ar/qr/qr-size-depth-context.d.ts +2 -2
- package/dist/ar/qr/qr-size-measurer.d.ts +1 -1
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/replay-scene.js +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-nue-basis.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +3 -3
- package/dist/ar/webxr-session.js +1 -1
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +1 -1
- package/dist/{ar-world-group-alignment-BdS_h8Nf.d.ts → ar-world-group-alignment-Dn_UiRy1.d.ts} +1 -1
- package/dist/{cell-key-Bj-eYTLA.js → cell-key-D1b_Ix-p.js} +12 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/{create-slam-app-store-oK9bnqyI.js → create-slam-app-store-B62K8_Qr.js} +17 -4
- package/dist/{create-slam-app-store-DFm5K9Ob.d.ts → create-slam-app-store-sxb1-esK.d.ts} +34 -4
- package/dist/{depth-grid-lookup-CCuzlqUo.d.ts → depth-grid-lookup-PcJTdRLL.d.ts} +1 -1
- package/dist/{depth-sampler-CS2jAFw4.d.ts → depth-sampler-BcvuxgCS.d.ts} +29 -2
- package/dist/{depth-unprojection-ET3Gwedf.d.ts → depth-unprojection-DbGipFkA.d.ts} +1 -1
- package/dist/{enable-gps-ar-D_xEHzh5.d.ts → enable-gps-ar-xjz3jNqm.d.ts} +4 -4
- package/dist/{frame-conversions-CH7E2Iv_.d.ts → frame-conversions-CzPQDYpM.d.ts} +1 -1
- package/dist/{fused-path-DOKzVMiO.d.ts → fused-path-CBAttcVm.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/{gps-anchor-BaqyRsPC.d.ts → gps-anchor-Gv4NDwH4.d.ts} +1 -1
- package/dist/{gps-ar-pose-sampler-BuuUuK-D.d.ts → gps-ar-pose-sampler-DBEYDFY5.d.ts} +1 -1
- package/dist/{gps-event-coordinator-Cruoe5I-.d.ts → gps-event-coordinator-BAy56wYd.d.ts} +4 -4
- package/dist/{gps-event-markers-y2b2aVl6.d.ts → gps-event-markers-212h7j3D.d.ts} +4 -4
- package/dist/hit-test-reticle-driver-CfKiDgsa.d.ts +40 -0
- package/dist/{image-capture-BevgKpoO.d.ts → image-capture-BXmx1YvD.d.ts} +3 -3
- package/dist/{index-Dxb6ATNK.d.ts → index-DVmgFIgm.d.ts} +1 -1
- package/dist/{index-BWVwd9Zw.d.ts → index-DX9VC257.d.ts} +3 -3
- package/dist/{index-ClmnNJ6-.d.ts → index-qYJ5-SBC.d.ts} +1 -1
- package/dist/index.d.ts +89 -82
- package/dist/index.js +17 -10
- package/dist/{leaflet-map-overlay-CksetpTt.d.ts → leaflet-map-overlay-BkHmzvpD.d.ts} +1 -1
- package/dist/{map-data-D8cCqpOM.d.ts → map-data-BQXPtRz7.d.ts} +1 -1
- package/dist/{map-overlay-draw-Cy-klqoA.d.ts → map-overlay-draw-sTM3wug_.d.ts} +1 -1
- package/dist/{null-storage-backend-DXXuwG8T.d.ts → null-storage-backend-Dtn3TBfT.d.ts} +2 -2
- package/dist/{occlusion-mesh-BWe2PrVi.d.ts → occlusion-mesh-BY2aMej3.d.ts} +22 -4
- package/dist/occupancy-cubes-visualizer-soN0Sizd.d.ts +146 -0
- package/dist/{occupancy-grid-CYBdmMOo.d.ts → occupancy-grid-DKzIdCSZ.d.ts} +113 -3
- package/dist/{occupancy-mesher-B4Bv4BTk.d.ts → occupancy-mesher-Co80tOpl.d.ts} +22 -1
- package/dist/occupancy-mesher-DzNeJdQf.js +837 -0
- package/dist/{opfs-storage-backend-D1ZpeNEL.d.ts → opfs-storage-backend-CZ-ECudx.d.ts} +2 -2
- package/dist/perf-stats-overlay-BMEQrzx6.d.ts +68 -0
- package/dist/{persistence-middleware-Cun4aF5M.d.ts → persistence-middleware-Byo_Fs4n.d.ts} +1 -1
- package/dist/{planar-pnp-ByxwDEyM.d.ts → planar-pnp-CkcMN3o3.d.ts} +1 -1
- package/dist/pointer-picking-BATHHTlT.d.ts +41 -0
- package/dist/{qr-debug-view-CGlITU09.d.ts → qr-debug-view-BMjNVhV2.d.ts} +1 -1
- package/dist/{qr-derived-pose-DZPxZd9C.d.ts → qr-derived-pose-Dq7mPK2s.d.ts} +2 -2
- package/dist/{qr-detected-slice-mfyxD2-M.d.ts → qr-detected-slice-8t_laDR9.d.ts} +4 -4
- package/dist/{qr-detection-controller-C5NII-vs.d.ts → qr-detection-controller-Dh4Paymb.d.ts} +3 -3
- package/dist/{qr-frontend-QzKZSqB-.d.ts → qr-frontend-BnLlVjKu.d.ts} +1 -1
- package/dist/{qr-pose-aggregation-mABSN0AW.d.ts → qr-pose-aggregation-Bpv4uARJ.d.ts} +1 -1
- package/dist/{qr-size-depth-context-CMDv6T29.d.ts → qr-size-depth-context-Bzbx98nS.d.ts} +2 -2
- package/dist/{qr-size-measurer-rVFf4AdM.d.ts → qr-size-measurer-18_W3INY.d.ts} +3 -3
- package/dist/{recording-replayer-qT2EM1Qs.d.ts → recording-replayer-CpFiYczh.d.ts} +2 -2
- package/dist/{recording-slice-DXw5-UvO.d.ts → recording-slice-zMedT0ot.d.ts} +1 -1
- package/dist/{replay-engine-B1H_kLhK.d.ts → replay-engine-DI7uknkv.d.ts} +1 -1
- package/dist/{replay-scene-BJeO36YT.d.ts → replay-scene-D5qzY0_x.d.ts} +3 -3
- package/dist/sensors/absolute-orientation.d.ts +1 -1
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/index.d.ts +4 -4
- package/dist/sensors/permission-checker.d.ts +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/combined-root-state.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/create-slam-app-store.js +1 -1
- package/dist/state/gps-ar-pose-sampler.d.ts +2 -2
- package/dist/state/gps-event-coordinator.d.ts +2 -2
- package/dist/state/gps-event-coordinator.js +1 -1
- package/dist/state/index.d.ts +18 -18
- package/dist/state/index.js +3 -3
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/qr-detected-slice.d.ts +3 -3
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-replayer.js +1 -1
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/replay-occupancy-subscriber.d.ts +51 -0
- package/dist/state/replay-occupancy-subscriber.js +85 -0
- package/dist/state/replay-session.d.ts +88 -0
- package/dist/state/replay-session.js +165 -0
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/store-subscribers.js +1 -1
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +1 -1
- package/dist/state/tracking-slice.d.ts +1 -1
- package/dist/{state-CDF5LvsO.js → state-BECcnNRW.js} +1 -1
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/index.d.ts +8 -8
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage.d.ts +1 -1
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-coverage-embed.d.ts +1 -1
- package/dist/storage/zip-export.d.ts +1 -1
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/{storage-backend-BX7egQKi.d.ts → storage-backend-DCYbOvTw.d.ts} +1 -1
- package/dist/{store-subscribers-CWHToX6N.d.ts → store-subscribers-BenHBQhD.d.ts} +2 -2
- package/dist/{subscribe-to-selector-j-eOYybQ.d.ts → subscribe-to-selector-hitZwSj8.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
- package/dist/text-sprite-C6VcC2mo.d.ts +53 -0
- package/dist/{tracking-slice-BAbcZK-Y.d.ts → tracking-slice-D5LDL_y4.d.ts} +1 -1
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/concurrency.d.ts +1 -1
- package/dist/utils/failure-tracker.d.ts +1 -1
- package/dist/utils/format-file-size.d.ts +1 -1
- package/dist/utils/fused-path.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/visualization/accuracy-circles.d.ts +1 -1
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.js +1 -1
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frame-conversions.d.ts +1 -1
- package/dist/visualization/frustum-visibility.d.ts +1 -1
- package/dist/visualization/gps-anchor.d.ts +1 -1
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-compass-cubes.js +6 -22
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/gps-event-markers.js +1 -1
- package/dist/visualization/hit-test-reticle.d.ts +1 -1
- package/dist/visualization/hit-test-reticle.js +3 -2
- package/dist/visualization/index.d.ts +25 -19
- package/dist/visualization/index.js +10 -4
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +1 -1
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-data.d.ts +1 -1
- package/dist/visualization/map-data.js +1 -1
- package/dist/visualization/map-overlay-draw.d.ts +1 -1
- package/dist/visualization/occluder-mesh-driver.d.ts +2 -2
- package/dist/visualization/occlusion-mesh.d.ts +1 -1
- package/dist/visualization/occlusion-mesh.js +26 -1
- package/dist/visualization/occupancy-cubes-visualizer.d.ts +2 -0
- package/dist/visualization/occupancy-cubes-visualizer.js +221 -0
- package/dist/visualization/perf-stats-overlay.d.ts +2 -0
- package/dist/visualization/perf-stats-overlay.js +85 -0
- package/dist/visualization/pointer-picking.d.ts +2 -0
- package/dist/visualization/pointer-picking.js +58 -0
- package/dist/visualization/text-sprite.d.ts +2 -0
- package/dist/visualization/text-sprite.js +105 -0
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/visualization/wayfinding-hud.d.ts +2 -0
- package/dist/visualization/wayfinding-hud.js +289 -0
- package/dist/visualization/wayfinding-placement.d.ts +2 -0
- package/dist/visualization/wayfinding-placement.js +157 -0
- package/dist/wayfinding-hud-DVun2b69.d.ts +82 -0
- package/dist/wayfinding-placement-dnHzfYlT.d.ts +97 -0
- package/dist/{webxr-session-OyR3YbTq.js → webxr-session-BBlgzrqY.js} +3 -3
- package/dist/{webxr-session-DefwObIu.d.ts → webxr-session-DurXRnl_.d.ts} +7 -7
- package/package.json +3 -3
- /package/dist/{absolute-orientation-Dj1One3y.d.ts → absolute-orientation-0WIsqJnu.d.ts} +0 -0
- /package/dist/{accuracy-circles-BHz7yVIL.d.ts → accuracy-circles-CFnKGfsD.d.ts} +0 -0
- /package/dist/{alignment-lerper-DAHicRON.d.ts → alignment-lerper-CK1TYLIL.d.ts} +0 -0
- /package/dist/{ar-crash-isolation-DlXCGzMf.d.ts → ar-crash-isolation-BSFw_beO.d.ts} +0 -0
- /package/dist/{ar-types-D6PYS4bc.d.ts → ar-types-BprL3nKv.d.ts} +0 -0
- /package/dist/{bresenham3d-D-t9i_b5.d.ts → bresenham3d-bt61R-Qa.d.ts} +0 -0
- /package/dist/{camera-blit-capture-BlC-arRb.d.ts → camera-blit-capture-CgNJ9grH.d.ts} +0 -0
- /package/dist/{camera-follower-CO_ibF2o.d.ts → camera-follower-OnnXsbHd.d.ts} +0 -0
- /package/dist/{capability-checker-BZ3_x1YL.d.ts → capability-checker-DrWimJ_t.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-BAUKjtXU.d.ts → capture-failure-tracker-bUXJeMvQ.d.ts} +0 -0
- /package/dist/{capture-motion-gate-CPwLekNf.d.ts → capture-motion-gate-C60Qrilh.d.ts} +0 -0
- /package/dist/{chromium-camera-access-workaround-BHR4clTE.d.ts → chromium-camera-access-workaround-BRs6gkI4.d.ts} +0 -0
- /package/dist/{concurrency-DW0jQo3G.d.ts → concurrency-CMhbkxBk.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-CJjHtCMT.d.ts → css3d-renderer-manager-CE6xN7XM.d.ts} +0 -0
- /package/dist/{device-orientation-cache-j-kLP8he.js → device-orientation-cache-BjEaEAmh.js} +0 -0
- /package/dist/{failure-tracker-B7fzPfZo.d.ts → failure-tracker-BdaFulDA.d.ts} +0 -0
- /package/dist/{file-system-utils-BHI0rXr9.d.ts → file-system-utils-DE3BViuq.d.ts} +0 -0
- /package/dist/{format-file-size-Da8rZgfs.d.ts → format-file-size-B2CJdRqD.d.ts} +0 -0
- /package/dist/{frame-loop-7GBMBu68.d.ts → frame-loop-CUEIdlhS.d.ts} +0 -0
- /package/dist/{frustum-visibility-COPfzruF.d.ts → frustum-visibility-BTx1Sqfo.d.ts} +0 -0
- /package/dist/{geo-types-BfDK8kJu.d.ts → geo-types-DGe5UKgx.d.ts} +0 -0
- /package/dist/{gps-CnhYrJCa.d.ts → gps-CC0l9lCp.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-CT3TWctJ.d.ts → gps-compass-cubes-QQJgpRXR.d.ts} +0 -0
- /package/dist/{gps-error-handler-DjVuLXve.d.ts → gps-error-handler-da4DCcs5.d.ts} +0 -0
- /package/dist/{h3-proximity-BaAulrnM.d.ts → h3-proximity-CAEk3osq.d.ts} +0 -0
- /package/dist/{hit-test-reticle-DhnCMOsc.d.ts → hit-test-reticle-DcOyqo3B.d.ts} +0 -0
- /package/dist/{image-capture-C4DwxC10.js → image-capture-Dn8uLIP2.js} +0 -0
- /package/dist/{image-quality--HLuyJ2r.d.ts → image-quality-G7_qT4aj.d.ts} +0 -0
- /package/dist/{index-CjxbDm8W.d.ts → index-T8Fxvzka.d.ts} +0 -0
- /package/dist/{index-Nr3qg4IH.d.ts → index-Y_RNWbQX.d.ts} +0 -0
- /package/dist/{leaflet-map-overlay-CTcTVmL1.js → leaflet-map-overlay-DjWfRT8a.js} +0 -0
- /package/dist/{lerp-utils-bwMwVCpU.d.ts → lerp-utils-B-ecvLq2.d.ts} +0 -0
- /package/dist/{list-formatter-1ttG18MQ.d.ts → list-formatter-C45u3Vgv.d.ts} +0 -0
- /package/dist/{logger-B4StJUDb.d.ts → logger-BQGNXi9W.d.ts} +0 -0
- /package/dist/{map-data-DkhsYDGM.js → map-data-vL8jb5Z9.js} +0 -0
- /package/dist/{opfs-storage-S_odkCk1.d.ts → opfs-storage-CrhVauNL.d.ts} +0 -0
- /package/dist/{permission-checker-B-VtjnBA.d.ts → permission-checker-BDrCOwQF.d.ts} +0 -0
- /package/dist/{qr-pose-21fRDcFO.d.ts → qr-pose-_dInl6di.d.ts} +0 -0
- /package/dist/{scene-node-names-DWzhE7Ro.d.ts → scene-node-names-Ct6ATrfM.d.ts} +0 -0
- /package/dist/{session-disposers-B7hUN90w.js → session-disposers-BJM5U62W.js} +0 -0
- /package/dist/{three-dispose-C3mnKQR5.d.ts → three-dispose-B5-XiECx.d.ts} +0 -0
- /package/dist/{vis-colors-CoSpbZEO.d.ts → vis-colors-16Pht13u.d.ts} +0 -0
- /package/dist/{webxr-nue-basis-C3vTqkE2.d.ts → webxr-nue-basis-B8ZEetVb.d.ts} +0 -0
- /package/dist/{xr-camera-texture-q0eIDSRg.d.ts → xr-camera-texture-BA4xiaQ4.d.ts} +0 -0
- /package/dist/{xr-error-handler-D9y5r8ok.d.ts → xr-error-handler-BeyxXCE_.d.ts} +0 -0
- /package/dist/{xr-frame-loop-BiZvgqP7.d.ts → xr-frame-loop-A1mGDFHI.d.ts} +0 -0
- /package/dist/{zip-coverage-embed-CyoX7XL7.d.ts → zip-coverage-embed-BC3O2-8b.d.ts} +0 -0
- /package/dist/{zip-export-CuBimX1J.d.ts → zip-export-Cfl_kNQ7.d.ts} +0 -0
- /package/dist/{zip-reader-BHc_b_iA.d.ts → zip-reader-DwkuvlGo.d.ts} +0 -0
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
import { createDepthUnprojector } from "./depth-unprojection.js";
|
|
2
2
|
import { bresenham3d } from "./bresenham3d.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as cellCoordsInKeyRange, c as unpackCellCoord, l as unpackCellKey, n as CELL_KEY_STRIDE_X, o as cellKey, r as CELL_KEY_STRIDE_Y, s as packCellKey, t as CELL_KEY_LIMIT } from "../cell-key-D1b_Ix-p.js";
|
|
4
4
|
//#region ../src/ar/occupancy-grid.ts
|
|
5
5
|
/**
|
|
6
|
+
* Recommended reconstruction defaults for apps that build AND render an occupancy
|
|
7
|
+
* mesh (the Recorder, the PhysicsDemo). These are the single framework-level source
|
|
8
|
+
* of truth so every consumer inherits the same tuning — change them here and both
|
|
9
|
+
* apps follow.
|
|
10
|
+
*
|
|
11
|
+
* They are DELIBERATELY separate from {@link OccupancyGrid}'s constructor fallback
|
|
12
|
+
* (`cellSizeM ?? 0.15`, Unity parity): that primitive fallback stays 0.15 because a
|
|
13
|
+
* pile of low-level tests build `new OccupancyGrid()` with no args and assume 0.15
|
|
14
|
+
* quantization. Both apps always pass an explicit `cellSizeM`, so the app-facing
|
|
15
|
+
* recommended default and the primitive fallback can differ without conflict.
|
|
16
|
+
*
|
|
17
|
+
* Tuning (2026-07-16 EVENING, maintainer's on-device framerate/mesh trade-off
|
|
18
|
+
* pass — supersedes the same-day corpus-sweep values 0.18/3): voxel 16 cm,
|
|
19
|
+
* noise floor 2. The sweep's argument for floor 3 (floaters = phantom
|
|
20
|
+
* colliders: mc 3 ≈ 1.9% vs mc 2 ≈ 3.5%) was measured under LEGACY carving;
|
|
21
|
+
* with the decay carve guard the floater gap largely disappears (real
|
|
22
|
+
* pillar-orbit A/B: guarded mc 2 isolates 2.12% vs guarded mc 3 2.19%), so
|
|
23
|
+
* the faster floor is affordable now. `0.16` stays within
|
|
24
|
+
* `OCCUPANCY_CONSTRAINTS.cellSizeM.max` (0.20); `2` within `minConfidence`
|
|
25
|
+
* 1–10. History: 2026-07-16-0557 corpus sweep (0.18/3),
|
|
26
|
+
* 2026-07-15-1640 device-impression change (0.18/2). See the recorder's
|
|
27
|
+
* recording-options.ts.md for the full tuning timeline.
|
|
28
|
+
*/
|
|
29
|
+
const DEFAULT_OCCUPANCY_CELL_SIZE_M = .16;
|
|
30
|
+
/**
|
|
31
|
+
* Recommended occupancy noise floor — the minimum observation count before a cell
|
|
32
|
+
* is rendered/meshed (the Recorder's `minConfidence`, the demo's `minObservations`,
|
|
33
|
+
* and — since the decay guard — both apps' `carveConfidenceThreshold`).
|
|
34
|
+
* See {@link DEFAULT_OCCUPANCY_CELL_SIZE_M} for the rationale and the tuning note.
|
|
35
|
+
*/
|
|
36
|
+
const DEFAULT_OCCUPANCY_MIN_OBSERVATIONS = 2;
|
|
37
|
+
/**
|
|
6
38
|
* Highest `minConfidence` a consumer can ask for (mirrors
|
|
7
39
|
* `OCCUPANCY_CONSTRAINTS.minConfidence.max`). Once a cell's count exceeds this,
|
|
8
40
|
* further observations can no longer change ANY consumer's occupied set, so they
|
|
@@ -13,6 +45,13 @@ const MAX_RELEVANT_COUNT = 10;
|
|
|
13
45
|
var OccupancyGrid = class {
|
|
14
46
|
cellSizeM;
|
|
15
47
|
carveStopCells;
|
|
48
|
+
/**
|
|
49
|
+
* Carve-blocking observation-count threshold, or undefined for legacy
|
|
50
|
+
* unguarded carving (see {@link OccupancyGridOptions}). Public + always
|
|
51
|
+
* present on instances so consumers built against a newer source can
|
|
52
|
+
* feature-detect the guard on an installed build at runtime.
|
|
53
|
+
*/
|
|
54
|
+
carveConfidenceThreshold;
|
|
16
55
|
cells = /* @__PURE__ */ new Map();
|
|
17
56
|
/**
|
|
18
57
|
* Chunk index (Step 2 of the 2026-07-03 long-session fps plan): cell keys
|
|
@@ -58,6 +97,7 @@ var OccupancyGrid = class {
|
|
|
58
97
|
if (!Number.isSafeInteger(carveStopCells) || carveStopCells < 0) throw new RangeError(`carveStopCells must be a non-negative integer, got ${carveStopCells}`);
|
|
59
98
|
this.cellSizeM = cellSizeM;
|
|
60
99
|
this.carveStopCells = carveStopCells;
|
|
100
|
+
this.carveConfidenceThreshold = validateCarveConfidenceThreshold(options?.carveConfidenceThreshold);
|
|
61
101
|
}
|
|
62
102
|
/** Number of occupied cells. */
|
|
63
103
|
get size() {
|
|
@@ -351,18 +391,153 @@ var OccupancyGrid = class {
|
|
|
351
391
|
* steps before the endpoint. The endpoint cell itself is additionally
|
|
352
392
|
* protected so a current observation is never erased (relevant for
|
|
353
393
|
* carveStopCells = 0 and for the unconditional start-cell visit).
|
|
394
|
+
*
|
|
395
|
+
* With `carveConfidenceThreshold` set, the trace additionally stops at the
|
|
396
|
+
* first cell whose count has reached the threshold, DECAYING it by one
|
|
397
|
+
* observation (means preserved) — soft contradiction instead of deletion,
|
|
398
|
+
* so nothing behind an established surface is carved but repeated
|
|
399
|
+
* contradictions still un-build it (see the option docs). Note this makes
|
|
400
|
+
* a repeated identical carve NOT a no-op — the per-sample unique-endpoint
|
|
401
|
+
* dedupe in `addSample` is therefore semantically load-bearing under the
|
|
402
|
+
* guard (one decay per contradicting ray per sample).
|
|
403
|
+
*
|
|
404
|
+
* PERFORMANCE — fused walk (2026-07-17 perf loop, iteration 1): this is
|
|
405
|
+
* the framework's hottest non-render loop (hundreds of rays per depth
|
|
406
|
+
* sample at the 200 ms reconstruction cadence), and the generic
|
|
407
|
+
* `bresenham3d(callback)` shape dominated the fold profile: a fresh
|
|
408
|
+
* `[x, y, z]` tuple + callback dispatch + full `cellKey` repack +
|
|
409
|
+
* `cellsEqual` per visited cell. The Bresenham walk (identical integer
|
|
410
|
+
* stepping, `bresenham3d` stays the reference — see the fold-oracle
|
|
411
|
+
* property test) is therefore fused in here with two key tricks:
|
|
412
|
+
*
|
|
413
|
+
* - The packed cell key is maintained INCREMENTALLY: stepping one cell
|
|
414
|
+
* along an axis moves the key by that axis' constant field stride
|
|
415
|
+
* (base-2^17 positional packing), replacing the 3-term repack.
|
|
416
|
+
* - The endpoint guard compares packed keys (`key === endpointKey`).
|
|
417
|
+
* Every walked cell lies inside the camera→point AABB whose corners the
|
|
418
|
+
* caller range-checked, so packing is bijective on the whole walk and
|
|
419
|
+
* the compare is exactly `cellsEqual` — and key aliasing is impossible.
|
|
420
|
+
*
|
|
421
|
+
* The cell tuple is materialized only on an actual delete/decay hit (rare
|
|
422
|
+
* per trace, handled in {@link carveCellAt}). Measured on the
|
|
423
|
+
* occupancy-fold bench (devbox-win11, Node 24, 50 samples × 576 pts,
|
|
424
|
+
* production config): 37.05 → 25.71 ms median of 5, −30.6%.
|
|
425
|
+
* Input safety: cameraCell/pointCell are integer cells from
|
|
426
|
+
* `cellForPosition` (finite-checked upstream) and both range-checked by
|
|
427
|
+
* `addSample`, so dm ≤ 2·CELL_KEY_LIMIT « MAX_TRACE_STEPS and the generic
|
|
428
|
+
* tracer's integer/span guards are structurally satisfied here.
|
|
354
429
|
*/
|
|
355
430
|
carve(cameraCell, pointCell) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
431
|
+
const threshold = this.carveConfidenceThreshold;
|
|
432
|
+
const stopDistance = this.carveStopCells;
|
|
433
|
+
let x = cameraCell[0];
|
|
434
|
+
let y = cameraCell[1];
|
|
435
|
+
let z = cameraCell[2];
|
|
436
|
+
const ex = pointCell[0];
|
|
437
|
+
const ey = pointCell[1];
|
|
438
|
+
const ez = pointCell[2];
|
|
439
|
+
const dx = Math.abs(ex - x);
|
|
440
|
+
const dy = Math.abs(ey - y);
|
|
441
|
+
const dz = Math.abs(ez - z);
|
|
442
|
+
const sx = Math.sign(ex - x);
|
|
443
|
+
const sy = Math.sign(ey - y);
|
|
444
|
+
const sz = Math.sign(ez - z);
|
|
445
|
+
const keyStepX = sx * CELL_KEY_STRIDE_X;
|
|
446
|
+
const keyStepY = sy * CELL_KEY_STRIDE_Y;
|
|
447
|
+
const keyStepZ = sz;
|
|
448
|
+
const endpointKey = packCellKey(ex, ey, ez);
|
|
449
|
+
let key = packCellKey(x, y, z);
|
|
450
|
+
const dm = Math.max(dx, dy, dz);
|
|
451
|
+
let i = dm;
|
|
452
|
+
let errX = Math.floor(dm / 2);
|
|
453
|
+
let errY = errX;
|
|
454
|
+
let errZ = errX;
|
|
455
|
+
for (;;) {
|
|
456
|
+
if (key !== endpointKey && !this.carveCellAt(x, y, z, key, threshold)) return;
|
|
457
|
+
if (i-- <= stopDistance) return;
|
|
458
|
+
errX -= dx;
|
|
459
|
+
if (errX < 0) {
|
|
460
|
+
errX += dm;
|
|
461
|
+
x += sx;
|
|
462
|
+
key += keyStepX;
|
|
363
463
|
}
|
|
364
|
-
|
|
365
|
-
|
|
464
|
+
errY -= dy;
|
|
465
|
+
if (errY < 0) {
|
|
466
|
+
errY += dm;
|
|
467
|
+
y += sy;
|
|
468
|
+
key += keyStepY;
|
|
469
|
+
}
|
|
470
|
+
errZ -= dz;
|
|
471
|
+
if (errZ < 0) {
|
|
472
|
+
errZ += dm;
|
|
473
|
+
z += sz;
|
|
474
|
+
key += keyStepZ;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Per-cell action of the fused carve walk (extracted so both it and the
|
|
480
|
+
* walk stay under the lint complexity budget; a monomorphic private-method
|
|
481
|
+
* call per visited cell measured within noise of the fully-inlined form).
|
|
482
|
+
*
|
|
483
|
+
* @returns `false` when the trace must stop: the cell is an established
|
|
484
|
+
* surface (count ≥ threshold) that was decayed instead of deleted.
|
|
485
|
+
*/
|
|
486
|
+
carveCellAt(x, y, z, key, threshold) {
|
|
487
|
+
const record = this.cells.get(key);
|
|
488
|
+
if (record === void 0) return true;
|
|
489
|
+
if (threshold !== void 0 && record.count >= threshold) {
|
|
490
|
+
this.decayCell([
|
|
491
|
+
x,
|
|
492
|
+
y,
|
|
493
|
+
z
|
|
494
|
+
], key, record);
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
this.cells.delete(key);
|
|
498
|
+
this.revision++;
|
|
499
|
+
this.unindexCell([
|
|
500
|
+
x,
|
|
501
|
+
y,
|
|
502
|
+
z
|
|
503
|
+
], key);
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Soft contradiction of an established cell (confidence-guarded carving):
|
|
508
|
+
* remove one observation while preserving the measured point/color MEANS
|
|
509
|
+
* (sums are scaled with the count — decrementing the divisor alone would
|
|
510
|
+
* silently shift `getCellPoint`/`getCellColor`). Deletes outright when the
|
|
511
|
+
* count would reach 0 (threshold 1). Bumps revisions like any mutation
|
|
512
|
+
* that can change a consumer's occupied set (counts above
|
|
513
|
+
* MAX_RELEVANT_COUNT cannot cross any selectable floor, so those decays
|
|
514
|
+
* stay revision-silent).
|
|
515
|
+
*/
|
|
516
|
+
decayCell(cell, key, record) {
|
|
517
|
+
const newCount = record.count - 1;
|
|
518
|
+
if (newCount <= 0) {
|
|
519
|
+
if (this.cells.delete(key)) {
|
|
520
|
+
this.revision++;
|
|
521
|
+
this.unindexCell(cell, key);
|
|
522
|
+
}
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
const scale = newCount / record.count;
|
|
526
|
+
record.count = newCount;
|
|
527
|
+
record.posSumX *= scale;
|
|
528
|
+
record.posSumY *= scale;
|
|
529
|
+
record.posSumZ *= scale;
|
|
530
|
+
if (record.colorCount > newCount) {
|
|
531
|
+
const colorScale = newCount / record.colorCount;
|
|
532
|
+
record.colorSumR *= colorScale;
|
|
533
|
+
record.colorSumG *= colorScale;
|
|
534
|
+
record.colorSumB *= colorScale;
|
|
535
|
+
record.colorCount = newCount;
|
|
536
|
+
}
|
|
537
|
+
if (newCount <= MAX_RELEVANT_COUNT) {
|
|
538
|
+
this.revision++;
|
|
539
|
+
this.bumpChunkRevision(chunkKeyOf(Math.floor(cell[0] / CHUNK_EDGE_CELLS), Math.floor(cell[1] / CHUNK_EDGE_CELLS), Math.floor(cell[2] / CHUNK_EDGE_CELLS)));
|
|
540
|
+
}
|
|
366
541
|
}
|
|
367
542
|
/** Add a newly-occupied cell to its chunk's index set. */
|
|
368
543
|
indexCell(cell, key) {
|
|
@@ -440,8 +615,13 @@ function unpackChunkCoord(key, axis) {
|
|
|
440
615
|
function cellsEqual(a, b) {
|
|
441
616
|
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
442
617
|
}
|
|
618
|
+
/** Constructor guard for {@link OccupancyGridOptions.carveConfidenceThreshold}. */
|
|
619
|
+
function validateCarveConfidenceThreshold(threshold) {
|
|
620
|
+
if (threshold !== void 0 && (!Number.isSafeInteger(threshold) || threshold < 1)) throw new RangeError(`carveConfidenceThreshold must be a positive integer when set, got ${threshold}`);
|
|
621
|
+
return threshold;
|
|
622
|
+
}
|
|
443
623
|
function isFiniteTriple(v) {
|
|
444
624
|
return Number.isFinite(v[0]) && Number.isFinite(v[1]) && Number.isFinite(v[2]);
|
|
445
625
|
}
|
|
446
626
|
//#endregion
|
|
447
|
-
export { OccupancyGrid, cellKey, unpackCellKey };
|
|
627
|
+
export { DEFAULT_OCCUPANCY_CELL_SIZE_M, DEFAULT_OCCUPANCY_MIN_OBSERVATIONS, OccupancyGrid, cellKey, unpackCellKey };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as meshOccupiedCells, i as OccupancyMeshResult, n as MeshMode, r as MeshOccupiedCellsOptions, t as Aabb } from "../occupancy-mesher-
|
|
1
|
+
import { a as meshOccupiedCells, i as OccupancyMeshResult, n as MeshMode, r as MeshOccupiedCellsOptions, t as Aabb } from "../occupancy-mesher-Co80tOpl.js";
|
|
2
2
|
export { Aabb, MeshMode, MeshOccupiedCellsOptions, OccupancyMeshResult, meshOccupiedCells };
|