Pergunta sobre o cubo no diagrama

Pergunta sobre o cubo no diagrama

Como esses diagramas podem ser desenhados? Além disso, como as cores podem ser adicionadas a esses diagramas?cubo no diagrama

Responder1

Você pode utilizartikz-3dplotpacote para desenhar cubos facilmente. Na imagem abaixo, estou desenhando uma solução incompleta, porém você pode facilmente completar o resto.

insira a descrição da imagem aqui

\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}

informação relacionada