You are on page 1of 3

Exchange Format for Geometries

Pawel, Henrik, Gerardo, Alex, Richard and Pierre


August 30, 2012

1 Introduction
The purpose of this document is to provide the basis for an exchange format for geometries so various
modelling environment and image digitisation software can exchange shapes labelled with simulation/data
analysis results.
The basic data structure to be exchanged are 2D and 3D cell complexes. The exact shape of each cell
can either be left to the reader, or specified (e.g. simplicial subdivision). Other extensions will be agreed
on when the need arises.

2 Basics of the file format


The file format is an extension of the PLY file format, in which more elements are defined compared to
the default.

2.1 Basics of the PLY file format.


The PLY file format is split in two parts: a human-readable header describing the content of the file, and
the body, that contains the values given as ASCII or binary.
The order in which the elements are specified is unimportant and readers should be able to re-order
the elements as suited.

2.2 Header.
The header has the following structure:

ply
format [FORMAT] [VERSION]
comment [COMMENT]
element [TYPE] [NUMBER]
property [TYPE] [NAME]
...
end_header

The two first lines must correspond to the ones above. Comments may appear anywhere and should
simply be ignored. The order in which the element appears defines their order of appearance in the body
of the file. As for the properties, they are attached to the last element described, and their order define
the order in correspond to their order in the body of the file.
The format must be one of ascii, binary_little_endian or binary_big_endian and be followed
by a version number. The present document will be using the version 1.0.
Properties can be either single values or lists. The types accepted are listed in table 1. In the case of
lists, the syntax become:
property list [TYPE_SIZE] [TYPE_VALUE] [NAME]

Where TYPE_SIZE is the type used to give the number of values and TYPE_VALUE the type of the values
in the list.

1
name type number of bytes
char character 1
uchar unsigned character 1
short short integer 2
ushort unsigned short integer 2
int integer 4
uint unsigned integer 4
float single-precision float 4
double double-precision float 8

Table 1: Valid property types

Element Description
vertex 0D cells
edge 1D cells
face 2D cells
volume 3D cells

Table 2: List of available elements

2.3 Standard elements.


The standard defines 2 types of elements: vertices and faces. And they should appear in that order. The
faces are defined by the ordered list of vertices defining the polygons. The minimum valid header for a
polygon mesh is then:
ply
format [FORMAT] 1.0
element vertex [NB_VERTEX]
property float x
property float y
property float z
element face [NB_FACES]
property list uchar int vertex_index
end_header
The full list of elements and their properties can be found in table 2 and 3.

2.4 Subdivision elements.


Any element of dimension 1 or greater, the cells might be subdivided, or at least their shape can be
defined by other means. For this, we can add subdivision elements, that will specify the shapes. In
general, the subdivided element is called subX, where X can be edge, face or volume. Table 4 defines the
properties suggested.

Element Property Type Description


x float Position x
vertex y float Position y
z float Position z
source uint 0-base vertex id of the source of the edge
edge
target uint 0-based vertex id of the target of the edge
face vertex index list uint List of 0-based vertex ids defining the polygon
volume face index list int List of signed 1-based face ids defining the
face. The sign of the face id define the rel-
ative orientation of the face w.r.t the volume

Table 3: List of mandatory properties per element.

2
Name Type Description
id uint 0-based id of the subdivided cell
type uchar Type of subdivision

Table 4: Properties for subdivided cells

You might also like