Thursday, July 29, 2010
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now
<< < > >>

AutoCAD Angles Demystified - November 2006

Have you ever faced the dilemma of +90 or -90? Do you perform the rotation of solid face by trial and error? If you have to pause and think when assigning angle in any AutoCAD command, then this article is for you. Rotating 2D objects on the XY plane involves angles, rotating 3D objects on the XY plane and across the planes involves angles, and the rotation of UCS involves angles. Let’s try to demystify the process—when is positive angle input required and when should you opt for negative angles?

While working on the XY plane, the default positive angles are in a counter-clockwise direction, having a zero angle in the East direction (Positive X direction). The 90 degree angle is aligning with the current Y direction. As angles are incrementing from X to Y direction, they are positive angles. The angles from Y to X are negative.

Figure 1: "Think angles" based on this figure

If you draw a 5-unit horizontal line with 2,3 as the starting point in the default XY plane, your line is parallel to positive X direction. The line drawn thus shall be in the first quadrant where X and Y both are positive. Let's assume you wish to rotate it by 30 degrees in such a way that the base point of rotation remains at 2,3 and other end of the line rotates from positive X direction to positive Y direction. I know that you smart readers will use the ROTATE command with positive 30 degrees to land at the right place.

Figure 2: Using Rotate and Rotate3D on the same objects.

Okay, so if everyone knows this, why am I making such a fuss about angles? Let's just say I have a SOLID reason for it. Draw a hidden line as shown in the above figure and use the ROTATE3D command with the following command sequence.

Command: rotate3d
Current positive angle: ANGDIR=counterclockwise ANGBASE=0
Select objects: 1 found
Select objects: Select Hidden line
Specify first point on axis or define axis by [Object/Last/View/Xaxis/Yaxis/Zaxis/2points]: Z
Specify a point on the Z axis <0,0,0>: Select same base point (e.g., 2,3,0)
Specify rotation angle or [Reference]: 30

Surprised? The line, rotated 30 degrees using the ROTATE command, and the hidden line, rotated 30 degrees using the ROTATE3D command, are overlapping each other. Does it mean that both commands are using the same logic? Whether you are working on 2D objects or 3D solid models, the logic of the angle calculation is the same. As it is with mathematics, logic for the AutoCAD programmer is the same in both cases, but as a user, we must understand the usability logic of angles. Just close your eyes and think about the possibilities available in AutoCAD for objects’ angular behavior.

The alignment of the current UCS plays a very important role in the rotational placement of a 3D solid. The solid face modification is also taking clues from the current UCS. If you need an elaborate discussion about UCS, read my article "WCS & UCS in 3D Solid Modeling," which was published in the April 2006 issue of AUGI HotNews. In 3D, you are working across the planes, hence the angular movement or rotation is to be considered in respect of positive X, Y and Z. Just observe Figure 3 and go through the observations made.

Figure 3: Positive angle directions—X to Y, Y to Z, and Z to X.

  1. When you rotate the positive Z arm of the UCS, you actually rotate the XY plane while keeping the Z arm in the same direction
  2. When you rotate the positive Z arm at a positive angle, X rotates towards Y
  3. When you rotate the positive Z arm at a negative angle, Y rotates towards X
  4. When you rotate the positive X arm of the UCS, you actually rotate the YZ plane while keeping the X arm in the same direction
  5. When you rotate the positive X arm at a positive angle, Y rotates towards Z
  6. When you rotate the positive X arm at a negative angle, Z rotates towards Y
  7. When you rotate the positive Y arm of the UCS, you actually rotate the ZX plane while keeping the Y arm in the same direction
  8. When you rotate the positive Y arm at a positive angle, Z rotates towards X
  9. When you rotate the positive Y arm at a negative angle, X rotates towards Z

Positive angles X, Y, and Z are following their natural order in the alphabet. For a clear understanding of angles on 3D solids, let's create a cube of 5 units using the BOX command. Set UCS to UCS>G>front and move UCS to the lower mid point of the box as shown in Figure 4 below. The figure 1 is aligned with current the XY plane to enhance your understanding of plus and minus angles.

Figure 4: The ROTATE command used for rotating BOX to 30 degrees in the XY plane

The hidden box shown in Figure 4 is the original box and the red box shows the effect of a 30-degree rotation applied to it. As plus 30 degrees is applied, the box has tilted from current X to Y. If you try this using negative 30 degrees, the box will tilt downwards from Y to X. For the same rotation effect, ROTATE3D can be employed. The rotation angle of 30 degrees remains the same, but the rotation will have to be performed on the Z axis.

This rule holds when the X, Y, and Z arms are positive. If you set UCS>G>Back, the orientation of the Z arm is changed to negative. In this case, the plus and minus calculations will be reversed as shown in Figure 5 below. In figure 5, a minus 30-degree rotation is applied, but you are getting results similar to Figure 4. The magic is in the hand of the Z arm.

Figure 5: The ROTATE command used for rotating BOX to minus 30 degrees in the XY plane. Please note that Z is negative [AutoCAD displays negative Z by a broken line].

Rotate3D offers many ways to rotate through options such as Object/Last/View/Xaxis/Yaxis/Zaxis/2points. It is obvious that it is most suited to 3D objects, but it can be applied to 2D objects with lots of advantages. The blue box in Figure 6 is rotated at 30 degrees along the X axis. You can observe a clear tilt from the Y to the Z arm. While remaining in default World UCS (WCS), this operation cannot be performed by the ROTATE command. The red box in Figure 6 is rotated at 30 degrees along the Z axis. You can observe a clear tilt from the X to the Y arm.

The rotation axis can also be defined by objects such as lines, arcs, circles, or 2D polylines. If the desired rotation axis is not aligning with Xaxis, Yaxis, or Zaxis, then the 2points option is handy for selecting any two points to be treated as a rotation axis.

