Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

alt text

Points enclosed by black ovals are the intersection points between the frame boundary of \rput and the line segment of \ncline.

How to find these points?


The screenshot above is copied from PSTricks Tutorial series on page 4.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted
\documentclass{article} 
\usepackage{pst-node}\SpecialCoor
\makeatletter
\def\psGetEdgeA#1#2{tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 
  /N@#1 /N@#2 InitNC { NCCoor } if pop pop \tx@UserCoor end}
\def\psGetEdgeB#1#2{tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 
  /N@#1 /N@#2 InitNC { NCCoor } if 4 2 roll pop pop \tx@UserCoor end}
\makeatother

\begin{document}
\Huge
\hspace*{4cm}\rnode{B}{Node B}

\vspace{2cm}
\rnode{A}{Node A}
\ncline{A}{B}
\pscircle*[linecolor=blue,opacity=0.4](!\psGetEdgeA{A}{B}){10pt}
\pscircle*[linecolor=blue,opacity=0.4](!\psGetEdgeB{A}{B}){10pt}

\end{document}
share|improve this answer
    
thanks for this help. Very good. –  xport Dec 28 '10 at 16:54
    
the pst-node version from http://texnik.dante.de/tex/generic/pst-node/ knows the above two macros. Will be available from CTAN this year :-) –  Herbert Dec 28 '10 at 21:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.