有人可以幫我在 TikZ 設計這個形狀嗎

有人可以幫我在 TikZ 設計這個形狀嗎

在此輸入影像描述

到目前為止我已經完成了一些工作,但我不知道該怎麼做。特別是因為我還不太知道如何做座標系。下圓柱體有一個箭頭指向它,表示其半徑為 5.1 公分(順便說一句)。

\begin{tikzpicture}
\draw [help lines] (0,0) grid (16,10);

  \node [ anchor=south west, minimum width=20,minimum height=10] (Response) at (0,0) {};


\draw [draw=black, very thick] (0,8) rectangle (8,10);
\draw [draw=red, dashed, very thick] (3,8) rectangle (5,5);


\end{tikzpicture}

我真的不懂坐標系。我怎樣才能更好地理解它?

答案1

我真的認為如果你問一些小小的概念性問題會更好,這樣你就可以自己做這些事情。最困難的部分是從螢幕截圖中解讀內容(很可能我讀錯了一些)。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{arrows.meta,quotes,positioning,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[m/.style={draw,minimum size=1.5em,label=right:$m$}]
 \node[minimum width=9em,minimum height=3em,draw] (M) {$M=\SI{4.58}{\kilo\gram}$};
 \draw[|-|] ([yshift=2ex]M.north west) -- node[fill=white]{$2R=\SI{27.5}{\centi\meter}$} 
    ([yshift=2ex]M.north east);
 \node[minimum width=2em,minimum height=3em,
  path picture={
  \draw[decoration={waves,radius=2em,segment length=3pt,pre length=0pt},decorate]
    ([yshift=2em]path picture bounding box.north) -- (path picture bounding box.south);
  \draw ([xshift=\pgflinewidth/2]path picture bounding box.north west)
   -- ([xshift=\pgflinewidth/2,yshift=3pt]path picture bounding box.south west)
   ([xshift=-\pgflinewidth/2]path picture bounding box.north east) --
   ([xshift=-\pgflinewidth/2,yshift=3pt]path picture bounding box.south east);
    },below,label={[right]30:{$2r=\SI{5.1}{\centi\meter}$}}] (S) at (M.south){};
 \draw ([xshift=0.5ex]S.south) |- ++ (-4em,-1ex) |- ++ (1ex,-1ex) -- ++ (0,1ex)
 ([xshift=-0.5ex]S.south) |- ++ (4em,-1ex) |- ++ (-1ex,-1ex) -- ++ (0,1ex);
 \node[circle,draw,minimum size=1.5em,right=8em of S.south east] (C){};
 \node[m,below=5em of C.east] (m1){};
 \node[m,below=5em of m1] (m2){};
 \draw[semithick] (m1) -- (C.east) arc[start angle=0,end
    angle=90,radius=0.75em+0.5\pgflinewidth] --([yshift=0.5\pgflinewidth]C.north-|S.east);
 \path[semithick,-Triangle,pos=0.9]
  ([yshift=0.5\pgflinewidth]C.north) edge ++ (-1,0)
  (m1.center) edge["$T$"'] ++ (0,1)
  (m1.center) edge["$m\,g$"] ++ (0,-1)
  (m2.center) edge ++ (0,1)
  (m2.center) edge ++ (0,-1);
 \draw[|-|] ([xshift=-3em]m1.west) -- node[fill=white]
 {$h=\SI{0.94}{\centi\meter}$} ([xshift=-3em]m2.west);
\end{tikzpicture}
\end{document}

在此輸入影像描述

對於未來,我建議您執行視覺搜尋從類似的圖表開始,有很多。如果您對程式碼的某些部分有問題,這將定義一個明確的問題,只要您努力發布完整的範例(而不是片段)並清楚地指出哪個部分導致問題,該問題就會更好地被接受。

相關內容