Grasshopper

algorithmic modeling for Rhino

Hi All,

Just working on trying to get a lits of data into specific tree branches (i.e. 128 branches with 30 items each)...right now my list is without any structure.

Is there anyway of using a split list (to every n'th number that I can assign?), or am I limited to building lists through series/range and using a list item type system to call-out data.

Any help would be greatly appreciated.

M.

Views: 9921

Replies to This Discussion

What Matthew and I are trying to do overall is split a large list every 30 items create a branch in a tree for every 30 items but the count of 30 is not a constant, it can adjusted parametrically. And suggestions would be apprciated.

Please RSVP.

Thank you

Greg
Guys,

With the new Replace Branches component you can achieve what you're trying to do.


-taz

pathSplit.jpg
Taz

Looks like that should do what we need it too

Thanks very much

Greg
Hi Taz,
did the older 'Replace Branches' example really work (august 2009 - pathSplit file), I seem to have an error and can't figure out where the mistake is. Can you please take a look?
Thanx.
Attachments:
Depending on what you are trying to do [Path Mapper] may be easier.

Check out this discussion:

http://www.grasshopper3d.com/forum/topics/subdivide-down-paths-with...
Hi Taz,

Everything is working perfectly...thank you very much again for your advice and efforts.

M.
could someone take a moment to explain what the function syntax "{"&x&"}" does? I seem to be aware that it somehow repackages the data from, say, 0.0 to the form of {0}, but why, precisely, the function syntax does that is beyond me!

Also, isn't the output generated by the Duplicate Data object a one-path tree, despite the fact of its wire showing the stream as "list"? That is what I see when I plug a param viewer into it.

thanks,

bwp
quick response:

"{"&x&"}" is just a string (text).

& = and (connection)
x = variable input, in this case is series of numbers

so its mean numbers between { } like this:
{0}, {1}, {2}, {etc...}
the function just output numbers in the necessary syntax for the replace component.

in the image, there is a duplicate component so i think that the output function is:
{0} five times, {1} five times, {2} five times, {etc...}

The S input in the replace component its a series of integers (i think 0 to 35 in the image, 36 elements = the length of the list):
0, 1, 2, 3, 4, 5, ..., 35

Also R input its exactly 36 elements.

The replace component re-order the branches like this:
take the s={0} element and put it on r={0}, then
take the s={1} element and put it on r={0}, then
take the s={2} element and put it on r={0}, then
take the s={3} element and put it on r={0}, then
take the s={4} element and put it on r={0}, then
take the s={5} element and put it on r={1}, then
take the s={6} element and put it on r={1}, and so on...

i hope it helps...
thanks so much and sorry for the late reply.. I was out of action. Will post another writeup later, too--
x
a list of N items is received
the graft tree object adds one path ("branch") per item to a tree
the simplify object then removes the "overlap", in this case the {0:..} trunk,
so that we get a tree with N paths.. {0}, {1}, {2} ---> {N}
(in the case of my posted example screen, it's 48!)

meanwhile, the list length is divided by an integer,
(here "16") yielding the result "3", which is piped into
a ceiling function that returns the "smallest integer greater than or equal to the specified number", suppressing float output.

This number feeds a preset series object to generate a list with 3 items,
which is then duplicated "16" times by the already mentioned integer, yielding
a list with 16x0, 16x1 and 16x2..
Note that we get the full number of "N" items as the duplicated output,
in this case 48, representing the exact number of original list items - yet with the respective values 0, 1, 2!

the following functions reformat the list syntax, as Manuel stated:
"
"{"&x&"}" is just a string (text).

& = and (connection)
x = variable input, in this case is series of numbers

so its mean numbers between { } like this:
{0}, {1}, {2}, {etc...}
the function just output numbers in the necessary syntax for the replace component.
"

the smart thing and reason why TAZ did this (I think...uh) is that the list is now a kind of template that will be used to indicate what replacement path number/"index" the items output from the simplified tree will receive.

the values of the template list are fed into the Replace object (as replacement paths"), as well as the simplified tree (as "data stream") and a series of "N" items ("search mask") (here, 48..) driven by the original list length.

"Replace" now cycles through the inputs and assigns new paths to the input data stream objects (which represent the original items on the list we wanted to package into a chosen number of paths in the first place!)

I've made a totally verbose re-draw of this.. see attached files. coords are fed from a text file, you'll have to re-link that one to play around with it!
Attachments:

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