Трехмерное представление поля давления

Трехмерное представление поля давления

Я хотел бы сделать 3D версию рисунка ниже.

введите описание изображения здесь

Я могу нарисовать разные векторы, но не могу изобразить цилиндр.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,3D}

\begin{document}
\begin{tikzpicture}[x={(-0.866cm,-0.5cm)}, y={(0.866cm,-0.5cm)}, z={(0,1cm)}]
\draw[-latex] (0,0,0) coordinate(B) -- ++ (3,0,0)node[above]{$x$};
\draw[-latex](B) -- ++ (0,3,0)node[above]{$y$};
\draw[-latex](B) -- ++ (0,0,3)node[right]{$z$};

\foreach \zz in {-20,-15,-10,...,20}{

\pgfmathsetmacro{\ZZ}{\zz/10}
\begin{scope}[canvas is xy plane at z=\ZZ]
\foreach \ii in {-85,-75,...,85}{
\draw[-latex] ({cos(\ii)},{sin(\ii)}) --++ (\ii:{1*cos(\ii)});
}
\end{scope}
}

\end{tikzpicture}

\end{document}

Рисунок не очень читаемый, его нужно улучшить!

введите описание изображения здесь

решение1

Я бы использовал tikz-3dplotиreverseclipобманыватьи сделать так, чтобы длина наконечников стрелок зависела от длины линий.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc,arrows.meta}
% based on https://tex.stackexchange.com/a/12033/121799
\tikzset{reverseclip/.style={insert path={(current bounding box.south west)rectangle 
  (current bounding box.north east)} }}
\begin{document}
\tdplotsetmaincoords{60}{135}
\begin{tikzpicture}[tdplot_main_coords]
\draw[-latex] (0,0,0) coordinate(B) -- ++ (3,0,0)node[above]{$x$};
\draw[-latex](B) -- ++ (0,3,0)node[above]{$y$};
\draw[-latex](B) -- ++ (0,0,3)node[right]{$z$};
\draw ({cos(\tdplotmainphi-180)},{sin(\tdplotmainphi-180)},2) --
  plot[variable=\t,domain=\tdplotmainphi-180:\tdplotmainphi,smooth,samples=51]
  ({cos(\t)},{sin(\t)},-2) --
  plot[variable=\t,domain=\tdplotmainphi:\tdplotmainphi+360,smooth,samples=101]
  ({cos(\t)},{sin(\t)},2);
  \pgfmathtruncatemacro{\imin}{-\tdplotmainphi+90} % helpers
  \pgfmathtruncatemacro{\iminnext}{-\tdplotmainphi+100}
  \pgfmathtruncatemacro{\imax}{-\tdplotmainphi+85}
\foreach \zz in {-20,-15,-10,...,20}{
\pgfmathsetmacro{\ZZ}{\zz/10} 
 \begin{scope}[canvas is xy plane at z=\ZZ]
   \foreach \ii in {\imin,\iminnext,...,85}{
   \draw[-{Latex[length={cos(\ii)*4pt}]}] ({cos(\ii)},{sin(\ii)}) --++ (\ii:{1*cos(\ii)});
   }
 \end{scope}
}
% clip away hidden part
\clip ({cos(\tdplotmainphi-180)},{sin(\tdplotmainphi-180)},2) --
  plot[variable=\t,domain=\tdplotmainphi-180:\tdplotmainphi,smooth,samples=51]
  ({cos(\t)},{sin(\t)},-2) --
  plot[variable=\t,domain=\tdplotmainphi:\tdplotmainphi+180,smooth,samples=101]
  ({cos(\t)},{sin(\t)},2) [reverseclip];
\foreach \zz in {-20,-15,-10,...,20}{
\pgfmathsetmacro{\ZZ}{\zz/10} 
 \begin{scope}[canvas is xy plane at z=\ZZ]
   \foreach \ii in {-85,-75,...,\imax}{
   \draw[-{Latex[length={cos(\ii)*4pt}]}] ({cos(\ii)},{sin(\ii)}) --++ (\ii:{1*cos(\ii)});
   }
 \end{scope}
}
\end{tikzpicture}
\end{document}

введите описание изображения здесь

Связанный контент