使用 tikz 或 pgf 绘制旋转体

使用 tikz 或 pgf 绘制旋转体

我一直在 TEX Stackexchange 上寻找创建旋转体的解决方案,但一无所获。我对这个问题的分析是,首先,绘制一个二维图形,其次,绘制旋转体,第三,绘制切片(圆盘)。

例子

你们曾经创造过类似的东西吗?

到目前为止我所知道的基本是这样的:

\begin{figure}[h]
\centering
\begin{minipage}{.5\textwidth}
Analisando a região hachurada vemos que a integração deve ser feita com os limites $x = 1$ e $x = 2$. A equação da curva superior é $y = \left( 2 - \frac{x}{2} \right)$ e a curva inferior pode ser considerada o próprio eixo $x$ (ou seja, $y = 0$). O sólido obtido pela rotação da curva e sua unidade de volume estão representados abaixo.
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\begin{tikzpicture}
\begin{axis}[axis lines=middle,
xlabel=$x$,
ylabel=$y$,
enlargelimits,
ytick={2},
yticklabels={2},
xtick={1,2,4},
xticklabels={1,2,4}]
\addplot[name path=F,black,domain={-.2:4.3}] {2-x/2} node[pos=.8, above]{$f$};
\addplot[name path=G,transparent,domain={1:5}] {0}node[pos=.1, below]{};
\addplot[pattern=north east lines, pattern color=red]fill between[of=F and G, soft clip={domain=1:2}];
\end{axis}
\end{tikzpicture}
\end{minipage}
\end{figure}


\centering
\begin{minipage}{.5\textwidth}
Revolution Solid code
\end{minipage}
\begin{minipage}{.2\textwidth}
\centering
\begin{center}
\begin{tikzpicture}
\node [cylinder, cylinder uses custom fill, cylinder body fill=red, cylinder end fill=red!50, rotate=0, draw,
minimum height=0.01 cm, minimum width=5cm, color=black] (c) {};
%   \draw[red, <->] (c.top)   -- (c.bottom)
%   node [at end, below, black]   {height};
\draw[black, <->] ([xshift=20pt]c.north) -- ([xshift=20pt]c.center)
node [at start, above, black, xshift=35pt, yshift=-40pt] {raio: $\left( 2 - \frac{x}{2} \right)$};
\draw[black, dashed] ([xshift=10pt]c.north) -- ([xshift=20pt]c.north);
\draw[black, dashed] ([xshift=8pt]c.center) -- ([xshift=20pt]c.center);
\end{tikzpicture}
\end{center}
\end{minipage}

工作正在进行中

谢谢。

相关内容