Sheet Metal Modelling in Bitbybit: Parts Made the Way a Shop Makes Them

Most enclosures, brackets, ducts and chassis are made the same way. A flat blank is cut from sheet of one thickness, bent on a press brake, its edges folded over, its corners closed, and holes and stiffening shapes punched or pressed into it. Bitbybit now models parts in exactly that vocabulary. You do not draw a solid and hope it can be made from sheet: you start a part from a flat face or a profile, then bend, fold, close and stamp it, and every step keeps it a part of one thickness.
It is bitbybit.occt.fabrication.sheetMetal, free in our MIT-licensed npm packages, so it runs wherever Bitbybit runs, in the browser or on your own server, and in all three of our editors: Rete, Blockly and TypeScript.
A part, as the shop sees it
Each operation takes a part and returns a new one, and the part it was given stays as it was. The result is an exact solid, so it draws, measures and exports like any other shape, STEP included. It also carries a record of what it is made of: its flat regions, the bends that join them, the seams where regions meet without a bend, and the forms pressed into it, each by name.
What is true of the material is set once, when the part starts: its thickness, its bend radius and K-factor, or the shop's own bend table, its reliefs, the shortest flange the shop's tooling can grip and the tightest bend the material takes. Every later operation inherits those settings, and a single flange or fold can still give its own. The sheet metal functions are new and marked beta, so their names and the shape of the record may still change.
Four ways to start a part
Which one you reach for depends on what you know first: an outline, a cross-section, two openings to connect or a path to follow.
- A plate gives a flat face a thickness. The face is the blank's outline, holes included. Most parts start here: a tray, a bracket, a cover.
- A contour flange runs an open profile of straight lines along a direction and makes every corner a bend: a channel, a hat section, a rail.
- A lofted flange joins two profiles. Bent, it is the square-to-round transition a duct shop folds from one blank in flat facets, opened along a seam. Formed, it is one smooth surface between two open profiles, for a chute, a hood or a guide vane that is rolled rather than bent.
- A swept flange carries a profile along a path of straight segments. One run of the profile becomes a web that turns every corner unbroken, and the others are mitred at each corner, the way a fabricator notches a flange to take it round a corner.




Flanges and hems
A flange bends a strip up off a straight edge. Its length is measured the way a drawing dimensions it, to the outer sharp unless you choose the inner sharp or the tangent. It can stop short of either end of its edge, with a relief notched beside the bend so the bend forms cleanly; its sides can taper; and a profile of further segments makes one flange a Z, a return or a step. Bend flanges off several edges in one call and they meet mitred at the corners, with a corner relief where their bends meet, as a tray is folded from a single blank.
A hem folds an edge back over the sheet to hide the cut edge or to stiffen it, in five styles: closed flat, open with a gap, a teardrop, a rolled edge, or a double hem that tucks the cut edge between the layers. Two hems folded inward cannot both run into one corner, so a hem that would touch a neighbouring wall or hem is refused, and the message says to stop it short of the corner or shorten it, as a shop would.


Folds, jogs and lances
A fold bends material that is already there, along any line drawn across a flat region, as a press brake bends a blank where its punch comes down. Give the fold an offset and it becomes a jog: two opposite bends that land the far side parallel to where it was.
The material beyond a bend lands where the flat blank would put it, worked out from the bend's angle, its inner radius and the K-factor. A shop that has measured its own bends can give the part a bend table instead, and each bend reads its K-factor from the table's rows, interpolated between them. A bend the table does not reach is refused rather than guessed.
A lance cuts a tongue free on three sides and bends it out, the way a cable-tie anchor, a hook or a small vent is pressed out of a panel without taking any material away.


Joins and closed corners
Some parts are easier to describe by where their walls stand. A join takes two plates drawn roughly where they are and joins them with one bend, cylindrical, or conical when its radius changes from one end to the other; each plate is cut back or extended to meet it.
Wherever two flanges come together at a box's corner, closeCorner extends their ends until they close it: the first reaching over the second's edge, the other way round, or both butting on the corner's mitre, ready for a weld. A rip cuts a slit in from an edge, a rip along an edge opens a welded corner again, and a tab adds a fixing ear or a locating tongue to a region's outline.


