This video is titled Bone Structures One. In this video I'm going to introduce a concept that we use in modelling and coding called a base or a bone structure. Essentially what it means is that we use a simpler structure to create more complex geometry from. So we're using a simpler form in putting it and then developing a more complex geometry from that in the code. And the analogy is to bones, if you think of the bones and the body, the structure that creates the size and proportions of the body but are fundamentally simpler than the things that they support the organs, the skin, the brain, everything else that gets, sort of structured by the bones. So the bones are the basic form which then everything else is structured by. So as an example of this, I have a rectangle and if we imagine, inputting that rectangle and this is the piece I'm going to work on that I can find a couple pieces of information from that rectangle, that square. I can find its corner points and I can find its centroid. If I find those things and we can find it for this here by just typing in centroid, area centroid. I could then use that data, those points to derive other curves from. If we're making this, Center one if I decide that's too large, then I might scale that Around that centroid. And so if I code this, then any rectangle that I apply it to, I'm going to be able to generate that geometry from. So that's a process that we're going to go through. So let's take a look at our code. So I'm inputting the rectangle and then I'm going to find the edit points from it, which is a function that we've already used. And then I'm going to create those points in rhinospace. Now I don't have to necessarily do this step, I don't have to see the points. But I'm doing it just so I can visualize them. I don't have to see them in order to do something like label them because the AddTextDot just takes point values. It doesn't need an actual point in space. Okay, so I selected that square and it generated the four points. I'm going to undo that, And get rid of this one. Okay, so I have those four points. And let's turn on our labeling here, By uncommenting it. I got a little fancy here. I added as a string for the label, I added the name of the list also that the points are being saved in and the index number Which helps to visualize them in the scene. So we'll run this again. Select the rectangle, And now I can see the order of the points in the scene, zero starting down here and then it goes to one to the right here, it's actually going in a counterclockwise direction. Point two is here and then point three is here. Again, I could turn off this AddPoints here and that would still work fine because the AddTextDot doesn't really need the points as a visual point in the scene. So it runs just fine and there's no, Point underneath that. So let's do the same. So we're going to need our centroid. So I find centroid here which we've used before, and we can visualize that. Run this again. Okay, that's creating that point. And we want to label that also. And this, we don't need. Okay, so now I've found all of the points that I need and I've labeled them, which is actually very handy as if this gets more complicated, it can often be difficult to understand where the points are that I'm trying to construct lines between in the scene. So you can imagine if I had, I can generate other points and we'll see with future lessons, I can generate other points from these points in multiple ways and they could be sort of anywhere in the scene. And so this idea of sort of labeling, visualizing the list structures directly in the geometry and then working on them manually figuring out how I'm going to construct geometry from those points in the scene, is a practice that we'll do over and over again. And it's actually gets me to introducing another new concept which is pseudo coding. I can write that out. So PSEUDO CODE. Okay, and what a pseudo code is, this is a concept that was introduced to me by David Pigram of supermanoeuvre in one of his coding workshops and it's a really smart way to go about coding particularly when things start to get more complicated. And essentially what it is as you run through let's say manually, the geometry that you're trying to, that you want to construct in the code, the thing that you want to do in the code, you write out in comments those actions, what you're going to do. So you you write out your code before you code it. So you write out the description of your code in PSEUDO CODE before you then go in and code it. And this is super useful too because it breaks your code into series of digestible chunks, individual lines that you can work on. So you're not having to conceptualize the entire code at once and deal with the sort of monumentality of that, you can deal with it in tiny little parts. So it's a really good practice that we're going to continue throughout the rest of the course. So what I've done here is and I can go through these, I've written in comments exactly what I'm going to do within the scene. So the practice would be if I want to draw this line, I'm going from point 0 up to the centroid and down to point 1. And so that one line of code that I write out in a comment here. I want to draw a line from point 0 to the centroid to point 1 And then the next line would be from point 1 to the centroid point 2. So we write there here are points 1 and centroids point 2 Point 2 to centroid and then point 3 Points to the centroid then point 3 and then points 3 to the centroid then point 0. So once after I've written those out, then I just need to code. So the code I'm going to use is to add a curve. And if you remember with AddCurve, what it's looking for is a list of points. So that has to be contained either as a tuple between parentheses, or it could be between brackets but I don't need it to be a list. It can be a tuple because I'm not doing anything with it, I'm not manipulating it. So it makes it more efficient to make it a tuple. So now since I've written this in the comment, three points in the order that I need them because that's also another important thing is that order. All I need to do is copy them and paste them in here. Then I can just copy that line Ctrl+C. And we can paste it. The three other spots, and then just cut and paste from my comments. Ctrl+C and then Ctrl+V. And that I have my code to construct those lines. So let's run that and see if there's any bugs in it. Save this. So I'll delete these. Actually what I could do is instead of doing that, let's just make a copy of this. Hold the Alt key down, drag it over to make a copy. And let's run that. Okay, so now it's constructing that. So why this is significant is, every four sided rectangle is topologically identical which matters in code. So it as the same number of segments, it has the same number of points no matter what the form is so, I can copy this And manipulate it however I want. And if I run the code on it, It still works fine, but it's producing a different geometry from that. All right, so this code will run on any four sided rectangle. Any four sided actually I should say any four sided and gon form. So whether it's trapezoidal, it doesn't matter. So let's do the last part of this which is the center piece. And this, if I use AddCurve since my points are already in a list, I don't need to put them in parentheses. So that's feeding a list. So if I run this, so it's creating that circle. And now I could leave it like that, or I could rescale it so it fits in here depending on what sort of design I want to do, but we can use a function which we've used before which is scale object. And I'm saving that curve and a variable called curve, then I'm scaling it around the centroid to half its size uniformly. And I'm not creating a copy of it, I want to scale the original object. So let's run that again. Okay, so let's, we cannot do that. Skip through these for a sec. And we can turn our labeling off, we don't need that anymore, Shift+Ctrl+C. So, I could draw, manipulate a rectangle with this. It'll also work with any closed polyline four sided, so I could just draw, As long as I close it. And actually it doesn't matter which direction I draw in. Just do a couple more here. So I'm sort of drawing a tower of connected Polygons and then I can run the code on each one of those polygons separately. Right, so you can see from this, you can start to imagine the advantage of coding and starting to create more complex geometries that if I was to do that manually, draw this out, construct this manually, it would take a considerable amount of time. And then if you think, well, this is, whatever, eight polygons but what if I had 1000 polygons and they were all different? I could run this code on that and it would construct that geometry. What if that geometry was 3D instead of 2D, then it gets even more complex. So we really start to see the advantage of doing this through code. The other thing I could do would be to let me just copy our bone structure over. Hold the key down to copy it, and go back to our code, the last thing we might do is that we could as we input the bone structure, we could hide it. So maybe we don't want to see that structure. We're just using it as a way to create the more complex structure and it disappears as we bring it in. So if we just run this again. So this is an example of a strategy for using a bone structure to create geometry and this is what your assignment two is about. I'm going to show a few more examples of it and from that understanding, some of the functions that we've introduced, you should be able to come up with your own structure or derive something from some of these logics.