VoxelGridData<T>
Models & Types · AiDotNet.Geometry.Data
Represents a voxel grid with world-space metadata.
How It Works
For Beginners: A voxel grid is like a 3D image made of cubes (voxels). Each voxel stores a value, such as occupancy or density.
Constructors
| Constructor | Summary |
|---|---|
VoxelGridData(Tensor<T> voxels, Vector<T> origin, Vector<T> voxelSize) |
Initializes a new instance of the VoxelGridData class. |
Properties
| Property | Summary |
|---|---|
Dictionary<string, object> Metadata { get; set; } |
Optional metadata associated with the voxel grid. |
Tensor<T> Voxels { get; } |
Voxel values of shape [depth, height, width] or [depth, height, width, channels]. |
Vector<T> Origin { get; } |
World-space origin of the voxel grid (corner of voxel [0,0,0]). |
Vector<T> VoxelSize { get; } |
Size of a voxel along each axis in world units. |
int Channels { get; } |
Number of channels per voxel (1 if no channel dimension). |
int Depth { get; } |
Depth (Z dimension) of the grid. |
int Height { get; } |
Height (Y dimension) of the grid. |
int Width { get; } |
Width (X dimension) of the grid. |
Methods
| Method | Summary |
|---|---|
PointCloudData<T> ToPointCloud(T occupancyThreshold, int occupancyChannel, bool includeOccupancyAsFeature) |
Converts occupied voxels to a point cloud using voxel centers. |
ValueTuple<Vector<T>, Vector<T>> ComputeBounds() |
Computes the axis-aligned bounds of the grid in world coordinates. |
Vector<T> GetVoxelCenter(int x, int y, int z) |
Gets the world-space center of a voxel at the given indices. |