PLY (file format)

Last updated
Polygon File Format
Filename extension
.ply
Internet media type
text/plain
Type code ASCII/Binary file
Magic number ply
Developed by Greg Turk, Stanford University
Initial release1994 [1]
Type of format3D model 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.

Contents

There are two versions of the file format, one in ASCII, the other in binary.

The file format

A 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 at the start of the line. Everything from there until the end of the line should then be ignored. e.g.:

comment This is a comment!

The element keyword introduces a description of how some particular data elements are stored and how many of them there are. Hence, in a file where there are 12 vertices, each represented as a floating point (X,Y,Z) triple, one would expect to see:

element vertex 12 property float x property float y property float z

Other property lines might indicate that colours or other data items are stored at each vertex and indicate the data type of that information. Regarding the data type, there are two variants depending on the source of the ply file. The type can be specified with one of char uchar short ushort int uint float double, or one of int8 uint8 int16 uint16 int32 uint32 float32 float64. For an object with ten polygonal faces, one might see:

element face 10 property list uchar int vertex_index

PLY implementations vary wildly in the property names. vertex_indices is more often used than vertex_index, for example in Blender and VTK. The extended specification lists a "Core List (required)", "Second List (often used)" and "Third List (suggested extensions)" of property names. [2]

The word list indicates that the data is a list of values, the first of which is the number of entries in the list (represented as a 'uchar' in this case). In this example each list entry is represented as an 'int'. At the end of the header, there must always be the line:

end_header

ASCII or binary format

In 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 endianness specified in the header and with the data types given in the property records. For the common property list... representation for polygons, the first number for that element is the number of vertices that the polygon has and the remaining numbers are the indices of those vertices in the preceding vertex list.

History

The 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 property and element keywords were devised to generalize the notions of vertices, faces, associated data, and other groups.

Example file

The 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

Related Research Articles

<span class="mw-page-title-main">ACIS</span> Geometric modeling kernel developed by Spatial Corporation

The 3D ACIS Modeler (ACIS) is a geometric modeling kernel developed by Spatial Corporation, part of Dassault Systemes. ACIS is used by many software developers in industries such as computer-aided design (CAD), computer-aided manufacturing (CAM), computer-aided engineering (CAE), architecture, engineering and construction (AEC), coordinate-measuring machine (CMM), 3D animation, and shipbuilding. ACIS provides software developers and manufacturers the underlying 3D modeling functionality.

<span class="mw-page-title-main">Polygon mesh</span> Set of polygons to define a 3D model

In 3D computer graphics and solid modeling, a polygon mesh is a collection of vertices, edges and faces that defines the shape of a polyhedral object. The faces usually consist of triangles, quadrilaterals (quads), or other simple convex polygons (n-gons), since this simplifies rendering, but may also be more generally composed of concave polygons, or even polygons with holes.

Netpbm is an open-source package of graphics programs and a programming library. It is used mainly in the Unix world, where one can find it included in all major open-source operating system distributions, but also works on Microsoft Windows, macOS, and other operating systems.

OBJ is a geometry definition file format first developed by Wavefront Technologies for its Advanced Visualizer animation package. The file format is open and has been adopted by other 3D graphics application vendors.

<span class="mw-page-title-main">Polygonal modeling</span> Object modeling method

In 3D computer graphics, polygonal modeling is an approach for modeling objects by representing or approximating their surfaces using polygon meshes. Polygonal modeling is well suited to scanline rendering and is therefore the method of choice for real-time computer graphics. Alternate methods of representing 3D objects include NURBS surfaces, subdivision surfaces, and equation-based representations used in ray tracers.

<span class="mw-page-title-main">Winged edge</span> Data structure for representing polygon meshes in computer memory

In computer graphics, the winged edge data structure is a way to represent polygon meshes in computer memory. It is a type of boundary representation and describes both the geometry and topology of a model. Three types of records are used: vertex records, edge records, and face records. Given a reference to an edge record, one can answer several types of adjacency queries in constant time. This kind of adjacency information is useful for algorithms such as subdivision surface.

<span class="mw-page-title-main">STL (file format)</span> File format for stereolithography applications

STL is a file format native to the stereolithography CAD software created by 3D Systems. Chuck Hull, the inventor of stereolithography and 3D Systems’ founder, reports that the file extension is an abbreviation for stereolithography.

<span class="mw-page-title-main">Shapefile</span> Geospatial vector data format

