# [pstricks] parallel arrows to an oval node

Armin Schmich armin.schmich at freenet.de
Sat Oct 26 20:15:24 CEST 2002

Hello,

I'm trying to draw two parallel arrows (with significant distance to each
other) from one ovalnode to another. Unfortunately, the "offset" parameter
doesn't give the result I'm looking for, depending on the angle of the
arrows, one arrow points inside the ellipse and one error points outside.

At the moment I'm doing stuff like this:
(I'm somewhat new to pstricks, so please excuse my bad code... I don't even
know how to handle Coordinates, so I use some lengths for position of the
nodes):

\newlength{\node1x}
\newlength{\node1y}
\newlength{\node2x}
\newlength{\node2y}
\setlength{\node1x}{1cm}
\setlength{\node1y}{1cm}
\setlength{\node2x}{4cm}
\setlength{\node2y}{4cm}

\pnode(\ynode1x,\ynode1y){node1}
\addtolength{\ynode1x}{-1mm}
\pnode(\ynode1x,\ynode1y){node1L}
\addtolength{\ynode1x}{2mm}
\pnode(\ynode1x,\ynode1y){node1R}
\addtolength{\ynode2x}{-1mm}

\rput{\node2x,\node2y}{\ovalnode[fillstyle=solid,fillcolor=yellow]{node1}{Ta
rget}

\addtolength{\ynode2x}{-1mm}

\rput{\node2x,\node2y}{\ovalnode[fillstyle=none,linestyle=none]{node1L}{\par
box[\heightof{Target}]{\widthof{Target}}{\ }}}

\addtolength{\ynode2x}{2mm}

\rput{\node2x,\node2y}{\ovalnode[fillstyle=none,linestyle=none]{node1R}{\par
box[\heightof{Target}]{\widthof{Target}}{\ }}}

\addtolength{\ynode2x}{-1mm}

\ncline[linewidth=1pt,arrowscale=1.3,border=.8pt]{->}{node1L}{node2L}
\ncline[linewidth=1pt,arrowscale=1.3,border=.8pt]{->}{node1R}{node2R}
\ncline[linestyle=none]{node1}{node2}
\psset{framesep=1pt}
\mput*{\psframebox[boxsep=false]{\sf \tiny P}

\rput{\node1x,\node1y}{\ovalnode[fillstyle=solid,fillcolor=yellow]{node1}{So
urce}

...i know, it's ugly - just to show the idea (and my desperation).
Is there a way to have the arrows exactly point to the border of the ellipse
(perhaps with psclip or/and pscustom)?
(and btw, how can I learn to deal better with calculations and Coordinates
in pstricks?)

Thanks for any suggestions,

Armin

More information about the PSTricks mailing list