Showing posts with label align. Show all posts
Showing posts with label align. Show all posts

September 10, 2009

TECHNIQUE: Distribute Art Around a Path

A reader from Poland wrote in that he was trying to recreate the European Union flag - where 12 stars are distributed in a circular pattern. This reader tried several techniques including a blend, but wasn't getting the result he was looking for.

In reality, there are many designs that call for distributing art along a path. And while Illustrator has some nice Align and Distribution tools, and even Smart Guides, they won't help when you're trying to align your objects to something other than a straight line.

Enter the Blend feature - yes - the very same Blend feature that has been in Illustrator since the beginning of time. When the main purpose for blends was to create shading or blends between colors (something we all use Gradients for these days). But blends are more powerful than people think. And more importantly, when you understand what makes a blend tick, you can use it for a variety of purposes -- including distributing art along any path -- even if that path isn't straight.

January 22, 2008

ASK MORDY: Distributing Objects

Today's question comes from Greg Walker:

Hey Mordy. Maybe you can shed some light onto one of my biggest Illustrator pet peeves.

Let’s say I have five boxes, and I want to distribute these boxes evenly. Seems easy enough, right? Select all the boxes and hit the “Horizontal Distribute Center” button. Often times this will work without a hitch and I can keep right on Rockin’ and Rollin’ right along. Other times, however, I’ll get the dreaded “Please choose a key object by clicking on one of the selected object(s) with the selection tool, or set the spacing value to Auto.” This drives me nuts. At the least I have to click okay and go over to the Align palette and change the spacing value to Auto and at worst I have to actually go to the trouble of opening the Align palette, which introduces even more clicks. What really gets under my skin is the apparent randomness with which Illustrator decides to change the distribution spacing from “0 in” to “Auto.” I would be quite happy for it to just stay at Auto until such time as I manually change it to some other number which will likely never ever be zero. Rarely do I draw five objects only to stack them all on top of one another.

Also, if you have the time and knowhow, is there a way to quickly center two (or more) objects both vertically and horizontally. The repeated “Horizontal Align Center” and “Vertical Align Center” click combo is a mine field of accidental clicks and subsequent undos.


Alas, the Align panel that appears in Illustrator also appears in InDesign. It is often that I lament about how difficult it is for one to decipher all the little "chicklet" icons on the panel. What makes it all the more difficult is that Adobe has combined alignment functions, object distribution functions, and spacing distribution functions all in one panel. So in addition to all of the icons, there are just so many combinations or choices at hand. As if that weren't enough, Illustrator "hides" the spacing distribution functions in the "Show Options" part of the panel, meaning that many people aren't aware that it even exists.

Hopefully my post here will relieve some of Greg's frustrations, and maybe the frustrations of others as well.

To start, I'll answer Greg's second questions first. It would be nice if Illustrator had a "Center Objects Horizontally AND Vertically" option (but that would add yet ANOTHER chicklet icon), as it's very often that designers need to center objects to each other in this way (or to the artboard if that option is chosen). Rather than click up a storm, this can easily be accomplished by recording a simple Action and assigning a keyboard shortcut to it.

1. Draw two objects on your page and select them.

2. Open the Actions panel by choosing Window > Actions.

3. Click the Create New Action button at the bottom of the Actions panel. Give the Action a name and assign a keyboard shortcut of your choice. Click Record.

4. Open the Align panel by choosing Window > Align.

5. Click the Horizontal Align Center button. Then Click the Vertical Align Center button.

6. Click the Stop Recording button at the bottom of the Actions panel.

Now you can select any objects in your document and press the keyboard shortcut you specified to instantly align the objects to each other both horizontally and vertically.

OK, so now on to the first question, which deals with the concepts of key objects and distribute spacing values and what we all affectionately refer to as "annoying dialog boxes"

