[Tex/LaTex] Drawing a 3D commutative diagram

3dasymptotecommutative-diagramstikz-cd

I was drawing a commutative-diagram when I had the (questionable?) idea of drawing a tetrahedral version of it. I used Asymptote in the hope of getting good-looking thumbnail and a nice embedded 3D model at the same time. This is what I got so far:

On the left side, a planar commutative diagram.  On the right side, a thumbnail of a tetrahedron.

After activating the diagram and rotating around freely, I realized that my 3D model doesn't really look pleasant:

On the left side, the previous planar commutative diagram.  On the right side, an activated embedded 3D model of a tetrahedron.

I would like to make the following improvements:

  1. Arrow start and end positions are automatically calculated like in tikz-cd such that I don't need to use Fill on the labels or use the convexcomb routine.
  2. Allow arrows in the front to cross over the ones in the back, analogous to the tikz-cd option crossing over.
  3. Arrows look good without activating the model.
  4. Arrows look good in 3D with camera rotation.

I don't really know how to do 1 & 2. Moreover, 3 & 4 seem to be contradictory goals. What should my realistic goal be and what improvements should I make?
Source:

settings.render = 0;
import solids;
import three;
size(240,120);
defaultpen(basealign);

real side = 1;
triple origin = (0,0,0);
triple voa = (0,0,sqrt(6)/3*side);
triple vob = (sqrt(3)/4*side,-.5*side,0);
triple voc = (sqrt(3)/4*side,.5*side,0);
triple vod = (-sqrt(3)/3*side,0,0);

triple convexcomb(triple a, triple b, real x)
{
  return (1-x) * a + x * b;
}

// A: U
// B: V1x...xVn
// C: W
// D: V

draw(convexcomb(vob,voa,.15)--convexcomb(vob,voa,.85),L=Label("$\varphi$",align=NW)         ,Arrow3(TeXHead2(normal=O)));
draw(convexcomb(vob,voc,.15)--convexcomb(vob,voc,.85),L=Label("$\psi$"   ,align=unit(4*S+W)),Arrow3(TeXHead2(normal=X)));
draw(convexcomb(vob,vod,.15)--convexcomb(vob,vod,.85),L=Label("$\phi$"   ,align=unit(4*N+E)),Arrow3(TeXHead2(normal=O)));
draw(convexcomb(voa,voc,.15)--convexcomb(voa,voc,.85),L=Label("$T_{0}$"  ,align=E)          ,Arrow3(TeXHead2(normal=O)));
draw(convexcomb(voa,vod,.15)--convexcomb(voa,vod,.85),L=Label("$\Pi$"    ,align=unit(E+NE)) ,Arrow3(TeXHead2(normal=O)));
draw(convexcomb(vod,voc,.15)--convexcomb(vod,voc,.85),L=Label("$T$"      ,align=unit(E+SE)) ,Arrow3(TeXHead2(normal=O)));

label(Label("$U$",Fill(white)),voa);
label(Label("$V_{1}\times\cdots\times V_{n}$",Fill(white)),vob);
label(Label("$W$",Fill(white)),voc);
label(Label("$V$",Fill(white)),vod);

Best Answer

Here is a proposal for a pseudo-3D tikz-cd diagram.

\documentclass[border=2pt]{standalone}
\usepackage{amssymb,amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\usepackage{tikz}

\begin{document}
\tikzset{zshift/.style={xshift={-0.3*#1},yshift={-0.9*#1}}}

\begin{tikzcd}[row sep=2cm,column sep=2cm,inner sep=1ex]
& U \arrow{d}{T_0} \arrow{dr}{\Pi} & \\
V_1\times\cdots V_n \arrow{ur}{\varphi} 
\arrow{r}{\phi} \arrow{rr}{\psi}&
|[zshift=-1.5cm]| V \arrow{r}{T}& |[zshift=1cm]|W
\end{tikzcd}

\end{document}

enter image description here

Related Question