[Tex/LaTex] How to rotate objects in pstricks without shifting them

pstricksrotating

I'm trying to draw an image with pstricks (an experiment schematics) and I'm having a hard time rotating stuff. I'm using psrotate and everytime I rotate something it has its position shifted as well. Is there a way to rotate something with respect to its center? I'm trying to rotate simple objects like squares and rectangles…

thank you very much.

 \documentclass[crop=true]{standalone} 
 \usepackage{pst-plot}
 \usepackage{pstricks-add}
 \usepackage{auto-pst-pdf}

\begin{document}
%
 \begin{pspicture}(-0.1,-0.1)(20.1,25.1)

\psframe[linewidth=0.065cm,linecolor=black](0,0)(20,25)
%
\psframe[linewidth=0.065cm,linecolor=black](1,15)(19,24)
\pspolygon[fillstyle=solid, linewidth=0.06cm,linecolor=gray](5,17)(10,22)(15,17)%prisma


\psframe[linewidth=0.065cm,linecolor=black](1,1)(19,14.5)
\pspolygon[linewidth=0.06cm,linecolor=gray](4,2)(10,8)(16,2)%prisma


\pscircle*[linecolor=LTCearthred](7.5,5.5){3pt}
\pscircle*[linecolor=LTCearthred](12.5,5.5){3pt}
\pscircle*[linecolor=LTCearthred](10,2){3pt}

\psline[linestyle=dotted,linecolor=black](5,8)(9,4)
\psline[linestyle=dotted,linecolor=black](11,4)(15,8)

\psline[linewidth=0.05cm,linecolor=black](4,13)(7.5,5.5)
\psline[linewidth=0.05cm,linecolor=black](10,2)(7.5,5.5)

\psline[linewidth=0.05cm,linecolor=red](10,2)(12.5,5.5)
\psline[linewidth=0.05cm,linecolor=red](12.5,5.5)(16,13)

\psrotate(0,0){-20}{\pspolygon*[](-1.95,13.9)(-0.95,14.9)(0.05,13.9)(-0.95,12.9)}

\end{pspicture}
\end{document}

The last object (inside the psrotate, third line from the bottom) is the one giving me headaches. It took so long to put it there and there will be others like it…

Best Answer

Use

\psdot[dotsize=1.41,dotstyle=square*,dotangle=70](-0.95,13.9)

instead of the rotated polygon. By the way, there is a package pst-optic with \psprism. See pages 21ff of the documentation.

Related Question