# [pstricks] ncangle variant is needed

Boris Veytsman borisv at lk.net
Fri Jun 22 21:23:35 CEST 2007

Greetings,

I need a variant of \ncangle, and I am afraid my PostScript skills are
not good enough to make it.

I want a node connection like \ncangle, where arm B starts from the
edge of the node, like in the current \ncangle, BUT its length is
calculated from the node center rather than from the edge.

Let me give an example.  In this picture:

\begin{pspicture}(5,4)
\cnode(2.5,3.5){0.2}{A}
\cnode(0.5,1){0.2}{B1}
\cnode(1.5,1){0.4}{B2}
\cnode(2.6,1){0.6}{B3}
\cnode(4,1){0.8}{B4}
\psset{angleB=90,angleA=-90,armB=1}
\ncangle{A}{B1}
\ncangle{A}{B2}
\ncangle{A}{B3}
\ncangle{A}{B4}
\end{pspicture}

the horizontal arms of the node connections are not aligned because
nodes Bi have different radii.  I can manually align them using
different values of armB:

\begin{pspicture}(5,4)
\cnode(2.5,3.5){0.2}{A}
\cnode(0.5,1){0.2}{B1}
\cnode(1.5,1){0.4}{B2}
\cnode(2.6,1){0.6}{B3}
\cnode(4,1){0.8}{B4}
\psset{angleB=90,angleA=-90}
\ncangle[armB=0.8]{A}{B1}
\ncangle[armB=0.6]{A}{B2}
\ncangle[armB=0.4]{A}{B3}
\ncangle[armB=0.2]{A}{B4}
\end{pspicture}

but I want this to be done automatically

By the way, I know how to align the node connections by inverting the
order of nodes:

\begin{pspicture}(5,4)
\cnode(2.5,3.5){0.2}{A}
\cnode(0.5,1){0.2}{B1}
\cnode(1.5,1){0.4}{B2}
\cnode(2.6,1){0.6}{B3}
\cnode(4,1){0.8}{B4}
\psset{angleA=90,angleB=-90,armB=1}
\ncangle{B1}{A}
\ncangle{B2}{A}
\ncangle{B3}{A}
\ncangle{B4}{A}
\end{pspicture}

I have been using this trick before.  However now I am going to have nodes
of different size on both ends (with aligned centers).  Therefore
I need a version of \ncangle with armB calculated from the center.

Thanks for any help.

--
Good luck

-Boris

I have the simplest tastes.  I am always satisfied with the best.
-- Oscar Wilde



More information about the PSTricks mailing list