如何繪製渦輪噴射發動機圖片

如何繪製渦輪噴射發動機圖片

在此輸入影像描述

這是我第一次使用 tikz,但我擔心我並沒有真正了解如何正確使用它(我一直搞得一團糟,到處都出現錯誤),所以我希望你們能幫我用 tikz 繪製這個方案。

答案1

例如這樣:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}

\usepackage{fontspec}
\setmainfont{Noto Serif CJK SC}

\begin{document}
\begin{tikzpicture}

\node[minimum size=5em] (a) {进气道};
\node[draw, minimum size=5em, right=of a] (b) {压气机};
\node[draw, minimum size=5em, right=of b] (c) {燃烧室};
\node[draw, minimum size=5em, right=of c] (d) {涡轮};
\node[minimum size=5em, right=of d] (e) {尾喷管};

\draw (b.south) -- +(0,-0.5) -| (d.south);
\draw[dashed] 
    ([yshift=-0.5cm]b.south) -- +(-4.5,0)
    ([yshift=-0.5cm]d.south) -- +(4.5,0);

\draw 
    ([shift={(-0.5,-0.75)}]a.north west) -- +(0,1.75)
        coordinate (ax)
        node[anchor=north east] {\strut 0}
    ([shift={(0.5,-0.5)}]e.south east) -- ([shift={(0.5,1)}]e.north east)
        coordinate (fx)
        node[anchor=north east] {\strut 8}
        node[anchor=north west] {\strut (9)};

\foreach \n [count=\i from 2] in {b,c,d,e} {
    \draw 
        ([shift={(-0.5,-0.25)}]\n.north west) -- +(0,1.25)
            coordinate (\n x)
            node[anchor=north east] {\strut \i};
}

\draw 
    ([yshift=-3em]ax) to[out=30, in=180] 
    ([yshift=-1.5em]bx) --
    ([yshift=-1.5em]ex) to[out=0, in=150] 
    ([yshift=-3em]fx);

\end{tikzpicture}
\end{document}

在此輸入影像描述


這裡發生了什麼事?首先,我繪製節點。它們都應該具有正方形的形狀,並且中間的三個節點應該有邊框。我透過使用\node[minimum size=5em] {...};選項minimum size來設定節點的高度和寬度來實現此目的,使其成為正方形。我還使用該positioning庫來相對放置節點。最後,我命名為a,,b……e以供以後參考。

然後,我在節點下方繪製線條:一條實線從b.south(節點 下邊框的中間b)開始,向下一點,然後向右,然後再次向上到達d.south。我使用-|在兩個座標之間繪製矩形線的運算子(先水平,然後垂直)。我還添加了線條的虛線部分,使用yshift向下移動起始座標的選項。

現在,我在節點上方繪製線條,首先是帶有數字的垂直線。我從最外面的線開始,現在使用shift水平和垂直移動起始座標的選項。然後,我使用\foreach循環添加其他行。在這裡,我使用計數器來添加數字。

最後,我利用預先放置在繪圖中的一些座標來繪製曲線。我使用to[out=..., in=...]語法在路徑的開頭和結尾處繪製曲線。

相關內容