Import std.collections.grid
Grid3
class
Public Class Grid3<T> Implements Iterable<T>, Cloneable
A box of cells, Width by Height by Depth, each a T, indexed as grid[x, y, z].
Examples
Local voxels = Grid3<Bool>(4, 4, 4, False)
voxels[1, 2, 3] = True
Expect(voxels[1, 2, 3] && !voxels[0, 0, 0])
Expect(voxels.Neighbors6(0, 0, 0).Count == 3)std/collections/grid.fb, line 173
-
A Grid3
widthcells across,heightdown, anddepthdeep, each holdingfill. A negative size panics, and so does one with more cells than an Int counts. -
How many cells wide it is.
-
How many cells high it is.
-
How many cells deep it is.
-
How many cells it has, Width times Height times Depth.
-
Whether (
x,y,z) is one of the Grid3's cells. -
The value at (
x,y,z). One outside the Grid3 panics. -
Sets the value at (
x,y,z) tovalue. One outside the Grid3 panics. -
The positions that share a face with (
x,y,z) and are in the Grid3: the layer before, then above, left, right, and below, then the layer after. -
The positions around (
x,y,z) that are in the Grid3, its edges and corners too, layer by layer and row by row. -
Gives every cell the
value. -
The values, layer by layer and row by row, in a new array.
-
A new Grid3 with the same size and values.
-
The values, layer by layer and row by row.
Report an issue with this page or with FutureBlitz on GitHub.