VIDEO SCRIPT: 8.2.1 Data Management OUTLINE/ INTENT: Create and control a simple numeric list. Use numeric relationships to describe simple geometry. Control lists using node lacing settings. This video will cover: o Create and control a simple numeric list. o Use numeric relationships to describe simple geometry. o Control lists using node lacing settings. Narrative -- START VIDEO-- 8.2.1 Data Management Introduction In this lesson we will discuss the basic concepts for creating and working with lists. Our final definition will create a series pulsing vertical louvers. On-screen action
Creating Lists with the Number Sequence and Number Range Nodes Let s begin by searching for the Number Sequence Node. This number sequence node will create a sequence of numbers. I am going to use a number node to input the: Number to start the sequence at Amount of numbers in the sequence Amount to step by Let s now search for a number range node and compare the output. The number range node creates a sequence of numbers in a given range Number to start the sequence at Number to end the sequence at Space between the numbers Instead of using the Watch node I will compare the output of these two nodes by clicking on the rectangle located at the bottom right corner of the nodes. Creating Sequences with the Number Node In our last lesson we used the number node to define a single value. Now let s see how this node can be used to define a sequence of values. In the value field of the number node type in 0..10. This indicates to Dynamo that you would like to create a list of values beginning at 0 and ending at 10. Let s use a Watch node to view the resulting sequence of numbers If I change either the start or end of value in the Number node the sequence will update. Let s change the end number to 5 and view the results.
Copy+ paste the Number and Watch nodes. Adding..2 to the end of our current string will step through the current range with an interval of 2 instead of 1. Notice that both lists have the same end number; however, the number of values in each list is different. Try changing the interval number a few times to see the result in the Watch Node (values = 0.5). The resulting sequence of values will always be less than or equal to the End Number. Let s repeat this process a few more times to see what other types of sequences we can create using the Number node. First let s use the modifier # to indicate the desired number of values we would like in our sequence. It is important to note that the first index, or position, in a list is zero. Therefore, the last index is one less than the desired count. Next we will swap the position of the modifier #. This results in a Start..#ListCount..Interval.
Using the string Start..End..#Count, let s create a sequence of points. I will use the same XYZ node as before, this time inputting the sequence of values into the X Coordinate port. I am going to use the Watch 3D node to view the result of this action.
Lacing Notice the little icon in the bottom right corner of the XYZ node. This indicates the Lacing for this particular node. Lacing determines how an input port should use the incoming data. By right-clicking on the XYZ node, I can access the Lacing options: First Shortest List Longest List Cross Reference To demonstrate the differences between these methods, I will disconnect the Y Coordinate port and replace it with the output of my Watch node. The Longest lacing will result in a diagonal list of points, as it is combining both the X and Y inputs to define the points coordinates By changing the Lacing operation to Cross Product a grid of points will be created. Lacing operations are an important component to effectively work with multiple sequences of data. For instance, if you were needing to construct a sequence of line segments you would need to create more than one collection of points. Let s copy + paste our nodes and create a list of lines by start and end points. By changing the #Count number the top list increases in length. This results in an uneven number of points being created. Let s verify this using the List Count node. This node will return the number of elements in a list. You can find this node in the: Core List Actions Category Clicking on the rectangular icon on the bottom right corner will display the output of the node. This is a quick alternative to using the Watch node.
To ensure that both Point nodes result in the same number of points, I will disconnect one of the Number nodes and share the output of the other to the input Port of each Watch node. Re-wiring nodes in a definition is a common task that you will need to do as you are developing visual programs in Dynamo. Mathematical Functions With the correct number of values flowing into our Point nodes we can use a mathematical function to change the character of our line segments. I would like to see the effect of modulating the lower point sequence using a sine function. The sin node is located in the Core Math category We can also locate this node by typing in sin in the library search field. The input port of the sin node is labeled angle, so I will put my mouse over the port to see what type of data this port requires. Since the angle input requires the data to be in degrees, I will need to find a node to convert my sequence of values from radians to degrees. Looking through the list of nodes in the Math category I will find both a degrees to radians and radians to degrees node. Connect the output of the Watch to the radians to degrees node, followed by the sin node. Replacing the in Y input of the XYZ node will result in a sequence of undulating lines.
To add a little more interaction to our definition let s look at an interesting feature of the number node. Strings used to define sequences in a number node can be modified to include variables. I am going to replace the #Count value with the variable a. In doing so, an input port is added to the number node. We can now connect an Integer Slider to this port to quickly change the number of points computed. Creating Solid Geometry Now that we have created and verified that the main functionality of our definition is working, let s locate the extrude node. Type extrude in the node library search field. Under Geometry-Curve Action there are a few extrude nodes. I am going to click on the Extrude Curve by (Direction, Vector). Connect the output of the Line node to the Curve Extrude input port. The second input port requires a vector, so let s search for vector and click on (ByCoordinate) node. Use a slider to define the Y Coordinate and a Number node to define X & Z Last I will thicken my louvers using the Thicken node located in Geometry-Surface-Actions -- END VIDEO -- 8.2.1 Data Management -- 1100 words, 6 minutes.