形状和箭头

形状和箭头

我想在 Latex 中设计以下图案。你能帮我画出来吗?3D 格式就更好了。非常感谢! 在此处输入图片描述

答案1

在此处输入图片描述

上图是通过以下 MWE(最小工作示例)生成的:

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

\begin{document}
    \begin{tikzpicture}[
node distance = 8mm and 12mm,
  start chain = going right,
  rbox/.style = {rounded corners=2mm, draw=green, thick, fill=white,
                 minimum width=15mm, minimum height=10mm,
                 font=\sffamily, drop shadow},
   arr/.style = {-Triangle, shorten >=1pt, shorten <=1pt}
                        ]
    \begin{scope}[nodes={on chain}]
\node (n1)  [rbox] {Apple};
\coordinate (n2);
\node (n3)  [rbox] {Apple};
    \end{scope}
\node (n4)  [rbox, above=of n1.north -| n2] {Apple};
%
\draw[arr] (n1) -- (n3);
\draw[arr] (n4) -- (n2);
    \end{tikzpicture}
\end{document}

使用 TikZ 库arrows.meta作为箭头、chains节点和水平链连接的坐标、possitioning for determining distance between nodes and阴影来模拟节点的 3D 外观。

答案2

在此处输入图片描述

\documentclass[12pt, a4paper]{article}

\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\usepackage{tikz}
\usetikzlibrary{angles,calc,intersections,quotes}
\usetikzlibrary {positioning, shapes.misc}
\usetikzlibrary{backgrounds, shadows, shadows.blur}

\newcommand\addcurlyshadow[2][]{
    % #1: Optional aditional tikz options
    % #2: Name of the node to "decorate"
    \begin{pgfonlayer}{background}
        \path[blur shadow={shadow xshift=0pt, shadow yshift=0pt, shadow blur steps=6}, #1]
        ($(#2.north west)+(.3ex,-.5ex)$)
        -- ($(#2.south west)+(.5ex,-.7ex)$)
        .. controls ($(#2.south)!.3!(#2.south west)$) .. (#2.south)
        .. controls ($(#2.south)!.3!(#2.south east)$) .. ($(#2.south east)+(-.5ex,-.7ex)$)
        -- ($(#2.north east)+(-.3ex, -.5ex)$)
        -- cycle;
    \end{pgfonlayer}
}
\begin{document}
\begin{tikzpicture}[
                        node distance=5mm,
                        terminal/.style={
                        % The shape:
                        rectangle,minimum size=10mm,rounded corners=3mm,
                        % The rest
                        very thick,draw=black!50,
                        top color=white,bottom color=black!20,
                        font=\ttfamily}
                        ]
        \matrix[
        row sep=10mm,
        column sep=5mm]{
        %first row
        &&\node (digit1) [terminal] {Apple};&&\\
        %second row
        &\node (digit2) [terminal] {Apple};&&\node (digit3) [terminal] {Apple};&\\
        };
        
        %arrows
        \path(digit2) edge[->] (digit3)
                (digit1) edge[->] ($(digit2) !0.5!(digit3)$);
        \addcurlyshadow{digit1};
                \addcurlyshadow{digit2};
                        \addcurlyshadow{digit3};
    \end{tikzpicture}
\end{document}

相关内容