[pstricks] Sunflower

Poul Riis Poul.Riis at skolekom.dk
Sat Nov 17 22:29:07 CET 2007


What's wrong here (bad centering, run the example below)?

Yours,
Poul Riis

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{geometry}
\makeatletter
\def\psSunflower{\pst at object{psSunflower}}
\def\psSunflower at i#1#2{%
   \begin at SpecialObj
   \addto at pscode{
    /rhomb {newpath 0 3 neg moveto 6 0 lineto 0 3 lineto 6 neg 0 lineto
closepath fill} def
    /radius #2 def
    0 1 0 setrgbcolor
    0 0 radius 0 360 arc fill gsave grestore stroke
    /phig 3 5 sqrt sub 180 mul def
    1 1 #1 {
    /jj ED
    /actradius jj #1 div sqrt radius mul def
    /actang phig jj mul def
    /xx actang cos actradius mul def
    /yy actang sin actradius mul def
    0.6 setgray
    actang rotate actradius 0 translate rhomb actradius neg 0 translate
actang neg rotate gsave grestore stroke
    1 1 0.7 setrgbcolor
    xx yy 1 0 360 arc fill gsave grestore stroke
     } for
   }%
   \end at SpecialObj}
\makeatother


\begin{document}
\psset{unit=1pt}
\begin{pspicture}(-200,-200)(200,200)
\psSunflower{2500}{200}%Number of points, radius
\end{pspicture}
\end{document}





More information about the PSTricks mailing list