0

I have this image...

Fuselage

I want to replicate this in LaTeX but also have dimensions in one of the windows. Something like this...

Drawing

How could I do this using TiKZ whilst also maintaining the feel and shape of an actual aircraft like in the image, and adding the dimensions thing as well?

The 'Draw an aircraft with Tikz' question does not answer this question.

dave
  • 65
  • This seems to be identical to https://tex.stackexchange.com/questions/534026/drawing-aircraft-fuselage you could edit that question and ask that it be re-opened rather than just posting again. It does not seem substantially different from the question on drawing a whole aircraft. Rather than just asserting the answers to that do not help it might be better to start with one of the answers there then ask for help adapting it – David Carlisle Mar 26 '20 at 19:03
  • why do you want to re-draw the aircraft why not include an image and just draw the dimension arrows over the window? – David Carlisle Mar 26 '20 at 19:04

1 Answers1

16

It is very easy to draw such things, just tedious. For the future I'd kindly ask you to provide some code that at the very least defines the colors, sets some dimensions and so on, so that others do not have to start from scratch.

\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}

enter image description here

ADDENDUM: Per request a version with passengers. (These are not necessarily animals, among the TikZlings there is a snowman and three beings.)

\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}

enter image description here

These are randomly chosen TikZlings, in each compilation you will get a random set. If you do not like this randomness, use \pgfmathsetseed{<int>} where int is an integer.

  • 1
    Wow, as if the windows were copied from the photograph! – AlexG Mar 26 '20 at 20:54
  • 4
    @AlexG Here is a version with photo-realistic passengers. ;-) –  Mar 26 '20 at 21:20
  • 1
    @Schrödinger'scat way too much time on your hands! – Thruston Mar 26 '20 at 23:06
  • 1
    @Thruston I don't have hands, only claws. ;-) –  Mar 27 '20 at 00:20
  • 1
    @Schrödinger'scat Just for curiosity, could you add the code of the animals picture you've done in the comments please. – dave Apr 10 '20 at 19:13
  • 1
    @dave Sure, done. –  Apr 10 '20 at 19:20
  • This is pure art! – Sebastiano Apr 10 '20 at 19:28
  • 2
    @Sebastiano No. it is highly unfair. The bear should not have gotten the business class seat! –  Apr 10 '20 at 19:29
  • @Schrödinger'scat But the bears are the same! Are they brother and sister? – Sebastiano Apr 10 '20 at 19:30
  • 2
    @Sebastiano I really do not know, but the airline must have made a mistake giving them so good seats. –  Apr 10 '20 at 19:31
  • @Schrödinger'scat A note...in your fuselage is missing the long line. Please, can you see the initial picture of the OP? – Sebastiano Apr 10 '20 at 19:32
  • 2
    @Sebastiano Just add \draw[gray,thin] (-4,-1.5) -- (4,-1.5); under \path[top color=pt,bottom color=pb] (-4,-3) rectangle (4,3);. –  Apr 10 '20 at 19:37
  • Unless seats have been seriously rearranged since the last time I was on an airplane, I hope this one is on the ground, because that view of passengers means that they haven't buckled their seat belts. – barbara beeton Apr 10 '20 at 20:32
  • 1
    @barbarabeeton Some time after take-off it is fine to unbuckle, especially if you are as lucky as the TikZlings who got upgraded. –  Apr 10 '20 at 20:38