Skip to content

Binary Curve File Format

François Beaune edited this page Dec 5, 2018 · 7 revisions

Introduction

The purpose of the BinaryCurve file format is to store 3D curve geometry in a compact and efficient-to-read form.

Binary Curve files conventionally use the .binarycurve file extension.

File Layout

Conventions

  • All offsets are zero-based (the first byte of the file is at offset 0).
  • All offsets and lengths are expressed in bytes.
  • All multi-byte fields are using the little-endian (Intel) convention.

High-Level Structure

Field Length Field Type Description
11 string File signature. Must be equal to BINARYCURVE (in capitals) for the file to be considered valid.
2 uint16 File format version
variable composite Data block (see below)

The format of the Data block depends on the value of the Version field.

Data Block Format Version 1

Field Length Field Type Description
1 uint8 Basis: 1 = Linear, 2 = Bézier, 3 = B-spline, 4 = Catmull-Rom
4 uint32 Number of curves
4 uint32 Number of vertices of curve #1
4 float X coordinate of vertex #1
4 float Y coordinate of vertex #1
4 float Z coordinate of vertex #1
4 float X coordinate of vertex #2
...
4 float Curve width at vertex #1
4 float Curve width at vertex #2
...
4 float Curve opacity at vertex #1
4 float Curve opacity at vertex #2
...
4 float Red component of curve color at vertex #1
4 float Green component of curve color at vertex #1
4 float Blue component of curve color at vertex #1
4 float Red component of curve color at vertex #2
...
Clone this wiki locally