Grasshopper

algorithmic modeling for Rhino

Hi, I have a list of data composed of sub-lists of data. I want to shift the first data of each sublist to the end of the sublist. Like shown in the diagram below.

 

I think I somehow can use the SHIFT component, but I am not sure how to decompose the list first and compose them at the end.

 

Views: 1362

Replies to This Discussion

Hmmm... haven't got any reply to this question. Is it too easy to answer or too hard to answer? I have attached the file where I want to resolve this problem. It's a triangulated diagrid. All are working now except one diagrid. I think if I can find answer to the above data shift issue, I can make it work.

Attachments:

Hi Darren,

You could maybe extract sublists from your main list, and then use a Shift List component with Wrap input = 1, and then merge your datas to rebuild the complete List

I know that. But my list has (i+1)*J elements, and I need to extract J sublists, each of which is i+1 long. Both i and J are variables. How do I do that?

Is it you who sets these values ? (With a slider for exemple)

If it is, you can extract your sublists using domains created by series, like done here : http://www.grasshopper3d.com/forum/topics/list-division

Rhydro, this is exactly what I was asking for. Now it's working. thnx!!

You're welcome :)

As I found in your file, your data tree is not like what you said in the picture above. Each of your date tree branch only has one Index that you can't shift them like semetaneously by different floor levels. What I did to you is Divide your flated data tree into 5 levels (each one has 7 points) and connect with polyline. That's it, you don't have to shift and line it.

PS. good try by using "mapping tree"

Attachments:

man, why you parse your data manually one by one? if I change the size of the data set, you have to go back to the code and mannually match the new size? I don't think this is working, unless I understood your code wrong.

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