[pstricks] Using \nccurve with Postscript coordinates inside \pscustom
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Wed Nov 30 20:24:35 CET 2011
Am 30.11.2011 16:16, schrieb Christoph Bersch:
> I want to use \nccurve with Postscript coordinates inside \pscustom.
> Using \pccurve does not work, because inside \pscustom no new nodes can
> be defined with \pnode (as is done internally in \pccurve), the
> following one does not draw any curve:
>
> \documentclass{article}
> \usepackage{pst-node}
> \begin{document}
> \begin{pspicture}[showgrid=true]
> \pscustom{\pccurve(! 1 1)(!3 3)}%
> \end{pspicture}
> \end{document
>
> This is a heavily simplified version of the original problem. There is
> no way to define the nodes outside the \pscustom scope.
>
> Is there any viable solution for my problem?
Maybe this helps:
\documentclass{article}
\usepackage{pst-node}
%/NewNode {
% on stack: { x y } boolean /N at name type /NodeScale {} def InitXnode
\begin{document}
\begin{pspicture}[showgrid](10,10)
\pscustom[linecolor=red,linewidth=2pt]{%
\moveto(0,0)
\code{ tx at NodeDict begin {1 1 0.292 div exch 0.292 div exch neg
} false /N at A 10 {InitPnode} /NodeScale {} def NewNode end }
\code{ tx at NodeDict begin {10 10 0.292 div exch 0.292 div exch neg
} false /N at B 10 {InitPnode} /NodeScale {} def NewNode end }
\nccurve{A}{B}
}
\end{pspicture}
\end{document}
For \pccurve(A)(B) you have to change the names to /N@@@A and /N@@@B
Herbert
More information about the PSTricks
mailing list