龙龙 2007-3-29 14:20
Learning Curve: All the Better to Hatch You With
AutoCAD 2006 includes crosshatching improvements that save It was a dark and stormy night. The wind was blowing, it was cold and icy rain was falling."I'm sick of this terrible weather," moaned Captain LearnCurve. "We need a tropical vacation."
"Forget it!" replied his gorgeous wife. "It's less than a week since we got back from six weeks on Maui!"
Captain LearnCurve sighed and resigned himself to watching thecriss-crossing patterns made by rain running down the windows. He wouldbe stuck in the house, quite miserable, until the storm let up. Thepredicament reminded him that in the good old days of PAP (pencil andpaper) drafting and one of the worst jobs it entailed -- applyingcrosshatching to a complex section view. It could, quite literally,take several days.
Hatching v1.0
When AutoCAD cameon the scene, things got a lot better. It automatically appliedhatching "almost instantly," depending on the complexity of the hatcharea and on the speed of the computer (see my [url=http://management.cadalyst.com/cadman/article/articleDetail.jsp?id=397564]20th Anniversary column[/url]).
Good as it was, however, it still had a couple of thin spots. Thethinnest spot involved the definition of the hatch boundary. It had tobe formed from a set of objects that exactly touched at their ends.There could not be any gaps or overlaps, or things would not workproperly. If you did make a mistake, or if the design subsequentlychanged, then you had to delete the hatching and start over.
[align=center][table][tr] [td][img=450,381]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-01.jpg[/img]
Figure 1. Gaps and overlaps confused the early versions of the Hatch command.
[/td][/tr][/table][/align]By the way, if you want to duplicate this in the current releases, thensimply click on Add: Select Objects instead of the usual Add: PickPoints button in the Hatch and Gradient dialog box.
Hatching v2.0
The majorbreakthrough came in Release 12. In fact, the change was so significantthat it became a new command called BHatch (Boundary Hatch). It was nolonger necessary to select each boundary object, nor was it necessaryfor the boundary objects to exactly touch at their ends. They stillcouldn't have gaps, but at least they could overlap.
All we had to do was select a point within the desired area.BHatch would go out looking for objects or sections of objects thatbounded the area, and would then create a polyline boundary. The singleboundary polyline would then be hatched using the old Hatch commandmechanism.
For all its other flaws, the ill-fated Release 13 did have someredeeming features. One of these was the fact that hatched areas nowbecame associative with their boundaries. This meant that you could usegrip editing or the Stretch command to change the shape of the area andthe hatching would automatically update to conform to the new boundary.
Release 14 added the ability to apply solid fills to areas.This is essentially the hatch command as we know it today -- or atleast it was until recently.
Hatching v2.5
AutoCAD 2006 only added five improvements to hatching, but they are all very significant.
[b]Area Answers.[/b] Okay, I've started with a lie already. This is notdirectly part of the BHatch command, but it is an improvement tohatching nonetheless.
Have you ever had fun trying to use the Area command on acomplex, multi-object area? It can get a little messy as you add andsubtract objects. Now, however, all you need to do is to hatch thearea. Single-click on it and then start the Properties command (Modify/ Properties), or vice-versa, and watch in shock and awe as theproperties palette now lists the area covered by the hatching. If youselect two or more hatched areas, then it displays the total cumulativearea.
Oh, rats. My topic for next month was going to be on how to handle the complexities of the Area command. Oh, well?
[b]Several Degrees of Separation.[/b] Previously, Hatch and BHatch letus select several non-contiguous boundary definitions in one run of thecommand. This produced a single hatch object that was applied to all ofthe enclosed areas.
Usually this is desirable from a simplicity point of view, butnow it's possible to select several non-contiguous boundary definitionsat one time and yet have a separate hatch object applied to each ofthem. Better yet, you can break an existing multi-area single-hatchobject up into separate hatch objects.
The dialog boxes are virtually identical, whether you'recreating a new hatch or editing an existing one. I'll use the Editdialog box for my examples, because the Create box has several optionsgreyed out.
Select Modify / Object / Hatch, or double-click on a hatchedarea to invoke the HatchEdit command. This brings up the Hatch Editdialog box.
[align=center][table][tr] [td][img=450,530]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-02.jpg[/img]
Figure 2. The Hatch Edit dialog box is used to edit hatched areas.
[/td][/tr][/table][/align]Select the Separate Hatches option, and then click OK. Like magic, eachseparate hatched area is now a discrete, separate object.
[b]In the Beginning...[/b] In the earliest releases, the Hatch commandalways began at the drawing origin (0,0) when creating a hatched area.If the hatched area didn't surround the origin then there wouldn't be aline that passed through the origin, but there would always be onewhose imaginary extension did. If the hatching did not line up with thearea boundaries, well, that was too bad.
This got marginally better when UCS (User Coordinate Systems)were introduced, in that hatching always aligned with the current UCSorigin. If hatching did not align properly with the boundaries we couldalways delete the hatching, move the UCS origin and then hatch again.
In the current releases, the hatch dialog boxes have a new zonein the lower left that let us specify the origin for each hatch objectindividually. Among other modes, we can pick a specific point, which isusually snapped to a significant point on the boundary, or we can haveit default to using the extents of the area boundary.
[b]Déjà Vu — Deux.[/b] BHatch usually works by starting from the pickedpoint. It radiates outward, looking for boundary objects and thenbuilds a polyline that defines a single boundary object. It applies thehatching and then normally it deletes the boundary object. If we want,we can have it retain the boundary polyline or convert it to a region.
HatchEdit now lets us recreate the boundary, either as a polyline or as a region, if we decide we need it back.
[b]Buddy, Can You Spare a Change?[/b] Let's end with one of the mostsignificant of the new features. BHatch now lets you edit a hatchboundary. Okay, you caught me in another lie. BHatch doesn't allowthis, but HatchEdit does.
Start with a drawing that looks something like this.
[align=center][table=450][tr] [td][img=450,329]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-03.jpg[/img]
Figure 3. A hatched area.
[/td][/tr][/table][/align]Now add another rectangular island within the hatched area.
[align=center][table][tr] [td][img=450,328]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-04.jpg[/img]
Figure 4. Add a rectangular island within the hatched area.
[/td][/tr][/table][/align]In previous releases it would have been necessary to delete thehatching and then create it again in order to add this island. Now, inAutoCAD 2006 and later, simply click on the Add: Select Objects buttonin the Boundaries section in the upper-right corner of the dialog box.The box is dismissed, and you are invited to select objects. Click onthe rectangle and then press Enter to complete the selection process.
Click on OK to complete the editing, and your drawing now looks like this.
[align=center][table][tr] [td][img=450,327]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-05.jpg[/img]
Figure 5. The rectangular island has been added to the hatched area.
[/td][/tr][/table][/align]That was a lot easier than the old way, wasn't it? This isespecially true when you realize that you can add more than one objectat a time to the boundary set, and that added objects need not fallwithin the existing hatched area. Not only that, but everything isstill fully associative.
[align=center][table][tr] [td][img=450,317]http://management.cadalyst.com/cadman/data/articlestandard/cadman/062007/402740/LearningCurve179-06.jpg[/img]
Figure 6. Boundary objects added with HatchEdit need not fall within current hatched areas.
[/td][/tr][/table][/align]There are two final points to note with the new HatchEditfunctionality. The first is that it can also be used to remove boundaryobjects, so that figure 5 can be turned back into Figure 4.
The second point is that we are not limited to selectingobjects to add. We can also pick a point within the bounded area, justas we are used to doing when creating hatched areas. The results can bea little bizarre, however, until you realize one thing. As near as Ican tell, picking a point reverses the current hatch status. That is,if you pick inside an existing hatched area, it then it becomesunhatched and unhatched islands within it become hatched, andvice-versa. Experiment a bit and you will see what I mean.
A Hatch-It Job
Okay, I lied abit again, but it's not my fault. The New Features Workshop for AutoCAD2006 only lists five improvements to hatching, but there is a sixth. Ifyou click on the sideways arrowhead in the lower-right corner of theBHatch/HatchEdit dialog boxes, they expand out to show advancedoptions. Another feature that was added in AutoCAD 2006 is that it isnow possible to specify a "fuzz factor." This means that gaps smallerthan the specified amount are ignored and the hatch is createdproperly.
Unbelievable -- I managed to get through an entire column on hatching without once using the word "egg."
And Now For Something Completely Different
There are two kinds of swimming snorkel in the world. The ones with arigid molded U-shape at the bottom are best for surface snorkelling,because they do not pull sideways at your mouth. Those with a ribbedflexible section at the bottom are best for scuba diving, because themouthpiece tends to pull down and away from your scuba regulator whennot in use.