off file format (Object File Format)

off file format (Object File Format)

This article translated Princeton Shape Benchmark, the original address http://shape.cs.princeton.edu/benchmark/documentation/off_format.html

Object File Format (off) file to represent the geometry of a surface of the object described by the model polygon. The polygon may contain any number of vertices. Princeton Shape Benchmark's off file comply with the following criteria:

1, off the file as an ASCII file, beginning with the keyword OFF.

2, the next line is the number of vertices of the model, the number of faces and edges. The number of edges can be ignored, the model will not be affected (may be zero).

3, vertices x, y, z coordinate lists, one row for each vertex.

4, after the target list is a list of vertices, each face one row. For each side, comprising a number of vertices specified first, followed by the surface of each vertex included in the previous vertex index list.

Namely the following format:

OFF

Number of edges Number of points top surface

x y z

x y z

Index n vertices vertices of vertex indices 1 ... 2 n vertices index

The following is an example of a cube:

OFF 
8 6 0 
-0.500000 -0.500000 0.500000 
0.500000 -0.500000 0.500000 
-0.500000 0.500000 0.500000 
0.500000 0.500000 0.500000 
-0.500000 0.500000 -0.500000 
0.500000 0.500000 -0.500000 
-0.500000 -0.500000 -0.500000 
0.500000 -0.500000 -0.500000 
4 0 1 3 2 
4 2 3 5 4 
4 4 5 7 6 
4 6 7 1 0 
4 1 7 5 3 
4 6 0 2 4

Published 29 original articles · won praise 23 · views 10000 +

Guess you like

Origin blog.csdn.net/sunshine04/article/details/102961566