[Problem] Requiring arrows change the position of points joined by curves

Denis Girou Denis.Girou at idris.fr
Fri Oct 17 23:34:14 CEST 1997


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

  Thomas Siegel <siegel at aix520.informatik.uni-leipzig.de> (in fact a friend
of him - and with good glasses!) reported in September the following problem:
when arrows are required, this change the way the curves are drawn.
In fact, the modification is small, and we must be very careful to see that,
but this effect can be clearly demonstrated if we surimpose a grid.
And it can be specially ennoying for Bezier curves. In the example shown by
Thomas, we can see that the Bezier curve is no longer symmetric.

  It is another case of "bug or feature", even if it seems hard to be
considered as expected... Nevertheless, even if the correction seems trivial,
as the impact is not seen in the great majority of cases and as it concern a
code so often used in very different situations that I'm not confident to
change, I prefer to don't change the code for the moment. I just give the
patch for interested people.

  I add this problem in the pstricks.bug file for notification.

  My test case is (developing the one transmitted by Thomas):

\documentclass{article}

\usepackage{pstricks}

\pagestyle{empty}

\begin{document}

\begin{pspicture}(4,2)
  \psgrid
  \psdot*(1,1)
  \psdot*(3,1)
  \psset{arrowinset=0}
  \psbezier[showpoints=true]{->}(1,1)(0,2)(4,2)(3,1)
  \psbezier[showpoints=true]{<-}(1,1)(0,0)(4,0)(3,1)
\end{pspicture}

\vspace{1cm}
\begin{pspicture}(4,2)
  \psgrid
  \psdot*(1,1)
  \psdot*(3,1)
  \psbezier[showpoints=true](1,1)(0,2)(4,2)(3,1)
  \psbezier[showpoints=true](1,1)(0,0)(4,0)(3,1)
\end{pspicture}
\vspace{2cm}

\begin{pspicture}(0,-2)(4,3)
  \psbezier[arrowsize=2]{->}(1,1)(0,2)(4,2)(3,1)
  \psbezier[arrowsize=2]{<-}(1,1)(0,0)(4,0)(3,1)
\end{pspicture}

\begin{pspicture}(0,-2)(4,3)
  \pscurve[arrowsize=2]{->}(1,1)(0,2)(4,2)(3,1)
  \pscurve[arrowsize=2]{<-}(1,1)(0,0)(4,0)(3,1)
\end{pspicture}

\clearpage

\makeatletter
% Version of the /Arrow macro which keep the coordinates of the point
% and doesn't used the entry of the arrow head for that
% (default was specially ennoying for \psbezier and when we use large
% value of arrowsize or arrowscale parameter)
% Work here on the current page
\pst at Verb{%
/Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1
scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto 
% DG modification begin - Sep. 25, 1997
0 0 moveto
% DG modification end
gsave fill grestore } def}
\makeatother

\begin{pspicture}(4,2)
  \psgrid
  \psdot*(1,1)
  \psdot*(3,1)
  \psset{arrowinset=0}
  \psbezier[showpoints=true]{->}(1,1)(0,2)(4,2)(3,1)
  \psbezier[showpoints=true]{<-}(1,1)(0,0)(4,0)(3,1)
\end{pspicture}

\begin{pspicture}(0,-2)(4,5)
  \psbezier[arrowsize=2]{->}(1,1)(0,2)(4,2)(3,1)
  \psbezier[arrowsize=2]{<-}(1,1)(0,0)(4,0)(3,1)
\end{pspicture}

\end{document}

D.G.

-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list