使用 tikz 在平面上绘制圆柱体

使用 tikz 在平面上绘制圆柱体

倾斜圆柱体

我想在平面上画一个倾斜的圆柱体\alpha。我可以用 latex 画这个tikz吗?

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{3d,shapes.geometric,positioning,intersections}
\begin{document}
\begin{tikzpicture}[font=\sffamily,scale=1.5,transform shape]
\begin{scope}[canvas is xz plane at y=0,transform shape]
\draw (-2,-3) rectangle (2,3);
\end{scope}
\node [cylinder,rotate=70,aspect=2,draw,
minimum height=3cm, minimum width=2cm+2*\pgflinewidth,
name path=cylinder] (cylinder) at (0.5,1,0) {};
\path[fill=white] (cylinder.195) coordinate[label=below:$A$](A) -- 
++(5:1) -- ++(-130:0.5) -- cycle;
\draw[rotate=-20,densely dashed,name path=hidden arc] ([yshift=\pgflinewidth]cylinder.before bottom) arc (0:180:1cm and 0.25cm);
\path[name path=aux2,overlay] (A) -- ++(0,6,0);
\draw[rotate=-20,densely dashed] ([yshift=\pgflinewidth]cylinder.before bottom) arc (0:-70:1cm and 0.25cm);
\draw[densely dashed] ([yshift=\pgflinewidth]cylinder.before bottom) --
++(70:0.1);
\path[name path=aux2,overlay] (A) -- ++(0,6,0);
\draw[name intersections={of=cylinder and aux2,total=\t}] (A)-- (intersection-3)
coordinate[label={above:$C$}](C);
\path (cylinder.before top) -- (cylinder.after top) coordinate[midway] (O2);
\node[fill,circle,scale=0.3,label={[right,yshift=-4pt]:$O_2$}] at (O2) {};
\path [name path=aux] (A) -- ++ (70:1);
\draw[densely dashed,name intersections={of=hidden arc and aux, by=X}] (A) -- (X) coordinate[label={[above,opacity=1]:$B$}] (B);
\node[below=1pt of cylinder.160] {$C_1$};
\node[above=1pt of cylinder.-20] {$C_2$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容