The title of this video is Bone Structure Two. This is another example of a bone structure I'm going to demonstrate. In this example, as input, I'm using two, three degree curves. We'll go into our code. I'm inputting these two curves, delineating them as first and second curve, and then saving them in separate variables. Then I'm going to divide the curves. We can uncomment this. It dividing the curves into five segments, which is going to produce six points. I'm setting the create points to true and the return points to true. I see the points and I also return the point values, and I'm saving those lists. Divide curve is going to return a list of points in separate variables named appropriately relative to the curves that I'm deriving the points from. So let's run that. Select the first curve, second curve, and I'm producing six points, five segments from each. To undo that, Control Z, back to our code. Then using the same or similar as I did in the first bone structure example, actually I need to change this to two, so I need a separate labeling sequence for each curve. Then I'm labeling them, uncomment this. I'm labeling them with point name and its index for each one, for each curve. Let's run that and see what we get. Select the first curve, second curve, and we label our points. I'll Control Z this, undo this. If I select these curves and type in Dir in the command line, I'm going to see the direction of the curve. This is showing the direction of the curve in which I drew it from bottom to top, and that has an effect on the sequence of points in the derive curve. It's going to start with my point zero, index number zero at the bottom because that's where I started drawing the curve. It does that for both of those. Let's run it again and then we'll see what we're going to do with them. Now I can start to think about what geometry do I want to create with these curves. If I start to think about them as the point, as a series of modular units, so these bottom four could have a relationship and then the next four, then the next four and so on. If I want to maybe construct a curve, let's say a polyline starting at points 01,0, data points 02,0, points 02,1, points 01,1, and then back to points 01,0. Now to one degree, it's a polyline I'm creating, so it's straight segments. It's really a one-degree NURBS curve. Now I could use that same sequence of points to create a three degree curve. I could create something like that. Then, of course, I could repeat that for each one. So I can use that, what I just did to set up my a pseudocode. If we go back to our coding window below, where I have create geometry. I've started to write out my pseudocode. As a comment, I'm writing exactly what I just described. This is a little tight with doubled screen, but it helps when doing this. So points 01 start down there, go to points 02 which is over here, then points 02,1 which is up here, and then points 01,1 which is here, and then back to points 01,0 to close the curve. Since we're here we could talk about the next one. Starts at points 01,1, it goes to points 02,1, then points 02,2, points 01,2, and points 01,1. I close that and then I would do the same. I could use the same exact code, just have to change the level of degree curve created. I close it. Here we go. I have the pseudocode written for those first two modules. Let's go back to full screen. Now I just need to code those, just type an rs.AddCurve. It needs a list of points. I have that already written out here. I put it in parentheses to make it convenient, copy that, drop it in. Then followed by a comma because I want to define the degree of the curve. I want a straight line, polyline for this first one so I'll just put a level one degree in there. Then I just need to copy that whole line. If I put my cursor again at the end of it, at Control C, I can copy that whole line and then Control V to paste it. Then I just change this to a three degree. So that'll give me my curvy curve. Let's run that, so undo these, so Control Z this, select first curve, second curve. Now it's creating that first module and then we can do the second, so undo that. So second one, rs.AddCurve. Just cut and paste this in. Put my degree one and followed by parentheses. Remember, you always got to put the parentheses in to close the function. You can see its pair. Copy that whole line and then change that to a three. That should give us our second, so select first curve, second. That's giving us our second module. I don't need to go through all these, but something to start to recognize is that there's a pattern here. My zero in this first list changes to one and the next, and then the one changes to a two. It's always going up by one. We'll see that next, the one changes to a two and then the two changes to a three. It's always stepping up by one, so that pattern repeats all the way through. If I understand that pattern and it's going to be important to begin to recognize these patterns in lists when we generate the geometry, because we're going to do this differently when we look at something like iteration. If I'm able to iteratively go through a list of points and there's a pattern to that, this geometry generation, then I can make an equation out of that pattern. So I don't have to do all this cutting and pasting and rewriting. We're going to look at a lot more efficient ways to use other tools within the code to create these geometries. But we haven't introduced looping and iteration yet so we'll be getting into that in the next lesson, but it's going to really change things quite a bit. We can start to recognize these patterns. For these remaining one, and so I actually wrote it in the code, I didn't even refer back to the graphic although you can still do that to try to understand this relationship. So I already have these written out, I'm just going to uncomment them. I don't need to type all this out. Now, we can run this, select the first curve, second curve, and it's creating that. So now I can hide or input geometry, and we could turn our point labeling scheme off or comment them out. So let's do that first and hide the input curves. We're creating our geometry, it's still showing the point, so that's okay. I could turn that off by changing the divide curve, but I don't need to do that right now. What if we had a bunch of curves? Now, I could run this progressively through this collection of curves. I won't be able to hide those input curves because I'm going to need it for the next one if it's hidden. So I'm going to comment that out. That's hidden, I wouldn't be able to select it. So select first curve, second curve, run it again, select that curve, that curve, run it again. So here's an interesting error. Well, it doesn't throw an error, actually, it still creates the geometry. I'm not getting an error in my output, but it's making this twisty form. You've might have seen this before if you've done a lot of lofting. What this means is that I drew one of these curves in the wrong direction. So it's starting with its zero point at the top instead of the bottom. If I undo that one and I check the direction of this curve, so it's probably that curve. So type in Dir, and it's showing me the direction from the top to the bottom. So up on the comment line, I can just select "Flip" and hit "Enter", and now it should be okay. Flip the direction of the curve. That's ultimately something you could test for and you could come up with a test for that in the code and then flip it if you need to. Maybe we'll look at that in a later lesson. I'd say select first curve, second curve. I think you get the idea here. We're creating our repeating pattern. Now, one more thing I'm going to do with this one is what if we wanted to take, let's say, instead of, I will just do this for one. So here I have a rectangle, so I could take my code from bone structure 1 and integrate it into this code, because what I'm producing here is a rectangle, and so I could use that code generating the geometry from this rectangle. So let's see how to do that. I wouldn't be creating this circle also, I'm going to turn that off. So as I said, I'll just do this for this first set of this first curve, this first module. I'm going to turn off creating that inside curve here, and then down below everything, I'm going to apply but on structured 1. So one thing I need to do is I need to save this curve. We could create a list called curves, and then I could save this by appending it in that list. So that's got to be in its own parentheses. The append has to have its own parentheses which contains the entire function. So I'm appending the output of that into this list called curves. So what do we need from our bone structure 1? Well, we need to find our edit points and we need to find the centroid. So we're skipping this whole part. I don't need to input the rectangle because I'm doing that already within the code. So let's just copy this control C and bring it over here and I have a different variable, like I don't have this curve Guid. The curve that I'm inputting in here, is the curve that's saved in this list. Now I'm only saving one curve so far. So it's curves index number 0 because that list only has one curve in it right now and I'm saving from that output. So we'd write curves 0. Now that shouldn't be too confusing. If you're confused by it, print out what this is holding and let's actually do that just so when it printed out. So curves, actually we just say curves so we can see what that's holding and I also need this here. So we're going to find our centroid of that. So I found my curve, edit points and the centroid. So let's just run this. I'm not creating any geometry yet, I'm just finding some points. I'm not even printing them out, but I just want to see what's being held in this curves, which is saved here. So let's run that. First curve, second curve and so this is showing me what curves is holding, what curves is holding as an ID and it's showing me within brackets. So it's a list. So there's just one thing in it. Since there's one thing in it, that's the first thing, which is an index 0. So to select that out, that's how I write that out curves 0, index 0 and that's not throwing an error. So it should be, it's producing something. We could even say that I wanted to before I did anything with this, let's say print points and it should print out four edit point. So let's do this one more time and then we'll create the geometry from that. So first curve, second curve. So it's printing out a list of 3D points at 1, 2, 3, 5. I guess it's print out 5. 1, 2, 3, and 4, 5. There must be two points. The first and last are the same, which is fine. That's not going to affect anything. So now we want to integrate where we actually create a geometry which is down here. So I just need to take this whole thing, grab it, control C, copy it, and then just paste it in down here. To undo. We'll run it and select first curve, second curve. Now it's creating that and I could hide that rectangle if I want. Let's just do that. Remember, it does not. Just because I'm hiding this rectangle doesn't make it unusable within the code. Because remember what I'm using in the code is the ID of that rectangle. So I'm not deleting it out of it, I'm just making it disappear, just hiding it so that ID of that is still active in the code after I hide it. There it is. So that's bone structures 2 and I think I'll show you one more example before I have you do the assignment.