Wednesday, February 20, 2013

Quick Tip - Join/Split Curves

While working with Blender curves the other day, there were two operations which I wanted to perform at the time, but couldn't find any way to do so. In theory, they were quite simple to implement, and pretty darn useful in certain cases; yet, they were nowhere to be found! A few days later, I finally had some time to look into how to implement them...

As it turns out, I didn't get very far with that. In fact, it turns out that these tools already existed! Argh! All that deleting and re-adding for nothing!

"Join" (aka "Make Segment" in Blender)

The first of these tools is what I call the "join" tool. That is, you've got two separate curves (within the same curve datablock), which you may have created at different times for convenience or other reasons. In the image above, we have two such curves:
  1. Olive-Handles (i.e. big outer one). This starts at point H, and ends at point 1.
  2. Orange-Handles (i.e. small inner spiral). This starts at point 2, and ends at point T.
We wish to join the two curves together between points 1 and 2 to create a single curve which traces out the larger spiral pattern we're interested in.

It turns out though, that if you were to try and find a tool for "joining curves" together within Edit Mode, you won't find any.

Instead, if you think in terms of the two what you've got selected when you try to perform such an operation (i.e. you'd select points 1 and 2 to indicate that the curves should be joined between these points), then it becomes obvious in hindsight what you need to be doing: making a new curve segment between the selected control points. In other words, the tool you want/need here is Make Segment (FKEY).

"Split" (aka "Delete Segment")

It was a similar story for the second tool, which I called "split". The idea here is that you've got a curve (1), which may have been set to cyclic (or not - but in this case it was). Anyways, the crux of the story is that you'd like to be able to make a well defined bump on the surface of the curve (as in 2).

However, to get from the selected verts in 1 to those in 2, you don't want to do this by repeatedly subdividing the segment between the two selected verts, as doing this tends to start messing with your perception a bit (as well as just being a pain, with much less freedom than simply ctrl-clicking to place new verts at an endpoint).

Hence, you try to split or cut the curve between these two selected verts with no avail. As we know though, there are once again no such tools.

Instead, the magic command has been sitting right under our noses once again: "Delete Segment" (second item in the Delete menu - first/default is selected verts, last is whole curve IIRC). Ahh... if we'd known that the terminology here was based around calling the parts of the curve between selected verts as segments... uhm... moving along ;)

Perhaps the best part here is that when dealing with cyclic curves, it will automatically rejig the curve so that the previous Start/End points will end up just being ordinary points along the curve, while the start/end points of the new curve will now be the selected verts. Hence, adding extensions to the curve from the new start/end points is as simple as simply extruding/placing new verts using standard techniques.

1) Make Segment (FKEY) = Operation to join two curves together between two selected control points
2) Delete Segment (XKEY) = Operation to split and reflow curve between two selected control points
3) Post extended-holiday brain fades suck. Long holidays from time to time though are nice :) 

No comments:

Post a Comment