Commit cd63cb3
committed
TSDF + ESDF + Occupancy + Decay + fast marching cubes
Add native CUDA kernels and Python wrappers for TSDF and ESDF
reconstruction, occupancy mapping, dynamic-scene decay, and a fast
sparse-compact marching-cubes variant. These features sit on top of
the nanoVDB allocator-overrides change (parent PR) and share a
common `PersistentTSDFState` + `BuildPointTruncationShell` substrate.
Topology + state primitives
src/fvdb/detail/ops/BuildPointTruncationShell.{cu,h}
Shared primitive that turns `(points, base_grid, truncation_margin)`
into the set of voxels within the truncation shell. Used by both
depth and LiDAR TSDF integrators.
src/fvdb/detail/ops/PersistentTSDFState.{cu,h}
Grow-on-touch state holder for incremental integration: wraps a
monotonically-growing live grid with fixed-shape tsdf / weights /
optional feature sidecars and exposes a `grow` method that
expands the grid + sidecars atomically while preserving values
at already-live voxels.
src/python/PersistentTSDFStateBinding.cpp
Pybind11 binding for the above.
Integrators
src/fvdb/detail/ops/IntegrateTSDF.{cu,h} (modified)
Depth TSDF integrator now uses `BuildPointTruncationShell` and
`PersistentTSDFState`, and exposes a new N-frame batched entry
point `integrateTSDFBatch` that grows the union grid one frame
at a time and copy-forwards sidecars through the
persistent-state object. Bit-identical to the per-frame loop
(pinned by `test_integrate_tsdf_frames_matches_sequential`).
src/fvdb/detail/ops/IntegrateTSDFFromPoints.{cu,h}
Native LiDAR / range-sensor TSDF integrator: per-point thread
HDDA-walks the union grid and `atomicAdd`s a running-sum into
(sum_w_sdf, sum_w, sum_w_feat) accumulators within the
truncation (and optionally free-space) band. Single-frame,
with-features, and N-frames-batched variants.
src/fvdb/detail/ops/IntegrateOccupancyFromPoints.{cu,h}
LiDAR occupancy mapping with free-space carving and log-odds
updates. Single-frame and N-frames-batched variants. Same
ray-walk structure as the LiDAR TSDF integrator.
ESDF
src/fvdb/detail/ops/ComputeESDF.{cu,h}
Euclidean Signed Distance Field from an integrated narrow-band
TSDF. Composition pattern is
`dilateGrid -> esdfSeed -> N sweeps of 26-N min-propagation`,
reusing the topology-op primitives.
src/fvdb/detail/ops/DirtyMaskFromSidecars.{cu,h}
Per-voxel dirty-mask primitive that lets the incremental ESDF
variant scope work to just the voxels whose sidecars changed.
Marching cubes
src/fvdb/detail/ops/MarchingCubesFast.{cu,h}
Sparse-compact, packed-key marching cubes for fp32 / fp16 CUDA.
`marchingCubes` now dispatches to this for eligible inputs and
to `marchingCubesLegacy` (the previous default, kept verbatim)
otherwise.
src/fvdb/detail/ops/MarchingCubes.{cu,h} (modified)
Routes through to the new fast path.
Python surface
fvdb/functional/_meshing.py
Wrappers for the new N-frame + with-features + LiDAR variants
of TSDF integration, occupancy mapping (single + frames), and
ESDF (single + incremental).
fvdb/functional/_topology.py
Wrapper for `dirty_mask_from_sidecars_single`.
fvdb/grid.py
New methods on `Grid`: `decay_and_prune`,
`integrate_tsdf_frames`, `integrate_tsdf_with_features`,
`integrate_tsdf_from_points` (+ frames + with-features
variants), `integrate_occupancy_from_points` (+ frames),
`compute_esdf`, `compute_esdf_incremental`. `decay_and_prune`
is implemented entirely in Python on top of existing fvdb
sidecar + topology primitives.
fvdb/functional/__init__.py
Export the new functional names.
src/python/Bindings.cpp, src/python/GridBatchOps.cpp
Register the new C++ bindings.
Tests
tests/unit/test_persistent_tsdf_state.py
tests/unit/test_compute_esdf.py
tests/unit/test_dirty_mask.py
tests/unit/test_integrate_occupancy.py
tests/unit/test_decay_and_prune.py
tests/unit/test_basic_ops.py (extended)
Cover the new primitives, the persistent-state invariants
(`grow` semantics, sidecar carry-forward), bit-identity of the
batched-vs-sequential TSDF paths, atomic-noise tolerance for
the LiDAR/occupancy variants, and fp16-vs-fp32 numerical
agreement for the new marching-cubes fast path.
Signed-off-by: Francis Williams <francis@fwilliams.info>1 parent fe2cbf1 commit cd63cb3
33 files changed
Lines changed: 9236 additions & 130 deletions
File tree
- fvdb
- functional
- src
- fvdb/detail/ops
- python
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 13 | | |
59 | 14 | | |
60 | 15 | | |
| |||
73 | 28 | | |
74 | 29 | | |
75 | 30 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
94 | 37 | | |
95 | 38 | | |
96 | 39 | | |
| |||
103 | 46 | | |
104 | 47 | | |
105 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
106 | 65 | | |
107 | 66 | | |
108 | 67 | | |
| |||
137 | 96 | | |
138 | 97 | | |
139 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
140 | 120 | | |
141 | 121 | | |
142 | 122 | | |
| |||
155 | 135 | | |
156 | 136 | | |
157 | 137 | | |
| 138 | + | |
158 | 139 | | |
159 | 140 | | |
160 | 141 | | |
| |||
175 | 156 | | |
176 | 157 | | |
177 | 158 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
184 | 194 | | |
185 | 195 | | |
186 | 196 | | |
| |||
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
257 | 271 | | |
258 | 272 | | |
259 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
260 | 281 | | |
261 | 282 | | |
262 | 283 | | |
| |||
277 | 298 | | |
278 | 299 | | |
279 | 300 | | |
| 301 | + | |
280 | 302 | | |
281 | 303 | | |
282 | 304 | | |
| |||
0 commit comments