I think the code is fine if one does not want to change the view. If you want to change the view, then it is much more efforts. Here is a start. (No, one cannot add this to `3dtools` because, to the best of my knowledge, it is not generalizable.)
```
\documentclass[tikz,border=2mm]{standalone}
\pagecolor{yellow!30}
\usetikzlibrary{3dtools}
\pgfmathdeclarefunction{symbolicscreendepth}{1}{\begingroup
\pgfmathsetmacro{\myP}{TD("#1")}%
\pgfmathparse{screendepth(\myP)}%
\pgfmathsmuggle\pgfmathresult\endgroup}
\newcounter{ipath}
\tikzset{3d/create and measure paths/.code={
\tikzset{3d/create and measure single path={#1_1}{#1_5}{#1_3}}
\tikzset{3d/create and measure single path={#1_2}{#1_6}{#1_3}}
\tikzset{3d/create and measure single path={#1_1}{#1_7}{#1_4}}
\tikzset{3d/create and measure single path={#1_2}{#1_8}{#1_4}}
},3d/create and measure single path/.code n args={3}{
\stepcounter{ipath}
\path[save named path=\number\value{ipath}]
(O) -- (#1) -- (#2) -- (#3) -- cycle;
\pgfmathsetmacro{\mysd}{max(symbolicscreendepth("(#1')"),
symbolicscreendepth("(#2')"),symbolicscreendepth("(#3')"))}
\ifnum\value{ipath}=1
\edef\lstsd{\mysd}
\else
\edef\lstsd{\lstsd,\mysd}
\fi
}
}
\begin{document}
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},
same bounding box=A,
line cap=round,line join=round,declare function={a=2;},
c/.style={circle,fill,inner sep=1pt}]
\path (0,0,0) coordinate (O)
(-a,0,0) coordinate (A_1) (a,0,0) coordinate (A_2)
(0,2*a,0) coordinate (A_3) (0,-2*a,0) coordinate (A_4)
(-a,2*a,0) coordinate (A_5) (a,2*a,0) coordinate (A_6)
(-a,-2*a,0) coordinate (A_7) (a,-2*a,0) coordinate (A_8)
(0,-a,0) coordinate (B_1) (0,a,0) coordinate (B_2)
(0,0,2*a) coordinate (B_3) (0,0,-2*a) coordinate (B_4)
(0,-a,2*a) coordinate (B_5) (0,a,2*a) coordinate (B_6)
(0,-a,-2*a) coordinate (B_7) (0,a,-2*a) coordinate (B_8)
(0,0,-a) coordinate (C_1) (0,0,a) coordinate (C_2)
(2*a,0,0) coordinate (C_3) (-2*a,0,0) coordinate (C_4)
(2*a,0,-a) coordinate (C_5) (2*a,0,a) coordinate (C_6)
(-2*a,0,-a) coordinate (C_7) (-2*a,0,a) coordinate (C_8)
(-a,0,0) coordinate (A_1') (a,0,0) coordinate (A_2')
(0,a,0) coordinate (A_3') (0,-a,0) coordinate (A_4')
(-a,a,0) coordinate (A_5') (a,a,0) coordinate (A_6')
(-a,-a,0) coordinate (A_7') (a,-a,0) coordinate (A_8')
(0,-a,0) coordinate (B_1') (0,a,0) coordinate (B_2')
(0,0,a) coordinate (B_3') (0,0,-a) coordinate (B_4')
(0,-a,a) coordinate (B_5') (0,a,a) coordinate (B_6')
(0,-a,-a) coordinate (B_7') (0,a,-a) coordinate (B_8')
(0,0,-a) coordinate (C_1') (0,0,a) coordinate (C_2')
(a,0,0) coordinate (C_3') (-a,0,0) coordinate (C_4')
(a,0,-a) coordinate (C_5') (a,0,a) coordinate (C_6')
(-a,0,-a) coordinate (C_7') (-a,0,a) coordinate (C_8');
\setcounter{ipath}{0}
\tikzset{3d/create and measure paths/.list={A,B,C}}
\pgfkeys{/my lists/.cd,%
my initial array/.is array=\lstsd,%
my values/.initial=\pgfkeysvalueof{/my lists/my initial array/content},%
my values/.sort numeric list={\temp}{\templ},%
my sorted array/.is array/.expanded={\temp},%
my index machinery/.is array/.expanded={\templ}}%
\tikzset{1/.style={fill=blue!30},2/.style={fill=blue!30},
3/.style={fill=blue!30},4/.style={fill=blue!30},
5/.style={fill=red!30},6/.style={fill=red!30},
7/.style={fill=red!30},8/.style={fill=red!30},
9/.style={fill=orange!60},10/.style={fill=orange!60},
11/.style={fill=orange!60},12/.style={fill=orange!60}}
\foreach \X in \templ
{\path[style/.expanded=\X,use named path/.expanded=\X];}
\end{tikzpicture}}
\end{document}
```
![ani.gif](/image?hash=14b01b2fffbe2d465dda8e54055366274696a0894099135869d8f358f979a436)