Monday, April 2, 2012

Making Curvy Pipes!

This is a tutorial on how to make 12 sided brush 'curves' on the grid, such as if you were making a pipe with a bend in it. I'll be using GTKRadiant 1.5, and using quite a bit of the Clipper tool and CSG Merge. Here's a picture of what we want to end up with:

 

All right, so, first things first, we need to make a 12 sided column. We want to stay on the grid to keep our brushwork tidy, so let's carve out of a square block. 


 To do this, we're going to use the Clipper tool (Shortcut  key X). The cuts shown below use a 1-to-2 ratio of our grid units and as you'll note, this keeps our resulting vertices on the grid!



Keep going around the brush and you'll end up with a 12 sided cylinder like this: 


Why are we so concerned with staying on the grid? Well, now we can use the Clipper to cut our cylinder into wedges (shift + enter will keep both halfs of a cut with the Clipper), and we can resize those wedges by pulling on the outer edges, and the resulting wedges remain in proportion and on the grid as well!


So we have our cylinder, lets make a bend in our pipe! For starters, we'll copy the pieces we have and rotate them to be the horizontal part of our pipe.


Now we'll make ourselves some pieces as a guide that will define our bend. To do this, I duplicate a couple slices of my cylinder and resize and slice them to be a 1/4 of a donut.


Now we're going to start making our cylinder follow the guide, to begin, we don't really need our cylinders to still be made of wedges, so select all the pieces of each and use CSG-Merge to turn them back into one brush. The shortcut for CSG-Merge is Ctrl-U, and what it does is take a selection of brushes, and makes them into a single brush as long as it's a valid brush.

With the cylinder as a single brush, elongate it and then slice it with the Clipper tool to follow the first wedge of our guide.


Now for the tricky part, we need to turn our brush 26.5 degrees... but doing that in Radiant and expecting it to stay on the grid is impossible. So we're going to do an old trick known as Trisouping. Make a copy of your cylinder and clip the top to be flat again. We're going to slice this brush into several wedges vertically to prepare. For clarity, I've hidden the vertical cylinder we previously made (H key hides brushes in Radiant, Shift + H shows them again).


Let's also clip some guidelines into our guide. At this point we need to go down a gridsize. Using the same 1-to-2 ratio, slice lines where the bottom edge meets a vertical line on our piece. This will give us the points we will be matching our vertices to.


Now it's time to do some vertex manipulation. Grab one of our wedges we made and go into Vertex Manipulation mode (V key). Hold Shift and draw a box over a vertex to grab both the front and back vertices, and then move them to match our guide. Be sure to grab both vertices, otherwise Radiant will make a mess of your brush as you try and move them.


Now repeat that for each of the wedges.


Now the piece is complete... and it's a valid brush! Grab all the wedges and CSG-Merge them and you'll have a single 12-sided cylinder that is rotated 26.5 degrees!


All that's left to do is duplicate and rotate the piece we just made, and we have a 12-sided cylinder with a bend in it... in only 4 brushes! With a little texture work and detailing, and this is done! Have fun!