Ramp Easy

From TOI-Pedia


Possible result of this tutorial
Expected Time: 30 min

In this tutorial you will learn how to create a ramp, based on a curve. This ramp will have no plateaus, if you do want them, take a look at Tutorial 13 - Ramp Intermediate Of course, you can combine this tutorial with Tutorial 3 - Railing. This will be explained in the final chapter. Before we start building the ramp however, this tutorial will have an intermezzo explaining planes in Grasshopper.

The Design

The design of the ramp will consist of the following parameters:

  • A Rhino curve/the shape of the ramp
  • The shape of the ramp section
  • Standard railing parameters, as can be seen in Tutorial 3 - Railing

Intermezzo - Planes in Grasshopper

As you may have noticed in the previous tutorials, geometries have always been created using X, Y and Z values. These X, Y and Z values tell us something about the location and size of the object in 3D space. Sometimes however, it is useful not to use the standard coordinate system of Rhino, but to create a plane and define what the X, Y and Z directions are yourself.

In this intermezzo, you will learn some methods to create a plane.

2D Plane

2D planes

2D planes are based on an origin point. For example, by using an XZ plane, the original Z direction in Rhino becomes Y in the new plane. You can use this plane to create a rectangle. The origin input is the point where the plane is created.

  • The XY, XZ and YZ Plane can be found under Vector » Plane

Construct Plane

Construct Plane manually

You can also create a plane yourself, based on an origin point, X-axis and Y-axis. This can be useful when you want to create a 2D or 3D object in a specific direction without rotating it manually.

  • The Construct Plane can be found under Vector » Plane » Construct Plane

Plane Normal

Plane based on normal direction

A plane normal is based on an origin and the normal direction, otherwise known as the direction perpendicular to the plane.

  • The Plane Normal can be found under Vector » Plane » Plane Normal

Curve Planes

Plane based on division of curve

Multiple planes based on a curve division. Generally speaking there are two functions to do this: horizontal planes and perpendicular planes.

  • Curve divisions by planes can be found under Curve » Division

Step 1 - Creating the Ramp

Create a curve in Rhino and set it to a Curve parameter

First we create a curve in Rhino that is the basis of our ramp. In this example we used the spiral function. Next this curve should be set on a curve parameter in Grasshopper.

  • Create a curve in Rhino, for example Rhino » Standard » Spiral
  • Set the curve to a curve parameter Params » Geometry » Curve

Divide the curve in planes

Now we need to create a section through the curve for the final ramp. An easy method to do this is using horizontal frames.

  • Divide the curve by horizontal frames Curve » Division » Horizontal Frames
  • Add a number slider to the count, 50 would be a good start Params » Input » Number Slider

Change the direction of the planes

As you can see, we have one problem now. The sections should be created in the perpendicular direction from the curve, which is not possible with this two-dimensional plane. Therefore we need to deconstruct the current planes. After that, using the new axes, we create new perpendicular planes.

  • Deconstruct the created Frames Vector » Plane » Deconstruct Plane
  • Create a new plane (Y becomes X, Z becomes Y) Vector » Plane » Construct Plane Plane

Create rectangles on the planes

Create a section of the ramp on each frame with a rectangle. You can set the X Size and the Y Size with a construct Domain function, as we have done in previous exercises. For the domain start we add a negative function, so that the rectangles is created in two directions.

  • Connect the Plane output with a rectangle Curve » Primitive » Rectangle
  • Add a Construct Domain function to the X Size and Y Size Maths » Domain » Construct Domain
  • Before connecting a Number Slider, add a negative function to the Domain Start Maths » Operators » Negative

Loft the rectangles

The ramp can be created by lofting the sections.

  • Loft the rectangles Surface » Freeform » Loft

Cap the holes

As you can see, the ends of the loft are not closed. This can be fixed by adding the cap function

  • Cap the loft Surface » Util » Cap Holes

Final ramp with geometry parameter

The ramp is now finished. Set off the preview of all nodes and add a final geometry parameter.

  • Set off the preview of all nodes
  • Finish the script with a geometry parameter Params » Geometry » Geometry

Step 2 - Adding the Railing

Deconstruct the ramp

Now that we have finished the main part of the ramp, Tutorial 3 - Railing tutorial can be used to create a railing. However, the input of this script is a curve, so we need to select which curves we will be using for the model.

First we should deconstruct the ramp in faces, edges and vertices with the Deconstruct Brep function.

  • Deconstruct Brep output Surface » Analysis » Deconstruct Brep

Retrieve specific edges

Now we use list item to select the edges we need. Probably you should use numbers 9 and 10.

  • Select the correct edges with a List Item Set » List » List Item
  • Connect a panel to the Index and type 9 (Enter) 10 Params » Input » Panel

Change options to Multiline Data

Your script will probably not work because your panel is not set right. By right-clicking on the panel and selecting Multiline Data, you can solve the problem.

  • Set the panel to multiline data RMB on panel » Multiline Data

Two edges for railing

As you see in the left picture, we now have the two curves we need for the railing.

Graft the resulting curves

Although you might think the script will work like this, we still need to graft the output. We have been talking about grafting before, but it is still hard to explain at this moment. Think about it like this: you want the curves to be handled individually and not as group. Of course we could add a graft node, but a cleaner way to do this is by right clicking on the Item output and select graft.

  • Graft the resulting curves RMB on Item output of List Item » Graft

Add the railing script

Finally, you can import the railing script created before. The tutorial can be found on Tutorial 3 - Railing Just connect the output of the List Item with the curve input of the railing script. This may look like the image on the left.

  • Copy your railing script to the ramp script
  • Connect the List Item output with the curve input of the railing script

Check the result

By selecting the ramp geometry parameter and the railing geometry parameter, you will see the full ramp.

Final script, click on image for full screen
Personal tools