- Practice · 6 marks
STL file: facet normals and file size
Short answer
The four facets with outward normals computed by right-hand rule are (0,0,-1), (0,-1,0), (-1,0,0), (0.577,0.577,0.577). Binary STL file size = 84 + 50N bytes; for tetrahedron N=4 yields 284 bytes, for 12,000 facets yields 600,084 bytes (about 0.6 MB).
Explain the STL file format used for rapid prototyping, including its rules. A tetrahedron has vertices A(0,0,0), B(10,0,0), C(0,10,0) and D(0,0,10) mm. (a) List its four triangular facets with outward normals computed by the right-hand rule. (b) Find the size of the binary STL file of this tetrahedron, and of a model with 12 000 facets.
STL format
STL describes the surface of a solid by a mesh of triangular facets. Each facet stores the unit normal and three vertex coordinates (in anticlockwise order seen from outside). There are two types: ASCII (readable, large) and binary (compact).
Rules:
- Facet orientation: the vertex order follows the right-hand rule, so the normal points outward.
- Vertex-to-vertex rule: each facet must share two vertices with each adjacent facet (no vertex may lie on another facet's edge), and each edge is shared by exactly two facets, so the mesh is watertight with no gaps.
- All coordinates are positive in older versions; the units are not stored.
- Finer facets give a smoother surface but a larger file (chordal tolerance control).
Binary layout: 80-byte header, 4-byte facet count, then 50 bytes per facet (12 floats bytes + 2-byte attribute).
(a) Facets
Normal with vertices ordered anticlockwise from outside.
| Facet | Vertices (order) | Cross product | Unit normal |
|---|---|---|---|
| ABC (bottom, z=0) | A, C, B | (0, 0, -100) | (0, 0, -1) |
| ABD (side, y=0) | A, B, D | (0, -100, 0) | (0, -1, 0) |
| ACD (side, x=0) | A, D, C | (-100, 0, 0) | (-1, 0, 0) |
| BCD (slanted) | B, C, D | (100, 100, 100) | (0.577, 0.577, 0.577) |
Example for facet BCD: , .
and , giving for each component. It points away from A, so it is outward.
Check: each edge appears in exactly two facets (6 edges, 4 faces, 12 edge uses ).
(b) Binary file size
Tetrahedron, : bytes.
Model with : bytes MB.
Answer: normals (0,0,-1), (0,-1,0), (-1,0,0), (0.577,0.577,0.577); file sizes 284 bytes and 600 084 bytes (about 0.6 MB).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Rapid prototyping and additive manufacturing · Computer Aided Design, chapter 6
- Fleming's right and left hand rules · Electrical Machine, chapter 1
- File size: 10 s, 44.1 KHz, 16-bit stereo · Multimedia System, chapter 2 · asked 2×
- Setting out right hand side composite curve · Surveying II, chapter 6
- Hand tapping and tap drill size · Workshop Technology, chapter 3