The Align To Target tool is used to automatically find a best-fit 3D alignment between a selection on one mesh, and a second mesh. This is a very difficult problem, so in many cases it will not work unless you kind of "help it along" by giving it a good starting point. See below for details.

To use this tool, you must first set a Target Object. The input selection will be fit to the target object surface. See the Target Object section of the 3D Scene page for details on how to set an object as the active target.

The property panel is shown to the right. The way the alignment is found is through an iterative process, where the alignment (ideally) gets slightly better at each round. The Solve Iterations slider sets the number of rounds. If the alignment is not good enough, the Improve Solution button will run another set of alignment rounds.

You can also set a maximum deviation you are willing to accept, using the Error Tolerance slider. If the maximum selection-vertex-to-target-surface distance becomes smaller than this value, the alignment will terminate early (ie before running the maximum number of steps).

If you wish to start over, use the Reset button to discard the current alignment.

The images below show a simple usage of Align To Target, to precisely align a cylinder to a cylindrical-shaped channel in a 3D scan. I sized the cylinder to a radius determined using the Measure Tool, and roughly positioned it in the hole. We set the scan as Target, select the length of the cylinder (but not the caps),  and then run Align To Target.

The image to the right shows the resulting alignment (I deleted the caps so we could see inside the cylinder). Note the overlapping areas on the cylinder and scan, this indicates that the alignment is reasonably accurate.

A critical step but non-obvious in this example is that the cylinder is already approximately aligned with the cylindrical region in the scan. The Align To Target tool is sensitive to initial conditions, which in this case is the initial alignment between the parts. If the cylinder was just floating off in space, it would likely have been aligned to a random part of the scan surface. So, if you want to align to a sub-region of the Target, you first have to use the Transform tool to get your part in roughly the right spot, before using Align to Target. 

 

Tips and Tricks

In the example to the left, I would like to replace the face on an existing model with a 3D scan of a second face. The actual replacement can be done many ways, but first we need to get the scan lined up with the existing head. Align to Target is an ideal tool for this task, however as above, we need to position the scan in roughly the right location for Align To Target to work properly.

In the images below, I show the initial approximate alignment that I set up using the Transform tool, then the selection I used to align, the alignment inside the Align To Target tool, and the final result after accepting the alignment. I will continue to use this example in the Attract To Target tool, to show an easy way to deform the existing face to fit the scan.

In creating the above example, it took several tries to find a good combination of initial rough alignment and selection region. The results of Align To Target are sensitive to both of these factors.

If your alignment keeps getting stuck on some other feature, try using Separate to extract the specific region you want to align to, remesh it, and use that as the Target. If you take this approach you can often get away with much less precision in the initial alignment.

Another thing to keep in mind is that Align To Target does better when there are distinct features in the selection, such that the "right" alignment is unique, and other alignments would necessarily have high deviation. For example if both of your objects have regular repeating patterns, it is easy for the alignment to get stuck. In those cases, try experimenting with the input selection, ie by removing repeating or very smooth regions.

If you are interested in the technical details, this alignment is based on a simple Vertex-to-Mesh ICP (Iterative Closest Point) strategy. This is quite a simple technique, which does have a lot of limitations. However by providing real-time feedback and control of the input selection, we have found that we can do alignments that would be very difficult for fully-automatic methods.