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.

3
  • And how should the arrows be? Pointing towards? Please clarify from the beginning. Sep 29, 2015 at 17:54
  • @Gonzalo Medina Will do. For that purpose it would have been nice to have names of the corners ... Sep 29, 2015 at 17:56
  • @Gonzalo Medina Done! Sep 29, 2015 at 18:06

1 Answer 1

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

4
  • 1
    That's nice, Gonzalo! The vertical arrows on the red face should go downwards. Perhaps i will see how to mend that myself. Sep 29, 2015 at 18:31
  • I like your colors betters. Sep 29, 2015 at 18:33
  • 2
    @FrodeBjørdal Thanks. I updated the answer changing the arrow direction. Sep 29, 2015 at 18:35
  • I was also able to change the directions myself. Now I would like to assign names as $O\lnot Bq$ to the vertices. Should I open a new question or is it trivial? Sep 29, 2015 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .