我回答了这个问题在 Tikz 图形中旋转一组点使用我扩展的新命令来创建新模式。这是代码以及一些创建的模式示例:
\documentclass{article}
\usepackage{tikz}
\newcommand*{\cross}[5]{
\begin{scope}[xshift=#1cm,
yshift=#2cm,
#3, %color
rotate=#4,
scale=#5]
\foreach \an in {0,90,180,270}
\draw [rotate=\an] (2,-1)--(1,0)--(2,1);
\end{scope}
}
\begin{document}
\begin{tikzpicture}
\cross{5}{0}{}{0}{1}
\cross{5}{2}{}{0}{1}
\cross{7}{0}{}{0}{1}
\cross{7}{2}{}{0}{1}
\cross{9}{0}{}{0}{1}
\cross{9}{2}{}{0}{1}
\end{tikzpicture}\qquad
\begin{tikzpicture}[scale=.3]
\clip[draw] (5,5) circle(5.5);
\foreach \x in {0,2,...,10}{%
\foreach \y in {0,2,...,10}{%
\cross{\x}{\y}{blue}{0}{.5}
}}
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}[scale=.4]
\clip[draw] (5,5) circle(5.5 and 3);
\foreach \x in {0,2,...,10}{%
\foreach \y in {0,2,...,10}{%
\cross{\x}{\y}{red}{0}{.8}
}}
\end{tikzpicture}\qquad
\begin{tikzpicture}[scale=.5]
\clip[draw] (.5,.5) rectangle (9.5,9.5);
\foreach \x in {0,1.17,...,10}{%
\foreach \y in {0,1.17,...,10}{%
\cross{\x}{\y}{}{0}{.3}
}}
\end{tikzpicture}
\end{document}
输出:
我的问题是:是否可以将这些模式集成到可通过 tikz 模式库访问的默认模式中?