1

I am attempting to draw a two lens system using pst-optic. Here is my code :

\documentclass{standalone} 

\usepackage{pst-optic}

\begin{document}
\begin{pspicture}(-15,-3)(15,3)
\rput(5,0)
{\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass=true,focus=3.33333333333,OA=-10,AB=1,nameO=O_1,nameF=F_1,nameA=A_1,nameB=B_1,nameFi=F'_1,nameAi={},nameBi={}]}
\rput(12.5,0)
{\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass=true,focus=1.666666666666,nameA=A'_1,nameB=B'_1,nameO=O_2,nameAi=A'_2,nameF=F_2,nameFi=F'_2,nameBi=B'_2,OA=-2.5,AB=-0.5]}
\end{pspicture}
\end{document}

The problem is that my image is truncated even though there is a wide space to the left (the "object" does not appear on the very left of the image):

enter image description here

How can I solve this issue?

1

\lens uses internally a pspicture* environment which clips the outside of the predefinied area. Use option xLeft for the first lens to modify the border:

\documentclass[pstricks]{standalone} 
\usepackage{pst-optic}

\begin{document}
\begin{pspicture}(-5,-3)(21,3)
\rput(5,0)%
    {\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass,
      xLeft=-12,focus=3.33333333333,OA=-10,AB=1,nameO=O_1,nameF=F_1,nameA=A_1,nameB=B_1,nameFi=F'_1,nameAi={},nameBi={}]}
\rput(12.5,0)%
    {\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass=true,focus=1.666666666666,nameA=A'_1,nameB=B'_1,nameO=O_2,nameAi=A'_2,nameF=F_2,nameFi=F'_2,nameBi=B'_2,OA=-2.5,AB=-0.5]}
\end{pspicture}

\end{document}

However, using xunit=0.6 or so may make some sense:

\psset{xunit=0.6}
\begin{pspicture}(...)(...)
...

enter image description here

1

Set the correct area of the picture as (-3,-3)(21,3). Also, consider placing the nodes (A',B',...) in a good location to be easily read.

\documentclass{standalone} 
\usepackage{pst-optic}
\begin{document}

\begin{pspicture}(-3,-3)(21,3)
\rput(5,0)
{\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass=true,focus=3.33333333333,OA=-10,AB=1,nameO=O_1,nameF=F_1,nameA=A_1,nameB=B_1,nameFi=F'_1,nameAi={},nameBi={}]}
\rput(12.5,0)
{\lens[lensType=CVG,lensHeight=5,lensWidth=0.5,lensGlass=true,focus=1.666666666666,nameA=A'_1,nameB=B'_1,nameO=O_2,nameAi=A'_2,nameF=F_2,nameFi=F'_2,nameBi=B'_2,OA=-2.5,AB=-0.5]}
\end{pspicture}

\end{document}

enter image description here

  • This does not solve my problem. I have an arrow on the left of the picture which is truncated. The truncated part is actually to the left of the image. The "object" is not displayed. – Melian Apr 11 '15 at 2:06
  • You mean line OA? you set its length twice. – AboAmmar Apr 11 '15 at 2:13
  • Actually, there should be an object 10 cm to the left of the first lens and this object is truncated from the image... – Melian Apr 11 '15 at 2:17
  • 10 cm is too far (the rays look parallel), if you use 7cm, e.g., you can see the object – AboAmmar Apr 11 '15 at 2:54
  • Yes, but my diagram must be to scale, so I must keep these numbers. – Melian Apr 11 '15 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.