2003 December
 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html

triangular grid

generate a triangular base grid

r base length of the triangle.

r = 1;
iMax = 3;

h = Sin[Pi/3]*r;
pts = 
        Table[Point[
            List[j*2*r/2 + r/2*(iMax - i), h*(iMax - i)] + {r/2, 
                h/3}], {i, iMax, 0, -1}, {j, i, 
            0, -1}];

Graphics[pts, AspectRatio -> 1, Frame -> True] // 
        Show;

draw triangle

triangle = 
      Line@Table[(Sin[2*Pi/6] - Sin[2*Pi/6]/3)*{Cos@x, Sin@x}, {x, 
            0 + 2*Pi/4, 2*Pi + 2*Pi/4, 2*Pi/3}]

Graphics[triangle, AspectRatio -> Automatic, Frame -> True] // 
      Show

change Points to triangle

gp = 
        pts /. {Point[coord_] :> 
              Map[(coord + #) &, triangle, {2}]};

Graphics[gp, Frame -> True, AspectRatio -> Automatic] // 
      Show

copy rotate the graphics 6 times to form a hex outline

gp2 = 
        Table[gp /. 
            Line[x_List] :> 
              Line@Map[{{Cos@α, -Sin@α}, {Sin@α, 
                          Cos@α}} . # &, x], {α, 0, 
            2*Pi - 2*Pi/6/2, 2*Pi/6}];

Graphics[gp2, Frame -> True, AspectRatio -> Automatic] // 
      Show

colored version to show structure

Graphics[{Transpose@{Table[Hue[i], {i, 0, 1 -  .01, 1/6}], 
              gp2 /. Line -> Polygon}, gp2}, 
        AspectRatio -> Automatic, Frame -> True] // Show

apply shear transform to show a rectangular equivalent

gpSheared = 
        gp2 /. Line[x_List] :> 
            Line@Map[{{1, 1/(2*h)}, {0, 1}} . # &, x];

Graphics[gpSheared, Frame -> False, 
        AspectRatio -> Automatic] // Show