루프를 나타내기 위해 화살표가 있는 원을 그립니다.

루프를 나타내기 위해 화살표가 있는 원을 그립니다.

그림에 표시된 것처럼 이미 세 개의 노드와 서로 연결되는 화살표가 있습니다. 화살표는 루프를 형성하며 루프가 형성되었음을 나타내기 위해 삼각형 영역 내부에 화살표가 있는 원(아마도 텍스트가 포함되어 있음)을 추가하고 싶습니다. 어떻게 해야 합니까?

내가 이미 가지고 있는 코드는 다음과 같습니다.

\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}

여기에 이미지 설명을 입력하세요

관련 정보