This is a cute problem. Here's my modest attempt:
kagomeTriangle[n_Integer /; n > 1] := Module[{bas, down, hex, mid, up},
bas = Table[{n - k, (n - k) Sqrt[3]} + {j, 0},
{k, n, 1, -1}, {j, 0, 2 k - 1}];
mid = Map[TranslationTransform[{0, Sqrt[3]/2}][Mean /@ Partition[#, 2]] &, bas];
up = MapThread[Polygon[Append[#1, #2]] &,
MapAt[Partition[#, 2] &, #, 1]] & /@ Transpose[{bas, mid}];
hex = Map[Polygon[Flatten[#, 1][[{3, 1, 2, 4, 5, 6}]]] &,
Flatten[{Partition[Delete[#, {{1}, {-1}}], 2] & /@ Most[bas],
Partition[#, 2, 1] & /@ Most[mid],
Reverse[Partition[#, 2], 2] & /@ Rest[bas]},
{{2}, {3}, {1}}], {2}];
down = MapThread[Polygon[Prepend[#2, #1]] &, #] & /@
Transpose[{Delete[#, {{1}, {-1}}] & /@ Drop[mid, -2],
Partition[Delete[#, {{1}, {-1}}], 2] & /@
Delete[bas, {{1}, {-1}}]}];
{down, hex, up}]
Graphics[{FaceForm[],
Transpose[{EdgeForm[Directive[#, AbsoluteThickness[4]]] & /@
{RGBColor["#00AEE6"], RGBColor["#00AEE6"], RGBColor["#E2328F"]},
kagomeTriangle[5]}]}]
If a Graph[]
is desired, the routine above can be slightly modified, like so:
kagomeTriangleGraph[n_Integer /; n > 1, opts___] :=
Module[{bas, e3, e6, facs, hex, mid, msh, up},
bas = Table[{n - k, (n - k) Sqrt[3]} + {j, 0},
{k, n, 1, -1}, {j, 0, 2 k - 1}];
mid = Map[TranslationTransform[{0, Sqrt[3]/2}][Mean /@ Partition[#, 2]] &,
bas];
up = MapThread[Polygon[Append[#1, #2]] &,
MapAt[Partition[#, 2] &, #, 1]] & /@
Transpose[{bas, mid}];
hex = Map[Polygon[Flatten[#, 1][[{3, 1, 2, 4, 5, 6}]]] &,
Flatten[{Partition[Delete[#, {{1}, {-1}}], 2] & /@ Most[bas],
Partition[#, 2, 1] & /@ Most[mid],
Reverse[Partition[#, 2], 2] & /@ Rest[bas]},
{{2}, {3}, {1}}], {2}];
msh = DiscretizeGraphics[{hex, up}];
facs = GroupBy[MeshCells[msh, 2][[All, 1]], Length];
e3 = Flatten[Map[Sort, Partition[#, 2, 1, 1]] & /@ facs[3], 1];
e6 = Complement[Flatten[Map[Sort, Partition[#, 2, 1, 1]] & /@
facs[6], 1], e3];
Graph[Join[Style[UndirectedEdge @@ #,
Directive[AbsoluteThickness[4], RGBColor["#E2328F"]]] &
/@ e3,
Style[UndirectedEdge @@ #,
Directive[AbsoluteThickness[4], RGBColor["#00AEE6"]]] &
/@ e6],
opts,
VertexCoordinates -> MapIndexed[First[#2] -> #1 &,
MeshCoordinates[msh]],
VertexShapeFunction -> "Circle",
VertexStyle -> Directive[ColorData["Legacy", "MintCream"],
EdgeForm[Opacity[1/2, Gray]]]]]
For example,
kagomeGraph[5, VertexSize -> Medium]