wunderbar ^^* !
maybe you would be interested in Jun Mitani's work ?
www.flickr.com/photos/jun_mitani/mitani.cs.tsukuba.ac.jhe published two books (keyword : 三谷 純)立体ふしぎ折り紙
ふしぎな 球体・立体折り紙
It could look like this in a panel
{0}
0 - A
1 - B
{1}
0 - C
1 - D
{2}
0 - E
1 - F
question: can you operate on elements between branches?
By default, when you apply polyline, it will connect the elements inside their branch. But how do we connect '{0} 0 - A' with '{1} 0 - B' and '{2} 0 - C'?
2)If we have 6 elements (A,B,C,D,E,F) at the same level or issued from a flatten operation, how do we create a tree like this one:
{0}
0 - A
1 - B
{1}
0 - C
1 - D
{2}
0 - E
1 - F
?
3) a work around would be to reverse the branch:
as the following transformation:
from this list:
{0}
0 - A
1 - B
{1}
0 - C
1 - D
{2}
0 - E
1 - F
that would transform in this one
{0}
0 - A
1 - C
2 - E
{1}
0 - B
1 - D
2 - F
?
4) Can we do such operation:
from this list:
{0;0}
0 - A
{0;1}
0 - B
{1;0}
0 - C
{1;1}
0 - D
{2;0}
0 - E
{2;1}
0 - F
to
{0}
0 - A
1 - B
{1}
0 - C
1 - D
{2}
0 - E
1 - F
5) I saw in a previous discussion in the VB# corner (about grid) that David was suggesting using some methods but I don't know how to use the "GH_Path" and the "Grasshopper.DataTree" object? is there other methods which are not mention either in SDK doc and Primer Grasshopper hand book?
Many thanks…
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.
…
sentation from the circle object
Dim n As New NurbsCurve(c.ToNurbsCurve())
'Divides the Curve domain in 3 segments (returns domain as double array)
Dim d() As Double = n.DivideByCount(3, True)
'to output the segment use trim function and the corresponding domain values...loop?
A = n.Trim(d(0), d(1))
End Sub
…
Added by Florian Frank at 5:10pm on February 4, 2011
the branch?
i.e.
{0;0} {1;0} {2;0} {2;1} {3;0} {3;1} {3;2}
a a a c a c e
b b b d b d f
in order to get
{0} {1} {2} {3}
a a a + c a + c + e
b b b + d b + d + f
I have tried using GH_Path, treedata.Paths etc.
but have no idea how to perform a looping in the second dimension of a tree.
Any ideas?
Many Thanks!!…