# Align Command

The align Operation is a combination of the rotate and move Operations. The align Operation will align the surface of a given volume with any other surface in the model, such that the surface centroids are coincident and the normals are pointing either in the same or opposite direction (depending on their initial alignment). The align Operation can also align a face of a volume with the xy, yz, and xz planes and the vertices of a volume with the x, y, and z axes.

To use the Align Operation

1. On the Commmand Panel, click on Geometry and then Volume.
2. Click on the Transform action button.
3. Select Align from the drop-down menu.
4. Enter the appropriate values for Volume ID(s), Surface ID and With Surface ID. This can also be done using the Pick Widget function.
5. Click Apply.

The first align command above will transform the specified volumes by computing a transformation that would align the first surface with the second surface such that the surface centroids are coincident and the normals are pointing either in the same or opposite direction (depending on their initial alignment). The first surface need not be in the specified volumes.

Align Volume <id_range> Surface <surface_id> with Surface <surface_id>[reverse][include_merged] [preview]

The second form of the align command either aligns a face of a volume or two vertices (forming a direction) with the xy, yz, and xz planes or the x, y, and z axes. If the [reverse] option is specified, the resulting alignment is flipped 180 degrees.

Align Volume <id_range> {Surface <surface_id>| Vertex <vertex_id>} {{X|Y|Z Axis}|{XY|XZ|YZ plane}} [reverse][include_merged][preview]

The third form of the command is a rotational alignment, where the specified entities are rotated about the specified axis, where the angle of rotation is the angle between the first and second locations with respect to the axis. This transformation is useful for aligning surfaces in preparation for geometry decomposition and aligning models for axis-symmetric analysis. If the [include_merged] option is used, all entities that are merged with the specified volume will be included in the align transformation also.

Align Volume <id_range> Location {options} with Location {options} about Axis {options} [include_merged] [preview]

The fourth form of the command uses vertex pairs to define the transformation. The first pair of vertices define a translation so that the source and target vertices are coincident (i.e.,the source is moved to the target). The optional second pair of vertices define a rotation such that the source and target vertices are all collinear after the transformation. The optional third pair of vertices define a rotation such that all the source and target vertices will be coplanar.  If the target vertices happen to be moved as a result of the alignment, the source vertices are moved such that they align with the original coordinates of the target vertices.

After the alignment, the first vertex pair will be coincident, the collinear vertex pair will be collinear, and the third vertex pair will be coplanar.

{Body|Volume|Surface|Curve|Vertex|Group} <id_range> Align Using Vertex <source_id> <target_id> [Collinear Vertex <source_id> <target_id> [Coplanar Vertex <source_id> <target_id>] ] [include_merged]

## Align (3 Step)

Beginning with Trelis 16.0, the command panel Align (3 Step) is included in the GUI. This new functionality is accessed via the command panel user interface in Trelis 16.0 and via the command panel and the command line in subsequent versions of Trelis.  This functionality is available for volumes, surfaces, curves, and vertices. In the first two vertex pickwidgets specify two vertices to align. The source vertex will be moved to align with the target vertex (target vertex is unchanged). In the [optional] second two vertex pickwidgets specify two vertices that will be collinear after the translation and rotation. The source vertex will be rotated about the translation target vertex (rotation target vertex is unchanged). In the [optional] third two vertex pickwidgets, specify two vertices that, when combined with the translation and rotation vertices, define source and target planes to align. The source vertex will be rotated to align with the target plane (target vertex is unchanged). 