Class OccupancyGrid
A 3D spatial grid representing discrete voxel states (Outside, Inside, Boundary).
Inherited Members
Namespace: ZLab.Discrete.Grids
Assembly: ZLab.Discrete.dll
Syntax
public sealed class OccupancyGrid : GridBase, IGrid<Occupancy>, IGridMeta
Constructors
| Name | Description |
|---|---|
| OccupancyGrid(Vector3, BBox) | Initializes an occupancy grid covering the specified bounds. |
| OccupancyGrid(Vector3, BBox, int) | Initializes an occupancy grid covering the specified bounds, with padding. |
| OccupancyGrid(GridMeta) | Initializes an empty occupancy grid with given metadata. |
| OccupancyGrid(GridMeta, Occupancy[]) | Initializes an occupancy grid from an existing flat array. |
| OccupancyGrid(Occupancy[], Vector3[], GridMeta) | Initializes an occupancy grid from parallel occupancy and position arrays. |
Methods
| Name | Description |
|---|---|
| Clone() | Deep clone of this grid. |
| CountState() | Count total number of voxels in the grid. |
| CountState(Occupancy) | Count voxels in a given Occupancy state. |
| Fill(Occupancy) | Fill the entire grid with a given occupancy value. |
| FromBinary1Bit(ReadOnlySpan<ulong>, GridMeta) | Create an occupancy grid from a packed ternary mask (2 bits per voxel). |
| FromTernary2Bit(ReadOnlySpan<ulong>, GridMeta) | Create an occupancy grid from a packed ternary mask (2 bits per voxel). |
| GetArrayUnsafe() | Get internal occupancy array. |
| GetBuffer() | Get a writable span over the internal occupancy buffer. |
| GetMaskBinary(bool, bool) | Export occupancy as a binary mask. |
| GetMaskTernary(bool) | Export occupancy as a ternary mask. |
| GetMaskTernary(Span<byte>, bool) | Export occupancy as a ternary mask into a provided span. |
| GetReadOnlyBuffer() | Get a read-only span over the internal occupancy buffer. |
| GetReadOnlyMemory() | Get a read-only memory over the internal occupancy buffer. |
| GetValue((int x, int y, int z)) | Get occupancy value at given grid index. |
| PackBinary1Bit(bool, bool) | Export occupancy as a packed binary mask (1 bit per voxel). |
| PackTernary2Bit(bool) | Export occupancy as a packed ternary mask (2 bits per voxel). |
| SetValue(ReadOnlySpan<Occupancy>) | Set occupancy values from an existing flat array (row-major order). |
| SetValue((int x, int y, int z), Occupancy) | Set occupancy value at given grid index. |
| ToString() | String representation of the grid. |
| TransformWorld(Vector3) | Translates the grid by a world-space vector. Internally shifts content by the nearest integer voxel offset. |
| TransformWorld(Vector3, Vector3) | Translates the grid so that |