Grasshopper

algorithmic modeling for Rhino

How to divide a list of data into list with equal number of datas

Hi Everyone,

here is the Problem:
I have a 3D space filled with random points (amount variable; divisible by 5).
Now I would like to use all the points to create interpolated curves using each 5 points.

How do I divide the whole list of points into sub lists, with each 5 randomly picked points?
_______
sorry, I´m kind of new to Grasshopper, so it might also be useful to get a hint on other research sources. Thanks a lot!

Flo

Views: 3026

Replies are closed for this discussion.

Replies to This Discussion

Sorry I haven't got enough time to go into more detail at the moment but to get you started have a look at this discussion thread http://www.grasshopper3d.com/forum/topics/simplify-this?commentId=2... which has some examples of dividing lists up using the path mapper. To get the randomness you could send the list through the jitter component.
Now I have the time I can elaborate. The Jitter component will randomize your list and you can control the amount by the J input the value 1 will give you a complete shuffle. Then the Path Mapper will allow you to split the lists by dividing by you intended value.

I use two different operators in the Path Mapper Component when splitting lists. Integer or Backslash Divide '\' gives you the desired number in each list where as the Modulo Operator '%' gives you the desired number of lists. In your case you want to have the first 5 items in branch 0 a next 5 in branch 1 etc. I would use '\' for this eg. {A;B;C}(i) --> {i\5} where A,B,C are place holders and i is the Number in the list. See below for example:


If you wanted to have 5 lists with the first of five going in the first branch and the second going in the second branch etc. I would have used % instead as seen in the previous thread

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service