#StackBounty: #tikz-pgf #diagrams #3d #tikz-cd #tikz-3d Deforming/projecting text in TikZ(-cd) along a curved surface

Bounty: 50

This is a continuation of STeX Exchange 552946.

I’ve been trying to get some 3D effects on tikz-cd, and got an amazing answer by @ZhiyuanLck. The only remaining problem is getting text/arrows to be drawn along curved surfaces (or look that way). Is it possible to achieve such an effect?

For instance, how would we do that for the Rightarrows and their labels theta_f and theta_g in the diagram below?

enter image description here

(This diagram is the ice cream cone condition for lax slice bicategories, as in Section 7.1 of Johnson–Yau’s new book on bicategories.)

Compilable code for this diagram:

documentclass[english,11pt]{standalone}
RequirePackage{luatex85}
usepackage{tikz}
usepackage{tikz-cd}
usetikzlibrary{3d}
makeatletter
tikzset{
  plane/.code args={#1and#2}{
    tikz@scan@one@pointpgf@process#1
    edeftemp@a{(thepgf@x, thepgf@y)};
    tikz@scan@one@pointpgf@process#2
    edeftemp@b{(thepgf@x, thepgf@y)};
    pgfkeysalso{
      plane x={temp@a},
      plane y={temp@b},
      canvas is plane,
    }
  },
}
makeatother
usepackage{libertine}
usepackage{mathtools}
usepackage[libertine]{newtxmath}
tikzcdset{
    arrow style=tikz,
    %diagrams={>={Straight Barb[scale=1.5]}}
    diagrams={>={Stealth[round,length=4pt,width=4.95pt,inset=2.75pt]}}
}
begin{document}
newsavebox{BoxNodeOne}
savebox{BoxNodeOne}{
    begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, ampersand replacement=&]
        {}
        arrow[r, "F(A)"{plane={(1,0) and (0,0.7)}},phantom]
        &
        {}
    end{tikzcd}
} 
newsavebox{BoxNodeTwo}
savebox{BoxNodeTwo}{
    begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, ampersand replacement=&]
        {}
        arrow[r, "F(B)"{plane={(1,0) and (0,0.7)}},phantom]
        &
        {}
    end{tikzcd}
} 
newsavebox{BoxOne}
savebox{BoxOne}{
    begin{tikzcd}[row sep={4.5em,between origins}, column sep={4.5em,between origins}, ampersand replacement=&]
        {}
        \
        arrow[u, Rightarrow]
        {}
    end{tikzcd}
} 
newsavebox{BoxTwo}
savebox{BoxTwo}{
    begin{tikzcd}[row sep={3.6em,between origins}, column sep={3.6em,between origins}, ampersand replacement=&]
        {}
        &
        {}
        \
        {}
        arrow[ru, Rightarrow, bend right=35]
        &
        {}
    end{tikzcd}
} 
begin{tikzcd}[row sep={14.4em,between origins}, column sep={6.3em,between origins}, ampersand replacement=&]
    {hspace{+1.25em}usebox{BoxNodeOne}}
    arrow[rr, "F(g)"{name=3,description,plane={(1,0) and (0,0.7)}},bend left=30]
    arrow[rr, "F(f)"{name=2,description,plane={(1,0) and (0,0.7)}},bend right=30]
    arrow[rd, "phi_{A}"'{name=1},start anchor={[xshift=+0.5em]}]
    &
    &
    {hspace{-1.25em}usebox{BoxNodeTwo}}
    arrow[ld, "phi_{B}",start anchor={[xshift=-0.5em]}]
    \
    {}
    &
    X
    &
    {}
    % 2-Arrows
    arrow[from=1,to=1-3,"theta_{f}"{description,yshift=-0.2em},shorten=2.5em,Rightarrow,xshift=-1.0em,yshift=-1.0em,bend right=15]
    arrow[from=2,to=3,"usebox{BoxOne}"{plane={(1,0) and (0,0.6)}},shorten=0.5em,phantom]
    arrow[from=2,to=3,"scalebox{0.75}{$F(alpha)$}"{description,plane={(1,0) and (0,0.6)}},shorten=0.5em,phantom]
end{tikzcd}
=
begin{tikzcd}[row sep={14.4em,between origins}, column sep={6.3em,between origins}, ampersand replacement=&]
    {hspace{+1.25em}usebox{BoxNodeOne}}
    arrow[rr, "F(g)"{name=3,description,plane={(1,0) and (0,0.7)}},bend left=30]
    arrow[rd, "phi_{A}"'{name=1},start anchor={[xshift=+0.5em]}]
    &
    &
    {hspace{-1.25em}usebox{BoxNodeTwo}}
    arrow[ld, "phi_{B}",start anchor={[xshift=-0.5em]}]
    \
    &
    X
    &
    % 2-Arrows
    arrow[from=1,to=1-3,"theta_{g}"{description,yshift=+0.15em},shorten=1.5em,Rightarrow,bend left=15,xshift=+0.25em,yshift=0.5em]
end{tikzcd}
end{document}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.