Creating Grids
Introduction
Expected Time: 20 min
In this tutorial we will generate a grid of collumns with the use of the series and the move option. The problems we will encouter by doing this are related to the proper use of data matching.
The Design
The task of this tutorial is to make a grid of round columns with the use of a point matrix. The variables of the definition will be:
- Number of columns
- Distance between columns
- Height of the columns
- Diameter of the columns
Building the grasshopper model
Step 1 - Starting the grasshopper model
To make the grid we start to define the origin of the grid. We use the construct point (point from XYZ) node.
- Create the origin of the grid
The defaults coordinates are 0,0,0 are fine in the case of this tutorial. The second tool we need is the move tool. This tool will move a copy of a geometry or multiple geometries to a certain direction.
- Connect the point to a move function
The direction is defined by a vector. To make a two dimensional grid we need to define the movement in the X and Y direction. To do this we create an X and Y vector.
- Add a Unit X to the canvas
- Add a Unit Y to the canvas
To combine the two vectors so you create a vector with a X and Y input you have to use the addition option.
- Connect the unit vectors to an addition node and put the output in the motion input of the move node
You can now see two points on your rhino screen, one is the original point and the other is the moved point. But we need multiple points to form the grids. To do this we need a series of movement vectors. How to do this will be explained in the next step.
Step 2 - Using series of values
The series tool in grasshopper can create a series of values with a determined start number, step size and number of values. You can find the series tool in:
- Connect a series node as input to the unit vectors
- Create three sliders and connect them to the three variables of the series tool.
- Use the panel option to show the list of values you just created
Probably you will now see a series of points generated on your screen that are aligned in a straight line. This is still not what we wanted. We want the points to be distributed as a matrix. To do this you have to add a 'Cross-reference' component in between.
- Make a cross reference between the unit X and unit Y list
The points will now be distributed as a matrix as shown in the image at the right.
Intermezzo - Cross reference, longest/shortest list
Sometimes, you are working with lists in Grasshopper that do not have the same length. If you want to use a function that has both lists as input, it is important that they work together in the correct way. Generally speaking, there are three methods to do this. This information can also be found on the Grasshopper Basic List Actions page.
Longest List
List (A) and List (B) have a different length, as can be seen in the right picture. By using the longest list component, output list (B) is grown to the length of list A.
- You can use Longest List with
Shortest List
Shortest list almost achieves the same as longest list with one difference. In this case, input List (A) is shortened to the length of list B.
- You can use Shortest List with
Cross Reference
Cross Reference, as used in this tutorial, combines the two list by multiplying both lengths. The used variables depend on the output you choose.
- You can use Cross Reference with
As you can see by right clicking on the Cross Reference Node, you can choose different outputs. Experiment with them to see the different results.
Step 3 - Making the columns
Now we have the grid, the only thing left is to populate the grid with parametrically defined columns. First we make the vector that defines the height of the column. To make a vertical column we use the z vector. You can find the vector at:
- Add an SDL line node with the created points as input for the Start
- Connect a Unit Z vector to the Direction input
- Connect a number Slider to the length
The last thing we do is making the columns. We do this by create a pipe around a rail curve. You can find this pipe component in:
- Create a pipe surface around the SDL Lines
- Add a number slider to the Radius input
- Finish you script by adding a geometry parameter
Column Alternative Method
As you can see in the first picture of this tutorial, it is also possible to add complex geometry (for example: a Roman style column) to the grid.
- Create a column in Rhino in the World origin point
- Set the column to a geometry parameter in Grasshopper
- Replace the Construct Point node with your created column parameter
- Remove the script after the Move function