關於圖中立方體的問題

關於圖中立方體的問題

這些圖如何畫出來呢?此外,如何為這些圖表添加顏色?圖中的立方體

答案1

您可以利用tikz-3dplot輕鬆繪製立方體的軟體包。在下圖中,我繪製了一個不完整的解決方案,但您可以輕鬆完成其餘部分。

在此輸入影像描述

\documentclass[border={10}]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc}

\begin{document}

\tdplotsetmaincoords{80}{125} % perspective angles

\begin{tikzpicture}[tdplot_main_coords]

\coordinate (O) at (0,0,0);


\draw[dashed] (O) -- (4,0,0);
\draw[dashed] (O) -- (0,8,0);
\draw[dashed] (O) -- (0,0,4);

%draw the top and bottom of the cube
\draw[fill=blue!5]      (O) -- (0,2,0) -- (2,2,0) -- (2,0,0) -- cycle;
\draw[fill=red!5 ]      (O) -- (0,2,0) -- (0,2,2) -- (0,0,2) -- cycle;
\draw[fill=red!5 ]      (O) -- (0,0,2) -- (2,0,2) -- (2,0,0) -- cycle;

\draw[fill=red!5 ]  (0,0,2) -- (0,2,2) -- (2,2,2) -- (2,0,2) -- cycle;
\draw[fill=red!5 ]  (2,2,2) -- (2,2,0) -- (2,0,0) -- (2,0,2) -- cycle;
\draw[fill=red!5 ]  (0,2,2) -- (2,2,2) -- (2,2,0) -- (0,2,0) -- cycle;

\node (A) at (2,1,1) {\Huge A};

\draw[very thick, ->] (1,2,1) -- node[midway,above] {$P_{1}$} ( 1,3.3,1);

\draw[fill=blue!5]    (0,4,0) -- (0,4,2) -- (2,4,2) -- (2,4,0) -- cycle;
\draw[fill=blue!5]    (2,4,0) -- (2,4,2) -- (2,6,2) -- (2,6,0) -- cycle;
\draw[fill=blue!5]    (2,6,2) -- (2,6,0) -- (0,6,0) -- (0,6,2) -- cycle;

\node (A) at (2,5,1) {\Huge B};

\end{tikzpicture}

\end{document}

相關內容