Lofting is a classic Rhino command that you should definitely know how to use in Grasshopper. In this article I’ll guide you through how to loft in Grasshopper step by step as well as how to troubleshoot common issues.
The Basics
Add the Loft component from the ‘Surface‘ component tab. It’s grouped under ‘Freeform‘.
To add the Loft component using the quick-search function, double-click anywhere on the empty canvas and type “Loft” in the component search bar. Click on ‘Loft’ to drop the component onto the canvas.
The Curves (C) input is where you connect the section curves to be lofted. This is where we’ll connect the curves we want to loft. They can be referenced straight from Rhino or they can be generated in Grasshopper.
For this example I drew and referenced the curves from Rhino.
The loft component will create a loft across all the curves that are provided in the input, in the order they are provided in. This is crucial. The order of the curves we connect to the Curves (C) input will determine the order of the lofting sequence.
If you referenced the curves from Rhino, make sure to select them in order, one by one, when you reference them.
If you created them in Grasshopper, be mindful of the order there too.
Chances are, if you’re reading this, you have already gotten this far on your own. While the process is straightforward, there are a few common issues that come up:
How to Fix Twisted Lofts
Sometimes, when you loft, the resulting surface is twisted. This is because the directions of the input curves don’t match.
There are two ways to fix this:
Manually Adjusting the Curve Direction
If the curves are referenced in Rhino, we can visualize and flip the curve direction by running the ‘Dir’ command in Rhino, and clicking on any curve to flip it.
- Select the curves you are trying to loft
- Type ‘Dir’ in the Rhino command line and hit ‘Enter’
- Click on the misaligned curve to flip it
- Confirm the command with ‘Enter’
The Grasshopper script will update automatically.
If the input curves have been created in Grasshopper we can use the ‘Flip Curve’ component to find and flip the offending curve.
Using the ‘Align Curves’ Option
Alternatively we can use the ‘Align Curves’ feature of the Loft component.
To use the Align Curves feature of the Loft component:
- Right-click on the Options (O) input of the Loft component, go to ‘Loft Options’, and check the ‘Align Sections’ checkbox.
- Click ‘Commit Changes’ to confirm.
Make sure to hit ‘Commit Changes’ to complete the operation! Just clicking away will cancel the command and the feature will not be enabled!
This feature will try to find the curve(s) that point in the wrong direction and align them with the rest. Keep in mind that the original input curves remain unchanged – the alignment only occurs inside the Loft component.
While this works well for simple applications, like lofting curves that point in the same direction, it can lead to unpredictable results in more complex situations.
Your best bet is to make sure that you are in control of the curve directions before you create the loft.
How to Close a Loft in Grasshopper
By default, the Loft component will create an open Loft, as shown on the left.
In a closed loft, the first and last input curves are connected to form a closed, continuous loop
To create a Closed Loft follow these steps:
- Right-click on the Options (O) input of the Loft component, go to ‘Loft Options’, and check the ‘Closed loft’ checkbox.
- Click ‘Commit Changes’ to confirm.
Closed lofts can differ considerably in shape compared to open lofts. This is normal due to the way lofts are generated.
How to Loft Pairs of Curves
If you are trying to loft several curve pairs using a single Loft component, we need to make sure to tell Grasshopper which curves we want to pair. The way this is done is by controlling the inputs’ data structure.
Without diving too deep into this topic, we need to ensure that the curves are organized into separate branches when they reach the Loft component’s input, so they are paired correctly.
We can reveal the data structure of the inputs using the ‘Param Viewer‘ component.
Here’s one way to achieve this:
Let’s say we have two lists of curves: one containing the bottom curves and one containing the top curves.
If we connected both to a Loft component, they would all end up in a single data branch {0} which means the Loft would end up looking like this:
The Loft component connects all the input curves.
In the example above, we can Graft both input curve containers, which means every list item will get its own branch.
To Graft, right-click on the component and select ‘Graft‘.
Repeat this for the other curve component.
Now the curves both at the top and at the bottom are all stored in individual branches. When connecting both inputs to a curve container (or the Loft input directly), the contents of branches of the same name are merged, creating our curve pairs.
This data structure now allows the Loft component to know exactly which curves belong together and lofts them to create the result shown above.
While the exact situation and number of curves to loft might change, this should give you a place to start for pairing curves for lofting!
Using Parametric Loft Options in Grasshopper
If you want to adjust the Loft Options parametrically to react to different situations in your script, you can specify the Loft Options with a dedicated component of the same name.
The Loft Options component contains the exact same options we can access from right-clicking on the component, but uses Grasshopper-native inputs. In the example below they are controlled directly with Boolean Toggles and Number Sliders, but they could also be generated in reaction to script-specific parameters.
The required inputs depend on the input setting. While the checkboxes are replaced with Booleans (True or False values), the Loft Type (Normal, Straight, etc.) is chosen through a number (visible when hovering over the input).
From experience, I would say that in 99% of applications, the in-component Loft Options are quicker and more useful.
Concluding thoughts on Lofting in Grasshopper
Lofting is deceivingly simple, but there is definitely some nuance to it. Knowing which things to look out for and how to solve common headscratchers will save you lots of time.
Happy designing!