Unfolding Sheet-Metal Parts#
Lay a sheet-metal part flat: the blank it is cut from, where the press brake folds it, and what the press forms after cutting.
Note
Prerequisites: Sheet Metal Shapes and Sheet Metal Features
What the blank is#
A sheet-metal part is a flat sheet that was cut, then bent and pressed. The blank is that sheet before any of it happened: one side of the part’s skin developed onto a plane. Flat faces keep their shape; every fold is opened out to the length of sheet it consumed, whether a bend, a hem folded back over the sheet or a curl rolled at its edge.
Bending stretches the outside of a bend and compresses its inside. Somewhere between the
two lies a layer that keeps its length, the neutral layer, and that is the length the
blank must supply. Where that layer sits is given by the K-factor: its distance from
the inside of the bend, as a fraction of the sheet thickness. A bend is developed at its
neutral radius, inside_radius + k_factor * thickness; the length of that arc is the
bend’s allowance. The thickness and each bend’s inside radius are read off the part;
the K-factor depends on the material and the tooling, so it is yours to give. The default,
0.33, puts the neutral layer a third of the way in from the inside of the bend;
Bend allowance and the K-factor explains what the value means and how to choose it.
Every value on the result is plain 2D geometry in the part’s own length unit, with angles in radians, and refers back to the part by face index.
Unfolding a part#
from volmdlr.model import VolumeModel
from volmdlr_tools.features.core import FeatureProcessor
from volmdlr_tools.features.unfold.dxf import write_dxf
part = VolumeModel.from_step("bracket.step").primitives[0]
pattern = FeatureProcessor(part).unfold(k_factor=0.44)
print(pattern.area, len(pattern.bend_lines))
write_dxf(pattern, "bracket_blank.dxf")
unfold() recognises the part’s
sheet-metal features first if that has not been done, apart from the processor’s own results (a
call to extract_blends or extract_cavities before it still stands afterwards), then returns a
FlatPattern:
blank: the cut outline, an outer contour and its holes;bend_lines: oneBendLineper fold: bend, hem or curl;slits: cuts with no width, where two edges of the outline lie on each other once flat;forming_marks: oneFormingMarkper formed feature;face_placements: the outline of each developed face on the blank, by face index;k_factor,thicknessandfixed_face: what the blank was developed with;length_unit: the unit every length is in, that of the part (metres when it was read from a file).
area is the blank’s area with its holes taken out, and bounding_rectangle is the
rectangle, at any angle, that holds it with none of the blank outside, curved outlines
included: its width is the longer side and its height the shorter.
The blank is developed from one face, which stays where it is; by default the largest face
of the largest flange. Pass fixed_face to choose another flat face. It must be a flat
face of the sheet outside every bend and formed feature, or a ValueError is raised, as
it is for a K-factor outside 0 to 1.
The fixed face also chooses the side of the sheet that is developed, but not the size of its holes: a hole is cut at its narrowest opening through the thickness. A hole whose walls are not square to the sheet opens wider on one side than on the other, and the blank takes the narrower opening whichever side is developed: the bore of a countersunk hole, the side of a chamfered hole without the chamfer, the inside opening of a slot cut through a bend with walls fanning out from the bend’s axis. The outer contour is the developed side’s.
A hole that is narrowest inside the sheet, such as one countersunk from both sides, is cut at the smaller of its two openings: an opening that reaches neither side of the sheet is not seen. A hole keeps its opening on the developed side when its other opening cannot be read: when its walls do not reach the other side of the sheet, as where a stiffener meets it; when the other opening does not close; when it cannot be laid onto the blank, because no developed face lies one thickness across from it; or when it does not lie within the developed one.
Except in the last case, where the other opening was read and is simply not the narrower,
such a hole is an unplaced hole: the blank cuts it at the developed side’s opening, which
is too wide if the hole is countersunk, chamfered or tapered on that side. The unfold does not
drop it silently. pattern.unplaced_holes lists each one with the faces of its wall, a
reason and a note explaining it in plain words:
no_other_sideThe hole’s walls never reach the other side of the sheet.
no_counterpartThe face the walls meet on the other side has no developed face one thickness across from it.
does_not_lie_flatThat face does not lie flat onto the developed face across from it.
open_outlineThe other opening does not close into a single contour.
An empty list means every hole was cut at its narrowest opening.
pattern = FeatureProcessor(part).unfold()
for hole in pattern.unplaced_holes:
print(hole.faces, hole.reason, hole.note)
For costing and nesting,
BlankMeasurement unfolds the part
and records the blank’s area and the nesting rectangle’s nesting_width and
nesting_height. A part that does not unfold gives no values; its reason and note
say why, so a batch of parts can be measured without stopping at the first refusal.
flagged counts the formed features whose hole to pierce the blank leaves to the forming
tool, such as a collar too tall for its footprint (see Formed features), and
unplaced_holes counts the unplaced holes, cut at the developed side’s opening.
from volmdlr_tools.features.measurements import BlankMeasurement
measurement = BlankMeasurement.from_processor(FeatureProcessor(part), k_factor=0.44)
print(measurement.area, measurement.nesting_width, measurement.nesting_height)
Bend lines and directions#
The blank is seen from outside its developed side: that side’s outward normal points at
the viewer. Each bend line is the centre line of a bend on the blank, from start to
end, and carries:
angle: the included turn of the material, in radians;direction:"up"when the sheet folds toward the viewer,"down"when it folds away;inside_radius,thicknessandk_factor: what the bend was developed with;allowance: the length of flat sheet the bend consumes;bend_nodes: the bend’s faces on the part.
Bend allowance and the K-factor#
Bending stretches the outside of a bend and compresses its inside. Between the two, one layer of the sheet keeps its length: the neutral layer. In the flat sheet it sits at mid-thickness; bending pushes it towards the inside of the bend. The blank has to supply the length of that layer, so every bend is developed along it.
(Source code, png, hires.png, pdf)
A bend in cross-section. The neutral layer (dashed) sits \(K\,t\) from the inside face; its arc across the bend (thick) is the bend allowance.#
The K-factor says where the neutral layer is: its distance from the inside face of the bend, divided by the thickness \(t\). With the bend’s inside radius \(r\) and its angle \(\theta\) in radians (the angle the sheet turns through, as each bend line reports it), the neutral layer’s radius and the length of its arc, the bend allowance, are
The unfold keeps every flat face as it is and opens every bend out to its allowance. Along a run of flanges and bends, the blank is therefore as long as the flat lengths of the flanges, each measured between the lines where its bends begin, plus one allowance per bend:
A flat length is not the outside dimension a drawing usually gives. An outside dimension runs to the corner where the outside faces of two flanges would meet, which lies \((r + t)\tan(\theta/2)\) beyond the start of the bend: \(r + t\) for a 90 degree bend. Subtract it for every bend a dimension ends at.
Choosing the K-factor#
K lies between about 0.3 and 0.5. At 0.5 the neutral layer is at mid-thickness, as in the unbent sheet. A tight bend, with an inside radius small next to the thickness, pushes it towards the inside, down to about 0.3; as \(r/t\) grows, K comes back towards 0.5. The material, its temper and the way it is bent move it too. Typical values for air bending mild steel, as a shop rule of thumb rather than a standard:
\(r/t\) |
typical K |
|---|---|
below 1 |
about 0.33 |
1 to 3 |
about 0.40 |
above 3 |
about 0.50 |
The default, 0.33, suits most air-bent steel with an inside radius close to the
thickness. For another material or other tooling, pass the value your shop measured: bend
a test strip of known blank length and measure its flat lengths: the blank length less the
flat lengths is the allowance, from which \(K = (BA/\theta - r)/t\).
The unfold takes one K-factor for the whole part: every bend, and the collar of every extrusion hole, is developed with it. A table of K-factors per bend is not supported, so on a part whose bends call for different values the blank is only as close as the K-factor is to each of them.
Worked example#
An L-bracket of 2 mm sheet with one 90 degree bend of inside radius 2 mm (\(r/t = 1\)), dimensioned 40 mm by 30 mm to its outside corner. Each outside dimension runs \(r + t = 4\) mm past the start of the bend, so the flat lengths are 36 mm and 26 mm: 62 mm in all. The bend turns through \(\theta = \pi/2\).
K |
neutral radius \(r + K\,t\) |
bend allowance |
blank length |
|---|---|---|---|
0.33 |
2.66 mm |
4.178 mm |
66.178 mm |
0.5 |
3.00 mm |
4.712 mm |
66.712 mm |
The two blanks differ by \(\pi/2 \times 0.17 \times 2 = 0.534\) mm, the whole of it in the bend. On a part with four such bends the difference grows to 2.136 mm.
Passing the K-factor#
import math
from volmdlr_tools.features.unfold import bend_allowance
processor = FeatureProcessor(part)
pattern = processor.unfold() # K = 0.33
measured = processor.unfold(k_factor=0.42) # the value your shop measured
for line in measured.bend_lines:
print(math.degrees(line.angle), line.inside_radius, line.k_factor, line.allowance)
# The allowance of the worked example's bend, at the default K-factor: 4.178...
bend_allowance(inside_radius=2.0, bend_angle=math.pi / 2, thickness=2.0, k_factor=0.33)
The same k_factor argument is taken by
BlankMeasurement.from_processor.
The K-factor a blank was developed with is recorded on the
FlatPattern, on each bend line and in
the drawing’s bend notes.
Formed features#
An emboss, a dimple, a bead, a louvre and an extrusion hole are pressed after the blank is cut, so the blank is flat where they sit. Each one leaves:
its footprint, the flat region of the blank it is pressed from, which is part of the blank;
a forming mark for the press: the feature type, the footprint’s centre and principal direction, the depth the formed skin leaves the sheet’s plane by, the side it rises toward (
"up"toward the viewer of the blank), the footprint’s outline and the feature’s faces;a slit wherever the sheet was sheared, such as along a louvre’s opening.
An extrusion hole is drawn from a smaller hole pierced in its footprint. The mark’s
pre_hole is that hole, and it is cut in the blank. Its size is an estimate that
assumes the collar is only bent, not stretched: it shares the footprint’s centre, and its
radius is the footprint’s radius less the length of the collar’s profile on its neutral
layer. A collar that thins as it is drawn takes less sheet, so its hole to pierce is
larger than this estimate.
A collar at least as long on its neutral layer as its footprint’s radius leaves no hole to
pierce by bending alone: drawing it stretches the sheet, by an amount that depends on the
forming tool. Such a collar is flagged, not refused. The blank is still produced, with
no hole there: its footprint is sheet, whole. Its mark has no pre_hole; its
pre_hole_issue is "collar_too_tall" and its pre_hole_note gives the collar’s
length on its neutral layer and the footprint’s radius. The hole to pierce must come from
the forming tool’s maker or a trial. pattern.flagged_marks lists every flagged mark,
and the drawing writes PRE-HOLE: SET BY TOOLING under each one’s label.
pattern = FeatureProcessor(part).unfold()
for mark in pattern.flagged_marks:
print(mark.feature_nodes, mark.pre_hole_note)
A formed feature must meet one flat stretch of sheet along a single closed loop. The unfold refuses one that:
reaches the edge of the sheet;
lies across a bend;
sits on another formed feature;
meets the sheet along more than one loop.
A flanged cutout that is neither an extrusion hole nor a louvre is refused, since there is no known blank to cut for it.
When a part does not unfold#
A part that cannot be laid flat raises
UnfoldError. Its reason says what
stopped the unfold, its faces say where, and its message explains in plain words.
not_sheet_metalThe part is not recognised as sheet metal, is built in a way sheet-metal recognition does not support (a formed feature or rib that meets the sheet along sharp edges instead of bends), or its thickness cannot be measured. Check the part with Sheet Metal Shapes first. The reverse also happens: a thick machined block that the recognition accepts as a sheet is laid flat like one, so check that the
thicknesson the result is a sheet’s before trusting its blank.non_developableSome of the sheet has no known flat shape. This covers:
curved faces of the sheet that belong to no recognised fold (bend, hem or curl) or formed feature. A fold is recognised only when the faces across the sheet’s thickness beside it are split where it starts and ends, as sheet-metal design tools write them. A part drawn as one section and extruded has each side wall as a single face, fold and all, so its folds are not recognised and the refusal names them;
a sheet with no flat face to develop from;
faces not connected to the fixed face through the sheet, or parted from it by the edges passed as
cut_edges;a fold with no measured inside radius or angle, a fold measured thicker or thinner than the sheet, or folds claiming the same faces that disagree on their radius or angle;
a formed feature that reaches the sheet’s edge, lies across a bend, sits on another formed feature or meets the sheet along more than one loop;
a flanged cutout that is neither an extrusion hole nor a louvre;
an extrusion hole whose collar is not round, not on both sides of the sheet or not turned about its axis. A collar too tall for its footprint is not refused: it is flagged (see Formed features).
The named faces are where to look.
closed_loopThe sheet closes on itself, as a tube or a box with its corners joined does, so it cannot lie flat without a cut.
candidate_cut_edgeslists the edges any one of which would open the loop, most likely first. Pass one of them ascut_edgesto make that cut. Cutting an edge parts the two faces it runs between along every edge they share; where the two sides of a cut land on each other once flat, the blank shows a slit.from volmdlr_tools.features.unfold import UnfoldError processor = FeatureProcessor(part) try: pattern = processor.unfold() except UnfoldError as error: if error.reason != "closed_loop": raise pattern = processor.unfold(cut_edges=error.candidate_cut_edges[:1])
overlapLaid flat, parts of the sheet land on each other, so the part cannot be cut from one blank as it stands. The faces whose outlines cross are named. If a cut produced the overlap, another of the candidate edges may not.
placement_mismatchTwo neighbouring faces do not line up along the edges they share once flat, or the outline does not close. The named faces are where the part’s geometry disagrees with itself.
Writing a DXF#
write_dxf() writes the blank as a DXF drawing for
the cutter and the press brake. It needs the optional dxf extra:
pip install 'volmdlr_tools[dxf]'
The drawing is laid out on layers:
OUTLINE: the cut outline, outer contour and every hole, pre-holes included;SLIT: the slits;BEND_UPandBEND_DOWN: the bend lines, dashed, by direction;BEND_NOTES: a note at each bend line, giving its angle in degrees, direction, inside radius and K-factor;FORMING: each formed feature’s footprint and a label with its type, side and depth; under the label of a flagged mark,PRE-HOLE: SET BY TOOLING.
units is the drawing’s unit: "mm" (the default), "m" or "in". Every length is
converted into it from the unit the pattern is in, pattern.length_unit, so a part read
in metres is drawn in millimetres with no scale to give. A part that is not in metres says
so when it is unfolded, unfold(length_unit="mm"). Lines, circles and circular arcs are written exactly.
Free-form curves are written exactly too, unless spline_tolerance is given: they are
then written as polylines that stray from the curve by no more than that distance, in the
drawing’s units, for cutters that accept only lines and arcs. Any other curve is written as
a polyline that strays from it by no more than a ten-thousandth of the blank’s longer side.
See Also#
Sheet Metal Shapes - Sheet metal recognition
Sheet Metal Features - Bends and formed features