The title of this video is 2D Point Matrix Bone Structure. In this video, I want to show how we can use the 2D point matrix as our base or bone structure for creating more complex geometry. As an example for that, I'm going to take the bone structure 1 that I showed in lesson 2, and I'm going to insert it or adapt it to the 2D point matrix in the dictionary structure. If we just take a quick look at that original code, it inputs a rectangle and I'm finding the edit points of that rectangle. I find the centroid of it, and then this is where I introduce pseudo coding, and so from those points, I derive the geometry using the centroid and the corner points. If I run that, I run it on a rectangle and it creates that geometry. In terms of translation into our matrix structure, we don't have to do too much. One thing that we don't have is we don't have our rectangle. So I have four points, but I don't have a rectangle to find my centroid. I could find that in a couple different ways. I could actually draw a rectangle and then find the centroid of that. That would be one way. Another way is to just draw a line between two opposing points and then find the midpoint of that line, and that's going to give us our centroid. So that's the method I'm going to use, and then we use that centroid to create our lines and then our center curve. If I go back to the code, I'll show you where I adapted that. We're taking the same typical point matrix code we used in the last lesson. I'm still doing a Fibonacci series here, and down where we loop through to create a geometry. Of course, still using a conditional that's only going to create geometry if the values are greater than zero. This should be fairly straightforward. I'm finding a line between two diagonally opposed points and holding it in a variable co-construct line and then using that to find that midpoint, which I'm calling centroid. The only thing we haven't seen here is that I'm just using this line as a constructor, which means I don't see it in the end so I delete it. After using it to find the midpoint, I delete it. That's something we haven't really seen so much before using creating geometry to just create points or other geometry from and then deleting them or hiding them, and that's something that we'll see more of. Then these lower lines I've just adapted to the point major C-structure. So one could go through that looking at this old code, and all I'm doing is writing out a new pseudo-code and then filling that in with the AD curve. Again, one thing you have to be careful about here is that that has to be within its own parentheses because it needs a list. Same thing for this closed curve at the end, which takes all four points and then it needs to go back to the fifth point in order to make it closed. I think in the original we just gave it the list of points and it created a closed curve from that. That's different. Then I save that curve and then scale it. So fairly straightforward. Nothing really surprising and you could look at this as an example for how you might do this next assignment. Don't be afraid to take an earlier exploration of geometry and begin to apply it to these new systems because all this is is it's logic of construction and so you can apply that to any new code. So let's run this and see what it does. So I input, x direction 10, enter, y 10, enter. You can see we can start to get much greater range now of complexity in overall aggregations of elements because of the characteristics of this system. We could just run it one more time. We'll just run it whether it's used or randomization. So if we take that out, put it at the end, Control X to cut that out. Then this is also showing how I can turn off elements within the same line of code without deleting them by just having another hashtag. So that's a randomization. So I'll just close by running this another time. So we've got 10 and 10. Now, let me put a multiplier of five in there. Yeah, I got a lot it. It didn't break. It's still producing actually good geometry. It's just overlapping our major C points a lot. If I wanted less distortion in that, either I could do one of two things, I could turn down this multiplier or I could expand the size of my major C. So let's do that by putting a times five in there. Okay. So the grid is almost not recognizable on that, although it's still maintained. I'm not getting overlap like I did in the last one. So that's probably a useful example. Have fun with the assignment.