Grasshopper

algorithmic modeling for Rhino

I am a mathematician, raised on the list handling in Mathematica, and am working on getting my head round the list model of grasshopper. This has a lot to recommend it, especially simplicity; however there are some things that I feel should be easy, but I where I cannot find an elegant solution. I have attached an illustrative example, what am I missing?

The idea is that I have a list of lists and want to cull each, but want a sequence of cull patterns for the lists. Say the cull pattern for the first list is {1,0,1}, for the second is {1,0} and for the third {1,0,0} before the three lists repeat, so the fourth list is also culled by {1,0,1} and so on.

 

[Could not get the forum to upload the file, so its here: List_Questions.ghx]

 

[Edit: When I say that the lists are reversed I was thinking about the order of indices, rather than the elements. Apologies for the confusion.]

 

Views: 1499

Replies to This Discussion

I am trying to upload the actual file, but I get errors every time I try.

Here's some comments in the GHX

 

Attachments:

Thanks for the comments, especially the work around, I had missed that trick with the path mapper. Also apologies for the bad use of language with "reverse", I was thinking about the order of indices.

 

In the final section, apologies, I think my question was unclear. I was not asking what the path mapping component was doing. I was wondering why the repeat list component was matching branch {1;0} in one input to branch {0;1} in the other input.

 

 

Grasshopper will try and match the order of the list not necessarily the Paths. {0;0} first in list A, {0;1} second in list A. {0;0} first in list B, {1;0} second in list B.

I suppose its that way so that you can supply lists with vastly different structures. {A} in one and {A;B;C;D} in the other.

OK, so the rule is?

 

Compatible tree structures: map equivalent branches.

Incompatible Tree structures: forget structure and just count elements.

 

Is there any way to think about lists within the tree at different levels? In other words take a task like 2d culling that needs to operate on lists of lists and turn it into a compenent that will work for anything that you send at it (which would be lists of lists of lists).

A List of [Lists of Lists] is the output of the Param Viewer component. You can manipulate this with cull patterns, dispatches and Nths etc. like any other list. and put the results back into a Tree Branch component to select only those branches.

 Is this what you mean or have I missed the point?

I am certainly learning a lot with this! Thanks for helping out.

 

I hadn't played with accessing the addresses directly like that. It could be powerful. Unfortunately the output is simply a list of addresses, loosing all the structure above that.

 

Let me try to explain what I might want.

 

I have a list of curves. I can put these into a divide operation and get a list of list of paths. The divide operation works on each individual curves. Now, however I have a list of lists. I want to be able to apply an operation not to the individual points but to the individual lists. I might want to do a reverse for example but operating on the list of lists and not the lists themselves. This particular operation could be done with the path mapper:

 

{B}(i) -> {pathcount - B}(i)

 

In grasshopper, however, you usually want to be able to work with several things at once. If I now have two separate collections of lists of points (for example I started with two surfaces, and divided both) and I wanted to reverse both lists my original component would not do what I expect as "pathcount" is a global property of the whole tree.

 

In other words, can I choose to make the atoms I am working on subtrees of a structure rather than the tips of the branches?

 

Hi Edmund,

 

My personal preference would be to try and change the geometry further up the chain before it got so convoluted eg flipping the direction of a curve before dividing etc.

 

But if I had to try and manipulate these scenarios I would probably use Tree Split to isolate the section of Data Paths to manipulate and the then Tree Branch to re-order the tree in the new order. After that if you needed the Path Structure to look similar to before you could use the Replace Branches Component.

 

Attachments:

Dear Danny

 

Thanks for your help with this. I agree that there are work arounds, and you have been very helpful with showing me what they might be. I do feel however that there are more elegant ways to deal with some of this. I believe my next task is to come up with them and implement them in C#!

 

Edmund

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service