CAD Automation

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
Sheet Metal Bend Calculator: A Flat Length You Can Check

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 with bend, coupon and batch commands and JSON output for automation.
From a flat-length question to a checked tool: define the problem, write the maths, build the module, pin the calculators with a testFrom a flat-length question to a checked tool: define the problem, write the maths, build the module, pin the calculators with a test
Each step produces something the next one can be tested against.

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.

Measurable Impact

Key Outcomes & Performance

Quantified business outcomes and engineering improvements delivered.

8

Self-tests

Run from the module itself

0

Dependencies

Standard-library Python

76.398 mm

Worked example

Flat blank for T 2.0, R 2.0, 90 deg, K 0.40

Process & Milestones

Engineering & Development Journey

From initial requirements gathering to precision modeling and manufacturing validation.

Write the maths

Article

K sets bend allowance, bend allowance sets bend deduction, bend deduction sets the blank.

Build the reference module

Module

Pure Python in mm and degrees, rejecting bad inputs instead of guessing.

Pin the calculators

Calculators

A unit test keeps every browser calculator in step with the module.

Publish free

Release

MIT-licensed resource with sample CSV and a lead-gated download.

Technical Stack

Technologies, Tools & Frameworks

Python
Browser calculators
CSV batch
JSON output
Unit tests