交差点を使用せずに装飾マーキングを使用して閉曲線をマーキングする (TikZ)

交差点を使用せずに装飾マーキングを使用して閉曲線をマーキングする (TikZ)

{Latex[length=4mm, cyan]}閉じた曲線を次のようにマークしたいこれ通常、曲線をマークするには、交差点を使用してから、 で新しいカスタム マークをマークしisosceles triangle、試行錯誤しながら回転とシフトを行います。 しかし、これは効率的ではありません。decorations.markingまたは などの単純なものを使用したいと思います。矢印の位置を調整するだけで効率的に使用できるためです。 しかし、私の曲線は閉じているため、 を使用すると多くのエラーが発生しましたdecorations.markings。 これは可能ですか? 知識を共有してください。 よろしくお願いします。

これが私の MWE です:

\documentclass[tikz, border=1mm]{standalone}
\usetikzlibrary{arrows.meta, decorations.markings}
\begin{document}
    \begin{tikzpicture} 
        \begin{scope}[>={Stealth[length=4mm]}]
            \draw[<->, thick] (-4,0)--(4,0) node[below,shift={(-.2,-.2)}]{\Large $x$};
            \draw[<->, thick] (0,-4)--(0,4) node[left, shift={(-.1,-.2)}]{\Large $y$};
        \end{scope}
        \begin{scope}[]
            \draw[line width=1.5pt] (0,0) circle [radius=3cm];
            \draw [red, line width=1.3pt]
            (.1,.4) .. controls (1.2,1.8) and (.4,2.3) .. (-.5,1.9)
            .. controls (-1.2,1.3) and (-1.8,1.5) .. (-2,1.4) 
            to[out=180,in=180] (-2,.2) 
            .. controls (-1.8,.1) and (0,.1) .. (.1,.4) -- cycle;
        \end{scope}
    \end{tikzpicture}
\end{document}

答え1

mark各パスの装飾を定義し、それを呼び出したらその装飾に関連付けられた番号を使用して矢印の位置を設定するだけです。

    \documentclass[border=1mm]{standalone}
    \usepackage[dvipsnames]{xcolor}
    \usepackage{tikz}
    \usetikzlibrary{arrows.meta, decorations.markings}
    \begin{document}
    \begin{tikzpicture} 
    \begin{scope}[>={Stealth[length=4mm]}]
    \draw[<->, thick] (-4,0)--(4,0) node[below,shift={(-.2,-.2)}]{\Large $x$};
    \draw[<->, thick] (0,-4)--(0,4) node[left, shift={(-.1,-.2)}]{\Large $y$};
    \end{scope}
    \begin{scope}[thick,decoration={
        markings,
        mark=at position 0.35 with {\arrow[Cyan]{<}}}]
    \draw[line width=1.5pt, postaction={decorate}] (0,0) circle [radius=3cm];
    \end{scope}
    \begin{scope}[thick,decoration={
        markings,
        mark=at position 0.65 with {\arrow[Cyan]{>}}}]
    \draw [red, line width=1.3pt, postaction={decorate}]
    (.1,.4) .. controls (1.2,1.8) and (.4,2.3) .. (-.5,1.9)
    .. controls (-1.2,1.3) and (-1.8,1.5) .. (-2,1.4) 
    to[out=180,in=180] (-2,.2) 
    .. controls (-1.8,.1) and (0,.1) .. (.1,.4) -- cycle;
    \end{scope}
    \end{tikzpicture}
    \end{document}

ここに画像の説明を入力してください

関連情報