The first thing one must understand about the Align panel is that it brings together three VERY different functions, yet that may not be readily apparent to the casual user. To fully grasp this, you need to make sure that the entire Align panel is expanded and visible. If it doesn't look like what you're seeing below, choose Show Options from the panel's flyout menu.



ALIGN OBJECTS:
These six options allow you to align objects TO EACH OTHER. You can use the toggle on the bottom right of the Align panel to align objects to the Artboard or active Crop Area. When objects are aligning to each other, a "key object" is defined so that Illustrator knows what you want your objects to align to. If you don't define a key object, Illustrator will appoint one for you. Anything you say can and will be used against you in a court of -- oh wait, no that's something else... For more information on defining key objects, see this post. Other alignment tips can be found in this post as well.

DISTRIBUTE OBJECTS:
These six options allow you to evenly distribute objects within a specified area. What is the specified area? Good question. In the case of alignment, you're always aligning your objects TO something else. Be it another object or an artboard, etc -- it's always a single object. But to distribute objects evenly, you need TWO key objects. By default, Illustrator picks the two objects that are the furthest apart from each other. Those objects don't move -- they remain stationery and all objects that fall between those two key objects are distributed evenly, as illustrated below.

Before:


After:


I used the Horizontal Distribute Center option in the above examples. The dashed line indicates the center of each object. After applying the distribute command, the object on the far left and right remained in place, while the two objects in between moved so that their centers were distributed evenly. The amount of space between the centers of all the objects is now consistent. However, the important thing here is that I, as a user, had absolutely NO control over the distance BETWEEN each object. The only way for me to adjust that is to move the two outer objects further away from each other (or closer together) and then reapply the distribute command. If I wanted each object to be a specific distance from each other (for example, 1 inch apart), I'd need to do the math and figure out how far the end objects need to be to make that happen.

Or, I could use Distribute Spacing.

DISTRIBUTE SPACING:

The most common mistake I see people make about Distribute Spacing is that they still focus on the objects on the page. Like any good designer knows, white space isn't just an abstract. It's SOMETHING. And to better understand what distribute spacing does, you need to think about white space. That's because distribute spacing allows you to determine the amount of consistent white space BETWEEN each object in your selection. And that's where the value comes into play. When you leave the value set to Auto, you're telling Illustrator to do the following:

1. Define the two outer-most objects as key objects. In other words, don't move those outer objects.

2. Evenly distribute the distance BETWEEN each object using the key objects as boundaries.

But if you specify a value, you're telling Illustrator to do the following:

1. Define a key object

2. Apply the specified amount of space (the Value) BETWEEN each object, starting from the key object.

Do you see the problem here? How can Illustrator perform step 1? How does Illustrator define a single key object? With the Auto setting, Illustrator could use the two outermost objects. But with a specified value, the key object can only be one object. And Illustrator doesn't know which object you want to distribute the spacing FROM. That's why Illustrator throws up the dialog, asking you to tell it which object stays still. Then it can perform step 2 as listed above. Let's take a look:

Before:


After using Horizontal Distribute Space with a value set to Auto:


After using Horizontal Distribute Space with a value set to 1p and specifying the left-most object as the key object:


And now for the kicker: Even though the design and layout of the Align panel make it seem as if the value field only applies to the Distribute Spacing functions, the value ALSO applies to the Distribute Objects functions! Surprise! This means if you have a value defined, the Distribute Objects functions don't use the two outermost objects as key objects. YOU have to define the key object. And the value that you specify is used to determine the amount of space not between the objects, but between the parts of the objects you're choosing by clicking any of the 6 distribute functions. For example:

Before:


After using Horizontal Distribute Center with a value set to Auto:


After using Horizontal Distribute Center with a value set to 4p and specifying the left-most object as the key object:


So basically, if you don't have the entire Align panel visible (i.e., the Show Options setting isn't enabled), and if there's a value anything other than Auto specified for Distribute Spacing, using any of the Distribute Objects functions will cause the "define a key object" dialog to appear.

