Skip to main content
Participant
December 14, 2016
Question

How to align hexagons to each other with the diagonal edge?

  • December 14, 2016
  • 3 replies
  • 4572 views

Hello Forums!

My name is Jace and I am a staff member for my high school's yearbook. Its my 2nd year and I am quite experienced with InDesign CS6, yet there are still some things I have yet to figure out. This year's theme includes many hexagons and honey comb patterns, and while I know you can create a tile pattern with the same alignment distance, there is no way (to my knowledge) on how to align individual edges. Ill attach a photo to explain it. You can free hand it, which I feel i will probably have to do, but our required spacing is 0p6. Is there a tool in the program that allows it or does anyone else know of an easier way rather than free handing it and hoping for the best?

(YES THE LAYOUT MAY NOT BE PERFECT, IT'S A WORK IN PROGRESS HAHA XD)

Thanks XD

This topic has been closed for replies.

3 replies

Roger Breton
Legend
December 16, 2016

Did you solve the problem already?

Does not seem such a great difficulty.

Mike Witherell
Community Expert
Community Expert
December 14, 2016

1. Go to Illustrator

2. Use the Polygon tool to draw a 6-sided polygon. Be sure to hold the shift key while dragging out a hexagon.

3. Drag and drop the hexagon into the Swatches panel

4. Double-click the new fill swatch; the Pattern Options editor panel opens up

5. Set the Tile Type to "Hex by Column"; click Done

6. Apply fill pattern to a larger rectangle; then object > expand it to separate shapes

7. Copy and paste into InDesign as frame shapes

8. Reward yourself with food and drink

Mike Witherell
Obi-wan Kenobi
Legend
December 15, 2016

Hi,

It's just a simple problem of geometry! 

So …

We want to align the hexagons by reference to the "Red" one! …

So "Blue" hexagon to be selected and 1 click! 

var gB1 = app.selection[0].geometricBounds;

var gB2 = app.selection[1].geometricBounds;

var center1_H = gB1[1] + ((gB1[3] - gB1[1])/2);

var center1_V = gB1[0] + ((gB1[2] - gB1[0])/2);

app.selection[1].move([center1_H - ((gB2[3] - gB2[1])/2), center1_V - ((gB2[2] - gB2[0])/2)]);

var NewgB2 = app.selection[1].geometricBounds;

var W1 = gB1[3] - gB1[1];

var H1 = gB1[2] - gB1[0];

var W2 = NewgB2[3] - NewgB2[1];

var H2 = NewgB2[2] - NewgB2[0];

var MoveX = NewgB2[1] - ((H1 + H2) * 0.866 / 2);

var MoveY = NewgB2[0] - ((W1 + W2) * 0.866 / 4);

app.selection[1].move([MoveX, MoveY]);       

"Green" one now! 

var gB1 = app.selection[0].geometricBounds;

var gB2 = app.selection[1].geometricBounds;

var center1_H = gB1[1] + ((gB1[3] - gB1[1])/2);

var center1_V = gB1[0] + ((gB1[2] - gB1[0])/2);

app.selection[1].move([center1_H - ((gB2[3] - gB2[1])/2), center1_V - ((gB2[2] - gB2[0])/2)]);

var NewgB2 = app.selection[1].geometricBounds;

var W1 = gB1[3] - gB1[1];

var H1 = gB1[2] - gB1[0];

var W2 = NewgB2[3] - NewgB2[1];

var H2 = NewgB2[2] - NewgB2[0];

var MoveX = NewgB2[1] + ((H1 + H2) * 0.866 / 2);

var MoveY = NewgB2[0] - ((W1 + W2) * 0.866 / 4);

app.selection[1].move([MoveX, MoveY]);       

"Yellow" and "Grey" ones ! …

var gB1 = app.selection[0].geometricBounds;

var gB2 = app.selection[1].geometricBounds;

var center1_H = gB1[1] + ((gB1[3] - gB1[1])/2);

var center1_V = gB1[0] + ((gB1[2] - gB1[0])/2);

app.selection[1].move([center1_H - ((gB2[3] - gB2[1])/2), center1_V - ((gB2[2] - gB2[0])/2)]);

var NewgB2 = app.selection[1].geometricBounds;

var W1 = gB1[3] - gB1[1];

var H1 = gB1[2] - gB1[0];

var W2 = NewgB2[3] - NewgB2[1];

var H2 = NewgB2[2] - NewgB2[0];

var MoveX = NewgB2[1] - ((H1 + H2) * 0.866 / 2);

var MoveY = NewgB2[0] + ((W1 + W2) * 0.866 / 4);

app.selection[1].move([MoveX, MoveY]);       

var gB1 = app.selection[0].geometricBounds;

var gB2 = app.selection[1].geometricBounds;

var center1_H = gB1[1] + ((gB1[3] - gB1[1])/2);

var center1_V = gB1[0] + ((gB1[2] - gB1[0])/2);

app.selection[1].move([center1_H - ((gB2[3] - gB2[1])/2), center1_V - ((gB2[2] - gB2[0])/2)]);

var NewgB2 = app.selection[1].geometricBounds;

var W1 = gB1[3] - gB1[1];

var H1 = gB1[2] - gB1[0];

var W2 = NewgB2[3] - NewgB2[1];

var H2 = NewgB2[2] - NewgB2[0];

var MoveX = NewgB2[1] + ((H1 + H2) * 0.866 / 2);

var MoveY = NewgB2[0] + ((W1 + W2) * 0.866 / 4);

app.selection[1].move([MoveX, MoveY]);       

Just for fun! 

[ code quickly written, Thanks for comments! ]

(^/)

Obi-wan Kenobi
Legend
December 15, 2016

… Of course, everybody understood that "0.866" is the square root of 3! 

(^/)

Community Expert
December 14, 2016

Hi Jace,

yes, that's doable. But would require perhaps two or three steps.

The trick is using InDesign's Smart Guides feature.

Smart Guides are working best in 90° situations, so to say.

And to get to a 90° configuration when using two hexagons you have to align the two segments you want to align to 90° or 180° respectively.

Some screenshots are showing this:

That's all…

Regards,
Uwe