答案1
欢迎!这会产生类似的东西。代码使用正交投影,但您可以安装透视图,这将在章节中描述64 三点透视绘图库pgfmanual v3.1.5。
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{perspective}
\begin{document}
\begin{tikzpicture}[3d view={140}{10},>=stealth,
line join=round,semithick,dot/.style={circle,fill,inner sep=1pt},
declare function={xmax=5;ymax=4;zmax=3;a=2;b=2;}]
\draw[->] (tpp cs:x=0,y=0,z=0) coordinate (O)
-- (tpp cs:x=xmax,y=0,z=0) coordinate[label=left:$x$] (X);
\draw[->] (O) -- (tpp cs:x=0,y=ymax,z=0) coordinate[label=above:$y$] (Y);
\draw[->] (O) -- (tpp cs:x=0,y=0,z=zmax) coordinate[label=above right:$z$] (Z);
\path (tpp cs:x=b,y=b,z=b-a/2) coordinate[dot,label=below:$E$](E)
(tpp cs:x=b+a,y=b-a/2,z=b) coordinate[dot,label=left:$A$](A)
(tpp cs:x=b+a,y=b-a/2,z=b+a) coordinate[dot,label=left:$B$](B)
(tpp cs:x=b+a,y=b+a/2,z=b+a) coordinate[dot,label=right:$C$](C)
(tpp cs:x=b+a,y=b+a/2,z=b) coordinate[dot,label=right:$D$](D);
\draw (A) edge (E) -- (B) edge[dashed] (E)
-- (C) edge (E) -- (D) edge (E) -- (A);
\end{tikzpicture}
\end{document}