[pstricks] Bug in pst-eucl

Christoph Bersch usenet at bersch.net
Thu Jul 14 10:54:18 CEST 2011


Hi,

there is a bug in pst-eucl, the \pstInterLL macro gives a Postscript 
error for parallel lines:

\documentclass{article}
\usepackage{pst-eucl}
\begin{document}
\begin{pspicture}(2,2)
   \pstGeonode(0,0){A}(1,1){B}(1,0){C}(2,1){D}
   \pstInterLL{A}{B}{C}{D}{E}
\end{pspicture}
\end{document}

This is, because for parallel lines too many elements are tried to pop 
off the stack. To fix this, change /InterLines to:

/InterLines {
   EqDr /D1c exch def /D1b exch def /D1a exch def
   EqDr /D2c exch def /D2b exch def /D2a exch def
   D1a D2b mul D1b D2a mul sub dup ZeroEq
   { pop 0 0 } %% parallel lines, pop only one element off the stack
   {
     /Det exch def
     D1b D2c mul D1c D2b mul sub Det div
     D1a D2c mul D2a D1c mul sub Det div
   }
   ifelse  } bind def

Christoph


More information about the PSTricks mailing list