feature: Add windows batch file, add support for xlsx output

This commit is contained in:
Keith Solomon
2025-12-07 17:31:43 -06:00
parent 4bd45bf2de
commit 26fa801aca
5 changed files with 211 additions and 14 deletions

View File

@@ -6,11 +6,14 @@ Command line and optional web tool to estimate filament usage and print time for
```bash
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 `.stl` files in the current directory (non-recursive).
- Writes `estimates.csv` or `estimates.json` if `--out` is not provided.
- Writes `estimates.csv`, `estimates.json`, or `estimates.xlsx` if `--out` is not provided.
- XLSX output requires `openpyxl` (installed via `pip install -r requirements.txt`).
## Web interface
@@ -19,7 +22,7 @@ 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 or JSON, and optionally tick “Provide download” to get the generated file.
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
@@ -50,6 +53,11 @@ Adjust values to match your machine and material. `travel_factor` is the fractio
- 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`