Obj format

The obj format is used for unstructured data sets. The file is ASCII format. The format is an extension of the OFF file format.

Example:

OFF
5 4 0
-1  -1   0
-1   1   0
 1   1   0
 1  -1   0
 0   0   1
3 0 1 4
3 1 2 4
3 2 3 4
3 3 0 4

File structure:

Magic                                            File magic
L N 0                                            L: Number of points
                                                 N: Number of elements

x(0)   y(0)   z(0)                               Coordinates (x,y,z)
x(1)   y(1)   z(1)
...
x(L-1) y(L-1) z(L-1)


M(0)   ID(0,1)   ID(0,2)   ... ID(0,M(0))        M(i):    Number of vertices
M(1)   ID(1,1)   ID(1,2)   ... ID(1,M(1))        ID(i,j): Index of vertex in point list
...
M(N-1) ID(N-1,1) ID(N-1,2) ... ID(N-1,M(N-1))

Notes:

File header

The first line contains the file magic 'OFF'. This is ignored by the pixmax program. The next line contains 3 integer numbers. The first gives the number of points (L). The second gives the number of elements (N). The third number is ignored.

Point list

This section contains L lines. Each line gives the coordinates (x,y,z) of one point. Numbers in floating point and exponential representation are allowed.

Pixmax supports lines with more than 3 numbers. By default the first 3 numbers are taken as coordinates (x,y,z). This can be changed by the 'set coord'-command.

Element list

This section consists of N lines. Each line defines an element. The first integer gives the number of vertices M. It is followed by M indices. These are pointers to entries in the point list. The index is defined by the order in which the point appear in the point list. The first point has the index zero.

Until now, pixmax supports only elements with 3 or 4 vertices.

Comments

A comment line starts with the '#'-symbol. Empty lines are allowed everywhere.
back