Creating Grids

From TOI-Pedia


Expected Time: 20 min
Possible result of this tutorial

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

Create a point in the origin

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 Vector » Point » Construct Point

Move the point in the x and y direction

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 Transform » Euclidean » Move

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 Vector » Vector » Unit X » Grasshopper
  • Add a Unit Y to the canvas Vector » Vector » Unit Y » Grasshopper

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 Math » Operators » Addition

Two points in the Top Rhino viewport

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

Add a serie of values to the unit x and y vector

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 Sets » Sequence » Series
  • 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 Params » Input » Panel

Points in diagonal straight line

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.

Add the cross-reference component
  • Make a cross reference between the unit X and unit Y list Sets » List » Cross Reference

The matrix of points

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

Longest list explanation

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 Sets » List » Longest List

Shortest List

Shortest list explanation

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 Sets » List » Shortest List

Cross Reference

Cross reference explanation

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 Sets » List » Cross Reference

Change the method of the cross reference

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

Add lines to the created points

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 Curve » Primitive » Line SDL
  • Connect a Unit Z vector to the Direction input Vector » Vector » Unit Z
  • Connect a number Slider to the length Params » Input » Number Slider

Make a pipe around the lines

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 Surface » Freedom » Pipe
  • Add a number slider to the Radius input Params » Input » Number Slider
  • Finish you script by adding a geometry parameter Params » Geometry » Geometry

Final script overview

Column Alternative Method

Final script overview

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 Params » Geometry » Geometry
  • Replace the Construct Point node with your created column parameter
  • Remove the script after the Move function

Personal tools