Grasshopper

algorithmic modeling for Rhino

Hi All,

I'm trying to sort a list of points into a specific pattern.
The points appear in this order: a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p, etc, etc
I'd like to have the put into groups like so: abcd, cdef, efgh, ghij, ijkl, etc, etc
I think sorting the list into groups: abcd, efgh, jklm, nopq, etc... would be rather easy but I'm not sure how to do this with the more complex pattern. Perhaps I could make two lists from the information and then merge them together?
Any advice would be appreciated.
Thanks!

Views: 1642

Replies to This Discussion

It's not really sorting, you're not changing the order of the points within the list if I understand correctly.

I think what you want is to use the Series component to generate a sequence of numbers (0, 2, 4, 6, ...). You then use those numbers to extract sublists from your big lists of points, each sublist being 4 items long.

I'm not sure I'm following. I am trying to change the order of the points in a list. The number of groups I want is dependent on the amount of initial points. each group is 4 points. The first is "abcd" and the last would be the last 4 points in the list. Therefore I don't think I want to manually make a group or sublist each time, rather I just want my original list to be reordered into a new single list of numbers.

I'll look into your idea though. Thanks for the response

Attachments:

fantastic! Thank you!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service