DocsNodesValues

Quantise

Snaps a value onto a grid of whole steps, in its own units.

snap, step, round to, grid, course, align, increment
Category
Values
Outputs
value
Runs live in
Godot, Roblox

Give a building a course height and every floor lands on a course, rather than wherever the division happened to leave it. Give a shelf a step and it sits at a whole number of steps up.

Nearest is what alignment usually wants. Down answers how many whole steps fit below this, which is a floor level. Up clears at least this much, which is a lintel over a door. Offset lets the grid start somewhere other than zero, so a course grid can begin at a plinth.

Inputs

SocketTypeWiring
fieldValuefield, optional
fieldStepfield, optional

Parameters

NameTypeDefaultAvailable whenWhat it does
inputValuenumber0always
Stepnumber1always
Modenearest | down | upnearestalways
Offsetnumber0always

Built with this node

Nothing in the manual is built around this node yet.

See also

  • mapRangeFor spreading a value across a different range, rather than snapping it.
  • measureTo derive the step from real geometry instead of typing it.

Open the editor and try it