Get a free year on Tuts+ this month when you purchase a Siteground hosting plan from $3.95/mo
In this tutorial you will learn how to use Shape Building, Clipping Paths and Opacity Masks to make a metallic Padlock. You will also learn how to use the VectorScribe Adobe Illustrator plug-in to save time when creating vector illustrations and designs.
I have specifically made this tutorial using multiple layers for each element. Advanced users can easily make this lock without the use of layers, but because I'm demonstrating Shape Building, Clipping Paths and Opacity Masks, I've used layers as visual instructions on how each part works together to make the image. Let's begin!
The very first thing you should do when starting a new icon in Adobe Illustrator is to set the guides and grids and change the measurement units to pixels. To find these settings go to Edit > Preferences then set the Guides & Grid to gridlines every 10px with 10 subdivisions and chose a grid color that will stand out against your illustration, then go to Units and set the general units to Pixels.
To make the creation of shapes easier you should show the grid and set the shapes to Snap to Grid by going to View > Show Grid then View > Snap to Grid.
Make a 240px by 240px square of any color with the Rectangle Tool (M) and align it against the pixel grid.
Open the Dynamic Corners, PathScribe and Dynamic Shapes dialogues for the VectorScribe plug-in (Window > VectorScribe).
First we will apply rounded corners to the body of the lock. Set the Dynamic Corners to 20px and click on the 4 corners of the square we have made. The good thing about Dynamic Corners is that you can click the first point and test a few different corner sizes and styles to find one that is suitable — once you have a corner you're happy with simply clicking the remaining three corners to apply the settings.
Copy the Square (Command + C), then lock the layer its on and make a new layer above it. Paste a copy of the square into the new layer with Command + F. Note: I have changed the color of the second square to yellow so you can see it clearly.
Select the bottom 4 points with the Direct Selection Tool (A) and while holding down Shift, move the points towards the top of the second square to make the top portion of the lock. This part can be whatever size you like, just be sure to line it up with a pixel boundary. You will see the result in the second image below.
Copy the top shape (Command + C), turn off the layer that it's on and make a new layer below. Paste the top shape into the new layer (Command + F). Select the top right point and using PathScribe split the path, then repeat with the top left point. Delete the path between the two "cuts," the top section will now have an open path across the top.
Select one of the two open points with the Direct Selection Tool (A) and click Retract Handles in the PathScribe Dialogue, re-select the point with the Direct Selection Tool and hold down Shift to line it up with the side of the lock. Repeat with the second open point.
Move the resulting shape down to create a band for the top of the lock. Turn the top layer back on. You should have a shape similar to the second image below.
Select the "Top" and "Top Side" shapes (seen in the layers below) and copy them (Command + C). Lock both layers and make a layer above, paste the shapes into this layer (Command + F). Note: When pasting a shape from one layer to another, it's best to lock the layer of origin.
These shapes will make the band around the lock, so move them towards the lower half of the lock body. As you can see from the second image below I have marked out guides to get an idea of the height I want the band to be. The band can also be any size you like, but I find that lining it up with pixel lines is a great help for the next few steps.
We're going to cut the top section the same way we cut the band shape in Step 6. Select the right side point and using PathScribe (if there's two points on the side — which can happen — select the bottom one), split the path then repeat with the left side point. Delete the path between the two "cuts," the top section will now have an open path across the top.
Leave this shape open as we will be joining it to the shape below in the next step.
You may have been wondering why, in step 6, I left the top band open after deleting the joining path, this is because I needed the shape to be open when I copied it for the middle band. As a general rule, all vector shapes should be closed off, so we will close the top band on the lock after we create the middle band.
With the Direct Selection Tool (A) click on both end points on the right side of the band shapes, press Command + J (or go to Object > Path > Join) to join them together. Repeat with the left side. You will now have a single shape for the middle band.
Let's close the other path. Click the top band on the lock with the Selection Tool (V) (represented in the image above as the pink "Top - Side" shape) and in the PathScribe options menu select Close Path.
Alright, you should now have something similar to the image below. I've used Guides to mark out the top middle of the padlock and made sections for the shackle — a guide for each side and one down the middle to line up the holes.
Make a new layer for the shackle and lock the previous layers. In the Dynamic Shapes dialogue, select Dynamic Donut and set it to have 8 segments and 135° and 315° angles on the ends (you will find the settings at the bottom of the dialogue).
Shift-click and Drag the shape to fit between the guides for the Shackle (be sure to keep the middle point at the top of the shape). If the middle of the donut is too large or small for the space, click on one of the red inside points. You may have to select the donut, then enable it by clicking on the dynamic shapes dialogue, and Control + Drag with the mouse to alter the dimensions.
The resizing feature is the best part about the Dynamic Shapes Tool, this feature has saved quite a bit of time and tweaking to make this section of the lock.
Lock the "Shackle" layer and create a new layer below it for the holes. Go to the Dynamic Shapes dialogue and make an Ellipse the size of the shackle, then create a second Ellipse that's slightly larger than the first one and send it behind (Command + Left Square Bracket). Center both shapes and align them to the bottom of the guides. Select the shapes with the Selection Tool (V) and Command + Drag them to the other side of the shackle (this will make a copy).
Select the top right point of the inner Ellipse, and using PathScribe split the path, then repeat with the top left point. Delete the path between the two "cuts," the top section will now have an open path across the top.
Select one of the two open points with the Direct Selection Tool (A) and click Retract Handles in the PathScribe Dialogue, re-select the point with the Direct Selection Tool and hold down Shift to line it up with the side of the shackle guide. Repeat with the second open point.
Move the resulting shape to the halfway point between the top of the shackle. You should have something similar to the image below.
If you've been following along with the layers I've been making, you should have a "Top" layer and "Holes" layer. In order to join the two parts of the shackle together the elements need to be on the same layer. To do this, select both layers (Shift + Click) then go to Merge Selected from the fly out menu at the side of the layers palette.
Now that the shapes are on the same layer, take the Direct Selection Tool (A) and click on the bottom left point of the "Donut" shape, and using PathScribe split the path then repeat with the right point. Delete the path between the two "cuts," the bottom left section of the "Donut" will now have an open path across it.
Direct Select (V) the corresponding end points for the shackle then press Command + J (or go to Object > Path > Join) to join them together. Repeat with the right side of the "Donut" and "Shackle." You will now have a single shape.
Note: Be sure to cut and join one arm of the shackle before then the other, if you open all the points on the "Donut" shape first the middle curve will open up and turn into half a circle.
We're now halfway though the tutorial, well done! Let's add some effects and colors to the Padlock.
First, make a Gradient for the body of the Padlock. I've made a Gradient using Mid Gray (R = 96 G = 96 B = 77) and Light Gray (R = 204 G = 204 B = 204), but you can chose any tone of gray, gold or bronze as these are all good colors for a metal lock.
Tip: When selecting colors for gradients and shades, the HSB slider is great to use, as you can set the Brightness and Saturation without effecting the Color. HSB can be set in the Color dialogue.
With the Padlock selected, open the Appearance Panel, select the Fill layer and click the Fx icon at the bottom to add a grain effect. Go to the Effects Gallery and select Grain in the window that opens. Play with the intensity and contrast of a Vertical Grain to achieve a desired effect.
Add the finish you have made to the Graphic Styles (with the shape selected, click the Add Graphic Styles button at the bottom of the palette.) The first time I applied this effect (settings below) it looked good but, later I changed the contrast to match the highlight areas that will be applied later in the tutorial. Don't be afraid to tweak settings as you go along.
Select the top of the padlock and apply an angled gradient (mine is minus 8°), then add it to the Graphic Styles. I have used tones of gray with a splash of white and light blue to create a highlight. Again, you can use a color palette that you like as long as the highlight color reflects the background color you want to use at the end.
Apply another gradient to the top band of the lock. Make the middle the lightest color, then add some mid tones to the sides of that and darker tones to the corner sections. Finally, add the darkest color at the very ends of the gradient to make a metallic finish. Add a 1px dark gray stroke above the Gradient Fill in the Appearance Palette Add the finish to the Graphic Styles.
Select one of the "Hole" shapes and apply a metallic style gradient like the one you made before, then add an Outer Glow by clicking the Fx button at the bottom of the Appearance Palette. Set the Glow to be on Multiply with a Mid Gray color, an Opacity of 75, and a blur of 3px. Add this to the Graphic Styles, select the other hole, and apply the Graphic Style.
Now we're going to get tricky with the Gradient Mesh. Select the shackle of the padlock and color it light grey, then copy and paste it in place (Command + C then Command + F). Select both shapes and make a Clipping Mask (Command + 7 or Right-click > Make Clipping Mask). Double-click into the Clipping Mask.
Make a 48px by 400px rectangle and align it to the left side of the shackle, color it light gray and turn it into an 8 by 4 section Gradient Mesh (select the Rectangle and then go to Object > Create Gradient Mesh).
Here's the tricky part. Follow these steps one section at a time, working from left to right. Use the Lasso Tool (L) to direct select the rows of points, then alternate between the Rotate Tool and Direct Selection Tool to move the points into place to create an arch shape. As you can see in the image below, it doesn't have to be 100% accurate (but it helps to be close).
Click on the points of the mesh with the Gradient Mesh Tool (U) to assign the first set of colors. You can see that I've used the same shades from the top of the padlock with the light blue on one side of the shackle only. Once you have a rough placement of the light and shade, use the Gradient Mesh Tool (U) to add points to the mesh. Use the new points to refine the areas of light and shade to make a more realistic metal finish. You can see how I've made my mesh and the resulting finish in the second image below.
Let's move onto the middle band. You may have noticed that I've been drawing along pixel lines, so to keep working to the grid I will use the VectorScribe Protractor tool. If you click on the number under the "Constrain Angle" text you can enter your own setting — I've set mine to 45°. Now when I draw a rectangle it will follow the 45° grid.
Copy the middle band and paste it in place (Command + C then Command + F). Select both shapes and make a Clipping Mask (Command + 7 or Right-click > Make Clipping Mask). Double-click into the Clipping Mask and draw a 45° rectangle and place copies across the length of the middle band equal distance apart.
I will now alter the two outer bands to create the illusion of a rounded edge. With the PathScribe Tool, Alt-click on the path at the intersection of the path and the guide to mark the rounded edge of the padlock body. Drag the bottom point out away from the point you have just made and make a smooth curve by pushing the path with the PathScribe pointer. Repeat on both sides.
Add a simple 90° light to dark gradient to the background of the band then another to the lines. Copy the background shape and paste it above (Command + C then Command + F). Select the top four points on the pasted shape and move them down slightly. Apply a 20% Opaque to 100% Opaque white gradient. Click back to the main illustration.
Finally, it's time to add some light and dark shades to the body of the padlock. Make a copy of the body shape and paste it in place two times on a layer above the main body of the lock (Command + C then Command + F two times). If your middle band is on a layer above this, move it below. Select both shapes and make a Clipping Mask (Command + 7 or Right-click > Make Clipping Mask). Double-click into the Clipping Mask.
Draw a rectangle over the main body of the lock and color it with a white to light blue horizontal gradient. Select the shape and go to the Transparency Panel, set the blending mode to Overlay. Open the Menu at the Side of the Transparency Panel and click Make Opacity Mask. The Opacity Panel will now show that you have an Opacity Mask applied to the shape.
Alt-click the icon of the Mask and draw another rectangle. Apply a gradient with black at the sides, white over the corner curve, and black in the middle. This will mask the white shape and make it into a highlight layer for the main illustration. Click out of the opacity mask (click the preview icon next to mask preview icon). Repeat the same steps to make another highlight rectangle on the middle top part of the padlock, this time make the rectangle a solid white and the Opacity Mask an oval gradient that goes from white to black. Use the second image below as a guide.
Make another copy of the main shape on a new layer, draw a rectangle at the bottom of the shape and fill it with a gray to transparent gradient. Move the gradient behind the main shape, select both shapes and make a Clipping Mask (Command + 7 or Right-click > Make Clipping Mask). Go to the Appearance Panel and reduce the transparency to 50% and the blend mode to Multiply.
For the finishing touch, we will make a reflection of the shackle. Copy the Shackle and paste it on a new layer below. Rotate (R) and move the copy into place, you can use the image below as a reference.
Select the reflected shackle and go to the Transparency Panel, open the Menu at the Side and click Make Opacity Mask. The Opacity Panel will now show that you have an Opacity Mask applied to the shape. Draw a small rectangle over the top of the lock body and apply a white to black gradient. Click out of the Opacity Mask and admire your work.
Make tweaks to the gradients and opacity values, add a background of your choice and you're finished. I have really enjoyed using VectorScribe for this tutorial, it has saved time and effort in shape construction and editing, I'll definitely be using it in the future for symbols and icons. If you would like to try VectorScribe, then visit astutegraphics.com. Enjoy!