Next: , Previous: VECT, Up: Object File Formats


4.2.7 SKEL Files

SKEL files represent collections of points and polylines, with shared vertices. The conventional suffix for SKEL files is .skel.

Syntax:

     [C][4][n]SKEL
     [NDim]                    # Vertex dimension, present only if nSKEL
     NVertices  NPolylines
     
     x[0]  y[0]  z[0]  # Vertices
     				    # if 4SKEL, each vertex has 4 components
     				    # if nSKEL, each vertex has NDim components
                                         # if C[4][n]SKEL vertex coordinates are
                                         # followed by an RGBA color specification
     ...
     x[NVertices-1]  y[NVertices-1]  z[NVertices-1]
     
                             # Polylines
                             # Nv = # vertices on this polyline (1 = point)
                             # v[0] ... v[Nv-1]: vertex indices                        #               in range 0..NVertices-1
     Nv  v[0] v[1] ... v[Nv-1]  [colorspec]
     ...
                             # colorspec continues past v[Nv-1]
                             # to end-of-line; may be nothing, or 3 or 4 numbers.
                             # nothing: default color
     			# 3 or 4 floats: RGB[A] values 0..1

The syntax resembles that of OFF files, with a table of vertices followed by a sequence of polyline descriptions, each referring to vertices by index in the table. Each polyline has an optional color.

For nSKEL objects, each vertex has NDim components. For 4nSKEL objects, each vertex has NDim+1 components; the final component is the homogeneous divisor.

A [4][n]SKEL BINARY format is accepted; See Binary format. It resembles the ASCII format in almost the way you'd expect, with 32-bit integers for all counters and vertex indices and 32-bit floats for vertex positions.

Exception: each polyline's vertex indices are followed by an integer indicating how many color components accompany it. Polyline color components must be floats, not integer values. Thus a colorless polyline with 3 vertices might be represented as

     int int int int int
     3   17   5   9   0

while the same polyline colored red might be

     int int int int int float float float float
      3  17   5   9   4   1.0   0.0   0.0   1.0