答案1
画这些东西很容易,就是有点乏味。以后我恳请您提供一些代码,至少定义一下颜色、设置一下尺寸等等,这样其他人就不必从头开始。
\documentclass[tikz,border=3mm]{standalone}
\definecolor{wt}{RGB}{210,215,219} % frame top
\definecolor{wb}{RGB}{151,154,162} % frame bottom
\definecolor{w}{RGB}{49,66,89} % window
\definecolor{pt}{RGB}{242,242,242} % plane top
\definecolor{pb}{RGB}{208,209,213} % plane bottom
\definecolor{wf}{RGB}{85,96,110} % inner frame
\definecolor{blind}{RGB}{115,119,128} % blind
\begin{document}
\begin{tikzpicture}[>=latex,pics/fuselage/.style={code={
\tikzset{fuselage/.cd,#1}%
\def\pv##1{\pgfkeysvalueof{/tikz/fuselage/##1}}%
\fill[w,rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
\clip [rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2);
\fill[blind] (-\pv{w}/2,\pv{h}/2-\pv{b}) rectangle (\pv{w}/2,\pv{h}/2);
\fill[wf,xshift=1.3pt,yshift=-1.3pt,even odd rule]
[rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2)
[rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
\draw[top color=wt,bottom color=wb,even odd rule]
[rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2)
[rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
}},fuselage/.cd,h/.initial=1.4cm,w/.initial=1cm,
d/.initial=0.7mm,r/.initial=4mm,b/.initial=2mm]
\path[top color=pt,bottom color=pb] (-4,-3) rectangle (4,3);
\path foreach \X in {0,...,3} {(-3+2*\X,0.5) pic{fuselage}};
\draw[|<->|] (1-0.425,0.5) -- (1+0.425,0.5) node[pos=0.75,above]{$a$};
\draw[|<->|] (1,0.5-0.625) -- (1,0.5+0.625) node[pos=0.75,left]{$b$};
\end{tikzpicture}
\end{document}
附录:每请求一个带乘客的版本。(这些不一定是动物,在 Ti钾Zlings 那里有一个雪人和三个生物。)
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikzlings}
\definecolor{wt}{RGB}{210,215,219} % frame top
\definecolor{wb}{RGB}{151,154,162} % frame bottom
\definecolor{w}{RGB}{49,66,89} % window
\definecolor{pt}{RGB}{242,242,242} % plane top
\definecolor{pb}{RGB}{208,209,213} % plane bottom
\definecolor{wf}{RGB}{85,96,110} % inner frame
\definecolor{blind}{RGB}{115,119,128} % blind
\begin{document}
\begin{tikzpicture}[>=latex,pics/fuselage/.style={code={
\tikzset{fuselage/.cd,#1}%
\def\pv##1{\pgfkeysvalueof{/tikz/fuselage/##1}}%
\fill[w,rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
\clip [rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2);
\fill[blind] (-\pv{w}/2,\pv{h}/2-\pv{b}) rectangle (\pv{w}/2,\pv{h}/2);
\tikzling[scale=0.6,yshift=-2cm]
\fill[wf,xshift=1.3pt,yshift=-1.3pt,even odd rule]
[rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2)
[rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
\draw[top color=wt,bottom color=wb,even odd rule]
[rounded corners=\pv{r}]
(-\pv{w}/2,-\pv{h}/2) rectangle (\pv{w}/2,\pv{h}/2)
[rounded corners=\pv{r}-\pv{d}]
(-\pv{w}/2+\pv{d},-\pv{h}/2+\pv{d}) rectangle (\pv{w}/2-\pv{d},\pv{h}/2-\pv{d});
}},fuselage/.cd,h/.initial=1.4cm,w/.initial=1cm,
d/.initial=0.7mm,r/.initial=4mm,b/.initial=3mm]
\path[top color=pt,bottom color=pb] (-4,-3) rectangle (4,3);
\path foreach \X in {0,...,3} {(-3+2*\X,0.5) pic{fuselage}};
\end{tikzpicture}
\end{document}
这些是随机选择的 Ti钾Zlings,每次编译时您都会得到一个随机集。如果您不喜欢这种随机性,请使用\pgfmathsetseed{<int>}
整数int
。