# Grasshopper Curve Frames-Arrays

## Contents

## Introduction

**LEVEL: BEGINNER**

In the Grasshopper Points from Curve tutorial you have learned to extract points from a curve by evaluating or dividing the curve. In this section, we elaborate on the different methods to distribute planes or geometries along a curve.

## Horizontal Frames

The first example demonstrates the difference between dividing a curve and connecting those points with a line versus creating perpendicular lines from the curves. This can be useful in creating stairs along a a curve, for example.

For the first example *set one curve* drawn in Rhino. Offset this curve using with a Number Slider for **D**istance. Divide both curves with the same number using and connect one Number Slider to both divide components with the same **N**umber.

Using a component you can connect the two points. This is explained into more detail here: Grasshopper Points from Curve. Notice that the connecting lines are not perpendicular. This is because the equal divisions of the curve are not perpendicularly placed across each other.

If you want perpendicular lines to the curve, you use the
*set a number* to control the **N**umber of Horizontal Frames. (Note: These are called Frames because they are planes derived from geometry)

To draw a line along the y-axis of the planes, use to extract the directions of the vector. Now use with the **S**tarting point at the origin of the **F**rame and the y-direction of the deconstructed vector into the **D**irection. The **L**ength of the line can vary, using a Number Slider.

If the direction of the offset and the SDL do not match, you can invert one or the other by using the tool. To complete the example, use an . The **D**istance should equal the length of the SDL line, by connecting the same Number Slider. If you want to retrieve the intersection points at the offset curve, use .

## Perpendicular Frames

In addition to Horizontal Frames, Grasshopper also has a tool to distribute Perpendicular Frames with the

component. If you follow the same steps as above, you'll see that in this case the y-direction of the plane follows the z-direction of Rhino's world coordinate system and the x-direction is perpendicular to the curve.

You can also use the plane base primitive geometry on. For example, by defining it as an origin plane for a circle. Use the command and connect the **F**rame output to the **C**enter point input of the CNR Circle. Also use the **F**rame for the **N**ormal input of the CNR Circle. Every circle is now oriented perpendicular to the curve in the z-direction.

## Curve Array

The difference between this method and the previous ones is that here we define a geometry to distribute along a curve rather than defining a point or plane to draw geometry upon or move geometry to. In this example we start with curve-geometry to be converted into a solid, but you can start with any type of geometry (point, curve, surface, brep) or even multiple geometries.

First, in Rhino, define your geometry to be arrayed along the curve. In this case, we have drawn a cross-like curve and *set one curve*. To convert this to a solid, we use and . For the extrusion, define the direction, in this case the z-direction by using . If we connect the capped **B**rep to the **G**eometry input of the command, it will distribute the geometry along the curve by a defined **N**umber. This can be adjust by using a Number Slider or *set a number*.

## Distance based Scaling using Remapping

**LEVEL: INTERMEDIATE**

Parametric design is about building relations between objects. In this example we will demonstrate one of this relations based on distance. We will show how an object is scaled based on the distance from the starting point of a line. Please keep in mind that a scale factor is always determined in percentages. If you want to scale an object in half, the scale factor is 0.5 (50%) if you want to double the size the scale factor is 2.0 (200%). This is important to understand when we use the remapping component. The concept of *Remapping* is quite similar to the *Reparametrize* option which was explained in more detail here: Grasshopper Points from Curve and later here: Grasshopper 3D Grid from Surface. Reparametrizing allows for redistributing a domain from 0-1, whereas the remapping component allows for redistributing a domain onto *any* new domain.

We continue to work on the same definition. First we need to set up the relationship. We want to measure the distance between the starting point of the original input curve and a point on the brep. For that, we explode the brep into its components; faces, edges and vertices. Use for this.

Then we retrieve one of the vertices (any will work, but closest to the curve give the least distortion) with . Let's flatten the data tree, since we have no need for it; right click on the **I**tem output and select *flatten*.

We still have to define the starting point of the input curve. Use . Select the **S**tarting Point and feed it into the **A** component. Feed the **I**tem output from the List Item into the **B** input. If you pull up a *panel* if you want to see the calculated distances.

We now have to convert this set of distances into scale factors to perform the scalar operation. To understand the scalar operation, load the component. This component requires a **G**eometry input and allows you to scale in 3 directions, x,y and z. Use Number Sliders to control the scale factor. (0-1 for reducing or >1 for increasing in scale).

In order to convert the distances to a usable scale factor, we will **Remap** the domain of the distances onto a new domain from 0.25-1.00. This means that the closest object will be scaled by 0.25 and the furthest object will be scale by 1.00. If you switch the domain, from 1.00-0.25, the scalar operation will occur the other way around; the closest object will be scaled by 1.00 and the furthest object will be scaled by 0.25.

To **Remap** the distances, you need to find the bounds of the current domain with . Plug in the **D**istance output into the **N**umbers input of the Domain component. This will be the source domain.

For the target domain, we need to construct a new domain by using . Here we can define the start and end of the new domain with Number Sliders, for example 0.25 and 1.00. By exchanging the **A** and **B** input you control the scalar operation for the closest and furthest object.

Use the tool to remap the numbers by substituting the source domain for the target domain. The **V**alues are the distances as a list. The **S**ource domain comes from the Bounds component and the **T**arget domain comes from the new Construct Domain component. The **R**emapped numbers now range from 0.25-1.00, where the lowest number is assigned 0.25 and the highest number is assigned 1.00. If you flip the **A** and **B** it will be the other way around.

Finally you can use the remapped numbers as a scale factor for the . If you want to decrease the height (by 0.25) of the object closest to the start of the curve, gradually increasing as you the geometry arrays along the curve, plug the **R**emapped Number into the **Z** input of the Scale NU component. Keeping the other scale factors (x&y) at 1, the geometry will be scaled into the z-direction only.

## Distance based Scaling using Graphmapper

To control, for example, the height of the geometry according to a *numeric mapping function*, you could use the command. This component functions similarly to the Remapping tool, but the Graphmapper will redistribute the values dictated according to a defined graph.

You can select a *Graph Type* by right-clicking the Graph Mapper. If you select a *Linear Graph*, you get a similar result to what we had previously with the Remapping tool. If you select a *Bezier Curve* you can control the handles of a Curve (also known as a Bezier Curve). This gives you a lot of flexibility in playing with the height of your geometry.