Figure 6: The ROTATE3D command used for rotating the BOX along axis.

The positive or negative rotation depends upon the sequence of the two points selected. Just imitate Figure 7 and soon you will discover that the selection of points 1 to 2 is considered to be a positive axis (positive Z) and the selection of points 2 to 1 is considered to be a negative axis (negative Z).

Figure 7: The 2points selection for deciding rotation axis.

Rotating UCS Figure 3 is principally meant for UCS, but objects’ rotation is also performed using the same logic, hence both were discussed together. In solid modeling, the tilting of UCS itself is required several times to define Section Plane OR Slicing Plane. The option X/Y/Z available under the UCS command does this job.

Command: UCS
Current ucs name: *NO NAME*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]<World>: X
Specify rotation angle about Z axis <90>: 30

To facilitate the comparison of the UCS rotation, I have created my own stationary UCS and placed AutoCAD UCS at the same orientation as shown in Figure 8 below. We will rotate AutoCAD UCS at positive 30 and negative 30 degrees.

Figure 8: Rotating UCS around various axes.

Rotating Solid Faces
Simple building blocks of AutoCAD solids are converted into a complex model through various modification options. The modification of solid through its FACES is an important option requiring the clear understanding of rotation angle. As was stated earlier, and also in this case, the orientation of UCS plays important role.

The sample command sequence is shown below. The face modification option is available under Modify > Solid Editing > Rotate Faces.

Command: _solidedit
Solids editing automatic checking: SOLIDCHECK=1
Enter a solids editing option [Face/Edge/Body/Undo/eXit] <eXit>: _face
Enter a face editing option
[Extrude/Move/Rotate/Offset/Taper/Delete/Copy/coLor/mAterial/Undo/eXit] <eXit>: _rotate
Select faces or [Undo/Remove]: Select desired face
Select faces or [Undo/Remove/ALL]:Press Enter
Specify an axis point or [Axis by object/View/Xaxis/Yaxis/Zaxis] <2points>: X
Specify the origin of the rotation <0,0,0>: Select UCS Origin or Donut as case may be
Specify a rotation angle or [Reference]: 30

Figure 9: Rotating Faces around various axes.

Figure 10: Rotating Faces around various axes.

3DRotate
In keeping with the new dynamic 3D Modeling interface introduced in AutoCAD 2007, 3DRotate is introduced as a visual pleasure for rotating objects along the X, Y, or Z axis. As soon as you select an object for the 3DRotate command, an icon with three rings appears with an invisible globe. The Red ring is perpendicular to the current X axis, the blue ring is perpendicular to the Z axis, and the Green ring is perpendicular to the Y axis. The RBG color scheme must be in the minds of programmers. You decide the axis of rotation based on the selection of the desired color ring. At the "Pick a rotation axis" prompt, you simply drag your mouse to the Red ring and the ring changes its color to announce its readiness for selection (illustrated by a chameleon icon). Along with change in the color of the ring, a guiding line appears in Red color along the X axis. It’s a visual luxury—there is no chance of an incorrect axis selection.

As soon as you click, after dragging the mouse to the desired ring, the axis selection is confirmed. Now it is time to supply the angle. Try it with plus and minus 30 degrees; the rotation logic is the same as discussed earlier. The chameleon is dynamic—you can show "angle start point" and "angle end point" by mouse selection. Depending on the Polar/Osnap/Otrack setting, you can actually see your object’s rotation on the screen to help you make a better decision.

Up to AutoCAD 2006, tracking was possible for the X and Y axis only. As Z axis tracking is introduced in AutoCAD 2007, angle rotation using 3DRotate really is a visual pleasure.

More Angles
The dynamic displays of angles depend on the Drafting Settings. As they are affecting your angular decision-making, I think it warrants discussion here. Dsettings is the command for invoking the dialog box (shown in Figure 11). While drawing a line, pline, or inserting a block, you need to specify the angle (AutoCAD has multiple ways of doing the same thing) which will depend on these settings.

The angle also comes into the picture when setting Hatch patterns. Hatching at a zero angle means the hatch pattern will appear as defined. The Oblique Angle option, available in the Style dialog box, considers Zero for normal text writing. Specifying plus 15 degrees will make the text tilt 15 degrees towards the right. The minus 15 degrees tilts text to the left. While writing through the TEXT or DTEXT command or Dimensioning, AutoCAD follows the same logic of angle rotation.

Figure 11: Drafting settings and figures showing effect of Polar Angle measurement method.

Case I
Increment angle for Polar Angle settings is 30 degrees, Track orthogonally only is ON, and Polar Angle measurement is Absolute.

Figure 12

The tracking of the angle is performed by keeping any angle in multiples of 30 and orthogonal angle of 0, 90, 180, or 270.

Case II
Increment angle for Polar Angle settings is 30 degrees, Track using all polar angle settings is ON, and Polar Angle measurement is Absolute.

Figure 13

The tracking of angle is performed by keeping both angles in multiple of 30.

Basic Angles
Searching points is basic to AutoCAD and the learning curve for AutoCAD starts with searching points through the Absolute co-ordinates method, the Relative co-ordinate method, and the Polar co-ordinate method. The Polar, Cylindrical, and Spherical point searching invariably involve angles. If you need an elaborate discussion on these methods, I recommend that you to join my AUGI Training Program class—ATP157 "Think 3D in AutoCAD," which is in session now.

(Discuss this Article! in AUGI's new Discussion Forums.)

Submitted by Mohmed Zuber Shaikh. Mohmed is a civil engineer in Bharuch, employed by Sardar Sarovar Narmada Nigam Limited, Gandhinagar (India). He can be contacted via email at mzyshaikh1@yahoo.co.in


<< < > >>