\documentclass{article}
\usepackage{pstricks,multido}
\begin{document}
\begin{pspicture}
\pswedge(0,0){2}{0}{15}
\pswedge*(0,0){2}{15}{30}
\pswedge(0,0){2}{30}{45}
\pswedge*(0,0){2}{45}{60}
\pswedge(0,0){2}{60}{75}
\pswedge*(0,0){2}{75}{90}
\pswedge(0,0){2}{90}{105}
\pswedge*(0,0){2}{105}{120}
\pswedge(0,0){2}{120}{135}
\pswedge*(0,0){2}{135}{150}
\pswedge(0,0){2}{150}{165}
\pswedge*(0,0){2}{165}{180}
\pswedge(0,0){2}{180}{195}
\pswedge*(0,0){2}{195}{210}
\pswedge(0,0){2}{210}{225}
\pswedge*(0,0){2}{225}{240}
\pswedge(0,0){2}{240}{255}
\pswedge*(0,0){2}{255}{270}
\pswedge(0,0){2}{270}{285}
\pswedge*(0,0){2}{285}{300}
\pswedge(0,0){2}{300}{315}
\pswedge*(0,0){2}{315}{330}
\pswedge(0,0){2}{330}{345}
\pswedge*(0,0){2}{345}{360}
\end{pspicture}
\end{document}
答案1
\foreach
frompgffor
包在 PSTricks 中也是默认可用的。因此,你不需要使用\multido
。
\documentclass[pstricks,preview,margin=5mm]{standalone}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)
\foreach \i [evaluate = \i as \j using \i+15] in {0,30,..., 330}{\pswedge*{2}{\i}{\j}}
\end{pspicture}
\end{document}
输出与其他答案完全相同。
答案2
\documentclass[pstricks,preview,margin=5mm]{standalone}
\usepackage{multido}
\def\obj#1{%
\begin{pspicture}(-2,-2)(2,2)
\multido{\i=#1+30}{12}{\rput{\i}(0,0){\pswedge*(0,0){2}{0}{15}}}
\end{pspicture}%
}
\begin{document}
\obj{0}\obj{15}%
\end{document}
注意:星号\pswedge
不需要linestyle=none,linewidth=0
删除轮廓,因为它已经自动完成了。
答案3
\documentclass{article}
\usepackage{pstricks,multido}
\begin{document}
\begin{pspicture}
\multido{\i=0+15}{24}{%
\def\dowedge{\pswedge}%
\ifodd\i\def\dowedge{\pswedge*}\fi
\dowedge(0,0){2}{\i}{\number\numexpr\i+15}%
}
\end{pspicture}
\end{document}
也许还可以绘制一个填充黑色的圆圈并插入 12 个白色楔子。
作为次要请求,您可以将 设置linestyle
为none
,这将删除外圆以及“内点”。实际上,这样就不需要打印白色楔形了,从而使代码更轻便一些:
\documentclass{article}
\usepackage{pstricks,multido}
\begin{document}
\begin{pspicture}
\multido{\i=0+30}{12}{%
\pswedge*(0,0){2}{\i}{\number\numexpr\i+15}%
}
\end{pspicture}
\end{document}