[pstricks] The psbezier anomaly within pscustom has re-emerged.

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Aug 26 22:17:26 CEST 2010


Am 26.08.2010 20:20, schrieb Dwight Aplevich:

> This behavior would seem to be a bug. The coordinate data defining a spline
> depend on whether the path will be embedded in a \pscustom environment,
> which may not be known when the coordinates are generated, and the first
> segment may not be known.
> 
> The following example illustrates the problem:
> 
> \psset{unit=1in,cornersize=absolute,dimen=middle}%
> \begin{pspicture}(0,0)(0.75,0.5)%
> \pscustom[fillstyle=solid, linecolor=black, fillcolor=lightgray]{
> \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
> \psbezier(0.5,0.5)(0.625,0.5)(0.75,0.375)(0.75,0.25)
> \psline(0.75,0.25)(0.75,0)(0.75,0)(0,0)
> }%
> \end{pspicture}%

the correct way inside a \pscustom is:

\pscustom[fillstyle=solid, linecolor=red, fillcolor=lightgray]{
  \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
  \psbezier(0.625,0.5)(0.75,0.375)(0.75,0.25)
  \psline(0.75,0)(0.75,0)(0,0)
}

And without \pscustom

\documentclass[]{book}
\usepackage{pstricks}
\begin{document}

\psset{unit=1in,cornersize=absolute,dimen=middle}%
\begin{pspicture}(0,0)(0.75,0.5)
  \psline(0,0)(0,0.5)(0,0.5)(0.5,0.5)
  \psbezier(0.5,0.5)(0.625,0.5)(0.75,0.375)(0.75,0.25)
  \psline(0.75,0.25)(0.75,0)(0.75,0)(0,0)
\end{pspicture}

\end{document}

Inside \pscustom the current point is always taken into account
and you have to define with the liftpen setting what to do
when the next line starts at another point.

Herbert


More information about the PSTricks mailing list