Format:PLY
| Magic | ply |
|---|---|
| Extensions | .ply |
| On this wiki | Facts · Code · Notes · Topics |
Polygon File Format / Stanford triangle format (.ply): a text header starting with the line "ply", a format line (ascii or binary_little_endian / binary_big_endian 1.0), element and property declarations, end_header, then the data.
Identification
The file starts with the line ply. Assimp's loader (code/AssetLib/Ply/PlyLoader.cpp, lines 205-215) accepts the first three characters in either case (ply or PLY); anything else gives "Invalid .ply file: Incorrect magic number (expected 'ply' or 'PLY')". The next line must start with format; then ascii, or a word beginning binary_ followed by little_endian or big_endian (lines 228-262; the version, normally 1.0, is not checked in the lines read). Without a format line the loader errors "Missing format specification".
Header
The header continues with comment lines, element NAME COUNT lines (for example element vertex 8) each followed by property TYPE NAME lines, or property list COUNTTYPE ITEMTYPE NAME, and ends with end_header (assimp PlyParser.cpp, lines 201-290, 420-465). Data follows right after the end_header line.
Scalar type names assimp accepts (PlyParser.cpp lines 73-105): char/int8, uchar/uint8, short/int16, ushort/uint16, int/int32, uint/uint32, float/float32, double/double64/float64. Unknown types are logged and allowed.
Property names it gives meaning to: red, green, blue, alpha, vertex_index / vertex_indices (face vertex list), texcoord, material_index and the ambient_* colour family, and the usual x y z, nx ny nz, s t.
Unverified: the loader requires vertices to be declared before faces (it errors "Vertices should be declared before faces", PlyLoader.cpp line 538).
Tools and sources
assimp (BSD-3-Clause): https://github.com/assimp/assimp
Code & repositories
- https://github.com/assimp/assimp @
f20e46b3fc1fdf9bc2675fd549d180dda06861f1· license: BSD-3-Clause (declared by the contributor for the files used; GitHub reports BSD-3-Clause (read from LICENSE; GitHub's detector did not classify it) for the repository)
Open Asset Import Library; importers in code/AssetLib read as format documentation
Tested on: source read, not run: source read only · checked 2026-10-19; last activity 2026-10-17; Note: the latest release ships binaries; the wiki links only the source, never the binaries