From the course: Learning Grasshopper

How to use spline curve components in Grasshopper

From the course: Learning Grasshopper

Start my 1-month free trial

How to use spline curve components in Grasshopper

- [Instructor] In this video, we'll look at several components for generating spline curves in grasshopper. Those are located under the curve component tab in the spline sub menu. In my example file, I have some points from Rhino that I've internalized into a point parameter. In Rhino, I'll go ahead and, double click on the front viewport, and zoom in a little bit with my middle mouse. So we can get a clearer view of how those points will form different spline curves. So we've got a NURBS curve, an interpolate curve, a kinky curve, a polyline, and a polyarc, as well as some helper components that will allow us to experiment with different settings on each one. Let's start with a NURBS curve. Go ahead and enable preview on that by right clicking. So NURBS curves are defined by a series of control points which influence the curves shape. And that's the data flowing from that point parameter into the vertices input. Along with the vertices NURBS curves are defined by a degree and that's an integer between one and 11. That's the second input there coming from a number slider. Now, there's a lot of really arcane information out there about exactly how NURBS geometry works. But that's way beyond the scope of this video. For now, you can think of the degree as basically how relaxed or uptight your curve is. So a lower degree makes for a more uptight curve. If I take it all the way down to one I can see I basically get something resembling a polyline, where each of the control points is connected by a straight line. Going up, we see the curve relax more and more. So basically, it pays less attention to those control points. Common degrees for curves are usually one, three, and five. Again, the reasons really aren't important for this video and involve a lot of math, but the information is out there if you're really curious. And finally, this last input on the NURBS curve is a Boolean setting for whether it is periodic or not. So that is whether it's closed off. I have a Boolean toggle attached to that input. So I can just double click and toggle that to true and I can see the curve closes off and the endpoint meets back up with a starting point. Okay, let's turn preview back off and move on to interpolate curves. I'm just right clicking to enable preview on that one. So interpolate curves actually pass through each one of the control points that flow into the vertices input. The degree input behaves very similarly to the NURBS curve, adjusting how relaxed or uptight the curve is. However, interpolate only takes odd values for its degree. So I've made sure to adjust my number slider here to only generate odd numbers. If I double click, I can look at this rounding and I've set it to O for odd numbers. Interpolate also has a Boolean input for whether the curve is periodic. So that means whether it closes itself off or stays open ended. I can see there double clicking to toggle that to true and taking it back to false. We also have an input for not style. This affects how the curve is parameterised. Again, not really useful for this video to explain exactly the math behind all of that, just notice how the different settings do affect the way the curve is drawn. Okay, let's disable preview on that one, and move on to kinky curve. And this one's almost the same as interpolate curve. It passes through all the points that flow into its vertex input. It has a degree which again controls how relaxed or uptight the curve is. And this one also requires an odd value. So I've adjusted my slider. And it has one different input which is the angle threshold. So what that controls is, when the change in direction from one point to the next, is above the angle threshold, the curve will be drawn with a kink that is an abrupt change in direction. So I can see there's one kink there, and as I change the angle threshold, the number of (indistinct) the curve will change too. Okay, moving on to polyline. Which simply connects the points that flow into its vertices input with straight lines. Polyline has a close parameter that determines whether the curve is open or not. So if closed is true, and the start and end points are not in the same place, an additional line will be drawn to connect them. So when I double click on that toggle, I get this extra line to close it off. Okay, last but not least, we have polyarc which is similar to polyline except that it connects the points that flow into its vertices input with arcs instead of straight lines. Each arc will be tangent to the next so the curvature will stay continuous. And we need to give Polyarc a tangent vector input to give the curve a starting direction. So we have this unit Z vector here that we can plug in to the vertical component. And i can see that will dictate how the curve starts off. polyarc also has a closed input, which I can adjust with this Boolean toggle. So I can see when it's on, I'll get that last arc closing off from start to finish. Okay, so those are some basic spline curve components in grasshopper.

Contents