Posts tagged with 'illustrator'

Regular hexagons in Adobe Illustrator

Last night, I had to draw a regular hexagon in Adobe Illustrator, Now, I remember from my school days how to draw one with a compass and ruler (draw a circle with the compasses, and then select a point on the circumference and mark off radii with the compasses, going round the circle; you'll mark off six intersections and then connect them with straight lines: voilà!), but I don't have any compasses in Illustrator.

(UPDATE: OK, now I feel silly. There's a Polygon tool in Illustrator. It's part of the rectangle tool list in the toolbox. Click it to select it, click on the artboard to set the number of sides, and then draw it. Oh well.)

A moment's reflection gave me an answer.

  • Draw a horizontal line
    image
  • Copy that line to the clipboard
  • Paste a copy of the line
  • Rotate it 60°, move it so it touches the horizontal line on the left
    image
  • Paste a copy of the line
  • Rotate it -60°, move it so it touches the horizontal line on the right
    image

You now have half a hexagon.

  • Using the lasso tool, lasso the left corner, and join the line segments (use Corner as the method)
    image
  • Lasso the right corner and do the same
    image

The lines now form a path.

  • Copy the half hexagon to the clipboard
  • Paste a copy
  • Reflect the copy horizontally
  • Move the copy so that it touches the other half
  • Join the two halves with the lasso tool
    image

You now have a regular hexagon. The lines form a closed path and so you can color the perimeter and the interior as desired.

The magic rotation angle is the exterior angle for the sides on a regular hexagon. If you want another regular polygon, calculate the relevant exterior angle (360 divided by the number of sides) and proceed as before. If the number of sides is not even you won't be able to use the reflection trick to save time, but will have to paste/rotate every side as required. For example, here's a regular pentagon (exterior angle = 72°):

image

Obviously, if the number of sides doesn't divide into 360° exactly, there will be some fudging at the corners to make it all fit properly.

Album cover for Muted Now playing:
Alias - sixes last
(from Muted)


Search

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl

Archives

February 2012 (3)
SMTWTFS
« Jan  
1234
567891011
12131415161718
19202122232425
26272829

Like this Archive Calendar widget? Download it here.

Social networking

Google ads

The OUT Campaign

The OUT Campaign

My Tweets

  • @TerriMorton "The Texan-ized Eiffel Tower" <shudders, whimpers in corner> /cc @rachelreese
  • One of my blog readers found this awesome picture of Roger Moore modeling a pullover in a "Father and Son" pattern http://t.co/DRs4dLSu
  • @RachelHawley First Vaseline, then a drill. It's a good job I have no imagination.
Bottom swirl