Sheet Metal Bend Calculator: A Flat Length You Can Check
Free K-factor, bend allowance and flat-length calculators backed by a tested zero-dependency Python module, so CAD flat patterns can be audited against one reference.
- Client
- Personal open-source project
- Role
- Designer and developer
- Timeline
- Oct 2026 — Oct 2026
- Stack
- Python, Browser calculators, CSV batch +2

Case study
Challenge & Solution
The problem
A CAD flat pattern is only as good as the K-factor behind it. When the K value is a guess, the blank comes out a few tenths of a millimetre off per bend, parts stop fitting and shops start writing “fudge” corrections on drawings. I wanted one place where the bend maths is written down once, can be checked by hand, and can be reused by anything that automates sheet metal.
What I built
A free, MIT-licensed toolkit for the bend maths, published as the resource Sheet Metal Bend Calculator:
- Interactive calculators for bend allowance, bend deduction, outside setback and the developed flat blank length.
- A coupon calculator that back-calculates the K your tooling really produces from one test bend.
- A K-error estimator that shows what a wrong K costs per bend and per part.
bend_calc.py, a zero-dependency Python module withbend,couponandbatchcommands and JSON output for automation.


Design decisions
| Decision | Why |
|---|---|
| One reference module | The calculators and the batch tool must agree. bend_calc.py is the source of truth and the browser tools are pinned to it by a unit test, so they cannot drift. |
| Bend angle, not included angle | The most common input mistake. The tool states the convention at every input and rejects values outside the valid range instead of guessing. |
| K limited to 0 to 0.5 | For conventional bending the neutral axis stays inside the thickness. A value outside the range almost always means a measurement or input error. |
| Audit the CAD, do not replace it | CAD owns the geometry. The module gives an independent answer to compare a flat pattern against. |
| Explain the maths first | The method is written up in Sheet Metal K-Factor Mathematics, so every number the tool prints can be reproduced by hand. |
Result
For a 2.0 mm sheet, 2.0 mm inside radius, 90° bend and K = 0.40 the tool returns a bend allowance of 4.398 mm and a bend deduction of 3.602 mm; the worked example’s developed flat blank is 76.398 mm. Those figures match the worked examples in the article.
- 8 self-tests run from the module itself.
- 0 runtime dependencies: standard-library Python.
- Batch mode reads a CSV of bends and writes results as a table or JSON, so the maths can sit inside a design-automation flow.
Limits
It covers conventional bends in millimetres and degrees. It does not model springback, hemming or tooling-specific die tables; it gives you the maths and the calibration step, not a machine setup.
Links
- Tool and download: Sheet Metal Bend Calculator resource page
- The maths: Sheet Metal K-Factor Mathematics
- Need bend or flat-pattern automation in your own CAD flow? Get in touch.
Measurable Impact
Key Outcomes & Performance
Quantified business outcomes and engineering improvements delivered.
Self-tests
Run from the module itself
Dependencies
Standard-library Python
Worked example
Flat blank for T 2.0, R 2.0, 90 deg, K 0.40
Visual Documentation
Project Gallery & Technical Visuals
High-precision 3D CAD renders, exploded assemblies, and fabrication documentation.
Process & Milestones
Engineering & Development Journey
From initial requirements gathering to precision modeling and manufacturing validation.
Write the maths
ArticleK sets bend allowance, bend allowance sets bend deduction, bend deduction sets the blank.
Build the reference module
ModulePure Python in mm and degrees, rejecting bad inputs instead of guessing.
Pin the calculators
CalculatorsA unit test keeps every browser calculator in step with the module.
Publish free
ReleaseMIT-licensed resource with sample CSV and a lead-gated download.
Technical Stack
