The conventional suffix for
VECT files is .vect.
VECT NPolylines NVertices NColors Nv ... Nv[NPolylines-1] # number of vertices # in each polyline Nc ... Nc[NPolylines-1] # number of colors supplied # in each polyline Vert ... Vert[NVertices-1] # All the vertices # (3*NVertices floats) Color ... Color[NColors-1] # All the colors # (4*NColors floats, RGBA)
VECT objects represent lists of polylines (strings of connected
line segments, possibly closed). A degenerate polyline can be used to
represent a point.
VECT file begins with the key word
and three integers: NLines, NVertices, and NColors.
Here NLines is the number of polylines in the file,
NVertices the total number of vertices, and NColors the
number of colors as explained below.
Next come NLines 16-bit integers
giving the number of vertices in each polyline. A negative number indicates a closed polyline; 1 denotes a single-pixel point. The sum (of absolute values) of the Nv[i] must equal NVertices.
Next come NLines more 16-bit integers Nc[i]: the number of colors in each polyline. Normally one of three values:
Next come NVertices groups of 3 or 4 floating-point numbers: the coordinates of all the vertices. If the keyword is 4VECT then there are 4 values per vertex. The first abs(Nv) of them form the first polyline, the next abs(Nv) form the second and so on.
Finally NColors groups of 4 floating-point numbers give red, green, blue and alpha (opacity) values. The first Nc of them apply to the first polyline, and so on.
A VECT BINARY format is accepted; see Binary format. The binary format exactly follows the ASCII format, with 32-bit Big-Endian integers where ordinary integer numbers appear, and with 16-bit Big-Endian integers where 16-bit integers appear; 32-bit Big-Endian floats where real values appear. BIG FAT NOTE: The vertex counts Nv[i] and the color counts Nc[i] are 16-bit Big-Endian integers.