[pstricks] Arrays of stars and other objects

Juergen Gilg gilg at acrotex.net
Sat Mar 7 17:31:46 CET 2009


Dear David,

> All,
>
> In the example below, Herbert has created an array of boxes for me.  
> What if I wanted an array of solid five pointed stars instead?
>
>   
Something like so?

\documentclass{article}

\usepackage{pstricks-add}


\def\fivestar{\psset{unit=0.2}%
\pspolygon(1;36)(2;72)(1;108)(2;144)(1;180)(2;216)(1;252)(2;288)(1;324)(2;360)(1;36)
}
\def\Box{\psframebox{\rule{3mm}{0pt}\rule{0pt}{3mm}}}
\def\putBox(#1,#2){\rput(#1,#2){\rnode{p#1#2}{\fivestar}}}

\begin{document}

\begin{pspicture}(1,0.5)(4,2.5)
\multido{\iRow=1+1}{2}{%
   \multido{\iCol=1+1}{4}{%
     \ifnum\iRow=1        % for lowest row
       \ifnum\iCol=4      % and last column do nothing
         \else\putBox(\iCol,\iRow)\fi
     \else\putBox(\iCol,\iRow)\fi}}
\ncbox[linearc=0.35,nodesep=0.52,linecolor=blue]{p11}{p31}
\ncbox[linearc=0.35,nodesep=0.52,linecolor=blue]{p12}{p32}
\end{pspicture}

\end{document}

Regards,

Juergen

-- 
 Jürgen Gilg
 Austr. 59
 70376 Stuttgart
-------------------------------------
 Tel       0711.59 27 88
 e-Mail    gilg at acrotex.net
 Websites  www.acrotex.net
           www.brueckenkurs-physik.de
           www.gilligan-online.de



More information about the PSTricks mailing list