Cuts, pockets and stamped forms
A cut takes closed profiles drawn on a region and cuts them square through the sheet, as a laser or a punch does, or pockets them to a depth for a label recess. A cut that would reach a bend is refused, since holes near a bend distort when it is formed. Forms press in the shapes a shop stamps into sheet:
- louvers for ventilation, and bridges, the same strip pressed out but joined at both ends, to pass a cable tie under;
- dimples, which stiffen a panel, act as feet or locate a part;
- extruded holes, whose rim is drawn into a collar so that thin sheet can take a thread or a self-tapping screw;
- embosses, raised or sunken panels that stiffen a large flat area or carry a label;
- beads, the classic stiffening rib, pressed along straight or curved paths.
Gussets pressed across a bend lock its angle, and rounded or bevelled corners take the sharp points off a blank.


Faces by name, not by number
A face number changes whenever an operation adds a face, so a script that picks faces by number stops picking the right ones as soon as a size changes. Every region, bend and form of a part is named instead, such as base, side1, its bend side1.b1 or the stamped form louver.1, and the pickers find faces by what they are:
- a region's inside or outside face, by the region's name;
- the edge of a region that lies furthest along a direction, or nearest a point;
- a flange's end face, by the direction it lies in, which is what closing a corner takes;
- the edge where two regions meet;
- the faces an operation added under a role, such as a flange's
endor a cut'swalls.
Every example on the learn pages picks its faces and edges this way, so each still finds what it needs when you change its sizes.
Checking that a part is still a sheet
check reads a part and reports whether it is still a sheet: one valid solid of one thickness that its record describes. It reports rather than refuses, with the problems it finds and warnings worth a look, such as a bend tighter than the material's minimum radius. Fuse a boss onto a part with an ordinary boolean and the check says the record no longer matches the shape. Make the same change with a sheet metal operation, a form for a boss, a cut for a hole, a tab or a flange for an added piece, and the part stays a sheet.
Drawn in its looks
A part draws like any shape, all one colour. Drawn with the sheet drawing options, bitbybit.draw.optionsOcctSheet, it shows what it is made of: the flat regions white, the bends tinted blue, the forms in orange, and, when you ask, the bend lines, including the line halfway round each bend that a press brake is set to. In Rete the options are the "occt sheet" component under draw > options, and in Blockly the "occt sheet" block. When a script needs the colours or the lines themselves, colorByKind gives the part its looks as an appearance to pass on, and bendLines gives the lines as wires to label, measure or export.

Every operation in one product
The showcase of the learn pages is a product almost every sheet metal shop makes in some form: an inline fan box that sits in a ceiling void between two ducts. It has a casing with mitred walls, hems, louvers, beads and stamped feet, a lid with closed corners, a square-to-round outlet, a smoothly formed turning vane, a DIN rail, a swept duct collar and four hanger brackets, one bracket and three mirrored copies of it. One script builds its seven parts with over fifty sheet metal operations, and each of them checks as a sheet, with no problems and no warnings.

The pictures in this post are rendered in Blender from the parts that the learn pages' own scripts build. An inline fan box builds this one step by step.
In Rete, Blockly and TypeScript
Every sheet metal function is in all three editors: a component to wire in Rete, a block to snap in Blockly, and a typed call in TypeScript. Every example on the learn pages runs on the page itself in the editor you pick, so you can open a part, change its sizes and watch it rebuild. In your own application the same calls come from our npm packages, in the browser or on a server.
From the folded part to the flat pattern
Modelling ends at the folded part, and that part is a solid of one thickness with rounded bends, which exports as STEP. Turning it into the flat pattern a laser cuts, with every bend measured, and laying flat parts out on sheets of stock are Pro algorithms of Bitbybit CAD Cloud, which run on our servers. Sheet-metal unfolding and nesting shows both.
A part need not start from a rectangle, either. A Voronoi perforated face is a face like any other, so it can be the blank of a vent panel, its holes kept clear of the flanges bent down off its edges; Voronoi patterns in Bitbybit shows it.
Try it
Start with Sheet metal, which explains regions, bends, the K-factor and reliefs, then follow its pages through starting a part, flanges and hems, bends, jogs and lances, joining and corners, cutting, forming and finishing and moving and checking. Each example is there in Rete, Blockly and TypeScript.
Building a configurator or a quoting tool around sheet metal parts? Reach out to us.
