Tikzを使用して環状のグリッドを描く

Tikzを使用して環状のグリッドを描く

私は、書いているレポートでいくつかのグリッド変換を視覚化しようとしています。添付した図の左側のグリッドには満足していますが、今度は右側に示すような環状メッシュを作成する必要があります。同じ数のポイントを持つことが重要です。左側は 10 x 10 なので、右側には円周に沿って 10 個のポイントと壁の法線方向に 10 個のポイントが必要です。 ここに画像の説明を入力してください

左側を生成するために使用したコードは次のとおりです。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}

\begin{document}
\begin{figure}[h!]
    \centering
    \begin{tikzpicture}
        \coordinate (A) at (0,0);
        \coordinate (B) at (3,0);
        \coordinate (C) at (3,3);
        \coordinate (D) at (0,3);

        \foreach [evaluate=\i as \x using \i/10] \i in {0,...,10} 
        {
            \draw ($(A)!\x!(B)$) arc -- ($(D)!\x!(C)$);
            \draw ($(A)!\x!(D)$) -- ($(B)!\x!(C)$);
        }   
        \draw[->, >= Latex] (-0.1, -0.1) -- (1, -0.1);
        \draw[->, >= Latex] (-0.1, -0.1) -- (-0.1, 1);
        \draw[->, >= Latex] (-0.1, -0.1) -- (0.5, 0.5);
        \node[] at (1, -0.35) (y) {$\zeta$};
        \node[] at (-0.35, 1) (x) {$\eta$};
        \node[] at (-0.35, -0.10) (x) {$\xi$};
        \draw[->, >= Latex] (3.5, 1.5) -- (4.5, 1.5);
    \end{tikzpicture}
    \caption{Visualisation of a mapping from a computational grid to a physical space using 2D section.}
\end{figure}
\end{document}

何かアドバイスはありますか?

ありがとう!

答え1

アップデート:質問をもう一度読んでみると、トーラスではなく環状部が必要なことがわかりました。scope元のコードでここを置き換えます。

\begin{scope}[shift={(7,1.5)}]
    \foreach \t in {0,...,10}{
        \draw (0,0) circle[radius=1+.1*\t];
        \draw (36*\t:1)--(36*\t:2);
    }
\end{scope}

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

他の 5 つは裏側にあるため、縦方向の 5 つの領域のみを表示する必要があると想定しています。

元の解決策:

いくつかの提案:

  • grid長方形グリッドのコードを簡略化するために使用します。
  • 配置を簡素化するために、コマンドにノードを含めることができます\draw
  • A をscope使用すると、トーラスの極座標を使用できるため、計算が簡単になります。

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

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{figure}[h!]
    \centering
        \begin{tikzpicture}
        \draw[step=3mm] (0,0)grid(3,3);
        \draw[-Latex] (-0.1, -0.1) -- (1, -0.1) node[below]{$\zeta$};
        \draw[-Latex] (-0.1, -0.1) -- (-0.1, 1) node[left]{$\eta$};
        \draw[-Latex] (-0.1, -0.1) node[left]{$\xi$} -- (0.5, 0.5);
        
        \draw[-Latex] (3.5, 1.5) -- (4.5, 1.5);
        \begin{scope}[shift={(7,1.5)}]
            \foreach \t in {0,36,...,360}{
                \draw (0,0) circle[radius=1.5+.5*cos(\t)];
                \draw (\t:1)--(\t:2);
            }
        \end{scope} 
    \end{tikzpicture}
    \caption{Visualisation of a mapping from a computational grid to a physical space using 2D section.}
\end{figure}

\end{document}

関連情報