Bug Watch February 2005: Ancient Egyptians Managed It, So Why Can't AutoCAD?

15 Feb, 2005 By: Steve Johnson Cadalyst

Unwanted round corners in 3D extrusions, line spacing in leaders and a gripe about gradients.

Mysteries of the Pyramids (2004 to 2005 SP1)
AutoCAD's Extrude command sometimes throws a curve ball. Let's say we want to create a 3D solid that fills the space between the polylines shown here (figure 1), forming a truncated pyramid. Start with a 10X10 unit polyline square and a 30X30 unit square located 10 units below it.

Figure 1. The polyline squares defining the outline of the truncated pyramid.

You should be able to use the Extrude command on the top polyline, with a height of -10 and a taper angle of -45. AutoCAD decides to round off the corners for me, which I didn't want (figure 2).

Figure 2. The Extrude command mistakenly rounds off the corners of the pyramid.

This only occurs when the object being extruded is a long way from the origin, and a negative extrusion angle is used. It doesn't matter if a positive or negative extrusion height is used. Moving the UCS closer to the objects does not help.

Before you write to tell me that this is just one of those unfortunate but unavoidable limitations caused by floating point rounding errors, go and try the same thing in AutoCAD 2002. The Extrude command works fine there on the exact objects.
Workaround: If you move the polyline closer to 0,0, AutoCAD will extrude it correctly. Alternatively, perform an extrusion that uses a positive extrusion angle. In this case, extruding the bottom polyline using a height of 10 and a taper angle of 45 will give you the expected results (figure 3).

Figure 3. Using a positive extrusion angle yields the correct results.

Not Exactly (2000 to 2005 SP1)
Submitted by Mike Perry, a moderator on the AUGI Forums, where it was originally reported.

The TSPACETYPE system variable controls the type of line space style used in mtext. A setting of 1 is equivalent to At Least, which adjusts line spacing based on the tallest characters in a line. A setting of 2 is equivalent to Exactly, which uses the specified line spacing, regardless of individual character sizes.

The Qleader command does not honor the TSPACETYPE system variable. It always uses the At Least setting, which means you don't get exactly what you want. The same applies to the Leader and Dim Leader commands. It actually occurs with all dimension commands, but in most cases it's not immediately obvious.
Workaround. None known that will prevent AutoCAD from creating leader and dimension mtext set to At Least spacing. All you can do is change it after creation. You could create a menu macro or LISP routine to do so.

Gradient Gripe (2004 to 2005 SP1)
Also submitted by Mike Perry.

The gradient hatching feature added by AutoCAD 2004 has made it much easier to create some very pretty drawings. But it's not perfect. Gradient hatches that should be identical are different if the hatched objects are drawn at different angles.

Draw a square at 0 degrees and another at 45 degrees. Use the Bhatch command to fill the first square with a standard blue-to-white left-to-right linear gradient hatch at 0 degrees, and then do the same with the second square using an angle of 45 degrees. Move one hatch on top of another and compare the colors at the extremities. The darkest part of the 45-degree hatch will not be anywhere near as dark as the darkest part of the 0-degree hatch. Similarly, the lightest part of the 45-degree hatch will not be anywhere near as light as the darkest part of the 0-degree hatch. The 45-degree hatch has a color range equivalent to the middle 50% of the 0-degree hatch. This will not matter for many users, but if you are trying to arrange your gradient hatches to blend into each other, you will find the task very difficult indeed.

When AutoCAD creates the gradient hatch, it is creating an imaginary 0-degree bounding box to define the extents of the gradient, then clipping away the parts of the bounding box that don't fit inside the objects being hatched. This results in the loss of the extremities of the gradient. The gradient is always calculated relative to the WCS, so rotating the UCS will not help.
Workaround: Rotate your hatch boundary objects such that they are parallel to 0 degrees and hatch them at 0 degrees. Convert the hatch to a block -- for example, using Edit / Cut and Edit / Paste as Block. Then rotate the hatch and boundary objects back to their original angle

AutoCAD Tips!

Lynn Allen

In her easy-to-follow, friendly style, long-time Cadalyst contributing editor and Autodesk Technical Evangelist Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD video tips. Subscribe to the free Cadalyst Video Picks newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!

Follow Lynn on TwitterFollow Lynn on Twitter

Which device do you typically use to read content?
A desktop computer / tower workstation
A tablet
A smartphone
A laptop or mobile workstation
I regularly use both a desktop computer and a smartphone for this purpose
I regularly use another combination of devices for this purpose
I prefer to print out articles from the website and read them on paper
Submit Vote

Download Cadalyst, Fall 2015

Download Cadalyst Magazine Special Edition