cost_estimate
Calculate per-unit manufacturing cost from volume, material, process, and quantity, factoring material, machine, setup, and amortized tooling expenses.
Instructions
Per-unit cost rollup (Design for Cost). material_cost = volume·density·price ·(1+scrap) from the Materials DB (process: cnc | fdm | casting | injection). process_cost = amortized setup + per-process machine time; tooling amortized over quantity, so unit_cost falls as quantity rises. The machine-time table is order-of-magnitude (fidelity='correlation', band_pct=100) — trust the ratios between processes/quantities, not the absolute dollars; material_cost alone is exact given its inputs.
material may be any Materials-DB card name (material_list / material_get), or
anything at all if you price it yourself: price_usd_kg and density_kg_m3
override the DB lookup and are flagged in breakdown.price_basis /
density_basis as 'explicit' instead of 'material'. A generic word like
'aluminum' is a CATEGORY, not a card — it carries a density but no price, so it
needs price_usd_kg or a real card name (AL6061-T6, …); the error says which.
Two optional inputs sharpen it. tolerance_class ('IT7', '9', …) scales the
TABLE machine time by the tolerance-cost curve (see tolerance_cost_check):
holding tighter than the process's natural capability roughly doubles cost every
1.5 IT grades. machine_time_hr REPLACES the table with a time a real model
computed (cnc_time_estimate) and drops band_pct from 100 to that model's band
(50 by default, or machine_time_band_pct); the tolerance factor is then not
applied again, because cnc_time_estimate already applied the same curve.
Both default to None, reproducing the pre-existing behaviour exactly.
Returns {material_cost, process_cost, tooling_amortized, unit_cost, mass_kg, fidelity, band_pct, breakdown:{…, density_kg_m3, price_usd_kg, density_basis, price_basis, machine_time_hr, machine_time_basis, base_machine_time_hr, tolerance_class, tolerance_factor, tolerance_applied, tolerance_basis}}. Errors on a material with no usable density/price and no override, an unknown process/tolerance class, or a non-positive volume/quantity/machine time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| process | No | cnc | |
| material | Yes | ||
| quantity | No | ||
| setup_min | No | ||
| volume_mm3 | Yes | ||
| tooling_usd | No | ||
| price_usd_kg | No | ||
| density_kg_m3 | No | ||
| scrap_fraction | No | ||
| machine_time_hr | No | ||
| tolerance_class | No | ||
| machine_rate_usd_hr | No | ||
| machine_time_band_pct | No |