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.
…
a follow up question... how do I wrap a list onto itself at a certain frequency?
i.e. I want the list {1;2;3;4;5;6;7;8;9}
to become {1,4,7; 2,6,8; 3,6,9} wrapped every 3rd item
Added by Joshua Jordan at 5:30pm on November 17, 2012
This is another shot of the jig we built to make each of the 10 upper truss sections. it's easier to see here the 36 degree angle we set the jig to in order to make all of the tines match
an be given as 88° and 95°. All three angles must sum up to 180, and we're already 3 degrees over balance. Or maybe the user specifies three edge-lengths: 21, 12 and 8. 21 is bigger than 12+8, so even if the triangle was stretched flat, the two short edges cannot reach the ends of the long edge. The above is easy to test for and I add errors to the component if an invalid triangle is provided. However there are also many angle+edge length combinations which result in invalid triangles.
I could of course test for these as well, but the problem is now tolerance. What if the user specifies a redundant angle of 54.7°, whereas the mathematics tell us that the actual angle is 54.7002°. Is that an error? If so, is the angle wrong or is perhaps one of the edges wrong? Or has the triangle simply been over-constrained? Is there a mathematically robust way of dealing with this? And if so, would that also be the most user-friendly way of dealing with it?…
Added by David Rutten at 2:23pm on August 23, 2014