1

I want to put some arrows along some edges of a cube such as in the answer I accepted for the following question: How may I color four sides of a cube?. How can this best be done?

Here are the arrows I want to have:

On the top edge of the blue face I want arrows from NE to NW.

On the top edge of the red face I want arrows from NE to NW.

On the bottom edge of the blue face I want arrows from NE to NW.

On the bottom edge of the red face I want arrows from NE to NW.

On the NE edge of the blue face I want arrows from top to bottom.

On the NE edge of the red face I want arrows from top to bottom.

On the NW edge of the blue face I want arrows from top to bottom.

On the NW edge of the red face I want arrows from top to bottom.

1 Answers1

3

Here's one option; since all vertices of the cube have names (that I asigned in the now deleted answer to the question linked), uncomment the commented out \foreach loop to see the names; I also changed the perspective and the color schema that I proposed to the other answer, but you can change it back if you want to. Since you have access to the names of the vertices, you can draw the arrows as required:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}

\definecolor{myred}{RGB}{183,18,52}
\definecolor{myyellow}{RGB}{254,213,1}
\definecolor{myblue}{RGB}{0,80,198}
\definecolor{mygreen}{RGB}{0,155,72}

\begin{document}

\begin{tikzpicture}[
  line join=round,
  y={(-0.86cm,0.36cm)},x={(1cm,0.36cm)}, z={(0cm,1cm)},
  arr/.style={-latex,ultra thick,line cap=round,shorten <= 1.5pt}
]
\coordinate (A1) at (0,0,0);
\coordinate (A2) at (0,1,0);
\coordinate (A3) at (1,1,0);
\coordinate (A4) at (1,0,0);
\coordinate (B1) at (0,0,1);
\coordinate (B2) at (0,1,1);
\coordinate (B3) at (1,1,1);
\coordinate (B4) at (1,0,1);

\fill[myyellow] (A2) -- (A3) -- (B3) -- (B2) -- cycle;
\fill[mygreen]  (A2) -- (A3) -- (A4) -- (A1) -- cycle;
\fill[myred](A3) -- (B3) -- (B4) -- (A4) -- cycle;
\fill[myblue]   (A1) -- (A2) -- (B2) -- (B1) -- cycle;

\draw (A2) -- (A1) -- (A4);
\draw (B2) -- (B1) -- (B4) -- (B3) -- cycle;
\draw (A1) -- (B1);
\draw (A2) -- (B2);
\draw (A4) -- (B4);

\draw[thin] (A3) -- (B3);
\draw[thin] (A3) -- (A4);

%If you want to see the names of the vertices
%\foreach \Value in {1,...,4}
%{
%  \node at (A\Value) {A\Value};
%  \node at (B\Value) {B\Value};
%}

\path[arr] 
  (A1) edge (A2)
  (B2) edge (A2)
  (B1) edge (B2)
  (B1) edge (A1)
  (B4) edge (A4)
  (B3) edge (A3)
  (B4) edge (B3)
  (A4) edge (A3);
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128