Grasshopper

algorithmic modeling for Rhino

Hello all (first post ever!), I'm completely stuck trying to recursively add the elements of several lists.  I'll try to be super effective at explaining what I mean:

- I want each element of a list to be the sum of itself and the elements before it. ie (1,2,3,4) becomes (1,3,6,10)

 

-I need to do this for several lists of arbitrary length ie (1,2,3) (2,3,4,5) becomes (1,3,6) (2,5,9,14)

Doing ONE list is easy by making a series of series of indeces (0) (0,1) (0,1,2) etc

However, when I try to create the a "series of series" for SEVERAL lists, the whole thing breaks down, and I believe it has to do with the branch structure.  Maybe there's something crucial I'm not grasping about datatrees?

The image shows where the whole thing goes wrong (and how the datatrees are not matched up as they should be)  The definition is also there to play with.

Thanks!

Views: 807

Attachments:

Replies to This Discussion

mass additions partial results.

Ok, that's really useful, thanks!  

Hi Jaime,

Use the "Mass addition" component.

To bad NING doesn't inform you someone else has already posted as your posting ;)

Agree on that :)
Seen that feature on some other forums: "New post has been added since you entered this topic. Do you still want to submit your reply?". Yes-submits the reply, No-refreshes the page.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service