畫一個有箭頭的圓圈來表示循環

畫一個有箭頭的圓圈來表示循環

如圖所示,我已經有三個節點和相互連接的箭頭。箭頭形成一個循環,我想在三角形區域內添加一個帶有箭頭的圓圈(可能帶有文字),以指示形成了一個循環。我怎樣才能做到這一點?

我已經有的程式碼:

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes, positioning, arrows.meta, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}[
    node distance = 3.0cm and 1.5cm,
    sa/.style = {->, thick},
    sb/.style = {->, thick, dashed, red},
    sc/.style = {->, thick, dotted, blue},
    n/.style = {draw, inner sep = 3pt, align = center}]

  \node[n] (ta)
  {Content};
  \node[n, left = of ta] (tb)
  {Content};
  \node[n, below right = of tb] (tc)
  {Content};
  \draw[sa, sloped] (ta) to (tb);
  \draw[sb] (tb) to (tc);
  \draw[sc] (tc) to (ta);

\end{tikzpicture}
\end{document}

在此輸入影像描述

答案1

作為一個快速技巧,您可以手動添加弧線和文字:

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes, positioning, arrows.meta, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}[
    node distance = 3.0cm and 1.5cm,
    sa/.style = {->, thick},
    sb/.style = {->, thick, dashed, red},
    sc/.style = {->, thick, dotted, blue},
    n/.style = {draw, inner sep = 3pt, align = center}]

  \node[n] (ta)
  {Content};
  \node[n, left = of ta] (tb)
  {Content};
  \node[n, below right = of tb] (tc)
  {Content};
  \draw[sa, sloped] (ta) to (tb);
  \draw[sb] (tb) to (tc);
  \draw[sc] (tc) to (ta);
  \draw[->,red] (-0.4,-1) arc [radius=0.5cm,start angle=0,end angle=340];
  \node at (-0.4-0.5,-1) {Text};
\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容