How to Extend a Curve in Grasshopper

Extend Curve in Grasshopper
Quick links

To extend a curve in Grasshopper, we can use the Extend Curve (Ext) component. The component allows us to take an input curve and extend it by specifying the extension length on both curve ends. We can choose between extending with a line, an arc, or smoothly.

In this article I’ll show you where to find the component, exactly how to use it, and a special way to utilize it.

Adding the Extend Curve component

To start, add the component by going to the ‘Curve’ component tab. The Extend Curve component is grouped in the ‘Util’ section on the far right.

Adding the Extend Curve component

To add it even more quickly, use the component search bar:

Double-click anywhere on the Grasshopper canvas, type “extend” and select the component to add it to the canvas.

How the Extend Curve Component Works

While most Grasshopper components are identical to their Rhino command counterparts, the Extend Curve component works a bit differently. In Rhino, you can extend curves to a boundary object, by specifying an extension length, or using the dynamic extension feature, which lets you interactively extend selected curve ends.

In Grasshopper, we can only extend a curve by specifying the extension length.

Extending a Curve by Length on both ends

Inputs and Outputs Explained

Start by connecting a curve to the Curve (C) input. The only requirement is for the curve to be open.

Just like in Rhino, we can choose the extension type. By hovering over the Type (T) input, the tooltip displays the available options.

Extension Type explained

We can either provide the corresponding numerical input with a Number Slider, for example 0 for a Line extension, or right-click on the Type (T) input and select the extension type from the popup menu as shown below.

Specifying the Extension Type

Extension Types

We can pick from three extension types:

  • Line – The curve end is extended with a line that follows the tangent of the curve at the end.
  • Arc – The curve end is extended with an arc that continues the radius of the curve at the end.
  • Smooth – The curve end is extended with a smoothly: there is no visible kink or change in continuity.
Line Arc and Smooth Extension Modes

The default extension type is “Line“. If you want a linear extension, you don’t need to connect any inputs.

Extension Lengths

The L0 and L1 inputs are the inputs for the extension length at the beginning (L0) and end (L1) of the curve. In addition, and this threw me off the first time I used the component, we have to define the extension length of both sides of the open curve, even if we just want to extend one end.

Unless we connect a numerical value to both the L0 and L1 input, the component will turn orange.

To only lengthen one end of the curve, connect an extension value of ‘0’ to the other end.

Below is an example with two extension lengths, using the ‘Smooth’ extension type.

Example Script of Extend Curve component

The output is the Extended Curve (C). The curve is the input curve joined with the extension curve segments. Keep in mind that there will be a kink at the extension points, with extra control points. Even when extending a straight line, we’ll get a line with four control points. This can cause some chaos in your script, so something to be aware of!

How to Shorten a Curve with Negative Extension Values

Despite the name, the Extend Curve component can also be used to shorten a curve by providing a negative extension value. This can be an extremely useful technique to create some space between curve segments, as shown in the example below.

Using the Extend Curve component to shorten curves

Keep in mind that the negative extension value cannot be greater than half the curve length. If it is, the component will turn red and give an error.

Concluding Thoughts

Mastering the Extend Curve component in Grasshopper can help you get more control over curves in Grasshopper. The most common challenge for first time users is that we need to provide extension lengths for both ends of the curve, even if we just want to extend one end. I hope you’ve found this useful!

Happy designing!

Like this article?
Share on LinkedIn
Picture of Thomas Tait
Thomas Tait
Architect at Snøhetta and Head Instructor @ Hopific (or, in plain English, I help designers use Grasshopper to supercharge their designs.
Ready to Dive into Grasshopper? Grab Your Free Ebook!

Accelerate Your Learning and Get Up and Running Quickly.