Functional API
The fvdb.functional module provides a pure-function alternative to
the equivalent methods on Grid and GridBatch.
Every operation is available as a standalone function that takes the grid as
its first argument, mirroring the design of torch.nn.functional.
Each operation has two variants:
*_batch– operates on aGridBatchwithJaggedTensordata.*_single– operates on aGridwith plaintorch.Tensordata.
Tip
Most users should prefer the methods on Grid and
GridBatch directly. The functional API is useful when
building custom operations or when you need explicit control over the
single-grid vs. batched code path.
Coordinate Transforms
- fvdb.functional.voxel_to_world_batch(grid: GridBatch, ijk: JaggedTensor) JaggedTensor[source]
Transform voxel-space coordinates to world-space positions for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch supplying the voxel-to-world transforms.
ijk (JaggedTensor) – Voxel-space coordinates, shape
(B, -1, 3).
- Returns:
result (JaggedTensor) – World-space coordinates, shape
(B, -1, 3).
See also
- fvdb.functional.voxel_to_world_single(grid: Grid, ijk: torch.Tensor) torch.Tensor[source]
Transform voxel-space coordinates to world-space positions for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The grid supplying the voxel-to-world transform.
ijk (torch.Tensor) – Voxel-space coordinates, shape
(N, 3).
- Returns:
result (torch.Tensor) – World-space coordinates, shape
(N, 3).
See also
- fvdb.functional.world_to_voxel_batch(grid: GridBatch, points: JaggedTensor) JaggedTensor[source]
Transform world-space coordinates to voxel-space positions for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch supplying the world-to-voxel transforms.
points (JaggedTensor) – World-space positions, shape
(B, -1, 3).
- Returns:
result (JaggedTensor) – Voxel-space coordinates, shape
(B, -1, 3).
See also
- fvdb.functional.world_to_voxel_single(grid: Grid, points: torch.Tensor) torch.Tensor[source]
Transform world-space coordinates to voxel-space positions for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The grid supplying the world-to-voxel transform.
points (torch.Tensor) – World-space positions, shape
(N, 3).
- Returns:
result (torch.Tensor) – Voxel-space coordinates, shape
(N, 3).
See also
Interpolation and Splatting
- fvdb.functional.sample_trilinear_batch(grid: GridBatch, points: JaggedTensor, voxel_data: JaggedTensor) JaggedTensor[source]
Sample voxel data at world-space points using trilinear interpolation for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space query points, shape
(B, -1, 3).voxel_data (JaggedTensor) – Per-voxel feature data.
- Returns:
result (JaggedTensor) – Interpolated values at each query point.
See also
- fvdb.functional.sample_trilinear_single(grid: Grid, points: torch.Tensor, voxel_data: torch.Tensor) torch.Tensor[source]
Sample voxel data at world-space points using trilinear interpolation for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space query points, shape
(N, 3).voxel_data (torch.Tensor) – Per-voxel feature data.
- Returns:
result (torch.Tensor) – Interpolated values at each query point.
See also
- fvdb.functional.sample_trilinear_with_grad_batch(grid: GridBatch, points: JaggedTensor, voxel_data: JaggedTensor) tuple[JaggedTensor, JaggedTensor][source]
Sample with trilinear interpolation and return spatial gradients for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space query points, shape
(B, -1, 3).voxel_data (JaggedTensor) – Per-voxel feature data.
- Returns:
values (JaggedTensor) – Interpolated values at each query point.
gradients (JaggedTensor) – Spatial gradients at each query point.
See also
- fvdb.functional.sample_trilinear_with_grad_single(grid: Grid, points: torch.Tensor, voxel_data: torch.Tensor) tuple[torch.Tensor, torch.Tensor][source]
Sample with trilinear interpolation and return spatial gradients for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space query points, shape
(N, 3).voxel_data (torch.Tensor) – Per-voxel feature data.
- Returns:
values (torch.Tensor) – Interpolated values at each query point.
gradients (torch.Tensor) – Spatial gradients at each query point.
See also
- fvdb.functional.sample_bezier_batch(grid: GridBatch, points: JaggedTensor, voxel_data: JaggedTensor) JaggedTensor[source]
Sample voxel data at world-space points using Bezier interpolation for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space query points, shape
(B, -1, 3).voxel_data (JaggedTensor) – Per-voxel feature data.
- Returns:
result (JaggedTensor) – Interpolated values at each query point.
See also
- fvdb.functional.sample_bezier_single(grid: Grid, points: torch.Tensor, voxel_data: torch.Tensor) torch.Tensor[source]
Sample voxel data at world-space points using Bezier interpolation for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space query points, shape
(N, 3).voxel_data (torch.Tensor) – Per-voxel feature data.
- Returns:
result (torch.Tensor) – Interpolated values at each query point.
See also
- fvdb.functional.sample_bezier_with_grad_batch(grid: GridBatch, points: JaggedTensor, voxel_data: JaggedTensor) tuple[JaggedTensor, JaggedTensor][source]
Sample with Bezier interpolation and return spatial gradients for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space query points, shape
(B, -1, 3).voxel_data (JaggedTensor) – Per-voxel feature data.
- Returns:
values (JaggedTensor) – Interpolated values at each query point.
gradients (JaggedTensor) – Spatial gradients at each query point.
See also
- fvdb.functional.sample_bezier_with_grad_single(grid: Grid, points: torch.Tensor, voxel_data: torch.Tensor) tuple[torch.Tensor, torch.Tensor][source]
Sample with Bezier interpolation and return spatial gradients for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space query points, shape
(N, 3).voxel_data (torch.Tensor) – Per-voxel feature data.
- Returns:
values (torch.Tensor) – Interpolated values at each query point.
gradients (torch.Tensor) – Spatial gradients at each query point.
See also
- fvdb.functional.splat_trilinear_batch(grid: GridBatch, points: JaggedTensor, points_data: JaggedTensor) JaggedTensor[source]
Splat point data into voxels using trilinear weights for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space point positions, shape
(B, -1, 3).points_data (JaggedTensor) – Per-point feature data to splat.
- Returns:
result (JaggedTensor) – Accumulated voxel data.
See also
- fvdb.functional.splat_trilinear_single(grid: Grid, points: torch.Tensor, points_data: torch.Tensor) torch.Tensor[source]
Splat point data into voxels using trilinear weights for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space point positions, shape
(N, 3).points_data (torch.Tensor) – Per-point feature data to splat.
- Returns:
result (torch.Tensor) – Accumulated voxel data.
See also
- fvdb.functional.splat_bezier_batch(grid: GridBatch, points: JaggedTensor, points_data: JaggedTensor) JaggedTensor[source]
Splat point data into voxels using Bezier weights for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
points (JaggedTensor) – World-space point positions, shape
(B, -1, 3).points_data (JaggedTensor) – Per-point feature data to splat.
- Returns:
result (JaggedTensor) – Accumulated voxel data.
See also
- fvdb.functional.splat_bezier_single(grid: Grid, points: torch.Tensor, points_data: torch.Tensor) torch.Tensor[source]
Splat point data into voxels using Bezier weights for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
points (torch.Tensor) – World-space point positions, shape
(N, 3).points_data (torch.Tensor) – Per-point feature data to splat.
- Returns:
result (torch.Tensor) – Accumulated voxel data.
See also
Pooling and Refinement
- fvdb.functional.max_pool_batch(grid: GridBatch, pool_factor: NumericMaxRank1, data: JaggedTensor, stride: NumericMaxRank1 = 0, coarse_grid: GridBatch | None = None) tuple[JaggedTensor, GridBatch][source]
Max-pool voxel data on a grid batch, reducing resolution by pool_factor.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The fine grid batch.
pool_factor (NumericMaxRank1) – Pooling factor per axis, broadcastable to
(3,).data (JaggedTensor) – Per-voxel feature data on the fine grid.
stride (NumericMaxRank1) – Pooling stride per axis. Default
0uses pool_factor.coarse_grid (GridBatch | None) – Optional pre-computed coarse grid batch.
- Returns:
pooled_data (JaggedTensor) – Pooled feature data on the coarse grid.
coarse_grid (GridBatch) – The coarse grid batch.
See also
- fvdb.functional.max_pool_single(grid: Grid, pool_factor: NumericMaxRank1, data: torch.Tensor, stride: NumericMaxRank1 = 0, coarse_grid: Grid | None = None) tuple[torch.Tensor, Grid][source]
Max-pool voxel data on a single grid, reducing resolution by pool_factor.
Supports backpropagation.
- Parameters:
grid (Grid) – The fine single grid.
pool_factor (NumericMaxRank1) – Pooling factor per axis, broadcastable to
(3,).data (torch.Tensor) – Per-voxel feature data on the fine grid.
stride (NumericMaxRank1) – Pooling stride per axis. Default
0uses pool_factor.coarse_grid (Grid | None) – Optional pre-computed coarse grid.
- Returns:
pooled_data (torch.Tensor) – Pooled feature data on the coarse grid.
coarse_grid (Grid) – The coarse grid.
See also
- fvdb.functional.avg_pool_batch(grid: GridBatch, pool_factor: NumericMaxRank1, data: JaggedTensor, stride: NumericMaxRank1 = 0, coarse_grid: GridBatch | None = None) tuple[JaggedTensor, GridBatch][source]
Average-pool voxel data on a grid batch, reducing resolution by pool_factor.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The fine grid batch.
pool_factor (NumericMaxRank1) – Pooling factor per axis, broadcastable to
(3,).data (JaggedTensor) – Per-voxel feature data on the fine grid.
stride (NumericMaxRank1) – Pooling stride per axis. Default
0uses pool_factor.coarse_grid (GridBatch | None) – Optional pre-computed coarse grid batch.
- Returns:
pooled_data (JaggedTensor) – Pooled feature data on the coarse grid.
coarse_grid (GridBatch) – The coarse grid batch.
See also
- fvdb.functional.avg_pool_single(grid: Grid, pool_factor: NumericMaxRank1, data: torch.Tensor, stride: NumericMaxRank1 = 0, coarse_grid: Grid | None = None) tuple[torch.Tensor, Grid][source]
Average-pool voxel data on a single grid, reducing resolution by pool_factor.
Supports backpropagation.
- Parameters:
grid (Grid) – The fine single grid.
pool_factor (NumericMaxRank1) – Pooling factor per axis, broadcastable to
(3,).data (torch.Tensor) – Per-voxel feature data on the fine grid.
stride (NumericMaxRank1) – Pooling stride per axis. Default
0uses pool_factor.coarse_grid (Grid | None) – Optional pre-computed coarse grid.
- Returns:
pooled_data (torch.Tensor) – Pooled feature data on the coarse grid.
coarse_grid (Grid) – The coarse grid.
See also
- fvdb.functional.refine_batch(grid: GridBatch, subdiv_factor: NumericMaxRank1, data: JaggedTensor, mask: JaggedTensor | None = None, refined: GridBatch | None = None) tuple[JaggedTensor, GridBatch][source]
Refine (upsample) voxel data by subdividing each voxel on a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The coarse grid batch.
subdiv_factor (NumericMaxRank1) – Subdivision factor per axis, broadcastable to
(3,).data (JaggedTensor) – Per-voxel feature data on the coarse grid.
mask (JaggedTensor | None) – Optional boolean mask selecting voxels to refine.
refined (GridBatch | None) – Optional pre-computed fine grid batch.
- Returns:
refined_data (JaggedTensor) – Refined feature data on the fine grid.
fine_grid (GridBatch) – The fine grid batch.
See also
- fvdb.functional.refine_single(grid: Grid, subdiv_factor: NumericMaxRank1, data: torch.Tensor, mask: torch.Tensor | None = None, refined: Grid | None = None) tuple[torch.Tensor, Grid][source]
Refine (upsample) voxel data by subdividing each voxel on a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The coarse single grid.
subdiv_factor (NumericMaxRank1) – Subdivision factor per axis, broadcastable to
(3,).data (torch.Tensor) – Per-voxel feature data on the coarse grid.
mask (torch.Tensor | None) – Optional boolean mask selecting voxels to refine.
refined (Grid | None) – Optional pre-computed fine grid.
- Returns:
refined_data (torch.Tensor) – Refined feature data on the fine grid.
fine_grid (Grid) – The fine grid.
See also
Spatial Queries
- fvdb.functional.points_in_grid_batch(grid: GridBatch, points: JaggedTensor) JaggedTensor[source]
Check if world-space points are located within active voxels of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to test against.
points (JaggedTensor) – World-space points, shape
(B, -1, 3).
- Returns:
mask (JaggedTensor) – Boolean mask indicating which points are in active voxels.
See also
- fvdb.functional.points_in_grid_single(grid: Grid, points: torch.Tensor) torch.Tensor[source]
Check if world-space points are located within active voxels of a single grid.
- Parameters:
grid (Grid) – The single grid to test against.
points (torch.Tensor) – World-space points, shape
(N, 3).
- Returns:
mask (torch.Tensor) – Boolean mask indicating which points are in active voxels.
See also
- fvdb.functional.coords_in_grid_batch(grid: GridBatch, ijk: JaggedTensor) JaggedTensor[source]
Check which voxel-space coordinates lie on active voxels of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to test against.
ijk (JaggedTensor) – Voxel coordinates with integer dtype.
- Returns:
mask (JaggedTensor) – Boolean mask indicating which coordinates correspond to active voxels.
See also
- fvdb.functional.coords_in_grid_single(grid: Grid, ijk: torch.Tensor) torch.Tensor[source]
Check which voxel-space coordinates lie on active voxels of a single grid.
- Parameters:
grid (Grid) – The single grid to test against.
ijk (torch.Tensor) – Voxel coordinates with integer dtype.
- Returns:
mask (torch.Tensor) – Boolean mask indicating which coordinates correspond to active voxels.
See also
- fvdb.functional.cubes_in_grid_batch(grid: GridBatch, cube_centers: JaggedTensor, cube_min: NumericMaxRank1 = 0.0, cube_max: NumericMaxRank1 = 0.0) JaggedTensor[source]
Check if axis-aligned cubes are fully contained within active voxels of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to test against.
cube_centers (JaggedTensor) – World-space cube centers, shape
(B, -1, 3).cube_min (NumericMaxRank1) – Minimum offsets from center, broadcastable to
(3,).cube_max (NumericMaxRank1) – Maximum offsets from center, broadcastable to
(3,).
- Returns:
mask (JaggedTensor) – Boolean mask indicating which cubes are fully contained.
See also
- fvdb.functional.cubes_in_grid_single(grid: Grid, cube_centers: torch.Tensor, cube_min: NumericMaxRank1 = 0.0, cube_max: NumericMaxRank1 = 0.0) torch.Tensor[source]
Check if axis-aligned cubes are fully contained within active voxels of a single grid.
- Parameters:
grid (Grid) – The single grid to test against.
cube_centers (torch.Tensor) – World-space cube centers, shape
(N, 3).cube_min (NumericMaxRank1) – Minimum offsets from center, broadcastable to
(3,).cube_max (NumericMaxRank1) – Maximum offsets from center, broadcastable to
(3,).
- Returns:
mask (torch.Tensor) – Boolean mask indicating which cubes are fully contained.
See also
- fvdb.functional.cubes_intersect_grid_batch(grid: GridBatch, cube_centers: JaggedTensor, cube_min: NumericMaxRank1 = 0.0, cube_max: NumericMaxRank1 = 0.0) JaggedTensor[source]
Check if axis-aligned cubes intersect any active voxels of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to test against.
cube_centers (JaggedTensor) – World-space cube centers, shape
(B, -1, 3).cube_min (NumericMaxRank1) – Minimum offsets from center, broadcastable to
(3,).cube_max (NumericMaxRank1) – Maximum offsets from center, broadcastable to
(3,).
- Returns:
mask (JaggedTensor) – Boolean mask indicating which cubes intersect the grid.
See also
- fvdb.functional.cubes_intersect_grid_single(grid: Grid, cube_centers: torch.Tensor, cube_min: NumericMaxRank1 = 0.0, cube_max: NumericMaxRank1 = 0.0) torch.Tensor[source]
Check if axis-aligned cubes intersect any active voxels of a single grid.
- Parameters:
grid (Grid) – The single grid to test against.
cube_centers (torch.Tensor) – World-space cube centers, shape
(N, 3).cube_min (NumericMaxRank1) – Minimum offsets from center, broadcastable to
(3,).cube_max (NumericMaxRank1) – Maximum offsets from center, broadcastable to
(3,).
- Returns:
mask (torch.Tensor) – Boolean mask indicating which cubes intersect the grid.
See also
- fvdb.functional.ijk_to_index_batch(grid: GridBatch, ijk: JaggedTensor, cumulative: bool = False) JaggedTensor[source]
Convert voxel-space coordinates to linear indices in a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to index into.
ijk (JaggedTensor) – Voxel coordinates with integer dtype.
cumulative (bool) – If
True, return indices cumulative across the batch.
- Returns:
indices (JaggedTensor) – Linear indices (
-1for inactive coordinates).
See also
- fvdb.functional.ijk_to_index_single(grid: Grid, ijk: torch.Tensor, cumulative: bool = False) torch.Tensor[source]
Convert voxel-space coordinates to linear indices in a single grid.
- Parameters:
grid (Grid) – The single grid to index into.
ijk (torch.Tensor) – Voxel coordinates with integer dtype.
cumulative (bool) – If
True, return indices cumulative across the batch.
- Returns:
indices (torch.Tensor) – Linear indices (
-1for inactive coordinates).
See also
- fvdb.functional.ijk_to_inv_index_batch(grid: GridBatch, ijk: JaggedTensor, cumulative: bool = False) JaggedTensor[source]
Get the inverse permutation of
ijk_to_index_batch()for a grid batch.- Parameters:
grid (GridBatch) – The grid batch to index into.
ijk (JaggedTensor) – Voxel coordinates with integer dtype.
cumulative (bool) – If
True, return indices cumulative across the batch.
- Returns:
indices (JaggedTensor) – Inverse permutation indices.
See also
- fvdb.functional.ijk_to_inv_index_single(grid: Grid, ijk: torch.Tensor, cumulative: bool = False) torch.Tensor[source]
Get the inverse permutation of
ijk_to_index_single()for a single grid.- Parameters:
grid (Grid) – The single grid to index into.
ijk (torch.Tensor) – Voxel coordinates with integer dtype.
cumulative (bool) – If
True, return indices cumulative across the batch.
- Returns:
indices (torch.Tensor) – Inverse permutation indices.
See also
- fvdb.functional.neighbor_indexes_batch(grid: GridBatch, ijk: JaggedTensor, extent: int, bitshift: int = 0) JaggedTensor[source]
Get linear indices of neighboring voxels in an N-ring neighborhood for a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to query.
ijk (JaggedTensor) – Voxel coordinates with integer dtype.
extent (int) – Neighborhood ring size.
bitshift (int) – Optional bit shift applied to input coordinates. Default
0.
- Returns:
indices (JaggedTensor) – Neighbor indices;
-1for inactive neighbors.
See also
- fvdb.functional.neighbor_indexes_single(grid: Grid, ijk: torch.Tensor, extent: int, bitshift: int = 0) torch.Tensor[source]
Get linear indices of neighboring voxels in an N-ring neighborhood for a single grid.
- Parameters:
grid (Grid) – The single grid to query.
ijk (torch.Tensor) – Voxel coordinates with integer dtype.
extent (int) – Neighborhood ring size.
bitshift (int) – Optional bit shift applied to input coordinates. Default
0.
- Returns:
indices (torch.Tensor) – Neighbor indices;
-1for inactive neighbors.
See also
- fvdb.functional.active_grid_coords_batch(grid: GridBatch) JaggedTensor[source]
Return the voxel coordinates of every active voxel in a grid batch, in index order.
- Parameters:
grid (GridBatch) – The grid batch to query.
- Returns:
ijk (JaggedTensor) – Voxel coordinates, shape
(B, -1, 3).
See also
Dense–Sparse Conversion
- fvdb.functional.inject_from_dense_cminor_batch(grid: GridBatch, dense_data: torch.Tensor, dense_origin: NumericMaxRank1 = 0) JaggedTensor[source]
Inject values from a dense tensor (XYZC order) into sparse voxel data for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
dense_data (torch.Tensor) – Dense input tensor, shape
(B, X, Y, Z, C*).dense_origin (NumericMaxRank1) – Voxel-space origin of the dense tensor.
- Returns:
result (JaggedTensor) – Sparse voxel data extracted from the dense tensor.
See also
- fvdb.functional.inject_from_dense_cminor_single(grid: Grid, dense_data: torch.Tensor, dense_origin: NumericMaxRank1 = 0) torch.Tensor[source]
Inject values from a dense tensor (XYZC order) into sparse voxel data for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
dense_data (torch.Tensor) – Dense input tensor, shape
(1, X, Y, Z, C*).dense_origin (NumericMaxRank1) – Voxel-space origin of the dense tensor.
- Returns:
result (torch.Tensor) – Sparse voxel data extracted from the dense tensor.
See also
- fvdb.functional.inject_from_dense_cmajor_batch(grid: GridBatch, dense_data: torch.Tensor, dense_origin: NumericMaxRank1 = 0) JaggedTensor[source]
Inject values from a dense tensor (CXYZ order) into sparse voxel data for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
dense_data (torch.Tensor) – Dense input tensor, shape
(B, C*, X, Y, Z).dense_origin (NumericMaxRank1) – Voxel-space origin of the dense tensor.
- Returns:
result (JaggedTensor) – Sparse voxel data extracted from the dense tensor.
See also
- fvdb.functional.inject_from_dense_cmajor_single(grid: Grid, dense_data: torch.Tensor, dense_origin: NumericMaxRank1 = 0) torch.Tensor[source]
Inject values from a dense tensor (CXYZ order) into sparse voxel data for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
dense_data (torch.Tensor) – Dense input tensor, shape
(1, C*, X, Y, Z).dense_origin (NumericMaxRank1) – Voxel-space origin of the dense tensor.
- Returns:
result (torch.Tensor) – Sparse voxel data extracted from the dense tensor.
See also
- fvdb.functional.inject_to_dense_cminor_batch(grid: GridBatch, sparse_data: JaggedTensor, min_coord: NumericMaxRank1 | NumericMaxRank2 | None = None, grid_size: NumericMaxRank1 | None = None) torch.Tensor[source]
Write sparse voxel data into a dense tensor (XYZC order) for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
sparse_data (JaggedTensor) – Per-voxel feature data.
min_coord (NumericMaxRank1 | NumericMaxRank2 | None) – Minimum voxel coordinate for the dense grid.
grid_size (NumericMaxRank1 | None) – Size of the dense grid, broadcastable to
(3,).
- Returns:
result (torch.Tensor) – Dense tensor, shape
(B, X, Y, Z, C*).
See also
- fvdb.functional.inject_to_dense_cminor_single(grid: Grid, sparse_data: torch.Tensor, min_coord: NumericMaxRank1 | None = None, grid_size: NumericMaxRank1 | None = None) torch.Tensor[source]
Write sparse voxel data into a dense tensor (XYZC order) for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
sparse_data (torch.Tensor) – Per-voxel feature data.
min_coord (NumericMaxRank1 | None) – Minimum voxel coordinate for the dense grid.
grid_size (NumericMaxRank1 | None) – Size of the dense grid, broadcastable to
(3,).
- Returns:
result (torch.Tensor) – Dense tensor, shape
(1, X, Y, Z, C*).
See also
- fvdb.functional.inject_to_dense_cmajor_batch(grid: GridBatch, sparse_data: JaggedTensor, min_coord: NumericMaxRank1 | NumericMaxRank2 | None = None, grid_size: NumericMaxRank1 | None = None) torch.Tensor[source]
Write sparse voxel data into a dense tensor (CXYZ order) for a grid batch.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
sparse_data (JaggedTensor) – Per-voxel feature data.
min_coord (NumericMaxRank1 | NumericMaxRank2 | None) – Minimum voxel coordinate for the dense grid.
grid_size (NumericMaxRank1 | None) – Size of the dense grid, broadcastable to
(3,).
- Returns:
result (torch.Tensor) – Dense tensor, shape
(B, C*, X, Y, Z).
See also
- fvdb.functional.inject_to_dense_cmajor_single(grid: Grid, sparse_data: torch.Tensor, min_coord: NumericMaxRank1 | None = None, grid_size: NumericMaxRank1 | None = None) torch.Tensor[source]
Write sparse voxel data into a dense tensor (CXYZ order) for a single grid.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
sparse_data (torch.Tensor) – Per-voxel feature data.
min_coord (NumericMaxRank1 | None) – Minimum voxel coordinate for the dense grid.
grid_size (NumericMaxRank1 | None) – Size of the dense grid, broadcastable to
(3,).
- Returns:
result (torch.Tensor) – Dense tensor, shape
(1, C*, X, Y, Z).
See also
Grid-to-Grid Injection
- fvdb.functional.inject_batch(dst_grid: GridBatch, src_grid: GridBatch, src: JaggedTensor, dst: JaggedTensor | None = None, default_value: float | int | bool = 0) JaggedTensor[source]
Inject data from
src_gridintodst_gridin voxel space for grid batches.Supports backpropagation.
- Parameters:
dst_grid (GridBatch) – The destination grid batch.
src_grid (GridBatch) – The source grid batch.
src (JaggedTensor) – Source per-voxel data.
dst (JaggedTensor | None) – Optional destination buffer; created with default_value if
None.default_value (float | int | bool) – Fill value for unmatched voxels. Default
0.
- Returns:
result (JaggedTensor) – Destination data with injected values.
See also
- fvdb.functional.inject_single(dst_grid: Grid, src_grid: Grid, src: torch.Tensor, dst: torch.Tensor | None = None, default_value: float | int | bool = 0) torch.Tensor[source]
Inject data from
src_gridintodst_gridin voxel space for single grids.Supports backpropagation.
- Parameters:
dst_grid (Grid) – The destination single grid.
src_grid (Grid) – The source single grid.
src (torch.Tensor) – Source per-voxel data.
dst (torch.Tensor | None) – Optional destination buffer; created with default_value if
None.default_value (float | int | bool) – Fill value for unmatched voxels. Default
0.
- Returns:
result (torch.Tensor) – Destination data with injected values.
See also
- fvdb.functional.inject_from_ijk_batch(grid: GridBatch, src_ijk: JaggedTensor, src: JaggedTensor, dst: JaggedTensor | None = None, default_value: float | int | bool = 0) JaggedTensor[source]
Inject data from source voxel coordinates into a grid batch’s voxel data.
Supports backpropagation.
- Parameters:
grid (GridBatch) – The grid batch to inject into.
src_ijk (JaggedTensor) – Source voxel coordinates, shape
(B, -1, 3).src (JaggedTensor) – Source per-voxel data.
dst (JaggedTensor | None) – Optional destination buffer; created with default_value if
None.default_value (float | int | bool) – Fill value for unmatched voxels. Default
0.
- Returns:
result (JaggedTensor) – Destination data with injected values.
See also
- fvdb.functional.inject_from_ijk_single(grid: Grid, src_ijk: torch.Tensor, src: torch.Tensor, dst: torch.Tensor | None = None, default_value: float | int | bool = 0) torch.Tensor[source]
Inject data from source voxel coordinates into a single grid’s voxel data.
Supports backpropagation.
- Parameters:
grid (Grid) – The single grid to inject into.
src_ijk (torch.Tensor) – Source voxel coordinates, shape
(N, 3).src (torch.Tensor) – Source per-voxel data.
dst (torch.Tensor | None) – Optional destination buffer; created with default_value if
None.default_value (float | int | bool) – Fill value for unmatched voxels. Default
0.
- Returns:
result (torch.Tensor) – Destination data with injected values.
See also
Ray Operations
- fvdb.functional.voxels_along_rays_batch(grid: GridBatch, ray_origins: JaggedTensor, ray_directions: JaggedTensor, max_voxels: int, eps: float = 0.0, return_ijk: bool = False, cumulative: bool = False) tuple[JaggedTensor, JaggedTensor][source]
Enumerate voxels intersected by rays using a DDA traversal on a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to trace through.
ray_origins (JaggedTensor) – Ray origin positions, shape
(B, -1, 3).ray_directions (JaggedTensor) – Ray direction vectors, shape
(B, -1, 3).max_voxels (int) – Maximum number of voxels to return per ray.
eps (float) – Small offset to avoid self-intersection. Default
0.0.return_ijk (bool) – If
True, return voxel coordinates instead of linear indices.cumulative (bool) – If
True, return cumulative indices across the batch.
- Returns:
voxels (JaggedTensor) – Voxel coordinates or linear indices per ray hit.
distances (JaggedTensor) –
(t_entry, t_exit)pairs per ray hit.
See also
- fvdb.functional.voxels_along_rays_single(grid: Grid, ray_origins: torch.Tensor, ray_directions: torch.Tensor, max_voxels: int, eps: float = 0.0, return_ijk: bool = False) tuple[JaggedTensor, JaggedTensor][source]
Enumerate voxels intersected by rays using a DDA traversal on a single grid.
- Parameters:
grid (Grid) – The single grid to trace through.
ray_origins (torch.Tensor) – Ray origin positions, shape
(N, 3).ray_directions (torch.Tensor) – Ray direction vectors, shape
(N, 3).max_voxels (int) – Maximum number of voxels to return per ray.
eps (float) – Small offset to avoid self-intersection. Default
0.0.return_ijk (bool) – If
True, return voxel coordinates instead of linear indices.
- Returns:
voxels (JaggedTensor) – Voxel coordinates or linear indices per ray hit.
distances (JaggedTensor) –
(t_entry, t_exit)pairs per ray hit.
See also
- fvdb.functional.segments_along_rays_batch(grid: GridBatch, ray_origins: JaggedTensor, ray_directions: JaggedTensor, max_segments: int, eps: float = 0.0) JaggedTensor[source]
Return continuous segments of ray traversal through a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to trace through.
ray_origins (JaggedTensor) – Ray origin positions, shape
(B, -1, 3).ray_directions (JaggedTensor) – Ray direction vectors, shape
(B, -1, 3).max_segments (int) – Maximum number of segments to return per ray.
eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
segments (JaggedTensor) –
(t_start, t_end)pairs per ray segment.
See also
- fvdb.functional.segments_along_rays_single(grid: Grid, ray_origins: torch.Tensor, ray_directions: torch.Tensor, max_segments: int, eps: float = 0.0) JaggedTensor[source]
Return continuous segments of ray traversal through a single grid.
- Parameters:
grid (Grid) – The single grid to trace through.
ray_origins (torch.Tensor) – Ray origin positions, shape
(N, 3).ray_directions (torch.Tensor) – Ray direction vectors, shape
(N, 3).max_segments (int) – Maximum number of segments to return per ray.
eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
segments (JaggedTensor) –
(t_start, t_end)pairs per ray segment.
See also
- fvdb.functional.uniform_ray_samples_batch(grid: GridBatch, ray_origins: JaggedTensor, ray_directions: JaggedTensor, t_min: JaggedTensor, t_max: JaggedTensor, step_size: float, cone_angle: float = 0.0, include_end_segments: bool = True, return_midpoints: bool = False, eps: float = 0.0) JaggedTensor[source]
Generate uniformly spaced samples along rays that intersect active voxels of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to sample through.
ray_origins (JaggedTensor) – Ray origin positions, shape
(B, -1, 3).ray_directions (JaggedTensor) – Ray direction vectors, shape
(B, -1, 3).t_min (JaggedTensor) – Minimum ray distances per ray.
t_max (JaggedTensor) – Maximum ray distances per ray.
step_size (float) – Distance between consecutive samples.
cone_angle (float) – Cone angle for mip-mapping. Default
0.0.include_end_segments (bool) – Include segment endpoints. Default
True.return_midpoints (bool) – Return midpoints instead of boundaries. Default
False.eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
samples (JaggedTensor) – Sample distances along each ray.
See also
- fvdb.functional.uniform_ray_samples_single(grid: Grid, ray_origins: torch.Tensor, ray_directions: torch.Tensor, t_min: torch.Tensor, t_max: torch.Tensor, step_size: float, cone_angle: float = 0.0, include_end_segments: bool = True, return_midpoints: bool = False, eps: float = 0.0) JaggedTensor[source]
Generate uniformly spaced samples along rays that intersect active voxels of a single grid.
- Parameters:
grid (Grid) – The single grid to sample through.
ray_origins (torch.Tensor) – Ray origin positions, shape
(N, 3).ray_directions (torch.Tensor) – Ray direction vectors, shape
(N, 3).t_min (torch.Tensor) – Minimum ray distances per ray.
t_max (torch.Tensor) – Maximum ray distances per ray.
step_size (float) – Distance between consecutive samples.
cone_angle (float) – Cone angle for mip-mapping. Default
0.0.include_end_segments (bool) – Include segment endpoints. Default
True.return_midpoints (bool) – Return midpoints instead of boundaries. Default
False.eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
samples (JaggedTensor) – Sample distances along each ray.
See also
- fvdb.functional.ray_implicit_intersection_batch(grid: GridBatch, ray_origins: JaggedTensor, ray_directions: JaggedTensor, grid_scalars: JaggedTensor, eps: float = 0.0) JaggedTensor[source]
Find ray intersections with an implicit surface defined by grid scalars on a grid batch.
- Parameters:
grid (GridBatch) – The grid batch defining the implicit surface topology.
ray_origins (JaggedTensor) – Ray origin positions, shape
(B, -1, 3).ray_directions (JaggedTensor) – Ray direction vectors, shape
(B, -1, 3).grid_scalars (JaggedTensor) – Per-voxel scalar values defining the implicit surface.
eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
distances (JaggedTensor) – Intersection distance per ray, or
-1if no intersection.
See also
- fvdb.functional.ray_implicit_intersection_single(grid: Grid, ray_origins: torch.Tensor, ray_directions: torch.Tensor, grid_scalars: torch.Tensor, eps: float = 0.0) torch.Tensor[source]
Find ray intersections with an implicit surface defined by grid scalars on a single grid.
- Parameters:
grid (Grid) – The single grid defining the implicit surface topology.
ray_origins (torch.Tensor) – Ray origin positions, shape
(N, 3).ray_directions (torch.Tensor) – Ray direction vectors, shape
(N, 3).grid_scalars (torch.Tensor) – Per-voxel scalar values defining the implicit surface.
eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
distances (torch.Tensor) – Intersection distance per ray, or
-1if no intersection.
See also
- fvdb.functional.rays_intersect_voxels_batch(grid: GridBatch, ray_origins: JaggedTensor, ray_directions: JaggedTensor, eps: float = 0.0) JaggedTensor[source]
Check whether rays hit any voxels in a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to test against.
ray_origins (JaggedTensor) – Ray origin positions, shape
(B, -1, 3).ray_directions (JaggedTensor) – Ray direction vectors, shape
(B, -1, 3).eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
hit (JaggedTensor) – Boolean mask indicating whether each ray hit a voxel.
See also
- fvdb.functional.rays_intersect_voxels_single(grid: Grid, ray_origins: torch.Tensor, ray_directions: torch.Tensor, eps: float = 0.0) torch.Tensor[source]
Check whether rays hit any voxels in a single grid.
- Parameters:
grid (Grid) – The single grid to test against.
ray_origins (torch.Tensor) – Ray origin positions, shape
(N, 3).ray_directions (torch.Tensor) – Ray direction vectors, shape
(N, 3).eps (float) – Small offset to avoid self-intersection. Default
0.0.
- Returns:
hit (torch.Tensor) – Boolean mask indicating whether each ray hit a voxel.
See also
Meshing and TSDF Integration
- fvdb.functional.marching_cubes_batch(grid: GridBatch, field: JaggedTensor, level: float = 0.0) tuple[JaggedTensor, JaggedTensor, JaggedTensor][source]
Extract isosurface meshes using marching cubes on a grid batch.
- Parameters:
grid (GridBatch) – The grid batch defining the sparse topology.
field (JaggedTensor) – Per-voxel scalar field values.
level (float) – Isovalue at which to extract the surface. Default
0.0.
- Returns:
vertices (JaggedTensor) – Mesh vertex positions, shape
(B, -1, 3).faces (JaggedTensor) – Triangle face indices.
normals (JaggedTensor) – Per-vertex normals.
See also
- fvdb.functional.marching_cubes_single(grid: Grid, field: torch.Tensor, level: float = 0.0) tuple[torch.Tensor, torch.Tensor, torch.Tensor][source]
Extract isosurface mesh using marching cubes on a single grid.
- Parameters:
grid (Grid) – The single grid defining the sparse topology.
field (torch.Tensor) – Per-voxel scalar field values.
level (float) – Isovalue at which to extract the surface. Default
0.0.
- Returns:
vertices (torch.Tensor) – Mesh vertex positions, shape
(N, 3).faces (torch.Tensor) – Triangle face indices.
normals (torch.Tensor) – Per-vertex normals.
See also
- fvdb.functional.integrate_tsdf_batch(grid: GridBatch, truncation_distance: float, projection_matrices: torch.Tensor, cam_to_world_matrices: torch.Tensor, tsdf: JaggedTensor, weights: JaggedTensor, depth_images: torch.Tensor, weight_images: torch.Tensor | None = None) tuple[GridBatch, JaggedTensor, JaggedTensor][source]
Integrate depth images into a TSDF volume for a grid batch.
- Parameters:
grid (GridBatch) – The grid batch defining the TSDF topology.
truncation_distance (float) – TSDF truncation distance.
projection_matrices (torch.Tensor) – Camera projection matrices.
cam_to_world_matrices (torch.Tensor) – Camera-to-world transform matrices.
tsdf (JaggedTensor) – Current TSDF values.
weights (JaggedTensor) – Current integration weights.
depth_images (torch.Tensor) – Depth images to integrate.
weight_images (torch.Tensor | None) – Optional per-pixel weight images.
- Returns:
updated_grid (GridBatch) – The updated grid batch.
updated_tsdf (JaggedTensor) – Updated TSDF values.
updated_weights (JaggedTensor) – Updated integration weights.
See also
- fvdb.functional.integrate_tsdf_single(grid: Grid, truncation_distance: float, projection_matrices: torch.Tensor, cam_to_world_matrices: torch.Tensor, tsdf: torch.Tensor, weights: torch.Tensor, depth_images: torch.Tensor, weight_images: torch.Tensor | None = None) tuple[Grid, torch.Tensor, torch.Tensor][source]
Integrate depth images into a TSDF volume for a single grid.
- Parameters:
grid (Grid) – The single grid defining the TSDF topology.
truncation_distance (float) – TSDF truncation distance.
projection_matrices (torch.Tensor) – Camera projection matrices.
cam_to_world_matrices (torch.Tensor) – Camera-to-world transform matrices.
tsdf (torch.Tensor) – Current TSDF values.
weights (torch.Tensor) – Current integration weights.
depth_images (torch.Tensor) – Depth images to integrate.
weight_images (torch.Tensor | None) – Optional per-pixel weight images.
- Returns:
updated_grid (Grid) – The updated grid.
updated_tsdf (torch.Tensor) – Updated TSDF values.
updated_weights (torch.Tensor) – Updated integration weights.
See also
- fvdb.functional.integrate_tsdf_with_features_batch(grid: GridBatch, truncation_distance: float, projection_matrices: torch.Tensor, cam_to_world_matrices: torch.Tensor, tsdf: JaggedTensor, features: JaggedTensor, weights: JaggedTensor, depth_images: torch.Tensor, feature_images: torch.Tensor, weight_images: torch.Tensor | None = None) tuple[GridBatch, JaggedTensor, JaggedTensor, JaggedTensor][source]
Integrate depth and feature images into a TSDF volume with features for a grid batch.
- Parameters:
grid (GridBatch) – The grid batch defining the TSDF topology.
truncation_distance (float) – TSDF truncation distance.
projection_matrices (torch.Tensor) – Camera projection matrices.
cam_to_world_matrices (torch.Tensor) – Camera-to-world transform matrices.
tsdf (JaggedTensor) – Current TSDF values.
features (JaggedTensor) – Current per-voxel features.
weights (JaggedTensor) – Current integration weights.
depth_images (torch.Tensor) – Depth images to integrate.
feature_images (torch.Tensor) – Feature images to integrate.
weight_images (torch.Tensor | None) – Optional per-pixel weight images.
- Returns:
updated_grid (GridBatch) – The updated grid batch.
updated_tsdf (JaggedTensor) – Updated TSDF values.
updated_weights (JaggedTensor) – Updated integration weights.
updated_features (JaggedTensor) – Updated per-voxel features.
- fvdb.functional.integrate_tsdf_with_features_single(grid: Grid, truncation_distance: float, projection_matrices: torch.Tensor, cam_to_world_matrices: torch.Tensor, tsdf: torch.Tensor, features: torch.Tensor, weights: torch.Tensor, depth_images: torch.Tensor, feature_images: torch.Tensor, weight_images: torch.Tensor | None = None) tuple[Grid, torch.Tensor, torch.Tensor, torch.Tensor][source]
Integrate depth and feature images into a TSDF volume with features for a single grid.
- Parameters:
grid (Grid) – The single grid defining the TSDF topology.
truncation_distance (float) – TSDF truncation distance.
projection_matrices (torch.Tensor) – Camera projection matrices.
cam_to_world_matrices (torch.Tensor) – Camera-to-world transform matrices.
tsdf (torch.Tensor) – Current TSDF values.
features (torch.Tensor) – Current per-voxel features.
weights (torch.Tensor) – Current integration weights.
depth_images (torch.Tensor) – Depth images to integrate.
feature_images (torch.Tensor) – Feature images to integrate.
weight_images (torch.Tensor | None) – Optional per-pixel weight images.
- Returns:
updated_grid (Grid) – The updated grid.
updated_tsdf (torch.Tensor) – Updated TSDF values.
updated_weights (torch.Tensor) – Updated integration weights.
updated_features (torch.Tensor) – Updated per-voxel features.
See also
Grid Topology
- fvdb.functional.coarsened_grid_batch(grid: GridBatch, coarsening_factor: NumericMaxRank1) GridBatch[source]
Return a coarsened version of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to coarsen.
coarsening_factor (NumericMaxRank1) – Factor per axis, broadcastable to
(3,).
- Returns:
result (GridBatch) – The coarsened grid batch.
See also
- fvdb.functional.coarsened_grid_single(grid: Grid, coarsening_factor: NumericMaxRank1) Grid[source]
Return a coarsened version of a single grid.
- Parameters:
grid (Grid) – The single grid to coarsen.
coarsening_factor (NumericMaxRank1) – Factor per axis, broadcastable to
(3,).
- Returns:
result (Grid) – The coarsened grid.
See also
- fvdb.functional.refined_grid_batch(grid: GridBatch, subdiv_factor: NumericMaxRank1, mask: JaggedTensor | None = None) GridBatch[source]
Return a refined (subdivided) version of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to refine.
subdiv_factor (NumericMaxRank1) – Subdivision factor per axis, broadcastable to
(3,).mask (JaggedTensor | None) – Optional boolean mask selecting voxels to refine.
- Returns:
result (GridBatch) – The refined grid batch.
See also
- fvdb.functional.refined_grid_single(grid: Grid, subdiv_factor: NumericMaxRank1, mask: torch.Tensor | None = None) Grid[source]
Return a refined (subdivided) version of a single grid.
- Parameters:
grid (Grid) – The single grid to refine.
subdiv_factor (NumericMaxRank1) – Subdivision factor per axis, broadcastable to
(3,).mask (torch.Tensor | None) – Optional boolean mask selecting voxels to refine.
- Returns:
result (Grid) – The refined grid.
See also
- fvdb.functional.dual_grid_batch(grid: GridBatch, exclude_border: bool = False) GridBatch[source]
Return the dual grid of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
exclude_border (bool) – If
True, exclude border voxels from the dual.
- Returns:
result (GridBatch) – The dual grid batch.
See also
- fvdb.functional.dual_grid_single(grid: Grid, exclude_border: bool = False) Grid[source]
Return the dual grid of a single grid.
- Parameters:
grid (Grid) – The single grid.
exclude_border (bool) – If
True, exclude border voxels from the dual.
- Returns:
result (Grid) – The dual grid.
See also
- fvdb.functional.dilated_grid_batch(grid: GridBatch, dilation: int) GridBatch[source]
Return a dilated version of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch to dilate.
dilation (int) – Number of voxels to dilate by.
- Returns:
result (GridBatch) – The dilated grid batch.
See also
- fvdb.functional.dilated_grid_single(grid: Grid, dilation: int) Grid[source]
Return a dilated version of a single grid.
- Parameters:
grid (Grid) – The single grid to dilate.
dilation (int) – Number of voxels to dilate by.
- Returns:
result (Grid) – The dilated grid.
See also
- fvdb.functional.merged_grid_batch(grid: GridBatch, other: GridBatch) GridBatch[source]
Return the union of two grid batches.
- Parameters:
- Returns:
result (GridBatch) – Grid batch containing the union of active voxels.
See also
- fvdb.functional.merged_grid_single(grid: Grid, other: Grid) Grid[source]
Return the union of two single grids.
- Parameters:
- Returns:
result (Grid) – Grid containing the union of active voxels.
See also
- fvdb.functional.pruned_grid_batch(grid: GridBatch, mask: JaggedTensor) GridBatch[source]
Return a grid batch containing only voxels where
maskis True.- Parameters:
grid (GridBatch) – The grid batch to prune.
mask (JaggedTensor) – Boolean mask selecting voxels to keep.
- Returns:
result (GridBatch) – The pruned grid batch.
See also
- fvdb.functional.pruned_grid_single(grid: Grid, mask: torch.Tensor) Grid[source]
Return a single grid containing only voxels where
maskis True.- Parameters:
grid (Grid) – The single grid to prune.
mask (torch.Tensor) – Boolean mask selecting voxels to keep.
- Returns:
result (Grid) – The pruned grid.
See also
- fvdb.functional.clipped_grid_batch(grid: GridBatch, ijk_min: NumericMaxRank2, ijk_max: NumericMaxRank2) GridBatch[source]
Return a grid batch clipped to the voxel-space range
[ijk_min, ijk_max].- Parameters:
grid (GridBatch) – The grid batch to clip.
ijk_min (NumericMaxRank2) – Minimum voxel coordinate bound.
ijk_max (NumericMaxRank2) – Maximum voxel coordinate bound.
- Returns:
result (GridBatch) – The clipped grid batch.
See also
- fvdb.functional.clipped_grid_single(grid: Grid, ijk_min: NumericMaxRank1, ijk_max: NumericMaxRank1) Grid[source]
Return a single grid clipped to the voxel-space range
[ijk_min, ijk_max].- Parameters:
grid (Grid) – The single grid to clip.
ijk_min (NumericMaxRank1) – Minimum voxel coordinate bound.
ijk_max (NumericMaxRank1) – Maximum voxel coordinate bound.
- Returns:
result (Grid) – The clipped grid.
See also
- fvdb.functional.clip_batch(grid: GridBatch, features: JaggedTensor, ijk_min: NumericMaxRank2, ijk_max: NumericMaxRank2) tuple[JaggedTensor, GridBatch][source]
Clip a grid batch and its features to the voxel-space range
[ijk_min, ijk_max].Supports backpropagation on features.
- Parameters:
grid (GridBatch) – The grid batch to clip.
features (JaggedTensor) – Per-voxel feature data.
ijk_min (NumericMaxRank2) – Minimum voxel coordinate bound.
ijk_max (NumericMaxRank2) – Maximum voxel coordinate bound.
- Returns:
clipped_features (JaggedTensor) – Features for the clipped voxels.
clipped_grid (GridBatch) – The clipped grid batch.
See also
- fvdb.functional.clip_single(grid: Grid, features: torch.Tensor, ijk_min: NumericMaxRank1, ijk_max: NumericMaxRank1) tuple[torch.Tensor, Grid][source]
Clip a single grid and its features to the voxel-space range
[ijk_min, ijk_max].Supports backpropagation on features.
- Parameters:
grid (Grid) – The single grid to clip.
features (torch.Tensor) – Per-voxel feature data.
ijk_min (NumericMaxRank1) – Minimum voxel coordinate bound.
ijk_max (NumericMaxRank1) – Maximum voxel coordinate bound.
- Returns:
clipped_features (torch.Tensor) – Features for the clipped voxels.
clipped_grid (Grid) – The clipped grid.
See also
- fvdb.functional.contiguous_batch(grid: GridBatch) GridBatch[source]
Return a contiguous copy of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
- Returns:
result (GridBatch) – A contiguous copy of the grid batch.
See also
- fvdb.functional.contiguous_single(grid: Grid) Grid[source]
Return a contiguous copy of a single grid.
- Parameters:
grid (Grid) – The single grid.
- Returns:
result (Grid) – A contiguous copy of the grid.
See also
- fvdb.functional.clone_grid_batch(grid: GridBatch, device: torch.device) GridBatch[source]
Clone a grid batch to the specified device.
- Parameters:
grid (GridBatch) – The grid batch to clone.
device (torch.device) – Target device.
- Returns:
result (GridBatch) – A clone of the grid batch on the target device.
See also
- fvdb.functional.clone_grid_single(grid: Grid, device: torch.device) Grid[source]
Clone a single grid to the specified device.
- Parameters:
grid (Grid) – The single grid to clone.
device (torch.device) – Target device.
- Returns:
result (Grid) – A clone of the grid on the target device.
See also
- fvdb.functional.conv_grid_batch(grid: GridBatch, kernel_size: NumericMaxRank1, stride: NumericMaxRank1 = 1) GridBatch[source]
Return the output grid for a convolution on a grid batch.
- Parameters:
grid (GridBatch) – The input grid batch.
kernel_size (NumericMaxRank1) – Convolution kernel size, broadcastable to
(3,).stride (NumericMaxRank1) – Convolution stride, broadcastable to
(3,).
- Returns:
result (GridBatch) – The output grid batch for the convolution.
See also
- fvdb.functional.conv_grid_single(grid: Grid, kernel_size: NumericMaxRank1, stride: NumericMaxRank1 = 1) Grid[source]
Return the output grid for a convolution on a single grid.
- Parameters:
grid (Grid) – The input single grid.
kernel_size (NumericMaxRank1) – Convolution kernel size, broadcastable to
(3,).stride (NumericMaxRank1) – Convolution stride, broadcastable to
(3,).
- Returns:
result (Grid) – The output grid for the convolution.
See also
- fvdb.functional.conv_transpose_grid_batch(grid: GridBatch, kernel_size: NumericMaxRank1, stride: NumericMaxRank1 = 1) GridBatch[source]
Return the output grid for a transposed convolution on a grid batch.
- Parameters:
grid (GridBatch) – The input grid batch.
kernel_size (NumericMaxRank1) – Kernel size, broadcastable to
(3,).stride (NumericMaxRank1) – Stride, broadcastable to
(3,).
- Returns:
result (GridBatch) – The output grid batch for the transposed convolution.
See also
- fvdb.functional.conv_transpose_grid_single(grid: Grid, kernel_size: NumericMaxRank1, stride: NumericMaxRank1 = 1) Grid[source]
Return the output grid for a transposed convolution on a single grid.
- Parameters:
grid (Grid) – The input single grid.
kernel_size (NumericMaxRank1) – Kernel size, broadcastable to
(3,).stride (NumericMaxRank1) – Stride, broadcastable to
(3,).
- Returns:
result (Grid) – The output grid for the transposed convolution.
See also
Space-Filling Curves
- fvdb.functional.morton_batch(grid: GridBatch, offset: torch.Tensor | NumericMaxRank1 | None = None) JaggedTensor[source]
Return Morton (Z-order) codes for active voxels in a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (JaggedTensor) – Morton codes per active voxel.
See also
- fvdb.functional.morton_single(grid: Grid, offset: torch.Tensor | NumericMaxRank1 | None = None) torch.Tensor[source]
Return Morton (Z-order) codes for active voxels in a single grid.
- Parameters:
grid (Grid) – The single grid.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (torch.Tensor) – Morton codes per active voxel.
See also
- fvdb.functional.morton_zyx_batch(grid: GridBatch, offset: torch.Tensor | NumericMaxRank1 | None = None) JaggedTensor[source]
Return transposed Morton codes (zyx interleaving) for a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (JaggedTensor) – Transposed Morton codes per active voxel.
See also
- fvdb.functional.morton_zyx_single(grid: Grid, offset: torch.Tensor | NumericMaxRank1 | None = None) torch.Tensor[source]
Return transposed Morton codes (zyx interleaving) for a single grid.
- Parameters:
grid (Grid) – The single grid.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (torch.Tensor) – Transposed Morton codes per active voxel.
See also
- fvdb.functional.hilbert_batch(grid: GridBatch, offset: torch.Tensor | NumericMaxRank1 | None = None) JaggedTensor[source]
Return Hilbert curve codes for active voxels in a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (JaggedTensor) – Hilbert codes per active voxel.
See also
- fvdb.functional.hilbert_single(grid: Grid, offset: torch.Tensor | NumericMaxRank1 | None = None) torch.Tensor[source]
Return Hilbert curve codes for active voxels in a single grid.
- Parameters:
grid (Grid) – The single grid.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (torch.Tensor) – Hilbert codes per active voxel.
See also
- fvdb.functional.hilbert_zyx_batch(grid: GridBatch, offset: torch.Tensor | NumericMaxRank1 | None = None) JaggedTensor[source]
Return transposed Hilbert codes (zyx ordering) for a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (JaggedTensor) – Transposed Hilbert codes per active voxel.
See also
- fvdb.functional.hilbert_zyx_single(grid: Grid, offset: torch.Tensor | NumericMaxRank1 | None = None) torch.Tensor[source]
Return transposed Hilbert codes (zyx ordering) for a single grid.
- Parameters:
grid (Grid) – The single grid.
offset (torch.Tensor | NumericMaxRank1 | None) – Coordinate offset before encoding.
- Returns:
codes (torch.Tensor) – Transposed Hilbert codes per active voxel.
See also
Edge Network
- fvdb.functional.edge_network_batch(grid: GridBatch, return_voxel_coordinates: bool = False) tuple[JaggedTensor, JaggedTensor][source]
Return the edge network of a grid batch.
- Parameters:
grid (GridBatch) – The grid batch.
return_voxel_coordinates (bool) – If
True, return voxel coordinates instead of indices.
- Returns:
sources (JaggedTensor) – Source node indices or coordinates for each edge.
targets (JaggedTensor) – Target node indices or coordinates for each edge.
See also
- fvdb.functional.edge_network_single(grid: Grid, return_voxel_coordinates: bool = False) tuple[torch.Tensor, torch.Tensor][source]
Return the edge network of a single grid.
- Parameters:
grid (Grid) – The single grid.
return_voxel_coordinates (bool) – If
True, return voxel coordinates instead of indices.
- Returns:
sources (torch.Tensor) – Source node indices or coordinates for each edge.
targets (torch.Tensor) – Target node indices or coordinates for each edge.
See also
Grid Indexing
- fvdb.functional.index_grid_batch(grid: GridBatch, index: int) GridBatch[source]
- fvdb.functional.index_grid_batch(grid: GridBatch, index: slice) GridBatch
- fvdb.functional.index_grid_batch(grid: GridBatch, index: list[bool]) GridBatch
- fvdb.functional.index_grid_batch(grid: GridBatch, index: list[int]) GridBatch
- fvdb.functional.index_grid_batch(grid: GridBatch, index: Tensor) GridBatch
Select a subset of grids from a batch using indexing.
Supports integer indexing, slicing, list indexing, and boolean/integer tensor indexing.
- Parameters:
grid – The grid batch to index into.
index – Index to select grids. Can be: -
int: Select a single grid. -slice: Select a range of grids. -list[int]orlist[bool]: Select specific grids. -torch.Tensor: Boolean or integer tensor for advanced indexing.
- Returns:
A new :class:`~fvdb.GridBatch` containing the selected grids.
Grid Constructors (Batch)
- fvdb.functional.gridbatch_from_dense(num_grids: int, dense_dims: NumericMaxRank1, ijk_min: NumericMaxRank1 = 0, voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0, mask: torch.Tensor | None = None, device: DeviceIdentifier | None = None) GridBatch[source]
Create a grid batch of dense grids.
- Parameters:
num_grids (int) – Number of grids to create.
dense_dims (NumericMaxRank1) – Dimensions of the dense grid, broadcastable to
(3,).ijk_min (NumericMaxRank1) – Minimum voxel index, broadcastable to
(3,).voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(num_grids, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(num_grids, 3).mask (torch.Tensor | None) – Optional boolean mask
(W, H, D)selecting active voxels.device (DeviceIdentifier | None) – Device to create on. Defaults to mask’s device or
"cpu".
- Returns:
result (GridBatch) – A new grid batch.
See also
- fvdb.functional.gridbatch_from_dense_axis_aligned_bounds(num_grids: int, dense_dims: NumericMaxRank1, bounds_min: NumericMaxRank1 = 0, bounds_max: NumericMaxRank1 = 1, voxel_center: bool = False, device: DeviceIdentifier = 'cpu') GridBatch[source]
Create a grid batch of dense grids defined by axis-aligned world-space bounds.
- Parameters:
num_grids (int) – Number of grids to create.
dense_dims (NumericMaxRank1) – Dimensions of the dense grids, broadcastable to
(3,).bounds_min (NumericMaxRank1) – Minimum world-space coordinate, broadcastable to
(3,).bounds_max (NumericMaxRank1) – Maximum world-space coordinate, broadcastable to
(3,).voxel_center (bool) – Whether bounds correspond to voxel centers (
True) or edges (False).device (DeviceIdentifier) – Device to create on. Defaults to
"cpu".
- Returns:
result (GridBatch) – A new grid batch.
- fvdb.functional.gridbatch_from_ijk(ijk: JaggedTensor, voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0) GridBatch[source]
Create a grid batch from voxel-space coordinates.
- Parameters:
ijk (JaggedTensor) – Per-grid voxel coordinates, shape
(B, -1, 3)with integer dtype.voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(B, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(B, 3).
- Returns:
result (GridBatch) – A new grid batch.
See also
- fvdb.functional.gridbatch_from_mesh(mesh_vertices: JaggedTensor, mesh_faces: JaggedTensor, voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0) GridBatch[source]
Create a grid batch by voxelizing triangle mesh surfaces.
- Parameters:
mesh_vertices (JaggedTensor) – Per-grid vertex positions, shape
(B, -1, 3).mesh_faces (JaggedTensor) – Per-grid face indices, shape
(B, -1, 3).voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(B, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(B, 3).
- Returns:
result (GridBatch) – A new grid batch.
See also
- fvdb.functional.gridbatch_from_nearest_voxels_to_points(points: JaggedTensor, voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0) GridBatch[source]
Create a grid batch by adding the eight nearest voxels to every input point.
- Parameters:
points (JaggedTensor) – Per-grid point positions, shape
(B, -1, 3).voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(B, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(B, 3).
- Returns:
result (GridBatch) – A new grid batch.
See also
- fvdb.functional.gridbatch_from_points(points: JaggedTensor, voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0) GridBatch[source]
Create a grid batch from point clouds.
- Parameters:
points (JaggedTensor) – Per-grid point positions, shape
(B, -1, 3).voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(B, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(B, 3).
- Returns:
result (GridBatch) – A new grid batch.
See also
- fvdb.functional.gridbatch_from_zero_grids(device: DeviceIdentifier = 'cpu') GridBatch[source]
Create a grid batch with zero grids.
- Parameters:
device (DeviceIdentifier) – Device to create on. Defaults to
"cpu".- Returns:
result (GridBatch) – An empty grid batch with
grid_count == 0.
- fvdb.functional.gridbatch_from_zero_voxels(device: DeviceIdentifier = 'cpu', voxel_sizes: NumericMaxRank2 = 1, origins: NumericMaxRank2 = 0) GridBatch[source]
Create a grid batch with one or more zero-voxel grids.
- Parameters:
device (DeviceIdentifier) – Device to create on. Defaults to
"cpu".voxel_sizes (NumericMaxRank2) – Voxel size per grid, broadcastable to
(num_grids, 3).origins (NumericMaxRank2) – Origin per grid, broadcastable to
(num_grids, 3).
- Returns:
result (GridBatch) – A new grid batch with zero-voxel grids.
See also
Grid Constructors (Single)
- fvdb.functional.grid_from_dense(dense_dims: NumericMaxRank1, ijk_min: NumericMaxRank1 = 0, voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0, mask: torch.Tensor | None = None, device: DeviceIdentifier | None = None) Grid[source]
Create a single dense grid.
- Parameters:
dense_dims (NumericMaxRank1) – Dimensions of the dense grid, broadcastable to
(3,).ijk_min (NumericMaxRank1) – Minimum voxel index, broadcastable to
(3,).voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).mask (torch.Tensor | None) – Optional boolean mask
(W, H, D)selecting active voxels.device (DeviceIdentifier | None) – Device to create on. Defaults to mask’s device or
"cpu".
- Returns:
result (Grid) – A new single grid.
See also
- fvdb.functional.grid_from_dense_axis_aligned_bounds(dense_dims: NumericMaxRank1, bounds_min: NumericMaxRank1 = 0, bounds_max: NumericMaxRank1 = 1, voxel_center: bool = False, device: DeviceIdentifier = 'cpu') Grid[source]
Create a single dense grid defined by axis-aligned world-space bounds.
- Parameters:
dense_dims (NumericMaxRank1) – Dimensions of the dense grid, broadcastable to
(3,).bounds_min (NumericMaxRank1) – Minimum world-space coordinate, broadcastable to
(3,).bounds_max (NumericMaxRank1) – Maximum world-space coordinate, broadcastable to
(3,).voxel_center (bool) – Whether bounds correspond to voxel centers (
True) or edges (False).device (DeviceIdentifier) – Device to create on. Defaults to
"cpu".
- Returns:
result (Grid) – A new single grid.
- fvdb.functional.grid_from_ijk(ijk: torch.Tensor, voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0) Grid[source]
Create a single grid from voxel-space coordinates.
- Parameters:
ijk (torch.Tensor) – Voxel coordinates, shape
(N, 3)with integer dtype.voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).
- Returns:
result (Grid) – A new single grid.
See also
- fvdb.functional.grid_from_mesh(mesh_vertices: torch.Tensor, mesh_faces: torch.Tensor, voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0) Grid[source]
Create a single grid by voxelizing a triangle mesh surface.
- Parameters:
mesh_vertices (torch.Tensor) – Vertex positions, shape
(N, 3).mesh_faces (torch.Tensor) – Face indices, shape
(F, 3).voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).
- Returns:
result (Grid) – A new single grid.
See also
- fvdb.functional.grid_from_nearest_voxels_to_points(points: torch.Tensor, voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0) Grid[source]
Create a single grid by adding the eight nearest voxels to every input point.
- Parameters:
points (torch.Tensor) – Point positions, shape
(N, 3).voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).
- Returns:
result (Grid) – A new single grid.
- fvdb.functional.grid_from_points(points: torch.Tensor, voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0) Grid[source]
Create a single grid from a point cloud.
- Parameters:
points (torch.Tensor) – Point positions, shape
(N, 3).voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).
- Returns:
result (Grid) – A new single grid.
See also
- fvdb.functional.grid_from_zero_voxels(device: DeviceIdentifier = 'cpu', voxel_size: NumericMaxRank1 = 1, origin: NumericMaxRank1 = 0) Grid[source]
Create a single grid with zero voxels.
- Parameters:
device (DeviceIdentifier) – Device to create on. Defaults to
"cpu".voxel_size (NumericMaxRank1) – Voxel size, broadcastable to
(3,).origin (NumericMaxRank1) – Origin, broadcastable to
(3,).
- Returns:
result (Grid) – A new single grid with zero voxels.
See also
I/O
- fvdb.functional.load_nanovdb(path: str, *, device: str | device = 'cpu', verbose: bool = False) tuple[GridBatch, JaggedTensor, list[str]][source]
- fvdb.functional.load_nanovdb(path: str, *, indices: list[int], device: str | device = 'cpu', verbose: bool = False) tuple[GridBatch, JaggedTensor, list[str]]
- fvdb.functional.load_nanovdb(path: str, *, index: int, device: str | device = 'cpu', verbose: bool = False) tuple[GridBatch, JaggedTensor, list[str]]
- fvdb.functional.load_nanovdb(path: str, *, names: list[str], device: str | device = 'cpu', verbose: bool = False) tuple[GridBatch, JaggedTensor, list[str]]
- fvdb.functional.load_nanovdb(path: str, *, name: str, device: str | device = 'cpu', verbose: bool = False) tuple[GridBatch, JaggedTensor, list[str]]
Load a grid batch from a
.nvdbfile.- Parameters:
path (str) – Path to the
.nvdbfile.indices (list[int] | None) – Optional list of grid indices to load.
index (int | None) – Optional single grid index to load.
names (list[str] | None) – Optional list of grid names to load.
name (str | None) – Optional single grid name to load.
device (DeviceIdentifier) – Device to load onto. Defaults to
"cpu".verbose (bool) – Print information about loaded grids.
- Returns:
grid_batch (GridBatch) – The loaded grid batch.
data (JaggedTensor) – Per-voxel data.
names (list[str]) – Grid names.
See also
- fvdb.functional.load_nanovdb_single(path: str, *, index: int = 0, name: str | None = None, device: DeviceIdentifier = 'cpu', verbose: bool = False) tuple[Grid, torch.Tensor, str][source]
Load a single grid from a
.nvdbfile.- Parameters:
path (str) – Path to the
.nvdbfile.index (int) – Grid index to load. Default
0.name (str | None) – Optional grid name to load (overrides
index).device (DeviceIdentifier) – Device to load onto. Defaults to
"cpu".verbose (bool) – Print information about loaded grids.
- Returns:
grid (Grid) – The loaded single grid.
data (torch.Tensor) – Per-voxel data.
name (str) – Grid name.
See also
- fvdb.functional.save_nanovdb(grid: GridBatch, path: str, data: JaggedTensor | None = None, names: list[str] | str | None = None, name: str | None = None, compressed: bool = False, verbose: bool = False) None[source]
Save a grid batch and optional voxel data to a
.nvdbfile.- Parameters:
grid (GridBatch) – The grid batch to save.
path (str) – File path (should have
.nvdbextension).data (JaggedTensor | None) – Optional voxel data to save with the grids.
names (list[str] | str | None) – Names for each grid, or a single name for all.
name (str | None) – Single name for all grids (takes precedence over
names).compressed (bool) – Use Blosc compression. Default
False.verbose (bool) – Print information about saved grids. Default
False.
See also
- fvdb.functional.save_nanovdb_single(grid: Grid, path: str, data: torch.Tensor | None = None, name: str | None = None, compressed: bool = False, verbose: bool = False) None[source]
Save a single grid and optional voxel data to a
.nvdbfile.- Parameters:
grid (Grid) – The single grid to save.
path (str) – File path (should have
.nvdbextension).data (torch.Tensor | None) – Optional voxel data as a plain tensor.
name (str | None) – Optional name for the grid.
compressed (bool) – Use Blosc compression. Default
False.verbose (bool) – Print information about saved grids. Default
False.
See also