VEF - Vertex - Edge - Face format

Written by Paul Bourke
January 1999


The Vertex-Edge-Face format isn't a formal file format but is used by many people to describe single geometric objects. The files are generally easy to create by hand or automatically, they are easy to read in software, and they contain the essense of the geometry of the object.

The file consists of 3 parts

For each of these parts there is a count at the beginning of the part indicating the number of items in that part. ie: the number of vertices preceedes the vertices themselves, the number of edges and faces preceed their respective data. Generally, line breaks separate each item. So there is one vertex per line, one edge per line, and one face per line. The parts of a line are separated by any white space character, usually a space or tab.

There are some variations that are often found

Example
A unit cube with it's left-bottom corner at the origin might be described as follows:

8                # Number of vertices
0 0 0            # x y z
1 0 0
1 0 1
0 0 1
0 1 0
1 1 0
1 1 1
0 1 1
12               # Number of edges
0 1              # Bottom edges
1 2
2 3
3 0
4 5              # Top edges
5 6
6 7
7 4
0 4              # Middle edges
1 5
2 6
3 7
6                # Number of faces
4 0 1 2 3        # Bottom
4 4 5 6 7        # Top
4 0 1 5 4        # Front
4 3 2 6 7        # Back
4 0 3 7 4        # Left
4 1 2 6 5        # Right

It was created by hand from the sketch below