Introduction
OFF is a very simple text format for polygon meshes, best known from Geomview, a 3D viewer from the Geometry Center at the University of Minnesota. It lists the vertices, then the faces as lists of vertex numbers, and little else.
Its simplicity made it popular in geometry research. Shape collections used to test 3D search and recognition, such as the Princeton Shape Benchmark and ModelNet, are distributed as OFF files.
Structure
The file usually starts with the keyword OFF. The keyword is recommended
but optional, since many older files lack it. Prefix letters, in a fixed order, add
data to each vertex: ST texture coordinates, C a colour,
N a normal, 4 a fourth, homogeneous coordinate, and
n a dimension other than 3, given on a line of its own. Next come three
counts: vertices, faces and edges. The edge count must be present but is not used.
Then come the vertices, usually one per line as x y z followed by any
extra data, and the faces, one per line as the number of corners followed by that
many vertex numbers, counted from 0. A face line may end with a colour. A
# starts a comment that runs to the end of the line. Writing
BINARY after the keyword switches the counts, vertices and faces to
big-endian 32-bit binary.
OFF
# a square pyramid
5 5 0
0 0 0
1 0 0
1 1 0
0 1 0
0.5 0.5 1
4 3 2 1 0
3 0 1 4
3 1 2 4
3 2 3 4
3 3 0 4
In this reference
- Syntax and binary form – the header keyword and every prefix, vertex data, face colours, comments, and the
BINARYform with a worked byte example
Not described
These pages follow the Geomview Object File Format manual. The explorer has no OFF viewer, so a dropped file shows as text or bytes.
Known, not yet covered
- Viewer: there is no OFF plugin.
Unknown
- Reference: whether normals take 4 or N components under the
4andnprefixes; the manual says only that normals make no sense for N-dimensional vertices.
Links
Software
- MeshLab – free open source mesh viewer and editor (Windows, macOS, Linux)
- CloudCompare – free open source point cloud and mesh tool (Windows, macOS, Linux)
- Geomview – the 3D viewer the format comes from (Linux and other Unix systems)
Developers
Reference
- OFF files – the format’s description in the Geomview manual
- Vertices – the Geomview manual’s rules for vertex data, shared by OFF
- Binary format – the Geomview manual’s rules for binary files, OFF BINARY among them