[pstricks] How to draw a \pspolygon with arbitrary arguments
Herbert Voss
Herbert.Voss at FU-Berlin.de
Sun Apr 4 21:22:55 CEST 2010
Am 04.04.2010 18:48, schrieb chrishunter:
> \recoverystar(3, 6, 9, 2, 5, 8, 1, 4, 7, 10)
>
> witch should draw the background and on top of that a star like
>
> \pspolygon(3, 0)(2, 0.5)(6, 1)(2, 1.5)(9, 2) ... (5, 3) ... (7, 8) ...
> (10, 9)(2, 9.5)
\documentclass{minimal}
\usepackage{pstricks}
\makeatletter
\def\recoverystar(#1){\expandafter\rstar at i#1,,\@nil}
\def\rstar at i#1,#2,,\@nil{%
\def\St at rt{#1}%
\rstar at ii#2}
\def\rstar at ii#1,#2,#3,#4,#5,#6,#7,#8,#9{%
\SpecialCoor%
\degrees[10]%
\begin{pspicture}(-10,-10)(10,10)
\pspolygon(\St at rt;0)(2;0.5)(#1;1)(2;1.5)(#2;2)(2;2.5)(#3;3)(2;3.5)%
(#4;4)(2;4.5)(#5;5)(2;5.5)(#6;6)(2;6.5)(#7;7)(2;7.5)%
(#8;8)(2;8.5)(#9;9)(2;9.5)
\end{pspicture}%
}
\makeatother
\begin{document}
\recoverystar(3, 6, 9, 2, 5, 8, 1, 4, 7, 10)
\end{document}
Herbert
More information about the PSTricks
mailing list