Composite Paths

 < Day Day Up > 



A composite path is simply the combining of two or more paths into one single path. A longer definition would include an explanation about using the Join, Split, Union, Divide, Intersect, Punch, Crop, and Transparency commands, and the conversion of text to paths. A few preferences can also affect the outcome of a composite path.

Using Join/Split

Paths have a set direction. Rectangle, Polygon, and Ellipse tools all draw in a clockwise direction. The direction in which you draw or place points sets the direction of the path when you use the Line, Pen, and Bezigon tools. This concept must be foremost in your mind when you make composite paths, but it's most important when making composite paths from multiple closed paths. The best way to provide for a possible compound path is to draw in a clockwise direction on the outside of objects, and counterclockwise on the "holes." As a rule, type fonts are built this way to create a "natural" compound path if the type is converted to paths.

Note 

To be confident that everything will work as you've planned, you can use one of two tools found in three locations. The Correct Direction Xtra is found in the Xtras ® Cleanup menu, or on your Main menu bar if you've put it there. It's also found in the Modify ® Alter Path menu. These tools will change the direction of paths if it is necessary in order to make a compound path.

You have two ways to combine two or more open paths into a single path. You can continue drawing one path, and place a point on an existing end point on another path. You can also connect the two paths by choosing Modify ® Join. This command does one of two things, depending on the physical relationship of the paths to each other: It connects the two end points that are nearest each other; or, if the four end points are equidistant, it connects the end points (not the beginning points) of both lines. In the latter instance, changing the direction of a line changes the connecting points, because the end points on the path are reversed. In real life, if you want two specific points to connect, you'll save a lot of time by continuing one path and connecting to the other path.

Working with closed paths expands the possibilities even more. Figure 7-7 begins on the left with a grouping of herons and egrets of different colors and fills. In the Objects inspector, an option named Even/Odd Fill utilizes the direction of the paths as explained previously. The center illustration shows what happens when the four objects are selected and Modify ® Join is used with Even/Odd Fill turned on (default). Notice how overlapping objects change color to transparent and the bottom object's color (black here). If you rearrange the colors of the objects, the final result will have a different color, as well. On the left side of the figure, the Great Blue Heron at the rear has been given a light gray tone, and the Cattle Egret (smallest bird here) was given a black fill. The group was joined and Even/Odd Fill was turned off.

click to expand
Figure 7-7: The effect of Join with Even/Odd Fill turned on (middle) and off (right)

The opposite of Join is Split. If you select a single point on a path and choose Modify ® Split, the point turns into two disconnected points, and the path becomes two paths. If you have a compound path, such as the birds in Figure 7-6, each shape becomes a separate entity, and all the shapes gain the same fill and stroke attributes of the bottom object — in this example everything turns black. The overall effect is the same as choosing the Union command, except there are the four original shapes with the same fill. The Union command presents one single shape.

The Combine commands

I use Union, Divide, Intersect, and Punch so often that I've installed buttons for them on my Main toolbar so I don't have to travel through the Modify ® Combine menu. They work only on closed paths. Figure 7-8 gives an example of each command. Here's how they work. The Path Operations Consume Original Paths option in Preferences enables you to either delete the original paths or keep them. Holding down the Shift key as you select the various commands achieves the same effect without the trip to the Preferences menu, and only affects the present operation.

click to expand
Figure 7-8: Six examples of compound path construction

Union

Union combines all selected overlapping objects into one single element, as shown in the top-left corner of Figure 7-8. If the objects do not overlap, a compound path is created that enables you to apply gradient fills to the various objects as a whole (this concept is explained later in the chapter). The new object contains the fill and stroke of the bottom object. If you hold down the Shift key as you select the command from the Modify ® Alter Path menu or the button in the menu, you'll think you've been tricked, because the unionized object appears. Move the new object, and you'll find the original group of objects lying below it. I use this feature at times when I want to apply a solid fill — usually white — to the objects so the drawing appears to have a clipping path when it's placed on other backgrounds. I just select the whole drawing, click Union (while holding down the Shift key held), and send the new shape to the back. Then I give it the stroke and fill I want.

