![如何在立方体中画立方体?](https://linux22.com/image/331820/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%AB%8B%E6%96%B9%E4%BD%93%E4%B8%AD%E7%94%BB%E7%AB%8B%E6%96%B9%E4%BD%93%EF%BC%9F.png)
答案1
这是一个使用的解决方案蒂克兹。tikz 使用的“视角”与问题中的略有不同。
以下是代码:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[inside/.style={fill=cyan!80,draw opacity=0.5,thick},
outside/.style={thick},
every node/.style={font=\tiny}]
\draw[inside](-1,-1,-1)--(-1,1,-1)--(-1,1,1)--(-1,-1,1)--(-1,-1,-1);
\draw[inside](-1,-1,-1)--(1,-1,-1)--(1,-1,1)--(-1,-1,1)--(-1,-1,-1);
\draw[inside](-1,-1,-1)--(1,-1,-1)--(1,1,-1)--(-1,1,-1)--(-1,-1,-1);
\draw[inside](1,1,1)--(1,-1,1)--(1,-1,-1)--(1,1,-1)--(1,1,1);
\draw[inside](1,1,1)--(-1,1,1)--(-1,1,-1)--(1,1,-1)--(1,1,1);
\draw[inside](1,1,1)--(-1,1,1)--(-1,-1,1)--(1,-1,1)--(1,1,1);
%% inside frame - this shouldn't be necessary...
\draw[gray](-1,-1,-1)--(-1,1,-1)--(-1,1,1)--(-1,-1,1)--(-1,-1,-1);
\draw[gray](-1,-1,-1)--(1,-1,-1)--(1,-1,1)--(-1,-1,1)--(-1,-1,-1);
\draw[gray](-1,-1,-1)--(1,-1,-1)--(1,1,-1)--(-1,1,-1)--(-1,-1,-1);
%%
\draw[outside](-2,-2,-2)--(-2,2,-2)--(-2,2,2)--(-2,-2,2)--(-2,-2,-2);
\draw[outside](-2,-2,-2)--(2,-2,-2)--(2,-2,2)--(-2,-2,2)--(-2,-2,-2);
\draw[outside](-2,-2,-2)--(2,-2,-2)--(2,2,-2)--(-2,2,-2)--(-2,-2,-2);
\draw[outside](2,2,2)--(2,-2,2)--(2,-2,-2)--(2,2,-2)--(2,2,2);
\draw[outside](2,2,2)--(-2,2,2)--(-2,2,-2)--(2,2,-2)--(2,2,2);
\draw[outside](2,2,2)--(-2,2,2)--(-2,-2,2)--(2,-2,2)--(2,2,2);
\foreach \x in {-1,0,1} {
\draw(\x,-2,2)node[below]{$\x$}--++(0,0,-0.2);
\draw(-2,\x,2)node[left]{$\x$}--++(0.2,0,0);
\draw(2,-2,\x)node[right]{$\x$}--++(-0.2,0,0);
}
\end{tikzpicture}
\end{document}