Home Software Fortran logo

Guitar

Guitar is a small program to draw longitudinal or transverse profiles formed by polylines with known points, and axes with distance and elevation data, with equally spaced horizontal and vertical lines, according to a system known as "guitar". It is a very simple example of the use of DXF graphics subroutines. I made this program in 2005 and it has hardly changed since then.

Source code guitar.f

Data file guitar.dat

The user must write the data file in the strict required format. Remember that for sequential data reading files we cannot add or remove lines and the number of parameters on each line must be as expected. The data file is self-explanatory, but we will give some details:

Compile the code on Linux or a Cygwin console on Windows with: gfortran guitar.f

Run with: ./a.out (linux) or ./a.exe (Windows) and the result is a file guitar.dxf

Explanation of the code of the data.dat file. Respect the number of parameters per line and the number of lines. Comments (not read) can be added to the right of the parameters. Blank lines can be added.

"LONGITUDINAL PROFILE OF THE AXIS" > one parameter, the name of the graphic 100 PK start > one parameter, start PK 400 PK end > one parameter, end PK 20 step between PKs > one parameter, PK step 5 lowest elevation > one parameter, low elevation 30 highest elevation > one parameter, high elevation 5 elevation step > one parameter, elevation step 10 Vertical scale 10:1 > one parameter, V scale 2 Number of profiles to draw > one parameter, number of profiles to draw "Profile 1" Name of profile 1 > one parameter, name of profile 1 5 Number of points for profile 1 > one parameter, number of points to define 2 Line color > one parameter, CAD color 1 100 11.5 > three parameters, i, x, y 2 120 15 3 160 26 4 200 30 5 250 10 "Profile 2" 3 Number of points for profile 2 > one parameter, name of profile 2 12 Line color > one parameter, color 1 100 30 > three parameters, npunt, x, y 2 159 20 3 200 15 3 Text scale > one parameter, text scale 25 Vertical separation between lines > one parameter, vertical separation