表面横截面

表面横截面

我必须制作这张图表

在此处输入图片描述 我只成功制作了一个部分,其余部分绘制起来非常复杂。顶部的图表应该是一个表面,我拿的是一块小的弧形板。有什么想法或帮助吗?我希望箭头是蓝色的,而不是图形上显示的黑色。我试过了,fill=blue但没有成功。

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, calc, arrows, decorations.markings, decorations.pathreplacing}

\tikzset{
on each segment/.style={
    decorate,
    decoration={
      show path construction,
      moveto code={},
      lineto code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
      curveto code={
        \path [#1] (\tikzinputsegmentfirst)
        .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
        ..
        (\tikzinputsegmentlast);
      },
      closepath code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
    },
  },
  % style to add an arrow in the middle of a path
  mid arrow/.style={postaction={decorate,decoration={
        markings,
        mark=at position .3 with {\arrow[#1]{stealth}},
        mark=at position .7 with {\arrow[#1]{stealth}}
      }}},
}

\begin{document}
\begin{tikzpicture}
    \clip (-1.7,-1.2) rectangle (1.7,1.2);
    \draw (-1.5,-1) rectangle (1.5,1);
    \draw (-2,0) -- (2,0);
    \draw[red] (0,-2) -- (0,2);
    \foreach \a in {-4,-3,...,3}
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-2,1/8+\a/4) -- (2,1/8+\a/4);
    \draw[fill, red] (0,1) circle (0.3mm);
    \draw[fill, red] (0,-1) circle (0.3mm);
\end{tikzpicture}
\end{document}

输出: 在此处输入图片描述

答案1

我会把我的尝试在这里作为答案,我知道我还有很多东西需要学习,但在这里我把它留起来以防有人想看看它是如何完成的或者想修改它:

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, calc, arrows, decorations.markings, decorations.pathreplacing}

\tikzset{
on each segment/.style={
    decorate,
    decoration={
      show path construction,
      moveto code={},
      lineto code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
      curveto code={
        \path [#1] (\tikzinputsegmentfirst)
        .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
        ..
        (\tikzinputsegmentlast);
      },
      closepath code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
    },
  },
  % style to add an arrow in the middle of a path
  mid arrow/.style={postaction={decorate,decoration={
        markings,
        mark=at position .35 with {\arrow[#1]{stealth}},
        mark=at position .7 with {\arrow[#1]{stealth}}
      }}},
}

\begin{document}
\begin{tikzpicture}

    \foreach \s in {1/2} %scale
    {
    \foreach \c in {0} %Vertical displacement
    \foreach \d in {4*\s} %Horizontal displacement
    {
%Give color
    \fill[gray!50!white,opacity=0.2] (-3*\s+\c,2*\s+\d).. controls (-3*\s+\c,2*\s+\d) and (-3*\s+\c,4*\s+\d)..(-2*\s+\c,4.2*\s+\d)..controls (1*\s+\c,4*\s+\d) and (2*\s+\c,3.1*\s+\d)..(2*\s+\c,3.1*\s+\d).. controls (1*\s+\c,2*\s+\d) and (1*\s+\c,1*\s+\d)..(1*\s+\c,1*\s+\d).. controls (0+\c,2*\s+\d) and (-2*\s+\c,2*\s+\d)..(-3*\s+\c,2*\s+\d);
%contour
    \draw (-3*\s+\c,2*\s+\d).. controls (-3*\s+\c,2*\s+\d) and (-3*\s+\c,4*\s+\d)..(-2*\s+\c,4.2*\s+\d)..controls (1*\s+\c,4*\s+\d) and (2*\s+\c,3.1*\s+\d)..(2*\s+\c,3.1*\s+\d).. controls (1*\s+\c,2*\s+\d) and (1*\s+\c,1*\s+\d)..(1*\s+\c,1*\s+\d).. controls (0+\c,2*\s+\d) and (-2*\s+\c,2*\s+\d)..(-3*\s+\c,2*\s+\d);
%Surface drawing
    \draw (-4*\s+\c,-1*\s+\d)..controls (-6.5*\s+\c,-1.5*\s+\d) and (-6.5*\s+\c,2.5*\s+\d)..(-4*\s+\c,4*\s+\d)..controls (-1.1*\s+\c,5.9*\s+\d) and (2.5*\s+\c,4.8*\s+\d)..(5*\s+\c,2*\s+\d)..controls (6.5*\s+\c, 0.1*\s+\d) and (4*\s+\c,-4.5*\s+\d)..(2*\s+\c,-3*\s+\d)..controls (1.1*\s+\c,-2.5*\s+\d) and (-0.5*\s+\c,-0.5*\s+\d)..(-4*\s+\c,-1*\s+\d);
%Flow drawing
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-3.5*\s+\c, 2.2*\s+\d)..controls (-1.8*\s+\c,2.8*\s+\d) and (0.5*\s+\c,2.1*\s+\d)..(1.8*\s+\c,1.1*\s+\d);
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-3.4*\s+\c, 2.8*\s+\d)..controls (-1.5*\s+\c,3.1*\s+\d) and (0.4*\s+\c,2.7*\s+\d)..(1.9*\s+\c,1.7*\s+\d);
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-3.2*\s+\c, 3.4*\s+\d)..controls (-1.6*\s+\c,3.7*\s+\d) and (0.8*\s+\c,3.1*\s+\d)..(2.1*\s+\c,2.1*\s+\d);
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-2.9*\s+\c, 3.9*\s+\d)..controls (-0.9*\s+\c,4*\s+\d) and (0.8*\s+\c,3.7*\s+\d)..(2.2*\s+\c,2.6*\s+\d);
    \draw (-5.6*\s+\c,1.2*\s+\d)..controls (-5.7*\s+\c,-0.1*\s+\d) and (-5.4*\s+\c,-0.5*\s+\d)..(-4.7*\s+\c,-0.8*\s+\d);
    \draw (4.2*\s+\c,2.5*\s+\d)..controls (5*\s+\c,1.9*\s+\d) and (5.2*\s+\c,1.2*\s+\d)..(5.2*\s+\c,0.8*\s+\d);
    \draw[thick, red] (-1.3*\s+\c,1.1*\s+\d)..controls (-0.9*\s+\c,1.9*\s+\d) and (-0.9*\s+\c,3.9*\s+\d)..(0.4*\s+\c,4.2*\s+\d);
    }




    \foreach \x in {6*\s}
    \foreach \y in {-4*\s}
    {
    \fill[gray!50!white,opacity=0.2] (-3*\s+\x,-2*\s+\y) rectangle (3*\s+\x,2*\s+\y);
    \draw (-3*\s+\x,-2*\s+\y) rectangle (3*\s+\x,2*\s+\y);
    \draw (-4*\s+\x,\y) -- (4*\s+\x,\y);
    \draw[thick, red] (0+\x,-3*\s+\y) -- (0+\x,3*\s+\y);
    \foreach \a in {-2,-1,...,1}
    \draw[postaction={on each segment={mid arrow=black}}, blue] (-4*\s+\x,1/2*\s+\a/2+\y) -- (4*\s+\x,1/2*\s+\a/2+\y);
    \draw[fill, red] (0+\x,2*\s+\y) circle (0.4mm);
    \draw[fill, red] (0+\x,-2*\s+\y) circle (0.4mm);
    \node at (-3.6*\s+\x,-1/8+\y) {$-\varepsilon$};
    \node at (3.4*\s+\x,-1/8+\y) {$\varepsilon$};
    \node[above right] at (0*\s+\x,2*\s+\y) {$+1$};
    \node[below right] at (0*\s+\x,-2*\s+\y) {$-1$};
    }
    
    
    \foreach \a in {-6*\s}
    \foreach \b in {-4*\s}
    {
    \draw (-4*\s+\a,0+\b) -- (4*\s+\a,0+\b);
    \draw (0+\a,-4*\s+\b) -- (0+\a,4*\s+\b);
    \fill[gray!50!white,opacity=0.2] (-3*\s+\a,2*\s+\b)..controls (-1*\s+\a,3*\s+\b) and (0+\a,1*\s+\b)..(2*\s+\a,2*\s+\b)..controls (2*\s\a,2*\s\b) and (1*\s+\a,0+\b)..(3*\s+\a,-2*\s+\b)..controls (1*\s+\a,-2*\s+\b) and (-1*\s+\a,-1*\s+\b)..(-2*\s+\a,-3*\s+\b)..controls (-3*\s+\a,-2*\s+\b) and (-4*\s+\a,0+\b)..(-3*\s+\a,2*\s+\b); 
    \draw (-3*\s+\a,2*\s+\b)..controls (-1*\s+\a,3*\s+\b) and (0+\a,1*\s+\b)..(2*\s+\a,2*\s+\b)..controls (2*\s\a,2*\s\b) and (1*\s+\a,0+\b)..(3*\s+\a,-2*\s+\b)..controls (1*\s+\a,-2*\s+\b) and (-1*\s+\a,-1*\s+\b)..(-2*\s+\a,-3*\s+\b)..controls (-3*\s+\a,-2*\s+\b) and (-4*\s+\a,0+\b)..(-3*\s+\a,2*\s+\b);
    \draw[blue, postaction={on each segment={mid arrow=black}}] (-4*\s+\a,1*\s+\b)..controls (-3*\s+\a,2*\s+\b) and (0+\a,0+\b)..(3*\s+\a,2*\s+\b);
    \draw[blue, postaction={on each segment={mid arrow=black}}] (-4*\s+\a,0+\b)..controls (-2*\s+\a,1*\s+\b) and (0+\a,-1*\s+\b)..(3*\s+\a,1*\s+\b);
    \draw[blue, postaction={on each segment={mid arrow=black}}] (-4*\s+\a,-1*\s+\b)..controls (-3*\s+\a,0*\s+\b) and (1*\s+\a,-2*\s+\b)..(3*\s+\a,0+\b);
    \draw[blue, postaction={on each segment={mid arrow=black}}] (-4*\s+\a,-2*\s+\b)..controls (-2*\s+\a,-1*\s+\b) and (2*\s+\a,-2*\s+\b)..(3*\s+\a,-1*\s+\b);
    
    \draw[thick, red] (-2*\s+\a,3*\s+\b)..controls (0+\a,2*\s+\b) and (-2*\s+\a,-1*\s+\b)..(2*\s+\a,-3*\s+\b);
    
    \node at (-4*\s+\a,2.5*\s+\b) {$\mathbf{x}_\alpha(U_\alpha)$};
    }
    
    \draw[-stealth] (-1*\s, -2) to ++(2*\s,0);
    \node at (0,-1.75) {$h$};
    
    \draw[-stealth] (-2.4*\s,5.6*\s) to[bend right] ++(-2*\s,-7*\s);
        \node at (-2.6,0.9) {$\mathbf{x}_\alpha$};
        
    \draw[-stealth] (4.6*\s, -1.7*\s) to[bend right] ++(-3.2*\s,6.4*\s);
    \node at (2.5,0.2) {$\delta$};
    \node at (2,4) {$M$};
    \node at (0.4,4.12) {\textcolor{red}{$\Sigma$}};
    }
    
\end{tikzpicture}
\end{document}

输出: 在此处输入图片描述

相关内容