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.

I want to adjust the arrow head tip of a bezier curve on the left such that it looks like the one on the right.

As there is no \ncbezier or \pcbezier available, I cannot use nodesep to adjust it. arcsep does not work as well.

Using \psbezier{->}([offset=4pt]R)([offset=-4pt]CR)([offset=-4pt]CL)([offset=4pt]L) is not perfect because it produces a new different bezier curve. In the right figure, can you see the filled region bounded by the first created bezier curve is not exactly enclosed by the second one?

enter image description here

\documentclass[border=12pt]{standalone}
\usepackage{pst-node}
\addtopsstyle{gridstyle}{griddots=0,gridwidth=0.4pt,subgriddiv=10,subgridwidth=0.1pt}

\def\Common{%
    % define nodes  
    \pnode(0,0){L}
    \pnode(1;45){T}
    \pnode(!2 sqrt 0){R}
    \pnode[-0.5,0.75](T){CL}
    \pnode[0.5,0.75](T){CR}
    % draw a bezier curve
    \pscustom[fillstyle=solid,fillcolor=red,linestyle=none]{\psbezier(R)(CR)(CL)(L)\closepath}
    % draw dots
    \pscircle(L){4pt}
    \pscircle(R){4pt}
}

\begin{document}
\begin{pspicture}[showgrid=false](1.45,1.25)
    \Common
    \psbezier{->}(R)(CR)(CL)(L)
\end{pspicture}
\qquad
\begin{pspicture}[showgrid=false](1.45,1.25)
    \Common
    \psbezier{->}([offset=4pt]R)([offset=-4pt]CR)([offset=-4pt]CL)([offset=4pt]L)
\end{pspicture}
\end{document}

So how to adjust it? More general question: Is it possible to put the arrow head to any point on the path (as in TikZ it is possible)?

share|improve this question
    
I don't know pstricks, but Metapost handles this as follows. Save the original path, shorten it by the required amount (by using metapost primitives that allow you to traverse a certain distance on the path) and then draw the arrow. The same idea should work in pstricks as well. –  Aditya Mar 31 '13 at 19:47
1  
@Karl's students Herbert has come up with a solution at tug.org/PSTricks/Examples/Gallery/exa070.tex. –  Svend Tveskæg Apr 3 '13 at 0:13
    
@SvendMortensen: You can make it as your answer and I will accept it to finalize the bounty and question. –  cyanide-based food Apr 3 '13 at 0:33
    
Okay, but I haven't really done anything, I think. :) –  Svend Tveskæg Apr 3 '13 at 0:36

1 Answer 1

up vote 1 down vote accepted
+150

Herbert has come up with a solution on his homepage.

share|improve this answer
    
But this solution used a trial-and-error approach that will be broken if I change the circle radius. :-) –  cyanide-based food Apr 3 '13 at 0:45
    
Good point! I actually hadn't noticed that; I just looked at the picture and thought that it was a good solution (it usually is when Herbert is the author). –  Svend Tveskæg Apr 3 '13 at 0:47

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.