The shapefile format is a geospatial vector data format for geographic information system (GIS) software. It is developed and regulated by Esri as a mostly open specification for data interoperability among Esri and other GIS software products. The shapefile format can spatially describe vector features: points, lines, and polygons, representing, for example, water wells, rivers, and lakes. Each item usually has attributes that describe it, such as name or temperature.

3DXML is a proprietary 3D file format developed by Dassault Systemes under its 3DVIA Brand. It uses an XML container whose specifications were published. It should not be confused with X3D, the ISO standard XML-based file format for representing 3D computer graphics.

<span class="mw-page-title-main">MeshLab</span>

MeshLab is a 3D mesh processing software system that is oriented to the management and processing of unstructured large meshes and provides a set of tools for editing, cleaning, healing, inspecting, rendering, and converting these kinds of meshes. MeshLab is free and open-source software, subject to the requirements of the GNU General Public License (GPL), version 2 or later, and is used as both a complete package and a library powering other software. It is well known in the more technical fields of 3D development and data handling.

<span class="mw-page-title-main">Seamless3d</span> Open source 3D modeling software

Seamless3d is an open-source 3D modeling software available under the MIT license.

3DS is one of the file formats used by the Autodesk 3ds Max 3D modeling, animation and rendering software.

OpenCTM is a 3D geometry technology for storing triangle-based meshes in a compact format.

<span class="mw-page-title-main">Point Cloud Library</span> Open-source algorithm library

The Point Cloud Library (PCL) is an open-source library of algorithms for point cloud processing tasks and 3D geometry processing, such as occur in three-dimensional computer vision. The library contains algorithms for filtering, feature estimation, surface reconstruction, 3D registration, model fitting, object recognition, and segmentation. Each module is implemented as a smaller library that can be compiled separately. PCL has its own data format for storing point clouds - PCD, but also allows datasets to be loaded and saved in many other formats. It is written in C++ and released under the BSD license.

Additive manufacturing file format (AMF) is an open standard for describing objects for additive manufacturing processes such as 3D printing. The official ISO/ASTM 52915:2016 standard is an XML-based format designed to allow any computer-aided design software to describe the shape and composition of any 3D object to be fabricated on any 3D printer via a computer-aided manufacturing software. Unlike its predecessor STL format, AMF has native support for color, materials, lattices, and constellations.

OFF is a geometry definition file format containing the description of the composing polygons of a geometric object. It can store 2D or 3D objects, and simple extensions allow it to represent higher-dimensional objects as well. Though originally developed for Geomview, a geometry visualization software, other software has adapted the simple standard.

The Esri TIN format is a popular yet proprietary geospatial vector data format for geographic information system (GIS) software for storing elevation data as a triangulated irregular network. It is developed and regulated by Esri, US. The Esri TIN format can spatially describe elevation information including breaking edge features. Each points and triangle can carry a tag information. A TIN stored in this file format can have any shape, cover multiple regions and contain holes.

This is a glossary of terms relating to computer graphics.

glTF 3D scene and model file format

glTF is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions: .gltf (JSON/ASCII) or .glb (binary). Both .gltf and .glb files may reference external binary and texture resources. Alternatively, both formats may be self-contained by directly embedding binary data buffers. An open standard developed and maintained by the Khronos Group, it supports 3D model geometry, appearance, scene graph hierarchy, and animation. It is intended to be a streamlined, interoperable format for the delivery of 3D assets, while minimizing file size and runtime processing by apps. As such, its creators have described it as the "JPEG of 3D."

JMesh is a JSON-based portable and extensible file format for the storage and interchange of unstructured geometric data, including discretized geometries such as triangular and tetrahedral meshes, parametric geometries such as NURBS curves and surfaces, and constructive geometries such as constructive solid geometry (CGS) of shape primitives and meshes. Built upon the JData specification, a JMesh file utilizes the JSON and Universal Binary JSON (UBJSON) constructs to serialize and encode geometric data structures, therefore, it can be directly processed by most existing JSON and UBJSON parsers. The JMesh specification defines a list of JSON-compatible constructs to encode geometric data, including N-dimensional (ND) vertices, curves, surfaces, solid elements, shape primitives, their interactions and spatial relations, together with their associated properties, such as numerical values, colors, normals, materials, textures and other properties related to graphics data manipulation, 3-D fabrication, computer graphics rendering and animations.

References

  1. Greg Turk. "The PLY Polygon File Format". Archived from the original on 2016-12-04.
  2. Greg Turk. "The PLY Polygon File Format (extended)" (PDF).