绘制 3D 车轮

绘制 3D 车轮

我正在尝试创建一个旋转轮的物理图示(参见这里)。我可以画出如下所示的车轮“平面”草图。有什么好技巧可以让它看起来更立体/更逼真吗?

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}

\tdplotsetmaincoords{100}{210}
\begin{tikzpicture}[tdplot_main_coords]

\def\ax{3}
\def\r{2}
\def\thick{0.15}
\coordinate (O) at (0,0,0);
\begin{scope}[rotate around y=90]
    \draw[fill=lightgray] (O) circle (\r);
    \draw[fill=white] (O) circle (\r-\thick);
    \def\gap{0.05}
    \foreach\a in {0, 30, ..., 150}
    {
    \draw[rotate around z=\a] (-\r+\thick,-\gap,0) --  (\r-\thick,-\gap,0);
    \draw[rotate around z=\a] (-\r+\thick,\gap,0) --  (\r-\thick,\gap,0);
    }
    \draw[fill] (O) circle (0.04*\r);
\end{scope}

\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\tdplotsetmaincoords{100}{210}
\begin{document}
\begin{tikzpicture}[tdplot_main_coords]
\def\ax{3}
\def\r{2}
\def\thick{0.15}
\coordinate (O) at (0,0,0);
\begin{scope}[rotate around y=90]
    \draw[fill=lightgray] (0,0,\thick/2) circle[radius=\r] (0,0,\thick/2) circle[x radius=\r-\thick, y radius=-\r+\thick];
    \fill[lightgray] (0,0,0) circle[radius=\r] (0,0,0) circle[x radius=\r-\thick, y radius=-\r+\thick];
    \def\gap{0.05}
    \foreach\a in {0, 30, ..., 150}
    {
    \draw[rotate around z=\a] (-\r+\thick,-\gap,0) --  (\r-\thick,-\gap,0);
    \draw[rotate around z=\a] (-\r+\thick,\gap,0) --  (\r-\thick,\gap,0);
    }
    \draw[fill] (O) circle (0.04*\r);
    \draw[fill=gray] (0,0,-\thick/2) circle[radius=\r] (0,0,-\thick/2) circle[x radius=\r-\thick, y radius=-\r+\thick];
\end{scope}
\end{tikzpicture}
\end{document}

自行车车轮示意图

编辑:

不适用于所有角度,因为如果从“后面”看车轮,则需要一些条件。-我还将 theta 从 100 改为 90,以避免补偿这种倾斜:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\newcommand{\myphi}{220}
\tdplotsetmaincoords{90}{\myphi}
\begin{document}
\begin{tikzpicture}[tdplot_main_coords]
\def\ax{3}
\def\r{2}
\def\thick{0.15}
\coordinate (O) at (0,0,0);
\begin{scope}[rotate around y=90]
\def\gap{0.05}
\foreach\a in {0, 30, ..., 150}{
  \draw[rotate around z=\a] (-\r+\thick,-\gap,0) --  (\r-\thick,-\gap,0);
  \draw[rotate around z=\a] (-\r+\thick,\gap,0) --  (\r-\thick,\gap,0);
}
 \draw[fill=lightgray] (-\r,0,\thick/2) arc[radius=\r, start angle=180, end angle=0] -- (\r,0,-\thick/2) arc[radius=\r, start angle=0, end angle=-180] -- cycle (-\r+\thick,0,\thick/2) arc[radius=\r-\thick, start angle=180, end angle=360]  -- (\r-\thick,0,-\thick/2) arc[radius=\r-\thick, start angle=0, end angle=180] -- cycle;
\foreach\a in {0, 30, ..., 150}{
  \draw[rotate around z=\a] (-\r+\thick,-\gap,0) --  (0,-\gap,0);
  \draw[rotate around z=\a] (-\r+\thick,\gap,0) --  (0,\gap,0);
}
\draw[fill] (O) circle (0.04*\r);
\draw[fill=gray, opacity=1] (0,0,-\thick/2) circle[radius=\r] (0,0,-\thick/2) circle[x radius=\r-\thick, y radius=-\r+\thick];
\end{scope}
\end{tikzpicture}
\end{document}

220:

旋转的轮子

195:

旋转的轮子

相关内容