pst-node and ncarc

18 views
Skip to first unread message

garthajax

unread,
Jul 14, 2025, 1:27:07 PMJul 14
to LaTeX Users Group
I’m trying to figure out the five controls on ncarc in pst-node package.

The first two arcs connecting Start and Middle seem to overlap even though the arcangles are 30 and 0. 

The second pair connecting Start and End also seem to overlap even though the arcangles are 90 and 30, angleA are 0 and 270, and angleB are 90 and 135.

Additionally, they seem to have the same terminus on Start as the first two do even though the first three have arcangleA=45 and angleA=0 but the last has 45 and 270

The third pair connecting Middle and End also seem to overlap even though angleA and angleB are 270 and 135, then 0 and 90.

Lastly, the Start-to-Middle terminus on Middle using arcangleB=90 and angleB=90, differs by seemingly 10-20 degrees from the terminus of the Middle-to-End using arcangleA=45 and angleA=0 or using arcangleA=45 and angleA=270.

I would think that angle sets the height of the apex from each terminus, and that angleA and arcangleA set the terminus and the angle at which the connection meets the (oval) node.

%!TEX TS-program = latexTR
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-node}

\begin{document}

\begin{pspicture}(6,3)
\rput(1,1){\ovalnode{X}{Start}}
\rput(5,2){\ovalnode{Y}{Middle}}
\rput(8,3){\ovalnode{Z}{End}}

\ncarc[
arcangle=30,
arcangleA=45,
arcangleB=90,
angleA=0,
angleB=90,
linecolor={[rgb]{1 0 0}}
]{->}{X}{Y}

\ncarc[
arcangle=0,
arcangleA=45,
arcangleB=90,
angleA=0,
angleB=90,
linecolor={[rgb]{1 1 0}}
]{->}{X}{Y}

\ncarc[
arcangle=90,
arcangleA=45,
arcangleB=90,
angleA=0,
angleB=90,
linecolor={[rgb]{0 0 1}}
]{<-}{X}{Z}

\ncarc[
arcangle=30,
arcangleA=45,
arcangleB=90,
angleA=270,
angleB=135,
linecolor={[rgb]{0 1 0}}
]{->}{X}{Z}

\ncarc[
arcangle=75,
arcangleA=45,
arcangleB=90,
angleA=270,
angleB=135,
nodesep=1pt,
linecolor={[rgb]{1 0 1}},
linestyle=dotted
]{->}{Y}{Z}

\ncarc[
arcangle=75,
arcangleA=45,
arcangleB=90,
angleA=0,
angleB=90,
nodesep=1pt,
linecolor={[rgb]{.3 .3 .3}},
linestyle=dotted
]{<-}{Y}{Z}

\end{pspicture}
\end{document}

Peter Flynn

unread,
Jul 14, 2025, 5:11:53 PMJul 14
to latexus...@googlegroups.com
On 14/07/2025 18:27, garthajax wrote:
> I’m trying to figure out the five controls on ncarc in pst-node package.

Is this not covered in the package documentation?
(I don't use pstricks so I'm not familiar with the package)

Peter

Emílio Kavamura eek

unread,
Jul 15, 2025, 7:09:33 PMJul 15
to LaTeX Users Group

I’m not very familiar with PSTricks, so I used DeepSeek to help refine this flow diagram code. The solution controls connection points (using angleA/angleB) and curvature (arcangle) between nodes. I’ve adjusted it to match these requirements:

  • Red & Blue lines start from the right of ‘Start’ and connect to the top of ‘Middle’/‘End’

  • Green & Purple lines begin at the bottom of their nodes and curve to ‘Middle’s northwest side

  • Yellow is a straight-line version of the Red path

Hope this helps! Let me know if you’d like any adjustments.


*******************************************

It looks like you're encountering some confusion with how angleAangleB, and arcangle work in pst-node. Let me clarify how these parameters function and adjust your code to achieve your desired connections.

Key Parameters:
  1. angleA: Specifies the angle (in degrees) at which the line departs from the source node (0=right, 90=up, 180=left, 270=down).

  2. angleB: Specifies the angle at which the line arrives at the destination node.

  3. arcangle: Controls the curvature of the arc (0=straight line, positive/negative values bend the arc).

Your Requirements:
  • Red & Blue: Start from right of "Start" (angleA=0), go to top of "Middle"/"End" (angleB=90).

  • Green & Purple: Start from bottom-middle of "Start"/"End" (angleA=270), arrive at northwest of "Middle" (angleB=135).

  • Yellow: Same as red but straight (arcangle=0).


Adjusted Code:

****************************
\documentclass
{article} \usepackage{pstricks} \usepackage{pst-node} \begin{document} \setlength{\unitlength}{1cm} \begin{pspicture}(10,4) % Adjusted canvas size to fit all nodes \rput(1,1){\ovalnode{X}{Start}} \rput(5,2){\ovalnode{Y}{End}} \rput(8,3){\ovalnode{Z}{Middle}} % Red: Start (right) -> End (top) \ncarc[ arcangle=30, angleA=0, % Depart from right of X angleB=90, % Arrive at top of Y linecolor=red ]{->}{X}{Y} % Yellow: Same as red but straight \ncarc[ arcangle=0, % Straight line angleA=0, angleB=90, linecolor=yellow ]{->}{X}{Y} % Blue: Start (right) -> Middle (top) \ncarc[ arcangle=20, angleA=0, % Depart from right of X angleB=90, % Arrive at top of Z linecolor=blue ]{->}{X}{Z} % Green: Start (bottom) -> Middle (northwest) \ncarc[ arcangle=-30, angleA=270, % Depart from bottom of X angleB=135, % Arrive at northwest of Z linecolor=green ]{->}{X}{Z} % Purple: End (bottom) -> Middle (northwest) \ncarc[ arcangle=30, angleA=270, % Depart from bottom of Y angleB=135, % Arrive at northwest of Z linecolor=purple, linestyle=dotted ]{->}{Y}{Z} \end{pspicture} \end{document}

Emílio Kavamura eek

unread,
Jul 15, 2025, 7:11:59 PMJul 15
to LaTeX Users Group
Formatted the code for better clarity and structure:
Reply all
Reply to author
Forward
0 new messages