Introduction
PLY, also called the Stanford Triangle Format, was designed at Stanford University in the 1990s to store data from 3D scanners. A text header declares which elements the file holds, such as vertices and faces, and which properties each one has, such as a position, a colour or a normal. This makes it a common format for scanned meshes and point clouds with colour.
This page describes the Polygon File Format itself. The same extension is also used for Gaussian splat scenes, which are PLY files with their own layouts; the PLY overview says how to tell them apart.
The data after the header is written in one of three encodings, named in the header: ASCII text, binary little-endian or binary big-endian. The header itself is the same text in all three.
Structure
The file opens with a text header. Its first line is ply, and the
format line says whether the data is ASCII, binary little-endian or binary
big-endian. Each element line gives a name and a count, and the
property lines under it list the values every item carries, with their
types. A property list holds a count followed by that many values, which
is how faces list their vertex numbers. end_header closes the header, and
the data follows in the order declared.
ply
format ascii 1.0
comment one coloured triangle
element vertex 3
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
element face 1
property list uchar int vertex_indices
end_header
0 0 0 255 0 0
1 0 0 0 255 0
0 1 0 0 0 255
3 0 1 2
In this reference
- Header – every header keyword, the scalar types, list properties and the usual element names
- Data encodings – how the ASCII and the two binary encodings store the elements, with a worked byte example, and the damaged cases
- Names later programs use – normals, colours, texture coordinates, triangle strips
- Range grids, cameras and textures – the scanner’s
range_grid, thecameraelement,TextureFile,texcoordandtexnumber, with the layouts checked on real files
Variants
Other kinds of file that use the extension .ply:
- Polygon File Format – meshes, point clouds and scanner grids with a header that declares every property
- 3D Gaussian Splatting PLY – the training code’s splat layout: one float vertex a splat, 248 bytes at degree 3
- 2D Gaussian Splatting PLY – the same layout with two scales: flat discs, 244 bytes at degree 3
- PlayCanvas compressed PLY – chunks of 256 splats with ranges, and four packed words a splat
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)
- Blender – free open source 3D suite that imports and exports PLY (Windows, macOS, Linux)
Developers
Reference
- PLY - Polygon File Format – Paul Bourke’s copy of the description by Greg Turk
- Blender’s PLY importer and exporter – source: vertex names, tristrips and the face fallbacks