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

Search Results for

    Edit this page

    Method GetVoxelBounds

    | Edit this page View Source

    GetVoxelBounds(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>, Span<BBox>)

    Gets axis-aligned bounding boxes for a set of voxels.

    Declaration
    public static void GetVoxelBounds(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes, Span<BBox> outBoxes)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    ReadOnlySpan<Vector3> voxelSizes

    Per-voxel sizes; must match origins length.

    Span<BBox> outBoxes

    Pre-allocated output span to write bounding boxes into; must match origins length.

    Remarks

    This variant avoids allocations by writing into a pre-allocated output Span<T>.

    Exceptions
    Type Condition
    ArgumentException

    voxelSizes length must match voxels length.

    | Edit this page View Source

    GetVoxelBounds(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>)

    Gets axis-aligned bounding boxes for a set of voxels.

    Declaration
    public static BBox[] GetVoxelBounds(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    ReadOnlySpan<Vector3> voxelSizes

    Per-voxel sizes; must match origins length.

    Returns
    Type Description
    BBox[]

    Array of bounding boxes, one per input voxel.

    Remarks

    This variant allocates a new array for the output bounding boxes.

    Exceptions
    Type Condition
    ArgumentException

    voxelSizes length must match voxels length.

    | Edit this page View Source

    GetVoxelBounds(ReadOnlySpan<Vector3>, Vector3, Span<BBox>)

    Gets axis-aligned bounding boxes for a set of voxels (all voxels share the same voxelSize).

    Declaration
    public static void GetVoxelBounds(ReadOnlySpan<Vector3> origins, Vector3 voxelSize, Span<BBox> outBoxes)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    Vector3 voxelSize

    Per-voxel sizes

    Span<BBox> outBoxes

    Pre-allocated output span to write bounding boxes into; must match origins length.

    Remarks

    This variant avoids allocations by writing into a pre-allocated output Span<T>.

    Exceptions
    Type Condition
    ArgumentException

    Output span is too small to hold all bounding boxes.

    | Edit this page View Source

    GetVoxelBounds(ReadOnlySpan<Vector3>, Vector3)

    Gets axis-aligned bounding boxes for a set of voxels (all voxels share the same voxelSize).

    Declaration
    public static BBox[] GetVoxelBounds(ReadOnlySpan<Vector3> origins, Vector3 voxelSize)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    Vector3 voxelSize

    Per-voxel sizes

    Returns
    Type Description
    BBox[]

    Array of bounding boxes, one per input voxel.

    Remarks

    This variant allocates a new array for the output bounding boxes.