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:
After activating the diagram and rotating around freely, I realized that my 3D model doesn't really look pleasant:
I would like to make the following improvements:
- Arrow start and end positions are automatically calculated like in
tikz-cd
such that I don't need to useFill
on the labels or use theconvexcomb
routine. - Allow arrows in the front to cross over the ones in the back, analogous to the
tikz-cd
optioncrossing over
. - Arrows look good without activating the model.
- 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);
Margin3(number,number)
parameter. But it is not automatic with respect to the Label. For an automatic command, a routine should be written.tikz-cd
. This is "secretly" using a matrix of node, and you could shift nodes into the "z-direction" simply by adding something like|[xshift=-1cm,yshift=-1cm]|
to the matrix, ah, sorry, diagram.