LaTeX forum ⇒ Graphics, Figures & TablesAirfoils in Tex using TikZ

Information and discussion about graphics, figures & tables in LaTeX documents.
flyingtex
Posts: 2
Joined: Sat Mar 31, 2018 2:30 pm

Airfoils in Tex using TikZ

Postby flyingtex » Sat Mar 31, 2018 2:33 pm

Hello,

This is the first time I'm trying to use TikZ and I have found this example:
http://www.texample.net/tikz/examples/airfoil-profiles/

However even with the example .tex files and .airfoil files I cannot get the airfoils to show when I typeset.

Should the .tex file be in the same directory as the .dat files when using TikZ, I have tried this and it doesn't show the airfoils.

Any ideas where I may be going wrong?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Apr 01, 2018 12:46 am

Hi,

welcome to the forum!

Perhaps show us the code you are using. You can also post attachments to posts here. It's hard to guess what may be not working in the code you tried.

Stefan
Site admin

flyingtex
Posts: 2
Joined: Sat Mar 31, 2018 2:30 pm

Postby flyingtex » Sun Apr 01, 2018 7:58 pm

Thanks for the reply, the code I am using is below, it comes from the link in my original post.

  1. \begin{document}
  2.  
  3. \newcounter{y}
  4. \setcounter{y}{0}
  5.  
  6. \begin{tikzpicture}
  7. \foreach \lbl / \fn in {EPPLER 625/e625.dat,
  8. WORTMANN FX 2/fx2.dat,
  9. EPPLER 664 (EXTENDED)/e664ex.dat,
  10. CLARK Y/clarcy.dat,
  11. Eiffel 10 (Wright)/eiffel10.dat,
  12. FX 69-PR-281/fx69pr281.dat,
  13. NACA Munk M-4 airfoil/m4.dat}{
  14. % Some profiles look better when using plot[smooth]
  15. \draw[yshift=-\arabic{y}cm,scale=3] node[left=0.5cm] {\lbl}
  16. plot file{data/\fn} -- cycle;
  17. \stepcounter{y}
  18. }
  19. \end{tikzpicture}
  20.  
  21. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Apr 01, 2018 9:39 pm

Ah, I see! The data is expected to be in the data/ subfolder, as it's written in the plot line.

It works with the files in the same directory if you change the line to

plot file{\fn} -- cycle;

Stefan
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests