Grasshopper

algorithmic modeling for Rhino

how to subtract each item in a list from the following one?

I have a list of values, and I want to get the list of "intervals" between the values.

I can do this with the "brute force and awkwardness" method -- shift the list by one, drop the last value from the original list, then feed those lists into a subtract component -- but I have a nagging feeling there's a more compact and elegant way.

Is there?

Views: 2135

Replies to This Discussion

Here is a non scripted way, not sure if its the best.

Alternatively, there is a Grasshopper component called "Relative Differences" (screenshot below) that you can use.

There's also Consecutive Domains:

--

David Rutten

david@mcneel.com

Dang! I suspected that there should be a domain component that can do this, but I was too lazy to check..

Hehe...

Nice, I knew it existed but could not remember the name and the icon just did not click for me. It's not as obvious as the mass addition icon. 

Thanks everyone! It's always nice to have options.

The icon actually shows what happens when you input points instead of numbers. You then get all the vectors along which you have to move a point in order to 'touch' all the original points.

--

David Rutten

david@mcneel.com

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service