In this video, we explore the concepts of curve and surface parameters, which use a decimal number between 0 and 1 to extract a point along a curve or a point on a surface. Nodes used: Curve.PointAtParameter, Curve.Reverse, Surface.PointAtParameter, Surface.NormalAtParameter, Surface.FlipNormalDirection
- [Voiceover] Now let's explore some of the methods we can use to extract information about surfaces and curves. In this example, we begin with two lines, each created by connecting a start point and an end point, and a surface that was created by lofting those two lines together. Let's begin by analyzing one of the two line objects. For a moment, I'm gonna turn off the surface geometry preview. If we navigate to the geometry line section of the node library, we see that there aren't too many options in the query section for us to analyze things about lines. That's because a line is a specific data type that falls under the larger umbrella of curves, same is true for poly curves, nurbs curves, polygons.
Let's find the geometry curve section of the node library, where you can see we have many more options to choose from. For example, we can find things like a curve's start point, and its end point, and its length, just to name a few. If we scroll up the list, we can see plenty of other operations that we can use to perform on curves of all kinds. Let's focus on one useful concept to know in computational design, which is the concept of curve parameters. A curve parameter considers the start point of a curve as the number zero, and the end point of that same curve as the number one.
By using a decimal number between zero and one, called a parameter in this context, you can extract any point along that curve. To demonstrate what I mean, let's drop in a point at parameter node. I'm gonna plug our line into the curve input, We also want to drop in a number slider to produce values between zero and one. In this particular curve, it seems like zero is towards the bottom of our screen and one is towards the top. Let's say we wanted to reverse the curve though, maybe conceptually it makes more sense for the top of the curve in this case to be zero, and the bottom to be one.
We can do that using a curve reverse node, which we can also find in the geometry curve section of the node library. I'm gonna place that curve reverse node in between our line and our curve point and parameter nodes. Now you'll notice that as I get closer to zero, the point gets closer to the top of the line, and when I drag the number slider closer to one, the point gets closer to the bottom. Let's add these three nodes to a group because they all work together to produce a point at a curve parameter.
Now let's take a look at what kind of analysis we can perform on surfaces. I'll go ahead and turn the geometry preview back on for a lofted surface. Let's begin with two easy pieces of information that we can get from surfaces, the perimeter and the area. We can find both of those nodes in the geometry surface portion of the node library. Excellent! So, with the single node each, we're already reporting the perimeter and the area of our surface. If we scroll up in the node library a little bit, we can also easily extract the surface's perimeter curves.
You'll notice that these four curves are now added to the background 3-D geometry preview. You might have noticed that the node right below perimeter curves in the library is pointed parameter, which is the same function that we used a few minutes ago on a curve. Let's drop this node into the workspace and give it a try. You'll notice that this node takes three inputs instead of two. The first input that this node takes is an input surface, let's go ahead and plug that in now. Instead of inputting a single parameter value to locate a point on our surface like we did for our curve, we need to define a "U" and a "V" value.
The UVW axes are commonly used throughout 3-D modeling tools to describe local coordinates, or coordinates that are specific to one application. In this case, the application is a single surface, as opposed to the X, Y, and Z axes which are global and apply to all of the elements in a scene or a project. Think of the U and V axes at this node as the X and the Y coordinates but they're specific just to this one surface. Let's copy and paste the zero to one number slider from above, and we'll plug them into the U and the V inputs for our point of parameter node.
You might have noticed that one point has been added to the geometry background preview. As we start to change the values on the slider, you'll notice that the location of that point changes. Again, think of U and V kind of like an X and a Y that's specific just to this one surface. As we move one of the sliders, the point will move in one direction, but if we change the value of the other slider, it moves in a perpendicular direction. Now let's try to extract multiple points through this node. As we've seen in some other examples, the easiest way to get multiple outputs from a single node is to provide multiple inputs to the node.
Let's replace the U input with a list of numbers, generated by a number range which we covered in another video. I'm gonna search for a number range node and drop it into the workspace, along with three number input nodes. We're going to want our number range to start at the number zero, end at the number one, and maybe our step is .2. You can see that the output list of numbers is a range of six numbers between zero and one. Let's plug that into our U input for our surface point of parameter node. In our background preview, you can see that our single point has turned into six points.
We can still use our number slider to change our V input, which moves all six of the points together in the V direction on this surface. What do you think will happen when we use a list of numbers for both U and V? Let's make a copy of our number range, and we'll plug it into the V input as well. As we can see, we end up with the diagonal line across our surface. Let's compare the node previews of these two number ranges. What Dynamo's doing here is it's matching up both lists' data by index. It finds both of the index zero, puts them together into a single UV point, so one of these points is U0, V0, then it moves onto the next item in the list, index one and index one, so another one of these points is .2, .2, then it moves down the list, that's why we only see six points in what looks like a diagonal line.
Now we're starting to touch on a programming concept called lacing, and it deals with how Dynamo handles lists of information. If we right-click on just about any node, we can see the option here called "lacing". There are three options for list lacing, and we set it at the node level, meaning that each node could be set to handle its list lacing differently depending on how you need that node to function. Shortest list and longest list will match each lists' data by index, meaning that both lists' index zero will be paired together in the function, and then each lists' index one and so on until we run out of information.
The difference between shortest and longest lists really only matters when the lists that are being matched up have a different number of items, which isn't the case in our example. Cross product behaves differently from shortest and longest list Cross product pairs each item in a list to all of the items in the other list. It find every possible combination of both lists' items, and then runs them all through the node. Let's switch to cross product and see what we get. In this case, we see our points visualized as a grid on our surface rather than a diagonal line.
Again, that's because Dynamo is starting with index zero of one list, and then it's running through all of the options of it being paired up with the opposite list, then it move onto index one, and pairs it with all of the options in the opposite list. That's why we see so many points being visualized on the surface. Now before we go, I want to point out just one more node to you, called "NormalsAtParameter". If we wanted to take this whole work flow one step further, we could use this node to extract the normals along the surface instead of just the points.
Again, the normals are the perpendicular direction to the surface at the UVs that we said. If a surface is going to be thickened using, say, panels or some other applied material, the normal direction is often the direction in which the material's thickness would extrude outward. So, looking back at the different types of information we extracted from input geometry, it seems that we're able to read things like a curve's length, and points along it, and from a surface we extracted the perimeter, the area, the boundary curves, and we could extract points and normals at set parameters as well.
- Placing and connecting Dynamo nodes
- Understanding Dynamo's data types
- Performing math functions
- Creating number lists and text strings
- Writing data to an Excel spreadsheet
- Creating points, curves, surfaces, and solids
- Analyzing geometry
- Linking a Dynamo-driven SAT into Revit
- Placing Revit families with Dynamo
- Creating Revit views and sheets with Dynamo