Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

core.raster.new (procNode)

Open a rect of ground as a Raster: a grid of cells, cut into tiles of 256 cells a side that each store a ring of 8 neighbour cells (stride 272), with named layers of one number per cell, all zero. The tiles store more than the rect: the cells of a border tile past the rect and the ring around the tiles are stored like the rest, and a write reaches them.

The Raster is a Record. Layout members: cellsX, cellsZ, resolution, min, size, origin (Vec3, the y lane 0), the same as numbers minX, minZ, sizeX, sizeZ, originX, originZ, core (256), apron (8), stride (272), tilesX, tilesZ, tiles (also tileCount), heldX and heldZ (the cells the tiles hold across and down: the tiles' cores, tilesX * core by tilesZ * core, and the ring of apron cells around them), layerNames (the list of layer names) and layers, a Geometry whose point class holds the stored cells of every tile, one column per layer. The grid kernel and core.raster.cells read that layout.

Inputs

  • origin (Vec2). Default { x = 0, z = 0 }. The world centre of the rect, in metres.
  • size (Vec2). The extent of the rect along x and z, in metres, as { x, z }.
  • resolution (Float). Metres per cell.
  • layers (List<String>). Default {}. The layers the raster opens with; none when left out.

Outputs

  • raster: the Raster.

Example

local raster = g.core.raster.new({ size = { x = 8, z = 8 }, resolution = 1, layers = { "height" } })

An 8 by 8 metre rect at one metre per cell: 64 cells, held in one tile, with a height layer at zero.