我需要构建瀑布模型图像这些:
答案1
替代方案格诺特很好的答案,其中使用了chains
TikZ 库并且在循环中建立节点之间的连接:
\documentclass[tikz, margin=3mm]{standalone}
\usepackage{}
\usetikzlibrary{chains,positioning,shadows}
\begin{document}
\begin{tikzpicture}[>=stealth,
node distance = 3mm and 3mm,
start chain = A going below right,
every node/.style = {draw, text width=24mm, minimum height=12mm, align=center,
inner sep=1mm, fill=white, drop shadow={fill=black}, on chain=A},
]
\node {Requirements}; % A-1
\node {Design};
\node {Coding and unit test};
\node {System integration};
\node {Operation and maintenance};
%
\foreach \i [count=\j] in {2,...,5}
{
\draw[->, thick] (A-\i) -| (A-\j);
\draw[->, thick] (A-\j) -| (A-\i);
}
\end{tikzpicture}
\end{document}
答案2
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\tikzset
{phase/.style={draw,minimum width=2cm,minimum height=1.3cm,align=center}
,previous/.style={below right=0.5cm of #1}
}
\newcommand\connect[2]%
{\draw[->,thick] (#1) -| (#2);
\draw[->,thick] (#2) -| (#1);
}
\begin{tikzpicture}[>=stealth]
\node[phase] (requirements) {Requirements};
\node[phase,previous=requirements] (design) {Design};
\node[phase,previous=design] (coding) {Coding and\\unit test};
\node[phase,previous=coding] (integration) {System\\integration};
\node[phase,previous=integration] (operation) {Operation and\\maintenance};
\connect{requirements}{design};
\connect{design}{coding};
\connect{coding}{integration};
\connect{integration}{operation};
\end{tikzpicture}
\end{document}
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\tikzset
{phase/.style={draw,minimum width=2cm,minimum height=1.3cm,align=center}
,previous/.style={below right=0.5cm of #1}
}
\newcommand\connect[2]%
{\draw[->,thick] (#1.east) to[out=0,in=90] (#2.north);
\draw[->,thick] (#2.west) to[out=180,in=270] (#1.south);
}
\begin{tikzpicture}[>=stealth]
\node[phase] (requirements) {Requirements};
\node[phase,previous=requirements] (design) {Design};
\node[phase,previous=design] (coding) {Coding and\\unit test};
\node[phase,previous=coding] (integration) {System\\integration};
\node[phase,previous=integration] (operation) {Operation and\\maintenance};
\connect{requirements}{design};
\connect{design}{coding};
\connect{coding}{integration};
\connect{integration}{operation};
\end{tikzpicture}
\end{document}