Tarquin's Extruder Tutorial Part 1

By: Tarquin

tarquin@planetunreal.com

Tarquin's UT

### Part 1: the path

When I posted to the PU forum suggesting a gallery page of cool brushes made with the extruder, several people responded that they hadn't yet figured it out. With that in mind, here's something that may help. I only hope the title of part 1 doesn't make it show up in search engines as a religious cult ;)

Preliminaries
Use the latest build of the extruder (currently 080).
Make sure your red builder brush is reset.
Unreal uses a left-handed co-ordinate system — this means that the y-axis goes in the opposite direction to the way you may remember from school or college.

Terminology
A brush made with the extruder tool is basically a long tube, that bends to follow a path.
Essentially, we are making a multi-story box, which will be allowed to bend so each story's 'up' may be in a new direction. (wouldn't you like to work in an office like that?)
The shape is the original floor-plan of the building — the blueprint. The joints of the brush are the actual floor levels of the building. The sections of the brush are the stories of the building — the walls that join two floors together.

Now, if you were to make a picture frame out of wood, you'd take 4 pieces of wood and mitre the corners. If the pieces of wood had a square cross-section, the cut made to meet at the corners would show a face which would be a rectangle — the square shape has been stretched because the cut doesn't cross the piece of wood at a right angle.
In the same way, our office-building floor plan may be stretched at the joints. Using the _ShowJoints command will make just the floor plans out of sheets (more on the command module later). I doubt you'd ever want to actually use a brush that's just the floor plans, but building this simplified version can help you see how the shape is being made.
So 4 points, for example, will make a 3-storey brush, with 4 floor plans: the last story needs a roof as well as a floor.

Going back to our wooden version, you'd use several sections of wood, which you'd join together. With this in mind, I refer to the brush as being made from sections, which meet at joints. The vertices of the brush are all at the joints, and the polys join them up to make the sections.
The path is a list of vectors that define points in 3D space. Join these up to make a line with bends in. Now the points indicate where the joints should go, and the lines between them show the direction of the sections.
Unless the brush is made into a complete loop, the brush will also have two caps, in the same way a cylinder brush does. These correspond to the ground floor and the roof of our building.

## Example 1.0: The Shape

The shape should be described in the XY plane. Build 075 gives preset shapes, so we'll use those for now and deal with making other shapes later, so you don't need to type in any shape vectors. The square preset is the simplest, so we'll start with that:
Make sure you've selected ShapeSource=SO_pSquare and that all the values in the PresetMetrics are left at zero. This tells the preset to make a square of the default size: side length 1, with a corner at the origin and the opposite corner at the point x=1, y=1.

Here's the default preset square, shown in the XY plane. We're not building anything yet, this is just to show you what it looks like before we make anything out of it.

Above & top: 3-D view. Right: front elevation, ie the XZ plane. The y-axis comes out of the screen towards you and the square is seen side-on. |

## Example 1.1

Since the shape starts off in the XY plane, it's best at first to send the path travelling upwards.
Set MergeCoplanars to false, otherwise the BSP merging will fuse the sides and leave you with a tall box such as you'd make with the cube builder.
We're going to set 4 points, which will make a box with 3 storeys (3 not 4 because the sections go from point to point, so each point starts a section except for the last point which closes the last section).

The ShapeFactor and PathFactor values allow vectors to be entered as multiples of the grid size. For example, the path point (0,1,2) with PathFactor=64 means the point will be scaled up to (0,64,128). This makes typing them in easier, as the numbers are smaller and you can count grid points to see where a point should be. Here I've used 64 for both, since it makes fairly chunky shapes that you don't have to zoom in on too much.
You should also check that PathSource is set to SO_Vect_Abs. This means that each vector will represent a path point measured absolutely: from the origin. Setting it to relative will take each vector as measured from the last point, which can be easier. More on this later.

Set the path points thus:
`PathPoints[0] = ( 0 , 0 , 0 )
PathPoints[1] = ( 0 , 0 , 1 )
PathPoints[2] = ( 0 , 0 , 3 )
PathPoints[3] = ( 0 , 0 , 4 )
`

Above & top: 3-D view. Right: front elevation, ie the XZ plane. The y-axis comes out of the screen towards you. |

As you can see from the front elevation picture, working out the path points is just a matter of counting the grid squares.

## Example 1.2

Now we're going to allow it tip over at the joints. Type in these path points:
PathPoints[0] = ( 0 , 0 , 0 )
PathPoints[1] = ( 0 , 0 , 1 )
PathPoints[2] = ( 3 , 0 , 4 )
PathPoints[3] = ( 6 , 0 , 4 )

Above & top: 3-D view. Right: front elevation, ie the XZ plane. The y-axis comes out of the screen towards you. |

The path now goes up, then diagonally, then along parallel to the x-axis. The brush keeps the same cross-section throughout — the shape has been tilted at each joint to follow the next piece of the path.
In case you're wondering, the diagonal line in the last section is a glitch: that side poly is split into two triangles. It's fixed in build 078. (It's not dangerous, and poly merging the built brush may merge them into one. I think it's caused by the floating point values being rounded off. Blame C++ for dealing with floating point decimals instead of proper irrational numbers.)

## Conclusion

This is all I've had time to make for now, and also probably all that can hold on a single page before the images really slow down load times. I hope this will give an idea of what can be achieved with the Extruder.
I suggest that you take the last example, and add or change the path points and see what happens. Keep the path in the XZ plane for now, so you can easily visualize it in the front 2D view.
Try these:

This makes a bendy pillar:
PathPoints[0] = ( 0 , 0 , 0 )
PathPoints[1] = ( 0 , 0 , 1 )
PathPoints[2] = ( 3 , 0 , 4 )
PathPoints[3] = ( 3 , 0 , 8 )

This makes an arch:
PathPoints[0] = ( 0 , 0 , 0 )
PathPoints[1] = ( 0 , 0 , 1 )
PathPoints[2] = ( 3 , 0 , 4 )
PathPoints[3] = ( 6 , 0 , 4 )
PathPoints[4] = ( 9 , 0 , 1 )
PathPoints[5] = ( 9 , 0 , 0 )

This makes an even bendier pillar:
PathPoints[0] = ( 0 , 0 , 0 )
PathPoints[1] = ( 0 , 0 , 1 )
PathPoints[2] = ( 3 , 0 , 4 )
PathPoints[3] = ( 3 , 0 , 6 )
PathPoints[4] = ( 0 , 0 , 9 )
PathPoints[5] = ( 0 , 0 , 12 )

Suggestions and comments about this tutorial, and screenshots of things you've extruded for a gallery page are welcome: tarquin@planetunreal.com

© Tarquin 9 April 2001