Grasshopper

algorithmic modeling for Rhino

Hi all!

What would be the simplest form to merge several lists (of different lengths) into one tree where each input list has its own branch?

Thanks a lot!

Views: 6504

Replies to This Discussion

If you can always guarantee the order of the lists (longest first) it's very easy. You can achieve it with two components Merge (Inputs Grafted) and Flip Matrix. But if the Inputs will always vary in length with no control over the order then you need to have a system that pads out the shorter lists to the same length as the longest and then after the graft/merge/flip you shift them back to the original length.

here's one way:

EDIT:

BTW you can also use a flatten component to set the Path of each list. eg. P = {1} 

Attachments:

Probably not the simplest though.

to danny:

interesting way of forcing it to use flip matrix (which would work easily if the liste lenghts were equal)

to chris:

although i hope not, this probably is the easiest way around

here is one way i thought of in the meantime:

maybe David would make a component that would do this (or maybe it could be an option on the merge component). seems like something you run across fairly often

thanks for your inputs!

(if anyone has a better idea, please do share!)

here's another quick way IF you are using geometry

How about the string tools. join and split.

very interesting workaround!

AND NOW WE HAVE ENTWINE... :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service