HowTo:Weld

From VsWiki
Revision as of 01:33, 30 April 2007 by chuck_starchaser (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Welding

This is probably the most difficult operation in modelling, and accordingly, it is, and probably will remain, my longest tutorial. Be sure to read the beveling tutorial; otherwise you won't understand why the thing we do in this tutorial looks so good.

So, you got two complex, smooth-shaded meshes, such as a ship's fuselage and a wing, or a partially embedded engine. You can leave them interpenetrating each other, if that looks good enough; but to paraphrase good old Moses, "You can tell rookie modellers because they just throw a bunch of shapes, leave them like that, and the ships look like they are glued together."

But if you use boolean ops, chances are you'll end up with gazillions of triangles, and it will shade very weirdly.

The ship I will use for this tutorial is a work in progress as of this writing. I was just about to start welding the control tower, and it occurred to me to save screenshots of the process, and make a tutorial out of it.

Here's a pic of the ship before welding the tower:


0.jpg


First of all, ensure that the two shapes to weld are separate objects. Separate one of them by highlighting it and pressing P, if necessary. Also make sure your two shapes are looking good; shading properly. It will be very diffucult to edit the mesh once the two parts are put together. First thing we need to do is isolate the parts of the mesh we want to work with. Working with the entire ship's mesh will likely result in mistakes that you might not discover till much later, such as moving something while a vertex or facet is selected on the other side of the ship, that you didn't intend to move...

So, highlight the faces of the fuselage that are near the tower:


1.jpg


Press P to separate them. Got to Object mode, with Tab, and select the newly separated polys, and the tower, and move them, by pressing M, to another layer. Any empty layer will do. Now switch to that layer.


2.jpg


I'd already cut the tower, by the time I thought of writing this tutorial, but I hadn't yet cut the main body's mesh; so we'll do so now. Problem is, we can't see the edge of the tower... What to do?


3.jpg


Transparent mode doesn't help us, because the tower has too many lines, and it's not easy to tell which of the lines are edge lines.

What we'll do is move the tower down momentarily, --just by 0.01 in Y seems to be enough in this case. Just be sure to write down the number, as we'll need to move it back up by the same amoung...


4.jpg


Now we can see the edge, so highlight the polygons and press Shift-K, for the cut tool, and follow the outline as closely as possible; then select all the polys to remove...


5.jpg


... and press X to delete them. Unfortunately, we only get vertices where the cut line crosses existing edges, and straight lines in between.


6.jpg


We'll select any line needing an extra vertex, press W for the extra menu, and then Subdivide. But the new vertex needs to be moved, and if we move it by eyeball, it will end up causing shading artifacts. Accuracy is everything in this rough trade...

My trick, in this situation is to select a vertex in the same polygon, Shift-S -> Snap Cursor to Selection, and then select the vertex I want to move, and move it by scaling to cursor:


7.jpg


This guarantees the vertex moves along the same plane as the polygon from which it originated. But more than one scaling may be necessary to get it the vertex to the right place...


8.jpg


Okay, granted, that's not a vertex in the same polygon, where I have the cursor, but almost :)... And I do the same for the vertex at the front...


9.jpg


Now, the other two vertices to the right and below aren't doing much, so I shift-select them...


10.jpg


And W -> Merge -> At first. But now I can take those triangles, select them...


11.jpg


...and turn them into a quad with F.


12.jpg


And the same with the next two triangles. Just keep going, cleaning up as you go.


13.jpg


But you may need to switch views sometimes, to understand what you're doing...


14.jpg


What were we doing, anyways? Ah, yes, moving vertices so that they align (vertically only) with the tower's edge vertices.

Here in a side-view (front is up), I see that the highlighted vertex doesn't line up with the nearest tower vertex (slightly up and to the left of it). Well, up is to the right in this view, so vertical alignment is horizontal alignment... So I will use the same trick: I put my cursor on another vertex in the same polygon, and I scale to cursor (you may need to press "." (period) to set the cursor as scaling center), and move it by scaling:


15.jpg


Keep doing this till all vertices line up with vertices of the other mesh, and cleaning up as you go. Once done, the mesh should look clean and mostly consisting of quads, and preferably with most edges radiating from the cut line, rather than arriving at it at a shallow angle. I have one shallow angle line there, on the right, but there's nothing I can do about it, really.


16.jpg


So now [Tab] back to Object mode, select both meshes and Ctrl-J to Join them. Actually, NO, first move the tower back up by 0.01, or as needed, to compensate for when we moved it down to see the edge. Then Join them:


17.jpg


Tab back to edit mode. The vertices should be so close together as to look as one, but they aren't joined yet. So start joining them together, one pair at a time, using W -> Merge -> At Center...


18.jpg


...but we may run into trouble sometimes, like extra vertices in one mesh or the other.


19.jpg


Just select the edge needing an extra vertex, W -> Subdivide, then select the pre-existing vertex, then select the new one, and W -> Merge -> At first.


20.jpg


But we don't want all those shallow angles to the cut line, so, to make the edges radiate from the cut line, select two triangles and Ctrl-F to Flip them...


21.jpg


Select the next two triangles and flip them...


22.jpg


Select the next two triangles and flip them...


23.jpg


Very good. If all went well, it should look horrible :)


24.jpg


Yep, this is all you'd get from a boolean operation, in terms of shading... But we want better than that, don't we? But we don't want to go the route of subsurfing everything just to get one weld to look right; and it wouldn't look right, anyways.

So what do we do?

Our next step is to make a cut parallel to the weld line. Select all the polys to cut. You can just select one and use Ctrl-Alt-Shift-F.


25.jpg


And cut along:


26.jpg


And clean up after yourself:


27.jpg


Now we want to make another parallel cut, on the other piece:


28.jpg


Trust me. Just do it:


29.jpg


And clean up --i.e.: Join vertices, join triangles into quads, etc.


30.jpg


Let's have a look at it now, in Object mode (Tab):


31.jpg


Not too bad, eh? What a difference those two cuts made! If you don't know why, it means you haven't read my beveling tutorial. I told you to read it first...

But it's still not good enough; and Blender's renderer won't shade smoothly across surfaces at 90 degree angles, so we're not done yet.

Select the entire welding edge:


32.jpg


Go to the Mesh menu, Scripts -> Bevel Center. Put the bevel quantity down to 0.01, press Bevel, then move the slider one tiny bit at a time, until about one third of the whole width of the weld is taken up by the bevels:


33.jpg


Bevel Center works like a charm, but it does a few weird things, though: Turns your geometry to flat shading, changes your materials, flips your normals, so after pressing Exit to get rid of the Bevel Center panel, press Ctrl-+ to select the whole welding area...


34.jpg


... and W -> Set Smooth; Ctrl-N; and find the original material, and Assign it agin, if necessary; then...


35.jpg


... then it should look pretty good ...


36.jpg


If so, then select it in Object mode, and send it back to the layer it came from:


37.jpg


Select the rest of the ship and Ctrl-J join them; then Tab to Edit mode, select all polygons on both sides of the separation line,


38.jpg


and Remove Doubles. The whole thing should be back in one piece, now.


39.jpg


And it should look better than any boolean, subsurfing or normal map tricks you may have heard of...


40.jpg


But don't get carried away, now; sharp edges look better in some places. Use common sense.


41.jpg


Cheers!

chuck_starchaser