# How to ask Mathematica to repeat the graphics in $x$ direction (the code is given)?

I use this code

a = Graphics[   { Inset[
Style["\[FilledRectangle]", FontSize -> Scaled[0.09]], { 0.34, -0.6755  }]  ,
Inset[ Style["\[FilledRectangle]", FontSize -> Scaled[0.09]], {    -0.33, -0.6755  }]  } ];

b = Graphics[{Thickness[0.002], CapForm["Butt"], Line[{{   0.34, -0.6755   }, {  2.5, -0.6755 }}]}];

c = Graphics[{EdgeForm[{Thick, Blue}], FaceForm[],  Triangle[{{-1, -2}, {0, 0}, {1, -2}}]}];

Show[{a, b, c}]



and the result is

How can I ask Mathematica to repeat the above picture such that I get this result?

• Have you seen TranslationTransform and GeometricTransformation? Commented Oct 25, 2021 at 23:03
• ˋTranslateˋ might also turn out useful. Commented Oct 26, 2021 at 7:49
• Define a unit cell and a lattice, like in here. Commented Oct 26, 2021 at 9:42

n = 5;
translations = {# 0.34 + (# - 1) 2.5, 0} & /@ Range[n];

Graphics[{EdgeForm[{Thick, Blue}], FaceForm[], CapForm["Butt"], Thickness[0.002],
Translate[{Triangle @ {{-1, -2}, {0, 0}, {1, -2}},
Text[Style["▮", FontSize -> Scaled[0.04]], {#, -0.6755}] & /@ {-.33, 0.34}},
translations],
Translate[Line[{#, -0.6755} & /@ {.34, 2.5}], Most @ translations]},
ImageSize -> 900]


here is a quick start that can be easily improved

unit[x_, y_] := {Rectangle[{0.34 - 0.1, -0.6755 - 0.2} + {x,
y}, {0.34 + 0.1, -0.6755 + 0.2} + {x, y}],
Rectangle[{-0.34 - 0.1, -0.6755 - 0.2} + {x,
y}, {-0.34 + 0.1, -0.6755 + 0.2} + {x, y}], Thickness[0.002],
CapForm["Butt"],
Line[{{0.34, -0.6755} + {x, y}, {2.5, -0.6755} + {x, y}}],
EdgeForm[{Thick, Blue}], FaceForm[],
Triangle[{{-1, -2} + {x, y}, {0, 0} + {x, y}, {1, -2} + {x, y}}]}


and then you can produce j unit as follow

Block[{j = 6, Xn = (Norm[{0.34, -0.6755} - {2.5, -0.6755}] + 0.7)},
Graphics[{Table[
unit[i (Norm[{0.34, -0.6755} - {2.5, -0.6755}] + 0.7), 0], {i, 1,
j}], Rectangle[{0.34 - 0.1, -0.6755 - 0.2} + {(j + 1) Xn,
0}, {0.34 + 0.1, -0.6755 + 0.2} + {(j + 1) Xn, 0}],
Rectangle[{-0.34 - 0.1, -0.6755 - 0.2} + {(j + 1) Xn,
0}, {-0.34 + 0.1, -0.6755 + 0.2} + {(j + 1) Xn, 0}],
EdgeForm[{Thick, Blue}], FaceForm[],
Triangle[{{-1, -2} + {(j + 1) Xn, 0}, {0, 0} + {(j + 1) Xn,
0}, {1, -2} + {(j + 1) Xn, 0}}]}, ImageSize -> 400,
Axes -> False]]