\documentclass[12pt,pstricks,border=15pt]{standalone}
\usepackage{newcent}
\begin{document}
\begin{pspicture}(0,0)(3,3)
\pscustom[fillstyle=solid,fillcolor=yellow,opacity=.5]{
\psarcn(3,0){3}{180}{90}
\psarcn(1,3){2}{0}{-90}
\psarc(1,2){1}{-90}{0}
\psarc(2,0){2}{90}{180}
}
\pscustom[fillstyle=solid,fillcolor=blue,opacity=.5]{
\psarc(0,3){3}{-90}{0}
\psarcn(1,3){2}{0}{-90}
\psarcn(2,1){1}{180}{90}
\psarc(2,0){2}{90}{180}
\closepath
}
\end{pspicture}
\end{document}
它生产:
创建方法如下:
在 PStricks 中,是否有复制给定图形的命令?或者我必须绘制 4 个图形...
答案1
\documentclass[12pt,pstricks,border=15pt]{standalone}
\begin{document}
\def\myFig{%
\pscustom[fillstyle=solid,fillcolor=yellow,opacity=.5]{%
\psarcn(3,0){3}{180}{90}\psarcn(1,3){2}{0}{-90}
\psarc(1,2){1}{-90}{0}\psarc(2,0){2}{90}{180}
}%
\pscustom[fillstyle=solid,fillcolor=blue,opacity=.5]{%
\psarc(0,3){3}{-90}{0}\psarcn(1,3){2}{0}{-90}
\psarcn(2,1){1}{180}{90}\psarc(2,0){2}{90}{180}
\closepath
}%
}
\begin{pspicture}[showgrid](0,0)(6,6)
\rput(0,3){\myFig}
\rput{-270}(6,3){\myFig}
\rput{180}(6,3){\myFig}
\rput{-90}(0,3){\myFig}
\end{pspicture}
\end{document}
答案2
保存更多字符。
\documentclass[pstricks,border=1pt]{standalone}
\degrees[4]
\def\a#1{\pscustom[fillcolor=#1]{%
\psarcn(3,0){3}{2}{1}\psarcn(1,3){2}{0}{-1}\psarc(1,2){1}{-1}{0}\psarc(2,0){2}{1}{2}}}
\begin{document}
\begin{pspicture}[fillstyle=solid,opacity=.5](6,6)
\foreach \p/\t in {0/0,0/-1,6/-3,6/2}{\rput{\t}(\p,3){\a{blue}\rput{2}(3,3){\a{yellow}}}}
\end{pspicture}
\end{document}