Более точный контроль за изогнутыми краями

Более точный контроль за изогнутыми краями

Вот мой код:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows, automata}

\begin{document}

\begin{tikzpicture}[
        > = stealth, % arrow head style
        shorten > = 1pt, % don't touch arrow head to node
        auto,
        node distance = 3cm, % distance between nodes
        semithick % line style
    ]

    \tikzstyle{every state}=[
    draw = black,
    thick,
    fill = white,
    minimum size = 4mm
    ]
    
    \node[state] (a) at (0,4) {A};
    \node[state] (b) at (4,4) {B};
    \node[state] (c) at (2,2) {C};
    \node[state] (d) at (0,0) {D};
    \node[state] (e) at (4,0) {E};
    
    \path[->] (a) edge node {$e_1$} (b);
    \path[->] (b) edge node {$e_2$} (e);
    \path[->] (a) edge node {$e_3$} (c);
    \path[->] (c) edge node {$e_4$} (e);
    \path[->] (d) edge node {$e_5$} (e);
    \path[->] (a) edge node {$e_6$} (d);
    \path[->, style={bend left = 145}] (b) edge node {$e_7$} (d);
\end{tikzpicture}

\end{document}

Вот какой результат получается: Результат

Я пытаюсь заставить ребро e_7 огибать узел E, как показано на следующем рисунке. Желаемый результат

Как мне контролировать изгиб e_7?

решение1

Вы можете использовать кривую Безье с контрольными точками немного юго-восточнее E.

введите описание изображения здесь

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows, automata,calc}

\begin{document}

\begin{tikzpicture}[
        > = stealth, % arrow head style
        shorten > = 1pt, % don't touch arrow head to node
        auto,
        node distance = 3cm, % distance between nodes
        semithick % line style
    ]

    \tikzstyle{every state}=[
    draw = black,
    thick,
    fill = white,
    minimum size = 4mm
    ]

    \node[state] (a) at (0,4) {A};
    \node[state] (b) at (4,4) {B};
    \node[state] (c) at (2,2) {C};
    \node[state] (d) at (0,0) {D};
    \node[state] (e) at (4,0) {E};

    \path[->] (a) edge node {$e_1$} (b);
    \path[->] (b) edge node {$e_2$} (e);
    \path[->] (a) edge node {$e_3$} (c);
    \path[->] (c) edge node {$e_4$} (e);
    \path[->] (d) edge node {$e_5$} (e);
    \path[->] (a) edge node {$e_6$} (d);
    %                                V--V - change here to adjust
    \path[->,draw] (b) .. controls ($(e)+(2,-1)$) .. node {$e_7$} (d);
\end{tikzpicture}

\end{document}

решение2

Альтернатива ответу Фелпе Олейника:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows, automata,calc}

\begin{document}

\begin{tikzpicture}[
        > = stealth, % arrow head style
        shorten > = 1pt, % don't touch arrow head to node
        auto,
        node distance = 3cm, % distance between nodes
        semithick % line style
    ]

    \tikzstyle{every state}=[
    draw = black,
    thick,
    fill = white,
    minimum size = 4mm
    ]

    \node[state] (a) at (0,4) {A};
    \node[state] (b) at (4,4) {B};
    \node[state] (c) at (2,2) {C};
    \node[state] (d) at (0,0) {D};
    \node[state] (e) at (4,0) {E};

    \path[->] (a) edge node {$e_1$} (b);
    \path[->] (b) edge node {$e_2$} (e);
    \path[->] (a) edge node {$e_3$} (c);
    \path[->] (c) edge node {$e_4$} (e);
    \path[->] (d) edge node {$e_5$} (e);
    \path[->] (a) edge node {$e_6$} (d);
    \draw[->] (b) to[in= 45,out=-45]  ($(e)+(0.5,-0.5)$)node[right]{$e_7$} to[in= -45,out=-135] (d);
\end{tikzpicture}

\end{document}

введите описание изображения здесь

решение3

Здесь также loosenessможно использовать такой вариант:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows, automata}

\begin{document}

\begin{tikzpicture}[
        > = stealth, % arrow head style
        shorten > = 1pt, % don't touch arrow head to node
        auto,
        node distance = 3cm, % distance between nodes
        semithick % line style
    ]

    \tikzstyle{every state}=[
    draw = black,
    thick,
    fill = white,
    minimum size = 4mm
    ]

    \node[state] (a) at (0,4) {A};
    \node[state] (b) at (4,4) {B};
    \node[state] (c) at (2,2) {C};
    \node[state] (d) at (0,0) {D};
    \node[state] (e) at (4,0) {E};

    \path[->] (a) edge node {$e_1$} (b);
    \path[->] (b) edge node {$e_2$} (e);
    \path[->] (a) edge node {$e_3$} (c);
    \path[->] (c) edge node {$e_4$} (e);
    \path[->] (d) edge node {$e_5$} (e);
    \path[->] (a) edge node {$e_6$} (d);
    \path[->, style={bend left = 70, looseness = 2}] (b) edge node {$e_7$} (d);
\end{tikzpicture}

\end{document}

введите описание изображения здесь

Связанный контент