Tools · 2024 · 09 — 7 min read
Building the Sheet Metal Unfolder in GHPython
Building a sheet-metal unfolder from scratch in GHPython — geometry, k-factor, and DXF export, one decision at a time.
Commercial unfolding tools exist, but building your own teaches you exactly what the operation is — and lets you bend it to the way you actually work. This is the shape of the GHPython tool behind AMD NSRI.
Walking the faces
Unfolding is a traversal problem. Pick a base face, then walk to each adjacent face across its shared edge, rotating it flat into the base plane. Repeat until every face has been laid down. The data structure that matters is the adjacency graph; get that right and the geometry follows.
Folding the k-factor in
At each shared edge, the bend allowance is inserted so the flat pattern reserves the right amount of material for the fold. This is where the k-factor enters the code — not as an afterthought, but as a parameter on every edge transition.
Out to the floor
The last step is export. Flattened outlines, fold lines on a separate layer, and bend annotations write out to DXF — the format the laser and the press brake actually read. From model to machine in one definition.