答案1
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d,angles,quotes}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,thick]
\draw[-stealth] (0,0,0) -- (6,0,0) node[below]{$x$};
\draw[-stealth] (0,0,0) -- (0,-6,0) node[below right]{$y$};
\draw[-stealth] (0,0,0) -- (0,0,4) node[left]{$z$};
\begin{scope}[canvas is xy plane at z=0]
\draw[rounded corners] (0,0) rectangle (2,-4);
\draw[rounded corners] (0.2,-0.2) rectangle (1.8,-3.8);
\node[fill,circle,inner sep=2pt,transform shape] (blob) at (1,-2){};
\end{scope}
\draw[dashed] (blob.center) -- (5,-2,0) coordinate(B) -- (5,-2,4) node[circle,draw,inner
sep=1.5pt,solid,label=right:$A$](A){};
\draw[-stealth] (blob.center) -- (A);
\begin{scope}[canvas is xz plane at y=-2,transform shape]
\pic[draw,angle radius=2cm,"$\alpha$",angle eccentricity=1.3] {angle=B--blob--A};
\end{scope}
\draw[semithick] (0,-4,0) -- (0,-4,1.5) (2,0,0) -- (2,0,1.5);
\begin{scope}[canvas is yz plane at x=0,transform shape]
\path (-4,1.2) -- (0,1.2) node[midway,above,transform shape=false]{$b$};
\pgflowlevelsynccm
\draw[stealth-stealth] (-4,1.2) -- (0,1.2);
\end{scope}
\begin{scope}[canvas is xz plane at y=0,transform shape]
\path (2,1.2) -- (0,1.2) node[midway,above,transform shape=false]{$a$};
\pgflowlevelsynccm
\draw[stealth-stealth] (2,1.2) -- (0,1.2);
\end{scope}
\end{tikzpicture}
\end{document}
至于 3D 效果,我失败了。这是我在合理时间内能想出的最好的效果。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d,angles,quotes,calc}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,thick]
\draw[-stealth] (0,0,0) -- (6,0,0) node[below]{$x$};
\draw[-stealth] (0,0,0) -- (0,-6,0) node[below right]{$y$};
\draw[-stealth] (0,0,0) -- (0,0,4) node[left]{$z$};
\begin{scope}[canvas is xy plane at z=0,transform shape]
\draw[rounded corners] (0,0) rectangle (2,-4);
\draw[rounded corners] (0.2,-0.2) rectangle (1.8,-3.8);
\node[fill,circle,inner sep=2pt,transform shape] (blob) at (1,-2){};
\begin{scope}
\clip[rounded corners] (0,0) rectangle (2,-4)
(1.8,-3.8) -| (0.2,-0.2) -- (1.8,-0.2) -- cycle;
\shade[top color=black!80,bottom color=black!70,middle color=gray!50,
shading angle=-35] (0.3,0.2) rectangle (1.7,-0.3);
\shade[top color=black!80,bottom color=black!70,middle color=gray!50,
shading angle=-35] (0.3,-4.1) rectangle (1.7,-3.6);
\shade[top color=black!80,bottom color=black!70,middle color=gray!50,
shading angle=52] (-0.2,-0.3) rectangle (0.3,-3.7);
\shade[top color=black!80,bottom color=black!70,middle color=gray!50,
shading angle=52] (1.6,-0.3) rectangle (2.1,-3.7);
\begin{scope}
\clip (0,0) rectangle (0.3,-0.3);
\shade[ball color=gray!70] (0.3,-0.3) circle[radius=0.3];
\end{scope}
\begin{scope}
\clip (2,0) rectangle (1.7,-0.3);
\shade[ball color=white] (1.7,-0.3) circle[radius=0.3];
\end{scope}
\begin{scope}
\clip (0,-4) rectangle (0.3,-3.7);
\shade[ball color=gray!30] (0.3,-3.7) circle[radius=0.3];
\end{scope}
\begin{scope}
\clip (1.7,-4) rectangle (2,-3.7);
\shade[ball color=white] (1.7,-3.7) circle[radius=0.3];
\end{scope}
\end{scope}
\end{scope}
\begin{scope}[tdplot_screen_coords]
\end{scope}
\draw[dashed] (blob.center) -- (5,-2,0) coordinate(B) -- (5,-2,4) node[circle,draw,inner
sep=1.5pt,solid,label=right:$A$](A){};
\draw[-stealth] (blob.center) -- (A);
\begin{scope}[canvas is xz plane at y=-2,transform shape]
\pic[draw,angle radius=2cm,"$\alpha$",angle eccentricity=1.3] {angle=B--blob--A};
\end{scope}
\draw[semithick] (0,-4,0) -- (0,-4,1.5) (2,0,0) -- (2,0,1.5);
\begin{scope}[canvas is yz plane at x=0,transform shape]
\path (-4,1.2) -- (0,1.2) node[midway,above,transform shape=false]{$b$};
\pgflowlevelsynccm
\draw[stealth-stealth] (-4,1.2) -- (0,1.2);
\end{scope}
\begin{scope}[canvas is xz plane at y=0,transform shape]
\path (2,1.2) -- (0,1.2) node[midway,above,transform shape=false]{$a$};
\pgflowlevelsynccm
\draw[stealth-stealth] (2,1.2) -- (0,1.2);
\end{scope}
\end{tikzpicture}
\end{document}