Grasshopper

algorithmic modeling for Rhino

Dear users,

Summary:

I would like some help in a data tree related problem. It involves trying to retrieve specific items from multiple lists where the index for retrieval also contains lists belonging to multiple paths. 

Problem:

I have a line that is divided into segments. For a single line, each item in a list is a segment. If i have multiple lines, then each path represents a line and the list contains the segments. My problem is with a data tree containing multiple lines with segments.

Separate to this, I have an independent list of integers which represent the indices of the segments I want to retrieve. This list of index items are also structured in multiple paths and the list length is not always constant for each path.

My objective is to reorder the data, therefore I want to retrieve specific items from the list of line segments of multiple lists. 

What I do know:

With just a single line, the data tree for the line segments are all in one list. Using the component "list item" I am successfully able to retrieve the items based on the index data tree from the base list.

Attempts made:

I have used the "path mapper" component to try modify the data trees so that the list of indexes operate for each base list for each (multiple) paths. 

How do I feed in multiple lists?

How do I get compatible data trees?

Over to you:

I appreciate any help and insight in understanding how to solve the problem. I have attached the grasshopper file. I have also tried to capture a useful snapshot of the problem.

Thanks, Daniel

Views: 2834

Attachments:

Replies to This Discussion

Like this? I'm not sure...

Attachments:

Thanks for the response. Unfortunately that is not what I require. 

I have set up the problem so that the index list for retrieval selects each segment in a line at least once. So where your "pipe" component shows intermittent line segments, I require all segments for each line. 

The list item works correctly when there is just a one base list, but not when there are multiple paths of list.

Any other help appreciated. 

How about this?

Attachments:

Thanks again. You have solved the problem I am having.

I have also found a solution and it is similar. It is based on the necessity to flatten the data coming into the "list item" component. Where you have flattened the base list, I have succeeded in by flattening the index. However this approach required more manipulation than yours.

I have attached file for alternative solution, however I prefer yours.

For the benefit of learning I am happy to see further approaches.

Thanks.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service