Fractal Trees
Based on this post, the problem of modeling tree-like fractal shapes is still a good question for the early years of computational design education. Last time, I used Rhino’s macro to study these fractal trees in an “impossibly” limited interface. But this time I used a VB.NET script.

Here is the code inside of the VB.net component:
Dim i,j As Int32
Dim d(15,65536) As Line
Dim temppoint As Point3d
Dim tempdirection1, tempdirection2 As Vector3d
Dim tempbranch1, tempbranch2 As Line
Dim tempdist As Double
Dim vector As New Vector3d(0, 0, 1)
Dim result As New List (Of Line)
d(0, 0) = c
For i = 0 To x
For j = 0 To (2 ^ i) - 1
temppoint = d(i, j).To
tempdirection1 = d(i, j).Direction
tempdirection2 = d(i, j).Direction
tempdirection1.Rotate(t, vector)
tempdirection2.Rotate(-y, vector)
tempdist = d(i, j).Length * k
tempbranch1 = New Line(temppoint, tempdirection1, tempdist)
tempbranch2 = New Line(temppoint, tempdirection2, tempdist)
d(i + 1, j * 2) = tempbranch1
d(i + 1, (j * 2) + 1) = tempbranch2
result.Add(tempbranch1)
result.Add(tempbranch2)
Next
Next
A = result
Here are the inputs. x is the number of iterations. The Crv input is a line needed for the first iteration. t represents how the tree is going to spread (the angles). Finally, k input is the scale factor for each iteration. The code has two nested loops. The first loop is responsible for the general number of iterations. Then, the second inner loop checks all the lines in the list and draws new lines using the input parameters. You can play with these inputs via Number Sliders as above. In addition, you can play with the code itself to generate interesting results. In the below animation, I played with the t input, which controls the rotation angles for every line segment in every iteration.

You can re-build the definition by looking at the image above and the explanation. While using the VB.net code, you should define the inputs and their data types. You can see this in the above code’s first line.






