First, let's draw the tile more precisely and also choose a corner as coordinate zero:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) coordinate (-i0)
-- ++(60:1/2) coordinate (-i1)
-- ++(120:1) coordinate (-i2)
-- ++(180:1/2) coordinate (-i3)
-- ++(90:{sin(60)}) coordinate (-i4)
-- ++(150:{sin(60)}) coordinate (-i5)
-- ++(240:1/2) coordinate (-i6)
-- ++(300:1/2) coordinate (-i7)
-- ++(210:{sin(60)}) coordinate (-i8)
-- ++(270:{sin(60)}) coordinate (-i9)
-- ++(0:1/2) coordinate (-i10)
-- ++(300:1/2) coordinate (-i11)
-- ++(30:{sin(60)}) coordinate (-i12)
-- cycle;
% adding the labels
\foreach \i in {0,...,12} {
\pgfmathparse{int(\i == 3 || \i == 9 ? 1 : 0)}
\draw[red] (-i\i) circle[radius=2pt];
\ifnum\pgfmathresult=1\relax
\node[below, red, font=\ttfamily\tiny] at (-i\i) {(-i\i)};
\else
\node[right, red, font=\ttfamily\tiny] at (-i\i) {(-i\i)};
\fi
}
\end{tikzpicture}
\end{document}
Having this, we can create a pic
from it. Since we would like to mirror and rotate this pic
and also place it relative to others, we need to create it in a special way so that we first create the coordinates and only then draw the path having the possibility to shift and rotate the coordinates:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\newif\ifaperiodicalhatmirrored
\tikzset{
pics/aperiodical hat/.style={
code={
\tikzset{
aperiodical hat/.cd,
#1,
coordinate transformation/.style={
rotate around={\pgfkeysvalueof{/tikz/aperiodical hat/rotate around inner anchor}:(-inner anchor)},
shift={($(-outer anchor)-(-inner anchor)$)},
}
}
\ifaperiodicalhatmirrored
\path[xscale=-1]
\else
\path
\fi
(0,0) coordinate (-i0)
-- ++(60:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i1)
-- ++(120:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}}) coordinate (-i2)
-- ++(180:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i3)
-- ++(90:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}*sin(60)}) coordinate (-i4)
-- ++(150:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}*sin(60)}) coordinate (-i5)
-- ++(240:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i6)
-- ++(300:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i7)
-- ++(210:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}*sin(60)}) coordinate (-i8)
-- ++(270:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}*sin(60)}) coordinate (-i9)
-- ++(0:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i10)
-- ++(300:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}/2}) coordinate (-i11)
-- ++(30:{\pgfkeysvalueof{/tikz/aperiodical hat/base unit}*sin(60)}) coordinate (-i12)
-- cycle;
\coordinate (-inner anchor) at (\pgfkeysvalueof{/tikz/aperiodical hat/inner anchor});
\coordinate (-outer anchor) at (\pgfkeysvalueof{/tikz/aperiodical hat/outer anchor});
\path[pic actions]
([aperiodical hat/coordinate transformation]-i0) coordinate (-o0)
foreach \x in {1,...,12} {
-- ([aperiodical hat/coordinate transformation]-i\x) coordinate (-o\x)
} -- cycle;
}
},
aperiodical hat/base unit/.initial={1},
aperiodical hat/inner anchor/.initial={0,0},
aperiodical hat/outer anchor/.initial={0,0},
aperiodical hat/rotate around inner anchor/.initial={0},
aperiodical hat/mirrored/.is if={aperiodicalhatmirrored}
}
\begin{document}
\begin{tikzpicture}
\pic[draw, fill=yellow!6] (tile1) {aperiodical hat};
\pic[draw, fill=black!6] (tile2) {aperiodical hat={inner anchor={-i5}, rotate around inner anchor=-60, mirrored}};
\pic[draw, fill=red!6] (tile3) {aperiodical hat={inner anchor={-i9}, rotate around inner anchor=240}};
\pic[draw, fill=green!6] (tile4) {aperiodical hat={inner anchor={-i2}, outer anchor={tile2-o10}}};
\end{tikzpicture}
\end{document}
The pic aperiodical hat
takes the following options:
base unit
: factor to scale the tile.
inner anchor
: anchor of the current tile.
outer anchor
: anchor of another tile (or some coordinate) which the anchor specified with inner anchor
should sit at.
rotate around inner anchor
: degrees the tile should be rotated around the coordinate specified by inner anchor
.
mirrored
: if used, the tile is mirrored.
There are two sets of anchors in each pic
. The first set is -i0
to -i12
and represents the corners of the tile before it is rotated and shifted (but after it has been mirrored). The second set is -o0
to -o12
and represents the corners of the tile after all transformations are applied. For inner anchor
the first set (-i0
to -i12
) should typically be used, for outer anchor
the second set (-o0
to -o12
) should be used.
Having this functionality, I assume it should be possible to create also larger tilings ...
pic
to tile those. But when it comes to place them correctly, it could be challenging. Good question.