Skip to main content

Flanges and hems

A flange is a strip of sheet bent up off an edge: the walls of a tray, the leg of a bracket, the lip that stiffens a panel. A hem is an edge folded back on itself, to hide a sharp cut edge, to stiffen it, or to give a lid something to hold on to. Both bend off a straight edge of a region's inside face, and both are new regions joined to it by bends.

One flange and its options​

bitbybit.occt.fabrication.sheetMetal.flange takes the part, the region's inside face and one of its straight edges, then the flange's angle (degrees from flat, 90 by default) and length. Pick the face with insideFace and the edge with insideEdgeToward or insideEdgeNearest, so the script still finds the right edge when the part's size changes.

Three flanges: short, tapered and turned downThree flanges: short, tapered and turned down, back view
Three flanges: short, tapered and turned down, below viewThree flanges: short, tapered and turned down, below back view
Bitbybit Platform

Three flanges: short, tapered and turned down in Rete

Rete

Length. A drawing dimensions a flange to the outer sharp, the corner the flange's outer face would make with the base's outer face if the bend had no radius, and that is what length means by default. lengthReference can measure it to the innerSharp instead, or to the tangent, where the bend ends and the straight run begins. The same flange measured three ways comes out three lengths, so set it to how your drawing dimensions it.

Where the bend sits. position places the bend against the edge. materialInside, the default, keeps the flange's outer face flush with the edge, so the part's outside size is the blank's. materialOutside puts the flange's inner face on the edge, and bendOutside starts the bend at the edge, growing the part by the bend.

A partial flange and its reliefs. extentStart and extentEnd stop the flange short of the edge's two ends (a negative extent runs past them). Where it stops short, a relief is notched beside the bend: the short flange above stops 20 from each end, and its reliefs are the part's relief setting, obround, set once on the plate. A flange's own relief, reliefWidth and reliefDepth override the part's for that flange.

Tapered sides. startSideAngle and endSideAngle slant the flange's two sides, positive widening it toward its free edge and negative narrowing it, as the tapered flange does; startSideOffset and endSideOffset say the same by how much wider the free end is. taperFrom starts the slant where the bend ends (tangent, the default, so the bend keeps square ends) or at the edge (edge, so the slant runs through the bend).

Direction and angle. direction set to down bends the flange away from the side the inside face looks at, as the lip does at 120 degrees. Any angle between 0 and 180 is a flange; a hem is the fold past that.

A shaped end. outline replaces the last run's rectangle with a closed wire drawn in the plane z = 0, x running along the edge from its start and y away from the bend, for a flange with a shaped end; it replaces length and the extents.

The roles of a flange are end (its free end face), sides (the faces through the thickness at both ends of its span, its bend's and its run's), legEnds (the run's two flat end faces, which closeCorner takes), reliefs, and rim.1 onward for a tapered or outlined run. A role lists its faces in the order of the part's faces, which says nothing of which end is which, so pick one end with bitbybit.occt.fabrication.sheetMetal.endFaceToward, by the direction it lies in.

Flanges of several bends​

profile adds further bends and straight runs after a flange's first: a list of segments, each made by bitbybit.occt.fabrication.sheetMetal.create.flangeSegment from an angle (negative turns the other way), a length and an optional bendRadius. A Z-shaped flange, a return or a stepped flange is then one call.

A Z flange and a return, each from a profileA Z flange and a return, each from a profile, back view
A Z flange and a return, each from a profile, side viewA Z flange and a return, each from a profile, below view
Bitbybit Platform

A Z flange and a return, each from a profile in Rete

Rete

The zFlange rises 25 off the right edge, then turns back by 90 degrees (angle: -90) and runs 20 outward: a Z whose last run is a mounting face 25 up, outside the base's outline. The return rises 30 off the left edge and turns 90 degrees on, inward over the base, a 12 lip that stiffens the wall's free edge. Each segment adds a region and a bend to its flange, zFlange.2 and zFlange.b2, return.2 and return.b2, and its bendRadius, left out here, is the part's.

Mitred flanges round a plate​

bitbybit.occt.fabrication.sheetMetal.flanges bends a flange off each of several edges of one inside face in a single call. Where two of them share a corner they meet mitred, cut on the line that halves the corner with a small gap between them, the way a shop makes a tray from one blank, and the bends' shared square is cleared by a corner relief.

A tray of four mitred flangesA tray of four mitred flanges, below view
Bitbybit Platform

A tray of four mitred flanges in Rete

Rete

The edges here are every edge of the inside face, from bitbybit.occt.shapes.edge.getEdges; any subset of straight edges works, and flanges that do not share a corner simply do not meet. Each runs its edge's whole length. The corner relief is the part's cornerRelief, circular in this example and set on the plate, with cornerReliefSize its diameter. The regions are named wall, wall.2 and on in the order of edges, and the corner seams wall.m1 and on. Each flange keeps a flange's roles as its own, numbered from 1 in the order of edges: 1.end, 1.sides, 1.legEnds, 1.reliefs and on to 4.legEnds here, beside corners, the faces of the corner reliefs.

Mitred flanges suit a tray whose corners stay open or are welded. When the corners must be closed by one flange overlapping the next, bend them one at a time and close the corners afterwards, as joining and corners shows.

Hems​

bitbybit.occt.fabrication.sheetMetal.hem folds a straight edge back over the sheet. It takes the same part, inside face and edge as a flange, and a style:

  • closed folds the edge back flat onto the sheet, a tenth of the thickness apart: the safe, stiff edge of a panel. length runs from the fold's outside to the free edge, 10 when left out.
  • open does the same with a gap between the layers, which it needs, for a panel that slides over another or takes a wire.
  • teardrop folds past a half turn round a radius, then runs straight back toward the sheet. Given no length, the run is as long as fits before it would meet the sheet; a length longer than that is refused with the longest that fits, rounded down, such as "a teardrop hem's run reaches at most 4.54558 here before it meets the sheet". It leaves a rounded, open edge that does not crack the way a tight closed hem can.
  • rolled is the fold alone, round a radius and through an angle (225 degrees unless given), a curled edge; it takes no length.
  • double rolls the edge over twice, the second fold tighter, so the cut edge is tucked between the layers and hidden.

The tray below has five walls, mitred round a pentagon floor, and each wall's top edge is hemmed in one of the five styles:

A pentagon tray with a different hem on every wallA pentagon tray with a different hem on every wall, back view
Bitbybit Platform

A pentagon tray with a different hem on every wall in Rete

Rete

A hem folds inward over the wall it is on, so at a corner it heads for the neighbouring wall and for that wall's hem. The closed hem on wall and the teardrop on wall.3 do not share a corner, and beside a wall with no hem yet a hem fits, so these two run their edges' whole length. The open hem, the rolled edge and the double hem each share a corner with one of them, and at full length the hems would cross there. A hem that would touch the sheet anywhere it does not join it is refused; at full length, the open hem here is refused with:

sheetMetal.hem: the hem would touch the sheet where it does not join it, such as a neighbouring wall, flange or hem at a corner; stop it short of the corner with extents, or shorten it

So the other three stop 6 short of each corner with extentStart and extentEnd, as a shop would: two hems folded inward cannot both run into one corner. Where a hem stops short, it is relieved as a flange is, by the part's relief unless it sets its own. The order matters only for what is already there when a hem is folded: the full-length hems go first, and each later one is checked against them.

direction set to up, the default, folds the hem over the inside face; down over the outside face. position keeps the fold inside the sheet's outline (inside, its outer face flush with the edge) or starts it at the edge (outside). A hem's roles are a flange's: its end, its sides, its legEnds and its reliefs.