How to Accurately Calculate 3D Printing Filament Weight and Part Cost from STL Files
Published on November 18, 2026
Whether you run an on-demand 3D printing farm or manage internal prototyping budgets, quoting parts by guesswork leads to eroded margins. Estimating the exact mass and material cost of an STL or STEP part before slicing comes down to three physical variables: manifold solid volume, effective infill factor, and polymer specific gravity.
1. Computing Exact Volume from a Triangle Mesh
An STL file only defines the outer boundary surface of a 3D model, not its interior. To calculate the enclosed solid volume, geometry engines use the Signed Tetrahedron Volume method:
For every triangle face with vertices v1, v2, v3, the algorithm forms a tetrahedron anchored at the coordinate origin (0, 0, 0) and computes its signed volume:
V_triangle = (1 / 6) * dot(v1, cross(v2, v3))
Summing these signed volumes across all triangles in a closed (watertight) mesh yields the exact solid volume in cubic millimeters, which divides by 1,000 to give cubic centimeters (cm³).
2. Accounting for Perimeters and Infill Density
Unlike CNC machining from solid billet, FDM 3D prints are rarely 100% solid. However, setting your slicer to 20% infill does not mean the part uses 20% of its solid volume. Outer wall perimeters, top layers, and bottom solid layers are printed at 100% density to provide structural rigidity and surface finish.
Across typical mechanical brackets and enclosures, solid perimeter shells account for roughly 12% to 18% of total part volume, while the remaining interior core scales linearly with your chosen infill percentage:
Effective_Volume = Total_Volume * (0.15 + 0.85 * Infill_Ratio)
For stereolithography (SLA/MSLA) resin printing or direct metal laser sintering (DMLS) where parts are cured solid without internal honeycombs, the infill ratio equals 100% (1.0).
3. Material Density (Specific Gravity) Reference Table
Once effective volume (cm³) is known, multiply it by the material density (g/cm³) to obtain part mass in grams:
| Material | Density (g/cm³) | Typical Spool / Resin Cost | Common Engineering Application |
|---|---|---|---|
| PLA (Polylactic Acid) | 1.24 g/cm³ | $18 – $25 / kg | Visual prototypes, fit-check jigs, low-temp fixtures |
| PETG | 1.27 g/cm³ | $22 – $30 / kg | Functional enclosures, chemical-resistant brackets |
| ABS / ASA | 1.04 g/cm³ | $24 – $35 / kg | High-temperature automotive & outdoor components |
| Standard UV Resin | 1.15 g/cm³ | $30 – $45 / kg | High-detail micro-parts, smooth surface masters |
| Aluminum 6061 (CNC) | 2.70 g/cm³ | $10 – $15 / kg (Raw stock) | Structural aerospace & industrial automation frames |
4. Instant Browser-Based Cost Estimation
Instead of opening a slicer for every single customer inquiry, you can drop any STL or STEP file into our 3D Print Cost & Weight Calculator to immediately inspect X-Y-Z bounding dimensions, toggle between PLA, ABS, PETG, Resin, or Aluminum, and calculate material cost per part.
100% client-side processing. No sign-up or file upload required.