xy_io


xy_io, a MATLAB code which reads and writes simple graphic files in the XY, XYL and XYF formats.

XY files are a simple way of storing information about sets of points in 2D.

An XY file has a simple structure. There are three kinds of records:

Here is an example of an XY file containing 13 points:

#  house.xy
#
        0.000000        0.000000
        6.000000        0.000000
        6.000000        7.000000
        3.000000       10.000000
        0.000000        7.000000
        4.000000        1.000000
        5.000000        1.000000
        5.000000        4.000000
        4.000000        4.000000
        5.000000        8.000000
        5.000000       11.000000
        4.000000       11.000000
        4.000000        9.000000
      

Of course, in many cases, we would like to describe LINES between the points. We can add this information by including a second file, called an XYL file, which consists of a string of point indices. A line is drawn from one point to the next, and so on for each point index in a record. Thus, an XYL file associated with the above XY file might be:

#  house.xyl
#
 1 2 3 4 5 1
 6 7 8 9 6
 10 11 12 13
      

We might also like to describe FACES defined by the points. We can add this information by including a file, called an XYF file, which consists of a string of point indices. A face is defined by listing in counterclockwise order the vertices that lie on it. The first vertex is not repeated as the final vertex. Thus, an XYF file associated with the above XY file might be:

#  house.xyf
#
 1 2 3 4 5
 6 7 8 9
 10 11 12 13
      

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

xy_io is available in a C++ version and a Fortran90 version and a MATLAB version.

Related Data and codes:

xy_io_test

grf_to_xyl, a Fortran90 code which converts information describing the adjacency and embedding of an abstract graph from GRF to XYL format.

xy, a data directory of XY files, a simple 2D graphics point format;

xy_display, a MATLAB code which reads a set of 2D points from a file and plots them.

xy_display_opengl, a C++ code which reads an XY file of 2D point coordinates, and displays an image of those points using OpenGL.

xyf, a data directory which contains examples of XYF files, a simple 2D graphics point and face format;

xyf_display, a MATLAB code which reads XYF information defining points and faces in 2D, and displays an image.

xyf_display_opengl, a C++ code which reads XYF information defining points and faces in 2D, and displays an image using OpenGL.

xyl, a data directory which contains examples of XYL files, a simple 2D graphics point and line format;

xyl_display, a MATLAB code which reads XYL information defining points and lines in 2D, and displays an image.

xyl_display_opengl, a C++ code which reads XYL information defining points and lines in 2D, and displays an image using OpenGL.

xyz_io, a MATLAB code which reads and writes XYZ files, a simple 3D graphics point format.

Source Code:


Last revised on 30 October 2024.