弯曲的路径以及如何使这幅图更加美观

弯曲的路径以及如何使这幅图更加美观

我想显示一个大框架由许多其他类型的小框架组成。因此我开始制作这个 tikzpicture。

大的叫long,小的叫small

\documentclass{article}
\usepackage{amsmath}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows.meta, calc, positioning, shapes, matrix}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}


\newcommand{\mylengthlong}{9cm}
\newcommand{\myheightmod}{0.7cm}

\newcommand{\mylengthsmall}{2cm}
\newcommand{\myheightsmall}{0.7cm}
\newcommand{\myfont}{\small}



% vert. distance between small ones and big one
\newcommand{\mydistance}{2cm}

% length of small ones projection on the big ones
\newcommand{\mylengthproject}{0.25cm}


\tikzstyle{long}=[draw, minimum width = \mylengthlong,
minimum height = \myheightmod,
rounded corners]

\tikzstyle{small}=[ minimum width = \mylengthsmall,
minimum height = \myheightsmall,
]

\begin{document}

    \begin{tikzpicture}[auto,  font = {\sf \myfont}]
    % Hilfslinien
%   \draw[help lines] (-7,-7) grid (7,7);

    \node[long] (long) {long};

    \node[small,draw] (small1) at ($(long.north west)+(\mylengthsmall/4,\mydistance)$) {small};
    \draw (small1.south west) .. controls ($(small1.west)+(0,-1)$) and ($(long.west)+(0,1)$) .. (long.west);

    \node[draw, small, right = 0 of small1] (small2) {small}; 
    \draw (small2.south west) .. controls ($(small2.west)+(0,-1)$) and ($(long.west)+(\mylengthproject,1)$) .. ($(long.north west)+(\mylengthproject,0)$);
    \draw (small2.south east) .. controls ($(small2.south east)+(0,-1)$) and ($(long.west)+(2*\mylengthproject,1)$) .. ($(long.north west)+(2*\mylengthproject,0)$);

    \node[draw, small, right = 0 of small2  ] (small3) {small};
    \draw (small3.south east) .. controls ($(small3.south east)+(0,-1)$) and ($(long.west)+(3*\mylengthproject,1)$) .. ($(long.north west)+(3*\mylengthproject,0)$);

    \node[small, right = 0 of small3] (many)    {...};
    \draw (many.south east) .. controls ($(many.south east)+(0,-1)$) and ($(long.east)+(-1*\mylengthproject,1)$) .. ($(long.north east)+(-1*\mylengthproject,0)$);

    \node[draw,small, right = 0 of many] (small4) {small};
    \draw (small4.south east) .. controls ($(small4.south east)+(0,-1)$) and ($(long.east)+(0,1)$) .. (long.east);

    \end{tikzpicture}

\end{document}

在此处输入图片描述 您能想到任何更好的方法来实现这种图像吗?

不知怎的,我觉得这张图片没有清楚地表达我想要表达的内容。

相关内容