![]() |
Industrial
Centre |
|
|
The binary format uses the IEEE integer and floating point numerical representation. Binary (.STL) files are organized as an 84 byte header followed by 50-byte
A facet entry begins with the x,y,z components of the triangle's face normal vector. The normal vector points in a direction away from the surface and it should be normalized to unit length. The x,y,z coordinates of the triangle's three vertices come next. They are stored in CCW order when viewing the facet from outside the surface. The direction of the normal vector follows the "right-hand-rule" when traversing the triangle vertices from 1 to 3, i.e., with the fingers of your right hand curled in the direction of vertex 1 to 2 to 3, your thumb points in the direction of the surface normal. Notice that each facet entry is 50 bytes. So adding the 84 bytes in the header space, a binary file should have a size in bytes = 84 + (number of facets) * 50. Notice the 2 extra bytes thrown in at the end of each entry to make it a nice even 50. 50 is a nice number for people, but not for most 32-bit computers because they store values on 4-byte boundaries. Therefore, when writing programs to read and write .STL files the programmer has to take care to design data structures that accommodate this problem. The recent introduction of colour RP introduced the need for a 'colour STL' extension. One of these proposed extension make use of the 2 padding bytes to store the RGB data. Click here to see the definition of the extension. To read an .stl file into a 'big-endian' machine, one would use an 'inverse' AcknowledgementPart of this introduction is an excerpt from technical documentation of Ennex Corporation and other sources. For more detail or full version of the Ennex document, contact www.Ennex.com
|
|
|