Divide the cost of the batch by the number of usable parts, not by the number that came off the bed. If you quote before printing, budget for failed attempts and keep one-time setup separate from costs you repeat for every attempt.
Start with the slicer, then check what it left out
Start with the filament weight and print time from the sliced file. Include supports and purge material if they aren’t already in the estimate. Add electricity using average measured power, not the power supply’s maximum rating. Add a separate allowance for machine time and the hands-on time you spend loading, removing supports, or inspecting the part.
A ten-part example
Suppose each full attempt costs €3 in material, power and machine time. You print 12 attempts to get 10 usable parts, then spend €4 once on setup. At that full-attempt allowance the batch costs 12 × €3 + €4 = €40, or €4 per usable part. If both failures stopped early, replace their €3 allowances with actual costs when you know them.
Use your own failure log
A first-layer failure and a failure near the end don’t consume the same material. Keep a short log with the printer, material, failure stage and usable yield. Use a past job with similar geometry for the next estimate. Treat the estimate as a production cost; add packaging, fees, taxes or margin separately if you’re quoting a client.
Use the Filament Workbench calculator to compare two plans before committing to a run.
