XYZ Files
These are some examples of XYZ files, a very simple format
for recording points and lines in 3D space.
An XYZ file has a simple structure:
-
Comment lines begin with '#" in column 1, and may appear anywhere;
-
Blank lines may appear anywhere.
-
The coordinates of a point are written on a single line,
separated by spaces;
There is a variation on the format which adds one additional rule:
-
If the coordinates for two points are listed consecutively,
it is assumed there is a line segment connecting them; to
indicate that no such line segment exists, insert a blank
line between the two records;
Example XYZ File:
# Corners of a tetrahedron
#
0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
Related Data and Programs:
XYZ file characteristics:
-
ASCII
-
3D
-
No compression
-
1 image
Programs to create an XYZ file:
-
RANDOM_DATA
can produce a set of points that are randomly sampled from a
given geometric shape. In cases where this was a 3D shape, the
resulting output file is an XYZ file.
-
RBOX
will produce a random sample of points according to a given
distribution, and over a given geometric shape. In cases
where this was a 3D shape, then the resulting output file is
ALMOST an XYZ file (you just need to delete the two initial
records that list the spatial dimension and number of points.)
Programs to process an XYZ file:
Programs to process an XYZ file include all the programs that will
handle a TABLE file, including:
Routines to read an XYZ file:
Routines to write an XYZ file:
Programs to convert an XYZ file to another format:
-
IVREAD
can read an XYZ file and convert it to a number of different formats.
-
SXYZ_VORONOI
is a FORTRAN90 program which
can read an XYZ file of points on a sphere, determine the
Delaunay triangulation and Voronoi diagram, and make
EPS file images of them.
XYZ_TO_PDB
is a FORTRAN90 program which reads an XYZ file
and writes the data as atomic coordinates in a
PDB file.
Programs to convert a file to XYZ format:
-
IVREAD
is a FORTRAN90 program which
can read a graphics file in a number of formats and write it as
an XYZ file.
-
PDB_TO_XYZ
is a FORTRAN90 program which
reads a
PDB file
and writes the atomic coordinates to an XYZ file.
Programs to display an XYZ file:
-
POINTS_DISPLAY_MATLAB
can read a file of point coordinates and display an image of
the points inside the MATLAB graphics window.
Sample XYZ files:
You can go up one level to
the DATA page.
Last revised on 19 January 2007.