;0;1;1;0}
{0;0;1;2;0} ...
{0;0;2;0;0}
{0;0;2;1;0}
{0;0;2;2;0} ...
{0;0;3;0;0}
{0;0;3;1;0}
{0;0;3;2;0} ...
...
and I would like to have this in two lists separated:
{0;0;0;0;0}
{0;0;0;1;0}
{0;0;0;2;0} ...
{0;0;2;0;0}
{0;0;2;1;0}
{0;0;2;2;0} ...
...
{0;0;1;0;0}
{0;0;1;1;0}
{0;0;1;2;0} ...
{0;0;3;0;0}
{0;0;3;1;0}
{0;0;3;2;0} ...
...
How can I do that?…
ems in the same way. Lofting was particularly difficult, you had to have a separate loft component for every lofted surface that you wanted to generate because the component would/could only see one large list of inputs. Then came along the data structures in GH v0.6 which allowed for the segregation of multiple input sets.
If you go to Section 8: The Garden of Forking Paths of the Grasshopper Primer 2nd Edition you will find the image above describing the storing of data.
Here you will notice a similarity between the path {0;0;0;0}(N=6) and the pathmapper Mask {A;B;C;D}(i). A is a placeholder for all of the first Branch structures (in this case just 0). B is a place holder for all the second branch structures possibly either 0, 1 or 2 in this case. And so forth.
(i) is a place holder for the index of N. If you think of it like a for loop the i plays the same role. For the example {A;B;C;D}(i) --> {i\3}
{0;0;0;0}(0) --> {0\3} = {0}
{0;0;0;0}(1) --> {1\3} = {0}
{0;0;0;0}(2) --> {2\3} = {0}
{0;0;0;0}(3) --> {3\3} = {1}
{0;0;0;0}(4) --> {4\3} = {1}
{0;0;0;0}(5) --> {5\3} = {1}
{0;0;0;1}(0) --> {0\3} = {0}
{0;0;0;1}(1) --> {1\3} = {0}
{0;0;0;1}(2) --> {2\3} = {0}
{0;0;0;1}(3) --> {3\3} = {1}
{0;0;0;1}(4) --> {4\3} = {1}
{0;0;0;1}(5) --> {5\3} = {1}
{0;0;0;1}(6) --> {6\3} = {2}
{0;0;0;1}(7) --> {7\3} = {2}
{0;0;0;1}(8) --> {8\3} = {2}
...
{0;2;1;1}(8) --> {8\3} = {2}
I'm not entirely sure why you want to do this particular exercise but it goes some way towards describing the process.
The reason for the tidy up: every time the data stream passes through a component that influences the path structure it adds a branch. This can get very unwieldy if you let it go to far. some times I've ended up with structures like {0;0;1;0;0;0;3;0;0;0;14}(N=1) and by remapping the structure to {A;B;C} you get {0;0;1}(N=15) and is much neater to deal with.
If you ever need to see what the structure is there is a component called Param Viewer on the first Tab Param>Special Icon is a tree. It has two modes text and visual double click to switch between the two.
Have a look at this example of three scenarios in three situations to see how the data structure changes depending on what components are doing.
…
here are 11 numbers (0 to 10), and a 'step' of 42 (0 to 42 to 84), and I need to be able to 'cap' the number of times the 11 numbers are added, for example 3 for the list above.
I'm sure this is simple, and I'm kicking myself that I can't figure it out for myself, so any help would be greatly appreciated!…
e), {1;2}(line), {1;3}(line)... and on the other side to have {0;0}(all lines except {0}(0)), {0;1} (all lines except {0}(1)), {0;2}(all lines except {0}(2)), {0;3}(all lines except {0}(3)), {1;0} (all lines except {1}(0)), {1;1} (all lines except {1}(1)), {1;2} (all lines except {1}(2)) ,{1;3} (all lines except {1}(3))...The first tree is easy to achieve, simply grafting a branch for each element, and the other, what I've done is to copy all lines of each tree ({0},{1},{2},{3}), to have them in all branches of each tree ({0;0}(elements of {0}), {0;1}(elements of {0}),,{1;0}(elements of {1}), {1;1}(elements of {1})..., and then remove in the first branch({0;1} the first element(0), in the second branch the second element, the third branch the third element...And so correctly you compare each line with all the other within each branched tree.Aaaaapufff XD…