Often, when an object is being transformed, you know exactly where you want to put it. The Snap feature can be the means whereby objects get to the precise place they should be. For example, if you are constructing a set of stairs from box primitives, you can enable the Edge Snap feature to make each adjacent step be aligned precisely along the edge of the previous step. With the Snap feature enabled, an object automatically moves (or snaps) to the specified snap position when you place it close enough. If you enable the Snap features, they affect any transformations that you make in a scene.
Snap points are defined in the Grid and Snap Settings dialog box that you can open by choosing Customize Grid and Snap Settings or by right-clicking any of the first three Snap buttons on the main toolbar (these Snap buttons have a small magnet icon in them). Figure 8.17 shows the Snaps panel of the Grid and Snap Settings dialog box for Standard and NURBS objects. NURBS stands for Non-Uniform Rational B-Splines. They are a special type of object created from spline curves.
Figure 8.17: The Snaps panel includes many different points to snap to depending on the object type.
CROSS-REF | In addition to the snap points for standard objects, the Snaps panel also includes a list of snap points for NURBS objects. For more information on NURBS, see Chapter 17, "Modeling with Patches and NURBS." |
After snap points have been defined, the Snap buttons on the main toolbar activate the Snaps feature. The first Snaps button consists of a flyout with three buttons: 3D Snap toggle, 2.5D Snap toggle, and 2D Snap toggle. The 2D Snap toggle button limits all snaps to the active construction grid. The 2.5D Snap toggle button snaps to points on the construction grid as well as projected points from objects in the scene. The 3D Snap toggle button can snap to any points in 3D space.
Tip | Right-clicking the snap toggles opens the Grid and Snap Settings dialog box, except for the Spinner Snap toggle, which opens the Preference Settings dialog box. |
These Snap buttons control the snapping for translations. To the right are two other buttons: Angle Snap toggle and Percent Snap. These buttons control the snapping of rotations and scalings.
Note | The keyboard shortcut for turning the Snaps feature on and off is the S key. |
With the Snaps feature enabled, the cursor becomes blue crosshairs wherever a snap point is located.
The Snap tab in the Grid and Snap Settings dialog box has many points that can be snapped to in two categories: Standard and NURBS. The Standard snap points (previously shown in Figure 8.17) include the following:
Grid Points: Snaps to the Grid intersection points
Grid Lines: Snaps only to positions located on the Grid lines
Pivot: Snaps to an object's pivot point
Bounding Box: Snaps to one of the corners of a bounding box
Perpendicular: Snaps to a spline's next perpendicular point
Tangent: Snaps to a spline's next tangent point
Vertex: Snaps to polygon vertices
Endpoint: Snaps to a spline's end point or the end of a polygon edge
Edge/Segment: Snaps to positions only on an edge
Midpoint: Snaps to a spline's midpoint or the middle of a polygon edge
Face: Snaps to any point on the surface of a face
Center Face: Snaps to the center of a face
Several snap points specific to NURBS objects, such as NURBS points and curves, are also shown in Figure 8.16. These points include:
CV: Snaps to any NURBS Control Vertex subobject
Point: Snaps to a NURBS point
Curve Center: Snaps to the center of the NURBS curve
Curve Normal: Snaps to a point that is normal to a NURBS curve
Curve Tangent: Snaps to a point that is tangent to a NURBS curve
Curve Edge: Snaps to the edge of a NURBS curve
Curve End: Snaps to the end of a NURBS curve
Surf Center: Snaps to the center of a NURBS surface
Surf Normal: Snaps to a point that is normal to a NURBS surface
Surf Edge: Snaps to the edge of a NURBS surface
The Grid and Snap Settings dialog box holds a panel of Options, shown in Figure 8.18, in which you can set whether markers display, the size of the markers, and their color. If you click the color swatch, a Color Selector dialog box opens and enables you to select a new color. The Snap Preview Radius defines the radial distance from the snap point required before the object that is being moved is displayed at the target snap point as a preview. This value can be larger than the actual Snap Radius and is meant to provide visual feedback on the snap operation. The Snap Radius setting determines how close the cursor must be to a snap point before it snaps to it.
Figure 8.18: The Options panel includes settings for marker size and color and the Snap Strength value.
The Angle and Percent values are the strengths for any rotate and scale transformations, respectively. The Snap to Frozen Objects lets you control whether frozen items can be snapped to. You can also cause translations to be affected by the designated axis constraints with the Use Axis Constraints option. The Display Rubber Band option draws a line from the object's starting location to its snapping location.
Within any viewpoint, holding down the Shift key and right-clicking in the viewport can access a pop-up menu of grid points and options. This pop-up quadmenu lets you quickly add or reset all the current snap points and change snap options, such as Transformed Constraints and Snap to Frozen.
As a shortcut to enabling the various snapping categories, you can access the Snaps toolbar by right-clicking on the main toolbar away from the buttons and selecting Snaps from the popup menu. The Snaps toolbar, shown in Figure 8.19, can have several toggle buttons enabled at a time. Each enabled button is highlighted in yellow.
Figure 8.19: The Snaps toolbar provides a quick way to access several snap settings
Many molecules are represented by a lattice of spheres. Trying to line up the exact positions of the spheres by hand could be extremely frustrating, but using the Snap feature makes this challenge … well… a snap.
One of the simpler molecules is methane, which is composed of one carbon atom surrounded by four smaller hydrogen atoms. To reproduce this molecule as a lattice, we first need to create a tetrahedron primitive and snap spheres to each of its corners.
To create a lattice of the methane molecule, follow these steps:
Right-click the Snap toggle button in the main toolbar to open the Grid and Snap Settings, and enable the Grid Points and Vertex options. Then click the Snap toggle button (or press the S key) to enable 3D Snap mode.
Select the Create Extended Primitives Hedra menu command, set the P Family Parameter to 1.0, and drag in the Top viewport from the center of the Home Grid to the first grid point to the right to create a Tetrahedron shape.
Click and hold the Snap toggle button, and select the 3D Snap flyout option. Select the Create Standard Primitives Sphere menu command. Right-click in the Left viewport, and drag from the top left vertex to create a sphere. Set the sphere's Radius to 25.
Create three more sphere objects with Radius values of 25 that are snapped to the vertices of the Tetrahedron object.
Finally, create a sphere in the Top viewport using the same snap point as the initial tetrahedron. Set its Radius to 80.
Figure 8.20 shows the finished methane molecule.
Figure 8.20: A methane molecule lattice drawn with the help of the Snap feature