A Faceted STL Cylinder: Measuring Volume Error Before Export
A cylinder can have the expected width, depth and height while its STL representation is almost 10% short on volume. A small reproducible example shows why a bounding-box check alone cannot validate an export.
Affiliation: This guide is published on behalf of CADProps and was prepared with AI assistance. The numbers below describe synthetic geometry, not a customer case study or a benchmark of CADProps.
1. Define the reference shape
Take a solid circular cylinder with radius r = 10 mm and height h = 20 mm. Its ideal volume is:
V_ref = π × r² × h = 6,283.185307 mm³.
Now replace its circular cross-section with a regular n-sided polygon whose vertices lie on the circle. Extrude that polygon through the same height, cap both ends and triangulate every face. This is a closed polygonal prism that can be represented by STL.
The Library of Congress describes STL as a triangular surface representation. In this example the flat faces connect points on the original cylinder, so they cut inside its curved surface. The missing volume is a geometric approximation error, even when the mesh is perfectly closed.
2. Derive the expected mesh volume
Split the polygon into n triangles from its center. Each triangle has area r² × sin(2π/n) ÷ 2. Multiplying their combined area by height gives:
V_n = (n ÷ 2) × r² × sin(2π/n) × h.
The relative volume deficit is:
Deficit (%) = 100 × [1 − n × sin(2π/n) ÷ (2π)].
Angles in these formulas are in radians. With r = 10 mm and h = 20 mm:
8 sides: 5,656.854249 mm³, or 9.968368% below the reference.
16 sides: 6,122.934918 mm³, or 2.550464% below.
32 sides: 6,242.890305 mm³, or 0.641315% below.
64 sides: 6,273.096981 mm³, or 0.160561% below.
128 sides: 6,280.662314 mm³, or 0.040155% below.
These values were checked both with the polygon formula and by summing signed tetrahedral volumes over a triangulated, capped prism.
3. Notice what an extents check misses
Place a polygon vertex on the positive X axis. For every side count above, vertices also lie on the other three coordinate-axis directions. All five prisms therefore have the same 20 × 20 × 20 mm axis-aligned bounding box as the ideal cylinder.
The eight-sided model passes that dimensions check while losing almost one tenth of the intended volume. Smooth shading can make faceting less obvious, but does not change the triangular geometry.
A second useful quantity is the maximum inward gap at the midpoint of a polygon edge:
Gap = r × [1 − cos(π/n)].
At 32 sides this gap is about 0.048153 mm, while the volume deficit is about 0.641315%. A distance tolerance and a percentage-volume tolerance answer different questions.
4. Reproduce the calculation without special software
In a spreadsheet, put the side count in A2, radius in B2 and height in C2. Use these formulas:
Reference volume: =PI()*B2^2*C2
Polygon-prism volume: =A2/2*B2^2*SIN(2*PI()/A2)*C2
Deficit percent: =100*(1-A2*SIN(2*PI()/A2)/(2*PI()))
Try 8, 16, 32, 64 and 128 in column A. Then increase radius or height. Volume changes, but this particular relative deficit depends only on n.
5. Apply the lesson to a real export
Keep the source model and establish its valid closed-solid volume before exporting.
Record the units, selected bodies and export settings. Check a known dimension after import.
Inspect mesh closure, winding and self-intersections before interpreting mesh volume.
Export again with finer tessellation and compare both volume and the small features that matter. Choose acceptance limits for the actual use.
Keep representation and measurement method beside the result. A preview can use triangles even when a separate property calculation uses source B-Rep geometry.
This inscribed-prism result is not a universal error bound for STL files. Real exporters may use nonuniform triangles; holes, curved ends, repairs and other geometry can change both the size and direction of error. More triangles alone do not establish validity or manufacturing suitability.
For the related distinction between source-solid properties and display-mesh measurements, see CADProps’ measurement accuracy notes. CADProps uploads files for server processing, so do not upload confidential geometry without permission. This worked example can be checked independently of any online service.