applyTerrainStroke
applyTerrainStroke(
grid,stroke):TerrainChange
Runs one stroke’s tool over the grid, dab by dab, and returns the
points it touched with their offsets before and after. Sculpt raises,
or lowers with lower; Smooth moves each point toward the average of
its four neighbours; Flatten moves each toward level, or the height
under the stroke’s first point. Every tool writes an offset over the
base.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
grid |
HeightGrid |
stroke |
{ clear: boolean; erase: boolean; families?: ScatterFamily[]; level?: number; lower: boolean; material?: string; multiplier?: number; points: [number, number][]; radius: number; shape: "circle" | "square"; strength: number; tool: "paint" | "smooth" | "scatter" | "sculpt" | "flatten"; } |
stroke.clear |
boolean |
stroke.erase |
boolean |
stroke.families? |
ScatterFamily[] |
stroke.level? |
number |
stroke.lower |
boolean |
stroke.material? |
string |
stroke.multiplier? |
number |
stroke.points |
[number, number][] |
stroke.radius |
number |
stroke.shape |
"circle" | "square" |
stroke.strength |
number |
stroke.tool |
"paint" | "smooth" | "scatter" | "sculpt" | "flatten" |
Returns
Section titled “Returns”TerrainChange