Skip to main content

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:

  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=48 bytes + 2-byte attribute).

(a) Facets

Normal =(V2−V1)×(V3−V1)=(\mathbf V_2-\mathbf V_1)\times(\mathbf V_3-\mathbf V_1) with vertices ordered anticlockwise from outside.

FacetVertices (order)Cross productUnit 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: (C−B)=(−10,10,0)(\mathbf C-\mathbf B)=(-10,10,0), (D−B)=(−10,0,10)(\mathbf D-\mathbf B)=(-10,0,10).

(C−B)×(D−B)=(10⋅10−0, 0−(−10)(10), 0−10(−10))=(100,100,100)(\mathbf C-\mathbf B)\times(\mathbf D-\mathbf B)=(10\cdot10-0,\ 0-(-10)(10),\ 0-10(-10))=(100,100,100)

and ∣ ⋅ ∣=173.2|\,\cdot\,|=173.2, giving 0.5770.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×2=6\times2).

(b) Binary file size

size=80+4+50 N\text{size}=80+4+50\,N

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

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

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Aided Design chapter 6 questions →