Terrain node

hf_from_mesh

Rasterise a polygon mesh (input 0) into a heightfield by projecting it straight down Y: e.g. convert a sculpted/imported terrain mesh, or stamp rocks/buildings into a terrain. With input 1 the mesh is written into that heightfield's grid; otherwise a new grid around the mesh is made. Writes 'height' and a 'mesh_mask' layer (1 where covered). Other geometry of input 0 is dropped (output is the heightfield, plus input-1 geometry).

Inputs

Parameters 5

cell_sizefloat
Default 2Range 0.001 to …

Cell size when no heightfield is given on input 1 (grid covers the mesh bounding box).

paddingfloat
Default 0Range 0 to …

Extra border around the mesh bounds (world units).

modemenu
Default maxOptions max min

Which surface to take where the mesh overlaps itself: max = top surface (typical), min = underside.

combinemenu
Default replaceOptions replace max min

With input 1: replace = covered cells take the mesh height, max/min = combine with existing terrain.

backgroundfloat
Default 0

Height of cells not covered by the mesh (when creating a new grid).

Use it

Add it from the node menu (right-click empty graph space or Tab, then type hf_from_mesh), ask the AI for it by name, or add it with a graph op from the API or MCP:

{"op":"add","type":"hf_from_mesh","name":"my_hf_from_mesh","params":{},"inputs":["src"]}

Any parameter can also be an expression such as "=sin(F*0.1)". See Parameters & expressions.