The problem of Illustrator just arbitrarily changing the spacing value from Auto to 0 is not something I have seen. But the setting itself is indeed "sticky", meaning if you make a change, it stays until you specify otherwise. That could be what is causing the problem.

I'll admit that I use a value of "0" all the time, because when used with the Distribute Spacing option, it will automatically "kiss fit" your objects to each other. Which is incredibly useful.

As a final tip, it's important to know that the Align panel looks at groups as individual objects (those who have taken my classes or who have read my books or seen my training videos know I refer to these groups as "containers"). So if you have multiple groups selected, the alignment and distribution functions work nicely. Also, if you're using Illustrator CS3, you'll be happy to know that the align functions now properly honor the bounds of masked artwork.

NOTE: You'll notice that in all of these examples, I've used boxes of different sizes. Often, the differences between the multitudes of settings in the Align panel are indistinguishable when the objects are all the same. Mixing up different heights and widths will make things MUCH easier to understand.

Hopefully, this has cleared up some confusion. As always, I encourage readers to leave comments if more detail or discussion is required.

May 21, 2007

ASK MORDY: Aligning Anchor Points in CS3

I pulled this anonymous question from a comment on a previous post here:

In CS3, when you try to align points, let's say u have a ragged line made with the pencil tool (of let's say 5 points), and then you want to align the points and select all of them with the white arrow tool, how does AI know if you want to align the points between themselves or the whole object relative to another one? I mean, when all nodes are selected, can Illustrator tell if u have selected the object or just all of its nodes? I've been told FH was able to tell the difference.

Illustrator CS3 introduced the ability to align individual anchor points using the functions found in the Align panel (or the Control panel). This question actually bring about something which appears to have somewhat changed in Illustrator CS3 from CS2. Or if it isn't a change in actual behavior (meaning that it did happen in CS2), it's something that we have visibility to that wasn't present in the past.

First, it's important to understand what the Align functions do. When you select several objects and choose to align them, Illustrator treats each of those objects as individual entities. However, you'll notice that if you select several groups, the Align panel will treat each group as an individual entity. Which is why you can't align objects that are within a group when you simply select the group (as the group is treated as one object). To align the objects in a group, you can of course, double click on the group to isolate it. Then perform the align, then double-click to exit the isolation. Of course, you can also use the Direct Selection tool to select a few elements within a group, and you can align those. But if you use the Direct Selection tool to select ALL of the elements within the group, the Align functions realize that you have a group selected. And once again, it's treated as a single object.

Now think of each anchor point within a single object as if they were individual elements in a group. As long as you have SOME of the anchor points selected (meaning, not all of them), then Illustrator allows you to align those points. But as soon as you select all of the point on a path, the Align functions don't see the anchor points anymore -- they see the single path (again, think of the group).

I've noticed that in Illustrator CS2, when you select just a few anchor points on a path, the Control panel lists the Path as being the target. But now in CS3, when you have just a few anchor points of a path selected, the Control panel lists "Anchor Point" as the target. Apparently, that's how the context-sensitive Control panel knows to display all the new convert, handles, and anchor functions.



So you would need to select all anchor point except one, perform the align, then select that last anchor point that was left out, shift click on any other anchor point, and then repeat the align to get what you want. It's important to select the anchor points in that order. You already know that to align to a specific object, you click on a key object once you've made your selection. Well, with anchor points, clicking on an anchor point after it was selected will deselect all other anchor points. So Illustrator uses the LAST anchor point you selected as its "key" anchor point.

With regards to FreeHand, yes, this is far easier to do there. That's because FreeHand has the ability to select all of the anchor points in an object without selecting the entire object itself. For example, if you marquee select your entire object with the pointer, the anchor points become selected, and you can align all of the anchor points in the object. Click on the path with the Pointer and the entire object becomes selected, and will align as a single object. I believe my good friend JET likes to refer to this as FreeHand's ability to select anchor points and paths individually, where with Illustrator, they seem to be one and the same.