ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Constructor OccupancyGrid

    | Edit this page View Source

    OccupancyGrid(Vector3, BBox)

    Initializes an occupancy grid covering the specified bounds.

    Declaration
    public OccupancyGrid(Vector3 voxelSize, BBox bounds)
    Parameters
    Type Name Description
    Vector3 voxelSize

    voxel size (must be positive in all dimensions)

    BBox bounds

    world-space axis-aligned bounding box

    Exceptions
    Type Condition
    ArgumentException

    Thrown if voxel size is not positive or if grid dimensions are invalid.

    | Edit this page View Source

    OccupancyGrid(Vector3, BBox, int)

    Initializes an occupancy grid covering the specified bounds, with padding.

    Declaration
    public OccupancyGrid(Vector3 voxelSize, BBox bounds, int paddingVoxels)
    Parameters
    Type Name Description
    Vector3 voxelSize

    voxel size (must be positive in all dimensions)

    BBox bounds

    world-space axis-aligned bounding box

    int paddingVoxels

    number of empty voxels to pad around the bounds

    | Edit this page View Source

    OccupancyGrid(GridMeta, Occupancy[])

    Initializes an occupancy grid from an existing flat array.

    Declaration
    public OccupancyGrid(GridMeta meta, Occupancy[] occupancies)
    Parameters
    Type Name Description
    GridMeta meta

    grid metadata (voxel size must be positive)

    Occupancy[] occupancies

    flat array of occupancies (length must be NxNyNz)

    Exceptions
    Type Condition
    ArgumentException

    if occupancies length does not match grid size

    | Edit this page View Source

    OccupancyGrid(GridMeta)

    Initializes an empty occupancy grid with given metadata.

    Declaration
    public OccupancyGrid(GridMeta meta)
    Parameters
    Type Name Description
    GridMeta meta

    Grid metadata (voxel size must be positive)

    Exceptions
    Type Condition
    ArgumentException

    Thrown if voxel size is not positive or if grid dimensions are invalid.

    | Edit this page View Source

    OccupancyGrid(Occupancy[], Vector3[], GridMeta)

    Initializes an occupancy grid from parallel occupancy and position arrays.

    Declaration
    public OccupancyGrid(Occupancy[] occupancies, Vector3[] positions, GridMeta meta)
    Parameters
    Type Name Description
    Occupancy[] occupancies

    occupancy values

    Vector3[] positions

    world-space positions corresponding to each occupancy

    GridMeta meta

    Grid metadata defining the voxel size and bounds

    Exceptions
    Type Condition
    ArgumentNullException

    occurs when occupancies or positions is null.

    ArgumentException

    occurs when input arrays have different lengths, or if grid dimensions are invalid, or if voxel size is not positive, or if any position is outside the provided grid bounds.

    OutOfMemoryException

    occurs when the grid size exceeds available memory.

    ArgumentOutOfRangeException

    occurs when any position is outside the provided grid bounds.