使用“foreach”命令在“TikZ”图中重复一行三个全等扇区

使用“foreach”命令在“TikZ”图中重复一行三个全等扇区

我想使用一个foreach命令在使用以下命令绘制的行下方再添加九行。

\documentclass{amsart}


\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}


\begin{document}


\noindent \hspace*{\fill}
\begin{tikzpicture}


%Three columns of sectors that are one-tenth of a circle are drawn.

%Here is the first row.
\coordinate (O) at (0,0);

%First column of sectors of a circle is drawn.
\path[fill=BrickRed] (O) -- (-5/3,0) arc (180:216:5/3) -- cycle;
\draw (O) -- (-5/3,0) arc (180:216:5/3) -- cycle;

%Second column of sectors of a circle is drawn.
\path let \n1={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in coordinate (P) at (2,\n1);
\path[fill=yellow] (P) -- ($(72:5/3) +(P)$) arc (72:108:5/3) -- cycle;
\draw (P) -- ($(72:5/3) +(P)$) arc (72:108:5/3) -- cycle;

%Third column of sectors of a circle is drawn.
\coordinate (Q) at (4,0);
\path[fill=BrickRed] (Q) -- ($(Q) +(5/3,0)$) arc (0:-36:5/3) -- cycle;
\draw (Q) -- ($(Q) +(5/3,0)$) arc (0:-36:5/3) -- (Q) -- cycle;


%The horizontal lines denoting the top and bottom of the row of sectors is drawn.
\draw[line width=1.2pt, dashed] (-5/3-0.75,0.75) -- (4+5/3+0.75,0.75);
\draw[line width=0.8pt, dashed] let \n1={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in (-5/3-0.75,{\n1-(0.75-(\n1+5/3))})
-- (4+5/3+0.75,{\n1-(0.75-(\n1+5/3))});

%The columns separating the sectors are drawn.
\draw[line width=2pt] let \n1={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in (-5/3-0.75,{\n1-(0.75-(\n1+5/3))}) -- (-5/3-0.75,0.75);
\draw[line width=2pt] let \n1={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in (4+5/3+0.75,0.75) -- (4+5/3+0.75,{\n1-(0.75-(\n1+5/3))});
\draw[line width=2pt] let \n1={(1/2)*(0+(2-(5/3)*sin(18)))}, \n2={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in (\n1,0.75) -- (\n1,{\n2-(0.75-(\n2+5/3))});
\draw[line width=2pt] let \n1={(1/2)*((2+(5/3)*sin(18))+4)}, \n2={-(5/3)*sin(36) - (1/2)*(5/3-(5/3)*sin(36))} in (\n1,0.75) -- (\n1,{\n2-(0.75-(\n2+5/3))});



\end{tikzpicture}
\hspace{\fill}


\end{document}

相关内容