Bends, jogs and lances
A flange adds material off an edge. A fold bends material that is already there: a flat region is bent along a line drawn across it, as a press brake bends a blank along the line where its punch comes down. A jog is two folds close together in opposite directions, which steps the far side up or down and lands it parallel. A lance cuts a tongue free on three sides and bends it out, leaving the region around it whole.
Folding and jogging
bitbybit.occt.fabrication.sheetMetal.bend takes the part, a region's inside face, and two points, from and to, that give the bend line. The points are taken onto the face's plane, and the line runs on past both of them until it leaves the region: the line may cross the region at any angle, but it must split it in two.




- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const blank = await bitbybit.occt.shapes.face.createRectangleFace({ width: 200, length: 50, center: [0, 0, 0], direction: [0, 1, 0] });
let strip = await sheetMetal.plate({ face: blank, thickness: 2, bendRadius: 2, name: "strip" });
strip = await sheetMetal.bend({
part: strip,
insideFace: await sheetMetal.insideFace({ part: strip, region: "strip" }),
from: [60, 0, -25],
to: [60, 0, 25],
angle: 90,
name: "fold",
});
strip = await sheetMetal.bend({
part: strip,
insideFace: await sheetMetal.insideFace({ part: strip, region: "strip" }),
from: [-20, 0, -25],
to: [-20, 0, 25],
angle: 45,
offset: 15,
name: "jog",
});
console.log(await sheetMetal.bendNames({ part: strip }));
const looks = bitbybit.draw.optionsOcctSheet({ drawBendLines: true, bendLineKind: Bit.Inputs.OCCT.sheetMetalBendLineEnum.insideCenter });
await bitbybit.draw.drawAnyAsync({ entity: strip, options: looks });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [-175, 165, 184], lookAt: [-22, 26, 0] });
The first call folds the end of the strip past x = 60 up 90 degrees; the second, with an offset of 15, jogs the strip: two opposite bends of 45 degrees, with the far side landing 15 higher and parallel to where it was. A jog is named jog by default and records two bends and two regions, the slanted run between them and the far side; a fold records one of each, named fold. The orange lines are the bends' centre lines: the part is drawn in its looks with drawBendLines on and bendLineKind set to insideCenter, the line on the inside layer halfway round each bend, where a press brake is set.
Which side moves. One side of the line stays where it is and the other turns. fixed set to left, the default, keeps the side that the region's normal crossed with the line's direction points to; right keeps the other. Swapping from and to swaps them too. Here the region's normal points down through the strip and the line runs along +z, so the side at smaller x stays. Work it out once from the right-hand rule rather than from what the screen shows, since the editors' view mirrors the kernel's z axis. The faces that moved come back as the role moved.
Which way it turns. direction works as a flange's: up turns the moving side toward the side the inside face looks at.
Where the bend sits. position set to centerline, the default, centres the bend's band on the line; bendOutside starts the bend at the line, on the side that moves, so the line marks where flat sheet ends.
Where the material lands. A fold does not stretch the sheet: the band it bends is as long as the bend's neutral layer, its bend allowance, worked out from the bend's angle, inner radius and the K-factor. So the far side lands exactly where the material from the flat blank would, and a different kFactor (or a bend table on the part) moves it. Each fold records the K-factor it was laid out with.
A fold is refused when its line does not split the region, crosses it more than once, or runs into a bend or a feature the band cannot carry; a jog also needs room on the moving side for both its bends and the run between them.
Folds from a bend table
A K-factor is an estimate. A shop that has bent its own material on its own tooling knows better, and writes what it measured down as a bend table. bitbybit.occt.fabrication.sheetMetal.create.bendTableRow makes one row: the thickness, inner radius and angle it is for, what it gives (kFactor, allowance or deduction) and the value. A list of rows is the bendTable a part starts with, and every bend after reads its K-factor from it.




- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const { sheetMetalBendTableValueEnum } = Bit.Inputs.OCCT;
const bendTable = [
await sheetMetal.create.bendTableRow({ thickness: 2, radius: 2, angle: 45, gives: sheetMetalBendTableValueEnum.kFactor, value: 0.36 }),
await sheetMetal.create.bendTableRow({ thickness: 2, radius: 2, angle: 135, gives: sheetMetalBendTableValueEnum.kFactor, value: 0.46 }),
];
const blank = await bitbybit.occt.shapes.face.createRectangleFace({ width: 200, length: 50, center: [0, 0, 0], direction: [0, 1, 0] });
let strip = await sheetMetal.plate({ face: blank, thickness: 2, bendRadius: 2, bendTable, name: "strip" });
strip = await sheetMetal.bend({
part: strip,
insideFace: await sheetMetal.insideFace({ part: strip, region: "strip" }),
from: [50, 0, -25],
to: [50, 0, 25],
angle: 90,
name: "fold",
});
strip = await sheetMetal.bend({
part: strip,
insideFace: await sheetMetal.insideFace({ part: strip, region: "strip" }),
from: [-40, 0, -25],
to: [-40, 0, 25],
angle: 45,
name: "kink",
});
const record: { bends: { id: string; allowance: { kFactor: number } }[] } = JSON.parse(strip.record);
console.log(record.bends.map((bend) => `${bend.id}: K ${bend.allowance.kFactor.toFixed(2)}`));
const looks = bitbybit.draw.optionsOcctSheet({ drawBendLines: true, bendLineKind: Bit.Inputs.OCCT.sheetMetalBendLineEnum.insideCenter });
await bitbybit.draw.drawAnyAsync({ entity: strip, options: looks });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [-188, 183, 179], lookAt: [-38, 49, 0] });
The table has two rows for sheet 2 thick bent round a radius of 2: a K-factor of 0.36 at 45 degrees and 0.46 at 135. The 90 degree fold falls between them and reads 0.41, interpolated; the 45 degree kink matches the first row and reads 0.36. The TypeScript tab prints both from the part's record, and the orange lines are the two bends' centre lines, drawn as on the fold above. The kink's moving side is the one that carries the fold, so the fold turns with it.
A bend the table does not reach is refused rather than guessed, with the reason: a fold of 150 degrees here gives "the bend table does not reach 150 degrees at thickness 2 and radius 2: its angles there run from 45 to 135 degrees, and a table is not extrapolated", and a radius of 3 is refused the same way. A bend given its own kFactor does not read the table, which is the way to make one bend the table does not cover.
Lanced tabs
bitbybit.occt.fabrication.sheetMetal.lance cuts a tongue free on three sides of a hinge line and bends it out, the way a cable-tie anchor, a hook or a small vent is pressed out of a panel without any material taken away.


- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const blank = await bitbybit.occt.shapes.face.createRectangleFace({ width: 140, length: 90, center: [0, 0, 0], direction: [0, 1, 0] });
let panel = await sheetMetal.plate({ face: blank, thickness: 1.5, bendRadius: 1.5, name: "panel" });
panel = await sheetMetal.lance({
part: panel,
insideFace: await sheetMetal.insideFace({ part: panel, region: "panel" }),
from: [-50, 0, -10],
to: [-20, 0, -10],
depth: 18,
angle: 90,
name: "hook",
});
panel = await sheetMetal.lance({
part: panel,
insideFace: await sheetMetal.insideFace({ part: panel, region: "panel" }),
from: [20, 0, -10],
to: [50, 0, -10],
depth: 18,
angle: 30,
kerf: 0.5,
name: "vent",
});
await bitbybit.draw.drawAnyAsync({ entity: panel, options: bitbybit.draw.optionsOcctSheet({}) });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [149, 142, -178], lookAt: [0, 8, 0] });
The hinge runs from from to to on the face's plane, and the tongue is depth long, measured flat, on the side of the hinge that moves (chosen with fixed, as for a fold). It is freed by a slot one kerf wide, a tenth of the thickness unless given: the second tab above is cut with a wider 0.5 slot, the kind a vent uses. angle is how far it bends. The tongue is a region of its own, named lance by default, the slot's faces are the role walls, and a tongue shorter than its bend needs is refused.
