Link Search Menu Expand Document

Qubicle Exchange Format File Specifications

The Qubicle Exchange Format is an easy to read ASCII voxel exchange format originally developed for the unreleased Qubicle Plugin for Maya

It is recommended to use Qubicle Binary instead because it supports compression and produces much smaller files.


Table of contents

  1. Data Structure
    1. Header
    2. Color Map
    3. Voxel Data
  2. Visibilty Mask

Data Structure

QEF files are divided into 3 parts: the header, the color map and the voxel data.

The first part of the header always looks like this:

Qubicle Exchange Format
Version 0.2
www.minddesk.com

It doesn’t hold any valuable information. Use it to test whether this file is really a QEF, or simply skip it.

The next line shows the size of the matrix stored in this file in X/Y/Z.

20 50 16

Color Map

QEF uses an indexed color map that contains all colors used in the following voxel data. The first line tells you how many colors are in the color map.

3

The following lines store the individual colors (in this case 3) as rgb, ranging from 0 to 1. So pure white would be 1.0 1.0 1.0 and pure black would be 0.0 0.0 0.0

0.000000 0.000000 0.000000
0.972549 0.972549 0.972549
1.000000 1.000000 1.000000

Voxel Data

The rest of the file stores all visible voxels, one voxel per line.

1 35 7 0 52
...
19 36 6 1 74
  • the first 3 values of each line are the voxel’s position in X:Y:Z.
  • the 4th value is the color index of the colormap (starting with 0).
  • the last value is the visibility mask telling you which sides of the voxel should be rendered.

Visibilty Mask

To increase render speed Qubicle internally uses a visibility mask telling the engine which of the voxel’s sides to render. To test whether a side should be rendered use this pseudo code:

if (mask && 2 == 2) // left side visible
if (mask && 4 == 4) // right side visible
if (mask && 8 == 8) // top side visible
if (mask && 16 == 16) // bottom side visible
if (mask && 32 == 32) // front side visible
if (mask && 64 == 64) // back side visible