Parquet Schemas

OMF uses several different types of arrays. Most types accept more than one Parquet schema, allowing flexibility on the types used.

The sections below describe each array type and give the accepted schema for it.

Take care when using 32-bit floating point values for vertex locations. They will make file sizes smaller, but it's easy to lose precision. When converting 64-bit floating-point to 32-bit you should calculate and subtract the center point from all vertex locations, then store that offset in the element origin field.

Using 8-bit or 16-bit unsigned integers won't affect the file size, because Parquet already compresses those efficiently. It will still help applications loading the file, letting them use the smaller type when loading the data without needing to check maximum values first.

Scalar

Floating-point scalar values.

message schema {
  REQUIRED FLOAT scalar;
}

message schema {
  REQUIRED DOUBLE scalar;
}

Vertex

Vertex locations in 3D. Add the project and element origins.

message schema {
  REQUIRED FLOAT x;
  REQUIRED FLOAT y;
  REQUIRED FLOAT z;
}

message schema {
  REQUIRED DOUBLE x;
  REQUIRED DOUBLE y;
  REQUIRED DOUBLE z;
}

Segment

Line segments as indices into a vertex array.

message schema {
  REQUIRED INT32 a (INTEGER(32,false));
  REQUIRED INT32 b (INTEGER(32,false));
}

Triangle

Triangles as indices into a vertex array. Triangle winding should be counter-clockwise around an outward-pointing normal

message schema {
  REQUIRED INT32 a (INTEGER(32,false));
  REQUIRED INT32 b (INTEGER(32,false));
  REQUIRED INT32 c (INTEGER(32,false));
}

Name

Non-nullable category names. These should be unique and non-empty.

message schema {
  REQUIRED BYTE_ARRAY name (STRING);
}

Gradient

Non-nullable colormap or category colors.

message schema {
  REQUIRED INT32 r (INTEGER(8,false));
  REQUIRED INT32 g (INTEGER(8,false));
  REQUIRED INT32 b (INTEGER(8,false));
  REQUIRED INT32 a (INTEGER(8,false));
}

Texcoord

UV texture coordinates. Values outside [0, 1] should cause the texture to wrap.

message schema {
  REQUIRED FLOAT u;
  REQUIRED FLOAT v;
}

message schema {
  REQUIRED DOUBLE u;
  REQUIRED DOUBLE v;
}

Boundary

Discrete color-map boundaries. If the inclusive column is true then the boundary is less than or equal to the value, otherwise it is less the value.

message schema {
  REQUIRED FLOAT value;
  REQUIRED BOOLEAN inclusive;
}

message schema {
  REQUIRED DOUBLE value;
  REQUIRED BOOLEAN inclusive;
}

message schema {
  REQUIRED INT64 value;
  REQUIRED BOOLEAN inclusive;
}

message schema {
  REQUIRED INT32 value (DATE);
  REQUIRED BOOLEAN inclusive;
}

message schema {
  REQUIRED INT64 value (TIMESTAMP(MICROS,true));
  REQUIRED BOOLEAN inclusive;
}

RegularSubblock

Parent indices and corners of regular sub-blocks. These sub-blocks lie on a regular grid within their parent block and defined by integer indices on that grid.

message schema {
  REQUIRED INT32 parent_u (INTEGER(32,false));
  REQUIRED INT32 parent_v (INTEGER(32,false));
  REQUIRED INT32 parent_w (INTEGER(32,false));
  REQUIRED INT32 corner_min_u (INTEGER(32,false));
  REQUIRED INT32 corner_min_v (INTEGER(32,false));
  REQUIRED INT32 corner_min_w (INTEGER(32,false));
  REQUIRED INT32 corner_max_u (INTEGER(32,false));
  REQUIRED INT32 corner_max_v (INTEGER(32,false));
  REQUIRED INT32 corner_max_w (INTEGER(32,false));
}

FreeformSubblock

Parent indices and corners of free-form sub-blocks. These sub-blocks can be anywhere within their parent block and are defined relative to it.

message schema {
  REQUIRED INT32 parent_u (INTEGER(32,false));
  REQUIRED INT32 parent_v (INTEGER(32,false));
  REQUIRED INT32 parent_w (INTEGER(32,false));
  REQUIRED FLOAT corner_min_u;
  REQUIRED FLOAT corner_min_v;
  REQUIRED FLOAT corner_min_w;
  REQUIRED FLOAT corner_max_u;
  REQUIRED FLOAT corner_max_v;
  REQUIRED FLOAT corner_max_w;
}

message schema {
  REQUIRED INT32 parent_u (INTEGER(32,false));
  REQUIRED INT32 parent_v (INTEGER(32,false));
  REQUIRED INT32 parent_w (INTEGER(32,false));
  REQUIRED DOUBLE corner_min_u;
  REQUIRED DOUBLE corner_min_v;
  REQUIRED DOUBLE corner_min_w;
  REQUIRED DOUBLE corner_max_u;
  REQUIRED DOUBLE corner_max_v;
  REQUIRED DOUBLE corner_max_w;
}

Number

Nullable number values, which can be floating-point, signed integer, date, or date-time. Date-time must be in UTC with microsecond precision.

message schema {
  OPTIONAL FLOAT number;
}

message schema {
  OPTIONAL DOUBLE number;
}

message schema {
  OPTIONAL INT64 number;
}

message schema {
  OPTIONAL INT32 number (DATE);
}

message schema {
  OPTIONAL INT64 number (TIMESTAMP(MICROS,true));
}

Index

Nullable category index values.

message schema {
  OPTIONAL INT32 index (INTEGER(32,false));
}

Vector

Nullable 2D or 3D vectors.

message schema {
  OPTIONAL group vector {
    REQUIRED FLOAT x;
    REQUIRED FLOAT y;
  }
}

message schema {
  OPTIONAL group vector {
    REQUIRED DOUBLE x;
    REQUIRED DOUBLE y;
  }
}

message schema {
  OPTIONAL group vector {
    REQUIRED FLOAT x;
    REQUIRED FLOAT y;
    REQUIRED FLOAT z;
  }
}

message schema {
  OPTIONAL group vector {
    REQUIRED DOUBLE x;
    REQUIRED DOUBLE y;
    REQUIRED DOUBLE z;
  }
}

Text

Nullable text. Some application may treat null as equivalent to an empty string.

message schema {
  OPTIONAL BYTE_ARRAY text (STRING);
}

Boolean

Nullable booleans. The values are optional, allowing them to be true, false, or null. Applications that don't support three-valued logic may treat null as false.

message schema {
  OPTIONAL BOOLEAN bool;
}

Color

Nullable colors, in 8-bit RGB or RGBA. Omitting the alpha column out is equivalent to setting all alpha values to 255.

message schema {
  OPTIONAL group color {
    REQUIRED INT32 r (INTEGER(8,false));
    REQUIRED INT32 g (INTEGER(8,false));
    REQUIRED INT32 b (INTEGER(8,false));
    REQUIRED INT32 a (INTEGER(8,false));
  }
}