Sometimes I have to put text on a path

Friday, May 23, 2008

STL binary

Binary STL


Because ASCII STL files can become very large, a binary version of STL exists. A binary STL file has an 80 character header (which is generally ignored - but which should never begin with 'solid' because that will lead most software to assume that this is an ASCII STL file). Following the header is a 4 byte unsigned integer indicating the number of triangular facets in the file. Following that is data describing each triangle in turn. The file simply ends after the last triangle.

Each triangle is described by twelve floating point numbers: three for the normal and then three for the X/Y/Z coordinate of each vertex - just as with the ASCII version of STL. After the twelve floats there is a two byte unsigned 'short' integer that is the 'attribute byte count' - in the standard format, this should be zero because most software does not understand anything else.

Floating point numbers are represented as IEEE floating point numbers and the endianness is assumed to be little endian although this is not stated in documentation.

--------

No comments:

Post a Comment