Grasshopper

algorithmic modeling for Rhino

Hi everyone! I am working on a definition in which I want to combine different points over curves in order to make a polygon tessellation. Basically, this is what I am doing:

 

1 - I have a set of curves (13 in the attached file)

2 - I shift the curve list, in order to be able to use points from one curve and the curve above simultaneously.

3 - I divide those curves on multiple points (50 points each in the attached file)

4 - This is where it gets messy: I want to access the points as follows:

  • Pick the items 1 and 2, then the items 3 and 4, and like that with all the points.
  • I've generated a series with a {0;0}(n) structure. The first branch goes from 0 to 13 (the number of curves) and the second tree goes from 0 to 25 (half the point quantity) and n = 2. 
  • I've the curves in a {a} structure, where "a" goes from 0 to 13. 
  • So, what I finally have is an item component, where the curves are provided as list set, and the series as the item input. So, for each curve, I have 25 pairs of item index (0,1;2,3;4,5;etc.).
  • I thought that the out would be all the points of the curve sorted in pairs, but I get just two points per curve, and also a lot of points in the last curve. I have tried with tree branch and tree item and I keep getting no results. Moreover, I think that item component has the ability to pick specific items in tree-structured lists, so I don't know what is happening.

 

I have attached a screenshot and the GH definition. In order to work, you must create a circle in rhino viewport and then reference it in GH.

I've been stucked with this for several days, so any help will be appreciated.

 

Thanks in advance.

Views: 770

Attachments:

Replies to This Discussion

This is a Longest List Data Matching issue.

Your two lists match like this:

List A --> List B

{0} (N = 50) --> {0;0} (N=2)

{1} (N = 50) --> {0;1} (N=2)

{2} (N = 50) --> {0;2} (N=2)

...

{13} (N = 50) --> {0;13} (N=2)

{13} (N = 50) --> {1;0} (N=2)

{13} (N = 50) --> {1;1} (N=2)

{13} (N = 50) --> {1;2} (N=2)

...

{13} (N = 50) --> {13;23} (N=2)

{13} (N = 50) --> {13;24} (N=2)

 

I'll Have a look at what would be a better approach.

Danny, thanks a lot for your answer. Now that you mention, that seems to be the cause. However, I would expect item component (or some GH component) to work like this:

 

LIST A -- > LIST B

{0}(N=50) --> {0;0}(N=2)

                     {0;1}(N=2)

                     {0;2}(N=2)

....

{1}(N=50) --> {1;0}(N=2)

                     {1;1}(N=2)

                     {1;2}(N=2)

...

{13}(N=50) --> {13;24}(N=2)

 

Which component - if not item - might work like that?

 

Afraid it doesn't work like that. Data Matching is a big enough head ache as it is. You would need to generate List a to be a duplicate of the first set of points 25 times followed by the next set 25 times etc. etc.

eg

{0} --> {0;0}

{0} --> {0;1}

{0} --> {0;2}

...

{0} --> {0;24}

{1} --> {1;0}

{1} --> {1;1}

...

{13} --> {13;23}

{13} --> {13;24}

Danny, that is a good idea. Also, I thought about applying the "{a;b}(i)-->{b;i\2}" path mapping to the point list instead of to the series list. I'll try both solutions to see which works the best.

 

Thanks for your help.

Regards.

 

Here's the best way to achieve your results.

For some reason its best to flatten the list of domains

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