---
title: "STL file: facet normals and file size"
subject: "Computer Aided Design"
chapter: 6
key: "semester_4/computer_aided_design:stl-format-numerical"
source: https://www.bctengineer.com/q/semester_4/computer_aided_design/stl-format-numerical
site: BCT Engineering
---

# STL file: facet normals and file size

Computer Aided Design · Chapter 6: CAM and Recent Technology

- Asked in: year not given, 6 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/computer_aided_design/stl-format-numerical
- Whole chapter: https://www.bctengineer.com/md/semester_4/computer_aided_design/chapter-6

## Question

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.

## 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).

## Answer

#### 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:**
1. Facet orientation: the vertex order follows the right-hand rule, so the normal points outward.
2. 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.
3. All coordinates are positive in older versions; the units are not stored.
4. 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 $=48$ bytes + 2-byte attribute).

#### (a) Facets
Normal $=(\mathbf V_2-\mathbf V_1)\times(\mathbf V_3-\mathbf V_1)$ 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: $(\mathbf C-\mathbf B)=(-10,10,0)$, $(\mathbf D-\mathbf B)=(-10,0,10)$.

$$
(\mathbf C-\mathbf B)\times(\mathbf D-\mathbf B)=(10\cdot10-0,\ 0-(-10)(10),\ 0-10(-10))=(100,100,100)
$$

and $|\,\cdot\,|=173.2$, giving $0.577$ 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 $=6\times2$).

#### (b) Binary file size
$$
\text{size}=80+4+50\,N
$$

Tetrahedron, $N=4$: $80+4+200=284$ bytes.

Model with $N=12\,000$: $84+50\times12\,000=600\,084$ bytes $\approx 0.6$ 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).**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which is an STL rule?
   A. Vertices follow the right-hand rule so the normal points outward, and each edge is shared by exactly two facets
   B. Facets can be any polygon
   C. Units are stored in the file
   D. Normals must point inward
   Answer: A. A watertight mesh with outward normals by anticlockwise ordering is required. (Key point: STL rules)

2. For B(10,0,0), C(0,10,0), D(0,0,10), what is the unit normal of BCD?
   A. (0, 0, -1)
   B. (0.577, 0.577, 0.577)
   C. (1, 0, 0)
   D. (0.707, 0.707, 0)
   Answer: B. (C-B)x(D-B) = (100,100,100), magnitude 173.2, giving 0.577 each; it points away from A. (Key point: Normal of facet BCD)

3. What is the outward normal of the bottom facet ABC (z = 0)?
   A. (0, 0, 1)
   B. (0, 0, -1)
   C. (0, -1, 0)
   D. (-1, 0, 0)
   Answer: B. Ordering A, C, B gives cross product (0,0,-100), pointing down, outward from the tetrahedron. (Key point: Bottom facet normal)

4. What is the binary STL size of a model with N facets, and for N = 4?
   A. 84 + 50N; 284 bytes
   B. 80 + 50N; 280 bytes
   C. 84 + 48N; 276 bytes
   D. 50N; 200 bytes
   Answer: A. 80-byte header + 4-byte count + 50 bytes per facet gives 84+200 = 284 bytes; 12 000 facets give 600 084 bytes. (Key point: Binary file size)

## Related in Computer Aided Design

- [Rapid prototyping and additive manufacturing](https://www.bctengineer.com/question.md?key=semester_4%2Fcomputer_aided_design%3Arapid-prototyping-additive-manufacturing) — Computer Aided Design, chapter 6

## Related in other subjects

- [Fleming's right and left hand rules](https://www.bctengineer.com/question.md?key=semester_4%2Felectrical_machine%3Afleming-hand-rules) — Electrical Machine, chapter 1
- [File size: 10 s, 44.1 KHz, 16-bit stereo](https://www.bctengineer.com/question.md?key=semester_8%2Fmultimedia_system%3Aaudio-size-10s-44khz-16bit) — Multimedia System, chapter 2, asked 2×
- [Setting out right hand side composite curve](https://www.bctengineer.com/question.md?key=semester_4%2Fsurveying_ii%3Aright-hand-composite-curve-setting-out) — Surveying II, chapter 6
- [Hand tapping and tap drill size](https://www.bctengineer.com/question.md?key=semester_2%2Fworkshop_technology%3Ahand-tapping-tap-drill) — Workshop Technology, chapter 3
