Grasshopper

algorithmic modeling for Rhino

Hi everyone!

 

I'm having problems shifting a list of points in order to make a line between each point. I've done it before on another function but for some strange reason, it doesn't work in this function here:

 

 

Trying to get the line in between each point!

 

 

I attached my function below. Would be great if someone could have a look at it and tell me what's going wrong!

 

Thanks in advance!

Views: 1077

Attachments:

Replies to This Discussion

Hi,

There s a problem with the point list you get from Eval Component, if you check it with paramter viewer yo u can see that each point is in one separate path (list) meaning that you can't shift a list with just one element. Faltten that list and it will work. And if you dont want to loose path information, just flatten the shift input. and later graft the output.
Attachments:
Thanks a lot for the help!

One quick question, how did you flatten the shift component? Just wondering 'cause the ghx file you gave did not have the flatten component.
By right click on the input of the component you can set it to "flatten" what does the same than the Flatten component.

:)
Ah yes! Now I remember!

Thanks again.
Hi Ra,

You need to use the tree branch component for this to work. What you are essentially doing with this method is shifting the paths on one and then using it to select the data. I suggest you switch on fancy wires which will allow you to see when you are dealing with data trees more easily. View>Draw Fancy Wires

rachel_lok_week10_pav_2.ghx
Good point Danny, but there is really a big difference on the result by shifting the paths or shifting just the points?

thanks
Hi Pep, that's why the paths are then used in the new order to select the tree branches that hold the required points. Effectively achieving the same result as shifting a flattened list but with out disturbing the data.
Thanks a lot, Danny!

Both work either way! But what are paths? I apologize for being vague!
I'll try my best to explain. Grasshopper now uses a Data Tree Structure to store items at different levels to allow multiple sets of data to be accessed by components. The Paths are the location of data.

Take the following example.
I have two curves referenced with a Crv Param this creates a single path with 2 items {0}(N=2).
If I divide these Curves by 10 segments I end up with 2 Paths of 11 points each {0;0}(N=11) and {0;1}(N=11)
If I want each point to be handled separately I can Graft a branch to hold each point. So I get 22 Paths looking like {0;0;0}(N=1), {0;0;1}(N=1).....{0;1;10}(N=1).

Each path is therefore the address of a particular item or items of interest.

The Param Viewer can be found Params>Special>Param Viewer and can be viewed either as a list of Paths or graphically by a double click.

Also note that the Fancy Wires display the structure of a stream of data. Single wire = Single Data Item, Double Wire = Multiple Data on single Path and Double Dashed Wire = Multiple/Single Data on Multiple Paths
That was really helpful!

The fancy wires are a little distracting but they're growing on me :)

Can't thank you enough for the help!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service