如何在 Tikz 图中将一个节点传播到彼此正后方的多个节点?

如何在 Tikz 图中将一个节点传播到彼此正后方的多个节点?

我使用 Tikz 绘制了下图:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning, quotes}

\begin{document}
    \begin{tikzpicture}[
node distance = 12mm and 12mm, 
   box/.style = {draw, rounded corners, 
                 minimum width=22mm, minimum height=5mm, align=center},
            > = {Straight Barb[angle=60:2pt 3]},
   bend angle = 15,
         auto = right,
                        ]
\node (n1)  [box] {text\\ text text text 1};
\node (n2)  [box, below right=of n1]    {text\\ text text 2};
\node (n3)  [box, above right=of n2]    {text\\ text text 3};
%
\draw[dotted,->] (n1) to ["label 1", swap]  (n3);
\draw[dashed,->] (n1) to [bend right, "label 2"]  (n2);
\draw[->]        (n2) to [bend right, "label 3"]  (n1);
\draw[->]        (n2) to [bend right, "label 5"]  (n3);
\draw[dotted,->] (n3) to [bend right, "label 4"]  (n2);
    \end{tikzpicture}
\end {document}

在此处输入图片描述

我的问题是:我怎样才能使节点n1看起来像那样?

在此处输入图片描述

答案1

让我阐述一下我的评论。对于这种情况,就像您希望在节点处n1,在 TiZ 库shadows定义选项double copy shadow

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, 
                positioning, 
                quotes,
                shadows}  % <--- added

\begin{document}
    \begin{tikzpicture}[
node distance = 12mm and 12mm,
   box/.style = {draw, rounded corners, fill=white,
                 minimum width=22mm, minimum height=5mm, align=center},
            > = {Straight Barb[angle=60:2pt 3]},
   bend angle = 15,
         auto = right,
                        ]
\node (n1)  [box,
             double copy shadow={% <--- added
                shadow xshift=1ex, 
                shadow yshift=1ex}] {text\\ text text text 1};
\node (n2)  [box, below right=of n1]    {text\\ text text 2};
\node (n3)  [box, above right=of n2]    {text\\ text text 3};
%
\draw[dotted,->] (n1) to ["label 1", swap]  (n3);
\draw[dashed,->] (n1) to [bend right, "label 2"]  (n2);
\draw[->]        (n2) to [bend right, "label 3"]  (n1);
\draw[->]        (n2) to [bend right, "label 5"]  (n3);
\draw[dotted,->] (n3) to [bend right, "label 4"]  (n2);
    \end{tikzpicture}
\end {document}

在此处输入图片描述

相关内容