 Okay, so now that we know a little bit about sine and cosine, let's take a look at creating our base pattern for our training fence. Okay, so let's come in here to our attribute wrangle node. We don't need this last guy here. All right, so let's come into our attribute wrangle and let's just focus on the X direction. So I'm going to hit 3 on the keyboard. What I want to do is get our basic pattern. I need to set up some sort of pattern that's like this. All right, but we need it to just go on this direction or this side of the grid. Okay, so let's take care of all of that. So I'm going to keep this particular expression going here, but I'm actually going to put this into a local variable. So I'm going to say float X val is equal to this cosine value here. All right, this will just help keep our code nice and clear because then I can go and just feed it into this value right here. So I can say X val, all right, just something to stay organized. All right, so now that we've got this particular value right here, all right, so we got this X value, I need this particular portion of the curve to actually sit right here. And we need this portion to stay relatively over there. That's totally fine if it's over there. So to do that, what I'm going to do is I'm going to fit this guy. So I'm going to say fit, and we're going to fit this value that we have right here. We're going to fit this from negative one to one, all right, because the cosine will give us a value between negative one and one. I actually need to remap that so that we are fitting between zero and one, like that. Look at that. How cool is that? All right, and if I come in here and say one minus, you can see I can flip it over and now I actually have my curve perfectly on the grid and it's fitting within zero to one. And this is very, very important when it comes to creating these tiling patterns to always work within what they call or refer to as a unit grid, right? If our pattern works well in the unit grid, that'll tile no problem, all right? So that's why we usually work in this unit grid. Okay, cool. So now I've got that particular portion of the curve done. So this basically, if we take a look, I actually have a picture up here. So we kind of have this spiraling motion, all right, on each one of these links inside of the chain link fence, all right? And they basically alternate between each other. So that's basically what we need to accomplish here with our particular pattern, all right? So what I need to do, if you also notice in the chain pattern, we kind of weave in and out of every other link in the fence, all right? So we need to get that weaving pattern. We already have the appropriate pattern for the diamond, if you will. What we need to do is we need to create another one of these guys. So I'm just going to copy this here, and I'm going to paste this down. And this is going to be our z value, all right? I want to create a nice weaving value. And to do that, I need this guy to basically spiral in and out, all right? Cool. So this is our z value, and what I'm going to do is use the sign for this and leave these guys like so, all right? So I'm going to say at p.z is now equal to the z-val, look at that. We have our spiral, all right? And that's basically what we were working on in the last lecture, okay? And so now what I can do is I can come in here and just flatten that out a little bit, all right? So I can do something like 0.1, and we get this nice spiraling effect, okay? So all we need to do now to make our chain link pattern is to mirror this. So I'm going to mirror this over here. And in this case, I'm not going to keep the original, all right? I just want the new mirror. And I actually want to scale this and y, so it's the opposite of this side, all right? So I need the spiraling action to be opposite than the other side, right? Now they're exactly the same if I were to keep this guy right here, all right? You can see that the spiral is exactly the same, and they need them to alternate. So this spiraling action needs to move in the opposite direction that this one is going in. Cool. So to do that, we just need to flip it on y, like so, and I need to turn this off here. There we go. I'm going to flip this guy in y right here, and then just move it up one. Another benefit to working in a unit grid. Everything basically is just the value of one. We're just moving this pattern around by a unit of one. And then let's merge those two guys back together, like so. And we basically have the start of our chain leap fence. But what we need to do is we need to come in here and play around with some of these offsets. So I need to come up here, and let's create an offset value up here. So I'm going to call this float offset, and this is going to be equal to chf offset. So I'm going to create a float channel. All right, so let's create that value, and then let's put it in for our offset amount right up here. We're going to say offset, and offset, all right. So you can see that totally hoses the whole thing. But what it allows us to do at this point now is it allows us to offset that inner portion, all right? If I can get it to work for me, there we go. Look at that. Cool. So now we have these two top parts crisscrossing, so you can see they're spiraling around each other. Very cool. And that has so many uses. I mean, you can basically create lots of different types of patterns with this. We're basically creating a braid in a way, a really basic one, but this is a braid with just two curves. All right, so I also want to come in here and scale this by something like .5, I think. All right. I'll make this feel a little bit more realistic. So with that, look at that, we now have our single pattern there. So if I come in here and we flattened out in Z a little bit more, we have a perfectly valid chain link component, all right? It's kind of the base pattern, if you will. All right, we'll come in here to that image again. We basically created just this section right here, you know. All right, cool. So with that, we're pretty much good to go. If I were to drop down a copy to transform node now, all right, we copied this over one in X, we get that tiling amount, all right? But what we need to do is we need to actually take into account this guy right here, okay? So let's keep working on this as we get through. So let's keep working on this in the next lecture.