r500/diagrams/texture_grid.tex
2025-11-13 10:56:28 -06:00

47 lines
1.4 KiB
TeX

\documentclass{standalone}
\usepackage{tikz}
\usepackage{fix-cm}
\usepackage[dvipsnames]{xcolor}
\usetikzlibrary {arrows.meta}
\newcommand*{\Width}{1}%
\newcommand*{\Height}{1}%
\newcommand*{\XOffset}{2}%
\begin{document}
\begin{tikzpicture}[scale=1]
\draw[thick,step=1.0] (0,0) grid (\Width + 1,-\Height - 1);
\foreach \y in {0,...,\Height} {
\foreach \x in {0,...,\Width} {
\node[font=\large] at (\x + 0.5,-\y - 0.3) {
p\pgfmathparse{int(\y * (\Height + 1) + \x)}\pgfmathresult
};
\node[font=\fontsize{8}{8}\selectfont] at (\x + 0.5,-\y - 0.75) {(x,y,z)};
}
}
%\draw[thick,step=1.0] (\Width + \XOffset,0) grid ((\XOffset + \Width) * 4 + 1,-\Height - 1);
\draw[thick,step=1.0] (\Width + \XOffset,0) grid (\XOffset + 2 * 4 + 1,-\Height - 1);
\foreach \y in {0,...,\Height} {
\foreach \x in {0,...,\Width} {
\foreach \i in {0,...,3} {
\node[font=\large] at (\Width + \XOffset + \x * 4 + \i + 0.5,-\y - 0.3) {
p\pgfmathparse{int(\y * (\Height + 1) + \x)}\pgfmathresult
};
\node[font=\fontsize{8}{8}\selectfont] at (\Width + \XOffset + \x * 4 + \i + 0.5,-\y - 0.75) {(x,y,z)};
}
}
}
\draw[-{Stealth[BrickRed]}, ultra thick, BrickRed] (2.1,-1) -- (2.9,-1);
\node[font=\large\bfseries ] at ( 1,0.5) {particle state};
\node[font=\large\bfseries ] at ( 7,0.5) {vertex coordinates};
\end{tikzpicture}
\end{document}