Wednesday, May 13, 2009

Spiraling Exercise

"Whether stars, storm clouds, or petals of a flower, the spiral is only detectable by observing things caught in its wake...The spiral is not so much a shape as the evidence of a shape in formation."
--Aranda, Benjamin, and Chris Lasch. Tooling (Pamphlet Architecture). New York: Princeton Architectural Press, 2006.



As always, dimensioning our variables is the first step in generating the Spiraling algorithm. We create variables x, y, and z which will be our the plotted points through which the spiral curve is passed. We create the variables 'dblAngle' to represent the angle from origin that each new point is plotted, and 'dblRadius' to determine the length from origin at which each new point is to be plotted.

By looping the functions 100 times, we create 100 curve points.

We multiply our loop variable by 30, and pass that through the 'dblAngle' variable to increase the angular dimension by 30 degrees each time the loop is run.



Using right angle trigonometry, whereby the 'dblRadius' value represents the triangle's hypotenuse, we are able to write functions that plot our points out in a spiraling pattern.

Lastly, we run the Rhino.AddCurve method to pass the curve through our spiraling points.

Sunday, May 10, 2009

Packing Exercise

"Packing is a powerful organizational method in which an element's position in regard to its neighbors is determined by certain rules -- not too close, no overlapping, etc."
--Aranda, Benjamin, and Chris Lasch. Tooling (Pamphlet Architecture). New York: Princeton Architectural Press, 2006.



In order to generate the Packing algorithm, we first dimension our variables. We leave open parentheses which follow the x, y, z and dblRadius variables. This is because we will be passing values from the 'i' and 'j' loops which will be run later in the script.

We then run the 'ReDim Preserve' method when we wish to assign a value to a variable that we have left open at the beginning of the script. Passing the value '0' through each of the open variables. This gives the loop a starting point.

ReDim Preserve x(0), y(0), z(0), dblRadius(0)

Next, we run our first loop. We use the 'i' variable and set the loop to run 100 times. Again, we re-dimension our variables from above. This time we pass the variable 'i', which will insert a value from 1 to 100 each time the loop is run.

ReDim Preserve x(i), y(i), z(i), dblRadius(i)

Passing the 'i' variable through x, y and z creates a discrete amount of instances for each, depending on the number of times the loop is to be run (In this case, 100). Then, we assign a unique value for each of the 100 instances. We will the 'random' method which assigns a random value from 0 to 1. By multiplying this times 50, our values will range from 0 to 50. Because we want our circles to be drawn flat on the x-y plane, our z value remains 0. Also, we want the radius of our circles to vary randomly up to 5.

x(i) = rnd * 50
y(i) = rnd * 50
z(i) = 0

Rhino's 'PlaneFromFrame' method constructs a plane from a point and two vectors in the plane. By passing the 'i' variable through the origin parameter, we create 100 separate instances of the origin point, and ultimately the centers of 100 circles. We then set the overlap string value to 'no', And run our second loop. It is important to note that this loop is being run inside of a larger loop. For every singular instance that the parent loop runs, this child loop will run through its entirety. We have set the child loop (j) to at all times equal one less than the parent loop (i).
Therefore, depending on which instance the (i) loop is at, the (j) loop will run from 0 to 1 less than where the (i) loop is at.

For j = 0 To i-1

Now we write our conditional statement to make sure that our circles do not overlap. It is important that we check this mathematically before the circles are drawn. If not, we would have to manually erase overlapping circles and start the process over each time. We measure the sum of the two most recent circle radii in relation to their x and y coordinates.



We say "If the absolute value of the 'x' component at its 'j' position is subtracted from the absolute value of the 'x' component at its 'i' position is less than the sum of the new circle and its most recent predecessor, and the same occurs for the 'y' coordinates, then we have an overlap.

If this overlap statement is not true, then Rhino draws the circle object as intended, and moves on to the next instance of the loop.

Monday, May 4, 2009

3-Dimensional Grids

In the first we apply the sine functions to the center point coordinated of each sphere and create a fluctuation that implies a deformation to the overall cube grid.





In the second we apply the sine function to the radius of each sphere which also implies an overall deformation to the cube but with keeping all of the center points in strict adherence to
the grid.



For next week we hope to continue these experiments with a variety of other shapes to see how that will affect the emergent patterns.