[pstricks] Strange interaction between pst-lens and pst-fill

halbard7 at aol.com halbard7 at aol.com
Sun Aug 20 20:09:19 CEST 2006


Please take a look at the following code: evidence of bugs or brain damage? Troubled lines
prefixed with %-> below. Using MikTeX 2.4 and dvips.
 
%% lensbug.tex
\listfiles
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-lens}
\usepackage{pst-fill}
 
\newcommand{\f}{\mathrm f{}}
\renewcommand{\d}[1]{\mathop{\mathrm d#1}\nolimits}
\newgray{mygray}{0.9}
 
\begin{document}
 
\def\incircle{% my boxfill, loads of dots
 \pspicture(0,0)(0.2,0.2)\psdots(0.1,0.1)\endpspicture
}
 
\def\inpic{% my lens picture
 \rput(1.9,0.1){
  \begin{pspicture}(-1,-1)(1,1)
  \psboxfill{\incircle}

%% begin problem
%% first problem:
%% remove %-> and feel the heat
%->  \psframe[fillstyle=boxfill](-1,0)(1,1)
%% end problem

  \psframe[fillstyle=crosshatch,hatchsep=1pt](-0.3,0)(0.4,1)% **

%% begin problem
%% second problem:
%% an alternative to the crosshatch style ** above
%% the fill bleeds into the lens surround, and looks awful
%->  \psframe[fillstyle=solid,fillcolor=mygray](-0.3,0)(0.4,1)
%% end problem

  \psline(-1,0)(1,0)
  \psline(-0.3,0)(-0.3,1)
  \psline(0.4,0)(0.4,1)
  \uput[d](-0.3,0){$\mathstrut x$}
  \uput[d](0.4,0){$\mathstrut x+\d x$}
  \end{pspicture}
 }
}
 
\psset{unit=1.75cm}
\begin{pspicture}(-.5,-.5)(5,3) % the plot thickens
 \psclip{% shaded area in plot
  \pscustom[linestyle=none]{%
   \pscurve(0,1.8)(0.5,2.3)(2,2.7)(3,2.4)(4.5,1.6)(5,1.5)
   \lineto(5,0)
   \lineto(0,0)
  }
 }
 \psframe*[linecolor=mygray](0.5,0)(4.5,3)
 \endpsclip
 \psaxes[labels=none,ticks=none]{->}(0,0)(-.2,-.2)(5,3)
 \pscurve(0,1.8)(0.5,2.3)(2,2.7)(3,2.4)(4.5,1.6)(5,1.5)
 \uput[r](5,1.5){$y=\f(x)$}
 \psline(2,0)(2,2.7)
 \uput[d](2,0){$\d x$}
 \psdots(2,2.7)
 \uput[ur](2,2.7){$(x,y)$}
 \uput[d](0.5,0){$a$}
 \uput[d](4.5,0){$b$}
 \uput[r](5,0){$x$}
 \uput[l](0,3){$y$}
 \PstLens[LensSize=.75,LensRotation=75](2,0.01){\inpic} % doing it
\end{pspicture}
 
\end{document}
 
  *File List*
  article.cls    2005/09/16 v1.4f Standard LaTeX document class
   size10.clo    2005/09/16 v1.4f Standard LaTeX file (size option)
 pstricks.sty    2005/12/19 v0.31 LaTeX wrapper for `PSTricks'(RN,HV)
 pstricks.tex    2006/02/06 v1.14a `PSTricks' (tvz)
   xcolor.sty    2005/12/21 v2.09 LaTeX color extensions (UK)
    color.cfg    2005/12/29 v1.1 MiKTeX 'color' configuration
    dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
 pst-plot.sty    2004/07/15 package wrapper for pst-plot.tex
 pst-plot.tex    2004/05/18 1.41 `pst-plot' (tvz)
 pst-lens.sty    2005/09/02 package wrapper for pst-lens.tex (hv)
 pst-lens.tex    2006/06/06 v1.02 `PST-lens' (hv)
 pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
  xkeyval.sty    2005/11/25 v2.5e package option processing (HA)
  xkeyval.tex    2005/11/25 v2.5e key=value parser (HA)
 pst-fill.sty    2004/07/15 package wrapper for pst-fill.tex
 pst-fill.tex    2004/08/18 97 patch 4 `pst-fill' (tvz)
  ***********
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20060820/c1cdb403/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lensbug.tex
Type: application/octet-stream
Size: 2823 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20060820/c1cdb403/attachment.obj 


More information about the PSTricks mailing list