PLY (file format)
PLY is a computer file format known as the Polygon File Format or the Stanford Triangle Format. It was principally designed to store three-dimensional data from 3D scanners. The data storage format supports a relatively simple description of a single object as a list of nominally flat polygons. A variety of properties can be stored, including color and transparency, surface normals, texture coordinates and data confidence values. The format permits one to have different properties for the front and back of a polygon. There are two versions of the file format, one in ASCII, the other in binary. The file formatA Ply file starts with the "header" attribute, which specifies the elements of a mesh and their types, followed by the list of elements itself. The elements are usually vertices and faces, but may include other entities such as edges, samples of range maps, and triangle strips. The header of both ASCII and binary files is ASCII text. Only the numerical data that follows the header is different between the two versions. The header always starts with a "magic number", a line containing: ply which identifies the file as a PLY file. The second line indicates which variation of the PLY format this is. It should be one of the following: format ascii 1.0 format binary_little_endian 1.0 format binary_big_endian 1.0 Future versions of the standard will change the revision number at the end - but 1.0 is the only version currently in use. Comments may be placed in the header by using the word comment This is a comment! The element vertex 12 property float x property float y property float z Other element face 10 property list uchar int vertex_index PLY implementations vary wildly in the property names. The word end_header ASCII or binary formatIn the ASCII version of the format, the vertices and faces are each described one to a line with the numbers separated by white space. In the binary version, the data is simply packed closely together at the HistoryThe PLY format was developed in the mid-90s by Greg Turk and others in the Stanford graphics lab under the direction of Marc Levoy. Its design was inspired by the Wavefront .obj format. However, the Obj format lacked extensibility for arbitrary properties and groupings, so the Example fileThe following is a full example of a PLY file which describes a cube mesh exported from Blender version 4.0.2: ply format ascii 1.0 comment Created in Blender version 4.0.2 element vertex 14 property float x property float y property float z property float nx property float ny property float nz property float s property float t element face 6 property list uchar uint vertex_indices end_header 1 1 1 0.5773503 0.5773503 0.5773503 0.625 0.5 -1 1 1 -0.5773503 0.5773503 0.5773503 0.875 0.5 -1 -1 1 -0.5773503 -0.5773503 0.5773503 0.875 0.75 1 -1 1 0.5773503 -0.5773503 0.5773503 0.625 0.75 1 -1 -1 0.5773503 -0.5773503 -0.5773503 0.375 0.75 -1 -1 1 -0.5773503 -0.5773503 0.5773503 0.625 1 -1 -1 -1 -0.5773503 -0.5773503 -0.5773503 0.375 1 -1 -1 -1 -0.5773503 -0.5773503 -0.5773503 0.375 0 -1 -1 1 -0.5773503 -0.5773503 0.5773503 0.625 0 -1 1 1 -0.5773503 0.5773503 0.5773503 0.625 0.25 -1 1 -1 -0.5773503 0.5773503 -0.5773503 0.375 0.25 -1 1 -1 -0.5773503 0.5773503 -0.5773503 0.125 0.5 1 1 -1 0.5773503 0.5773503 -0.5773503 0.375 0.5 -1 -1 -1 -0.5773503 -0.5773503 -0.5773503 0.125 0.75 4 0 1 2 3 4 4 3 5 6 4 7 8 9 10 4 11 12 4 13 4 12 0 3 4 4 10 9 0 12 The file starts with the header which defines a file in ASCII format. There are 14 vertices (6 faces * 4 vertices - 10 vertices saved due to merging) and 6 faces in total. After the header, the vertex and face data is listed. The vertex list contains position (x,y,z), normals (nx,ny,nz) and texture coordinates (s,t) for each of the 14 vertices. The face list contains the vertex count (4) and the vertex indices for each of the 6 quadrilateral faces. See also
Open source software
References
External links
|