Why does range take number of gaps rather than number of output values?

I’ve had the best time learning Grasshopper over the past three years, and almost without exception when there is something that seems crazy (like trees an grafting), after a little while I understand the system better and it all makes perfect sense.

But… Range? Literally every time I use the Range component I add an “x-1” expression because my input is how many values I want out, not how many “steps” after the initial value.

This is what essentially every use of Range looks like for me:

Am I using Range wrong? Is there some historical reason it works this way?

Super minor quibble but every time I add “x-1” I think I should ask. So…?

EDIT: hopefully less confusing wording

EDIT2: added example

Perhaps it is to be consistent with dividing curves, divide a curve into 8 segments you get 9 points. Not sure though. You can always “Create user object” on a range component with the x-1 expression in place to save yourself having to enter it every time.

Hi Brooks,
an Interval (mathematics), also called range , a set of real numbers that includes all numbers between any two numbers in the set.
So if you pass in the value 4, this will give you 5 numbers as “limits”. If you want to use the range component to get the limits matching your input “steps” then you will always have to add the “x-1” expression.
You can also read the following thread explaining the difference between the series and range component: range and steps.

you can do this once, then save it as a “user object”… then use your user object instead of the default component from then on.

1 Like