Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

grid.sample (procNode)

A grid's channel read at every point of a geometry, blended trilinearly between the eight cell centres around each point; a point past the outermost centres reads the edge. It is the grid kernel in sample mode: u = clamp((p - min) / cell - 0.5, 0, n - 1) and a blend of the eight cells around it, over the grid as one tile with no apron. A channel of several lanes (a Vec3) is read lane by lane.

Built from: op.device.kernel (grid), core.points.

Inputs

  • geometry (Geometry). Whose points read. A copy comes out with the values under as.
  • grid (Grid). The grid whose channel is read.
  • name (String, default ""). The grid channel read: a point attribute of the grid.
  • as (String, optional). The point column the values are written to: name when left out.

Outputs

  • geometry (Geometry). The input carrying the sampled values.
local air = g.grid.box({ size = vector.create(4, 4, 4), cells = vector.create(8, 8, 8) })
air.point.heat = air.point.P.y
local probes = g.grid.sample({ geometry = g.points.grid({ countX = 4, countZ = 4 }), grid = air, name = "heat" })