Divide

An example of Divide is shown in the top right of Figure 7-8 (shapes in the example have been moved for clarity). This command makes a new object wherever objects overlap. Two long rectangles at right angles to each other in a cross formation would result in five separate objects. Each of the objects retains its fill and stroke. The new objects can be removed or moved around as you see fit. This command is the basis for the Transparency command, and if you experiment with it a bit, you'll find all kinds of uses for it.

Punch

The Punch tool is the topmost element in your group. It takes a bite out of the element immediately beneath it. Sadly, it doesn't go all the way through a grouping. To accomplish that, you must continue clicking the Punch button. In Figure 7-8, the middle left example used Punch for the top two birds, and the bottom two birds were selected and punched again. You can get some very striking effects in your artwork with this tool.

Intersect

The same group of birds was attacked with the Intersect command, and it left what you see in Figure 7-8 (middle right). This command is really only useful on objects that overlap. If all of the objects do not overlap in one place or another, the entire mass disappears (unless Path Operations Consume Original Paths has been deselected). In this example, only a portion of the smallest bird happens to overlap all the other birds. The result of Intersect has the stroke and fill of the bottom object.

Crop

Crop is the opposite of Punch in that anything under it will be captured inside the topmost shape. The top shape loses its fill and stroke, but the other objects retain theirs. The bottom left image in Figure 7-8 is an example of Crop at work.

Transparency

This command (Figure 7-8 bottom right) changes the opacity of various objects. Transparency is similar to Punch in that it only goes one level deep at a time. In this example, Transparency was applied to the bottom two birds, followed by the top two birds. When you invoke this command, a dialog box opens to enable you to change the level of transparency. Here, the levels were set at 25 percent both times. If you tear the final results apart, you'll find that the original birds are intact, but a new object inside the topmost object appears to be transparent. In reality, it's a combination of the bottom element impacted by a percentage of the top element.

Text Composite paths

The counters in letterforms — the holes in letters and numbers, such as a, o, e, g, 8, and so on — become a special problem when you convert text to paths. Simple letterforms such as an L or J are converted to simple closed paths. Letters with counters must be converted to compound paths, however, and they are created with counter-directional paths for that purpose.

You can't have a gradient fill in text. Instead, you must convert the text to paths. At that point, you can do pretty much what you want with the text (except edit it). It has become a graphic element in the form of a compound path.

This brings up some interesting situations. Fonts are built within invisible guidelines; the top of the letter won't go above the ascent, and the bottom won't drop below the descent. This rule seems to be broken on many fonts, where ascenders, such as the vertical paths on an h, b, or l rise above the height of a capital letter. However, that only serves to move the ascent to the height of the lowercase letters' ascender. Descenders on p, g; swash f, and so on go to various depths according to the font's design. All this causes a confusing mix of tones if you want to place a gradient fill inside the letters, as shown at the top of Figure 7-9. The bold gray line shows the midpoint of the gradient, and the text has been given a stroke for clarity. Notice how much the midpoint of the gradient varies up and down from one letter to another. It's obvious that all letters aren't of equal size. It also creates a cacophony of color in the text.

click to expand
Figure 7-9: The effects of gradient fills in text that has been converted to compound paths

To get around the seemingly haphazard gradient balance, use Modify ® Join to make all the letters in the text group into a compound path. (Yes, the counters are now compound-compound paths.) In this way, the gradient goes from the absolute bottom of the group to the absolute top, and the tonal effect is even. The letters at the bottom of Figure 7-9 have been joined, but the gradient fill is exactly the same fill as the example above it. The text now has a homogenous appearance.

Fills and gradients in compound paths

The same logic holds true with "normal" compound paths, as shown in Figure 7-10. The flock on the left side is individual shapes with equally individual gradient fills, but the right flock has been joined, making a compound path that employs a single gradient. Sometimes you want the effect shown on the left, and at other times you want the effect shown on the right; it all depends on the job, your mood, and creativity.

click to expand
Figure 7-10: Normal compound paths



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net