STL Print Estimator
Command line and optional web tool to estimate filament usage and print time for STL files using configurable printer settings.
Quick start (CLI)
python estimator.py --config printer-config.json --output-format csv --out estimates.csv
python estimator.py --config printer-config.json --output-format xlsx --out estimates.xlsx
Defaults:
- Reads all
.stlfiles in the current directory (non-recursive). - Writes
estimates.csv,estimates.json, orestimates.xlsxif--outis not provided. - XLSX output requires
openpyxl(installed viapip install -r requirements.txt).
Web interface
pip install -r requirements.txt
python estimator.py --serve --port 5000 --config printer-config.json --output-format csv
Open http://localhost:5000, upload a single STL or a ZIP containing multiple STLs, choose CSV, JSON, or XLSX, and optionally tick “Provide download” to get the generated file.
Configuration
Printer settings live in a JSON file (default printer-config.json):
{
"layer_height_mm": 0.2,
"nozzle_diameter_mm": 0.4,
"perimeter_count": 2,
"top_layers": 4,
"bottom_layers": 4,
"infill_density": 0.25,
"perimeter_speed_mm_s": 40.0,
"infill_speed_mm_s": 60.0,
"travel_speed_mm_s": 120.0,
"filament_diameter_mm": 1.75,
"filament_density_g_cm3": 1.24,
"travel_factor": 0.1
}
Adjust values to match your machine and material. travel_factor is the fraction of extrusion distance added as travel moves for the time estimate.
Notes on estimates
- Volume and surface area are computed directly from the STL triangles (binary or ASCII).
- Shell volume is approximated from surface area and perimeter thickness; infill volume is scaled by
infill_density. - Print time is a heuristic using perimeter/infill/travel speeds; real slicer output will differ.
XLSX layout
- The spreadsheet has columns for File, Filament Length (mm), Filament Mass (g), Estimated Print Time (min), and a time string in hr/min.
- Totals are placed in columns F/G with formulas: total filament mass (SUM of column C) and total time (SUM of column D converted to hr/min via the same formula used per row).
Examples
- JSON output:
python estimator.py -f json -o result.json - Use a custom config:
python estimator.py -c my-printer.json - Serve on a different port:
python estimator.py --serve --port 8080
Description
Languages
Python
97.2%
Batchfile
2.8%