Introduction
PLY was designed at Stanford University in the 1990s to store data from 3D scanners.
Every PLY file opens with the line ply and a text header that declares
the elements the file holds and the properties of each. The header does not say what
the file is for, and that is why one extension covers several different things: a
polygon mesh, a scanned point cloud, and three kinds of Gaussian splat scene, which
are ordinary PLY files whose vertices carry the parameters of a splat instead of a
position and a colour.
A program tells them apart by reading the header. The file explorer on this site does the same: it chooses the kind from the element and property names, opens the file in that kind’s own view and names the kind in the first row of the overview, with the reason.
Variations
| Format | Variation | About | Open |
|---|---|---|---|
.PLY | 3D Gaussian Splatting PLY | The training code’s splat layout: one float vertex a splat, 248 bytes at degree 3. | Open |
.PLY | Polygon File Format | Stanford’s mesh and point cloud format, with a header that declares every property. | Open |
.PLY | PlayCanvas compressed PLY | Chunks of 256 splats with ranges, and four packed words a splat. | Open |
.PLY | 2D Gaussian Splatting PLY | The same layout with two scales: flat discs instead of ellipsoids, 244 bytes at degree 3. | Open |
Polygon File Format
The original: a text header, then elements such as vertex and
face in ASCII or binary. It holds meshes, scanned point clouds, scanner
range grids, triangle strips, edges and materials. Any file that is none of the
three splat kinds below is read as this one.
How to tell it apart: it is the default. A header with a vertex
element and a face or tristrips element, or one with only
positions and colours, or one with a range_grid element, is a polygon
file.
3D Gaussian Splatting PLY
The layout of the Inria training code: one vertex element of float
properties, with the position, the colour as spherical harmonics, an opacity, three
scales and a rotation quaternion for each splat.
How to tell it apart: the vertex element has f_dc_0,
opacity, scale_0, scale_1,
scale_2 and rot_0, and there is no chunk
element.
2D Gaussian Splatting PLY
The layout of the 2D Gaussian Splatting training code, which fits flat discs, or surfels, to a scene so that the surface can be extracted. It is the 3D layout with one scale property fewer: a disc has two radii and no thickness.
How to tell it apart: the same names as the 3D layout, but only
scale_0 and scale_1. A file with scale_2 is
the 3D layout.
PlayCanvas compressed PLY
A smaller layout from PlayCanvas’s SuperSplat editor and splat-transform tool. Splats are grouped in chunks of 256, each chunk with the ranges of its positions, scales and colours, and each splat is four packed 32-bit words.
How to tell it apart: a chunk element with min_x to
max_scale_z, and a vertex element of
packed_position, packed_rotation,
packed_scale and packed_color.
When the header fits two kinds
The header decides, but a header can fit two readings. A file whose vertices have
the splat properties and which also has a face element is a valid
polygon file (its vertices are points with extra properties) and a valid splat scene
at the same time. Nothing in the bytes says which the author meant. Tools that write
such files exist: a splat scene that has been meshed keeps its splat vertices and
gains faces.
The explorer shows the file as a splat scene, because the splat property names are specific and a polygon file that happens to use them is unlikely, and it adds the option Read it as at the top of the window: Gaussian splats (the default) or Polygon file. The option appears only for such a file. In the polygon reading the vertices are drawn as points and the faces as a mesh; in the splat reading the faces are listed but not drawn.
A file that has the compressed layout and faces is treated the same way. The overview’s first row, Kind of PLY file, says which reading is on.
Sources
- The polygon kind: Greg Turk’s description of the format, as kept by Paul Bourke.
- The 3D layout:
construct_list_of_attributesandsave_plyin gaussian-splatting. - The 2D layout: the same two functions in 2d-gaussian-splatting, where the scale array has two columns.
- The compressed layout: PlayCanvas’s splat-transform.
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)
- SuperSplat – PlayCanvas’s free open source splat editor (web)
Developers
- plyfile – reads and writes PLY with NumPy (Python)
- gaussian-splatting – Inria’s training code, which defined the 3D splat layout (Python, C++, CUDA)
- 2d-gaussian-splatting – the 2D training code (Python, C++, CUDA)
Reference
- PLY - Polygon File Format – Paul Bourke’s copy of the description by Greg Turk