We need your help! 🔥
Please consider disabling your ad-blocker to support this website! 🔑
We are a free, community-supported website! 🥰
We only display small unobtrusive ads which help us stay online! 💯
Thank you in advance! ❤️
Color
Curve
Domain
List
Mesh
Number
Plane
Point
SubD
Surface
Transform
Twisted Box
Vector

Round To Nearest

Round numbers in x to the nearest numbers in y with the option of remapping number set x to the domain bounds of number set y.

Inputs

NameIDDescriptionType
Numbers XxSet of numbers to roundNumber
Numbers YySet of numbers to round nearest to (best to not have duplicate y values)Number
Remap xRRemap number set x to the domain bounds of number set yBoolean

Outputs

NameIDDescriptionType
NearestNResulting numbers in y nearest to each number in x (if Remap(R) is set to true then numbers in y nearest to each remapped number x)Number
IndexiIndex of number in y nearest to each number in x (if Remap(R) is set to true then index of number in y nearest to each remapped number in x)Integer
DifferenceDThe difference between the resulting nearest number set and the input number set xNumber
Remapped xxRRemapped number set x to the domain bounds of number set y if Remap(R) is true. Same number as number set x if Remap(R) is falseNumber

Video Tutorials

Site design © Robin Rodricks.   Pufferfish and associated data © 2024 Michael Pryor.  
Rhinoceros and Grasshopper are registered trademarks of Robert McNeel & Associates.  Hosted by GitHub

Report an Issue  |  Terms of Service