# Truncated octahedron in TikZ

I'm having trouble drawing a truncated octahedron for a Brillouin zone in TikZ. My attempt so far is an adaptation of this answer which produces wonky square bits that are also too small (the sides of the hexagons should be equal in length).

The size of the square parts could be changed by adjusting the nodes but this seems very manual and there must be a better way. Can anyone enlighten me? Perhaps a TikZ-3D plot is more appropriate?

Output:

MWE:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[thick,scale=10]
%
\coordinate (C1) at (0.3,-0.15);
\coordinate (C2) at (0.55,-0.15);
\coordinate (C3) at (0.425,-0.025);
\coordinate (C4) at (0.425,-0.275);
%
\coordinate (D1) at (0.85,-0.05);
\coordinate (D2) at (0.9,0.05);
\coordinate (D3) at (0.875,0.125);
\coordinate (D4) at (0.875,-0.125);
%
\coordinate (E1) at (0.375,0.375);
\coordinate (E2) at (0.625,0.375);
\coordinate (E3) at (0.525,0.425);
\coordinate (E4) at (0.525,0.325);
%
\coordinate (F1) at (0.15,0.015);
\coordinate (F2) at (0.1,-0.015);
\coordinate (F3) at (0.125,0.125);
\coordinate (F4) at (0.125,-0.125);
%
\coordinate (G1) at (0.375,-0.375);
\coordinate (G2) at (0.625,-0.375);
\coordinate (G3) at (0.475,-0.425);
\coordinate (G4) at (0.575,-0.325);

\begin{scope}[thick,dashed]
\draw (C1) -- (C4) -- (C2) -- (C3) -- (C1);
\draw (D1) -- (D4) -- (D2) -- (D3) -- (D1);
\draw (E1) -- (E4) -- (E2) -- (E3) -- (E1);
\draw (F1) -- (F4) -- (F2) -- (F3) -- (F1);
\draw (G1) -- (G4) -- (G2) -- (G3) -- (G1);
\end{scope}
\draw (F3) -- (F2) -- (C1) -- (C3) -- (E4) -- (E1);
\draw (C1) -- (C4) -- (G3) -- (G1) -- (F4) -- (F2);
\draw (D1) -- (C2) -- (C3) -- (E4) -- (E2) -- (D3) -- (D1);
\draw (D1) -- (C2) -- (C4) -- (G3) -- (G2) --(D4) -- (D1);
\draw (E2) -- (E3) -- (E1) -- (F3) -- (F2) -- (F4) -- (G1) -- (G3) --  (G2) -- (D4) -- (D1) -- (D3) --cycle;
\end{tikzpicture}

\end{document}


Desired output:

Please note I haven't added the labels to my attempt as undoubtably they would change after getting the shape right.

• This would probably be easier in 3D, but you will still need to do some trig to orient the faces perpendicular to the radius. – John Kormylo Apr 9 '15 at 13:26
• I suggest that you read the pst-solides3d package. This uses pstricks. It has the octahedron easy to plot and there is the ability to remove slices from the octahedron to get a truncated octahedron. texdoc.net/texmf-dist/doc/generic/pst-solides3d/… – R. Schumacher Apr 9 '15 at 14:58
• @R.Schumacher Is that package compatible with pdfLaTeX? The manual says pdfTeX won't work so that should mean pdfLaTeX won't work either as it's non dvips? – Christopher Apr 9 '15 at 15:12
• @Christopher Not directly, however this discussing some ways to get pdf output with pstricks. tex.stackexchange.com/questions/8413/… I suggested this because ease of getting your figure. Personally, I would use pstricks with standalone, then use the aforementioned conversion utilities to get a pdf which I would put in my original document using includegraphics – R. Schumacher Apr 9 '15 at 16:59

This ought to get you started constructing the shape in 3d.

I started by drawing all the squares, then joining neighboring corners one at a time.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[blue] (1.414,.707,0) -- (1.414,0,.707) -- (1.414,-.707,0) -- (1.414,0,-.707) -- cycle;
\draw[blue,dashed] (-1.414,.707,0) -- (-1.414,0,.707) -- (-1.414,-.707,0) -- (-1.414,0,-.707) -- cycle;
\draw[red] (.707,1.414,0) -- (0,1.414,.707) -- (-.707,1.414,0) -- (0,1.414,-.707) -- cycle;
\draw[red,dashed] (.707,-1.414,0) -- (0,-1.414,.707) -- (-.707,-1.414,0) -- (0,-1.414,-.707) -- cycle;
\draw[green] (.707,0,1.414) -- (0,.707,1.414) -- (-.707,0,1.414) -- (0,-.707,1.414) -- cycle;
\draw[green,dashed] (.707,0,-1.414) -- (0,.707,-1.414) -- (-.707,0,-1.414) -- (0,-.707,-1.414) -- cycle;
\draw (1.414,.707,0) -- (.707,1.414,0)
(1.414,0,.707) -- (.707,0,1.414)
(0,1.414,.707) -- (0,.707,1.414)
(1.414,-.707,0) -- (.707,-1.414,0)
(-.707,0,1.414) -- (-1.414,0,.707)
(0,-.707,1.414) -- (0,-1.414,.707)
(-.707,1.414,0) -- (-1.414,.707,0)
(-1.414,-.707,0) -- (-.707,-1.414,0);
\end{tikzpicture}
\end{document}


• I understand the trigonometry but I'm at a loss when it comes telling TikZ-3D this information. There's a TikZ-3D as an alternative answer to the one linked in the question but how do you put in the additional points? – Christopher Apr 9 '15 at 14:40
• You don't really need tikz-3d unless you intend to rotate the image. Just use (x,y,z) when entering the points. – John Kormylo Apr 9 '15 at 14:42
• Some form of paremetrization probably? – azetina Apr 9 '15 at 14:53