le-ge 
[en] [fr] [ru]
air2dxf (octave)

This small program converts any airfoil file in the standard .dat format, in a .png file and  .dxf file ( .dat to .dxf ) for use and analyze in CAD programs. We already have a fortran executable program utility on Linux or Windows, here. This program does the same, but programmed in GNU Octave and showing that the simplicity and beauty of the code is unbeatable! All in just 14 lines of useful code (discounting comments and blank lines).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Airfoil to png & dxf
% Pere Casellas pere@laboratoridenvol.com
% GNU Octave
% Version 20181017-en
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hold on

% load airfoil
fid = fopen ("airfoil.dat");
name = fgetl (fid);
airc = dlmread('airfoil.dat', '',1,0);

A = airc(:,1);
B = airc(:,2);

% plot airfoil
grid on
xlabel('Chord')
ylabel('Thickness')
axis ([0 1 -0.3 0.3], 'equal');
title(name,'fontsize',15,'color','red');
plot(A,B,'linewidth',2);

% print airfoil
print('airfoil.dxf','-ddxf');
print('airfoil.png','-dpng');

air2dxf Octave

Download: air2dxf-octave-en.zip

Usage:


First of all, you need to install the OCTAVE system on your computer. This is a very powerfull programming environment for numerical calculation and graphics. It is GNU General Public License software.
GNU Octave https://www.gnu.org/software/octave/

Put the profile airfoil.dat (exactly with that name) in the same directory as the executable code airfoil.m

Run octave in the working directory and type
on the command line:  air2dxf

The result is the graphic representation of the profile on the screen, a .png file and a .dxf file

index