Joining and corners
Sometimes a part is easier to describe by where its walls stand than by how its blank bends: a floor here, a wall there, and a bend between them. And wherever two flanges come together at a box's corner, something has to happen to the corner. This page covers both, and the two edits that open or extend a region's outline: rips and tabs.
Two plates joined by a bend
bitbybit.occt.fabrication.sheetMetal.join takes two parts, each with a plate's inside face and the edge toward the bend, and joins them with one bend. Each plate is cut back or extended to the bend's tangent line, so the plates only need to be roughly where they stand; the bend itself follows from the two planes and its radius. A plate cut back or extended stays one face on each side, so insideFace still gives the whole region.


- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const { face } = bitbybit.occt.shapes;
const floor = await sheetMetal.plate({ face: await face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] }), thickness: 2, bendRadius: 3, name: "floor" });
const wall = await sheetMetal.plate({ face: await face.createRectangleFace({ width: 50, length: 100, center: [0, 30, 36], direction: [0, 0, -1] }), thickness: 2, name: "wall" });
const joined = await sheetMetal.join({
first: floor,
firstInsideFace: await sheetMetal.insideFace({ part: floor, region: "floor" }),
firstEdge: await sheetMetal.insideEdgeToward({ part: floor, region: "floor", direction: [0, 0, 1] }),
second: wall,
secondInsideFace: await sheetMetal.insideFace({ part: wall, region: "wall" }),
secondEdge: await sheetMetal.insideEdgeToward({ part: wall, region: "wall", direction: [0, -1, 0] }),
name: "elbow",
});
const floor2 = await sheetMetal.plate({ face: await face.createRectangleFace({ width: 100, length: 60, center: [130, 0, 0], direction: [0, 1, 0] }), thickness: 2, bendRadius: 3, name: "floor" });
const wall2 = await sheetMetal.plate({ face: await face.createRectangleFace({ width: 50, length: 100, center: [130, 30, 36], direction: [0, 0, -1] }), thickness: 2, name: "wall" });
const conical = await sheetMetal.join({
first: floor2,
firstInsideFace: await sheetMetal.insideFace({ part: floor2, region: "floor" }),
firstEdge: await sheetMetal.insideEdgeToward({ part: floor2, region: "floor", direction: [0, 0, 1] }),
second: wall2,
secondInsideFace: await sheetMetal.insideFace({ part: wall2, region: "wall" }),
secondEdge: await sheetMetal.insideEdgeToward({ part: wall2, region: "wall", direction: [0, -1, 0] }),
bendRadius: 3,
endRadius: 12,
name: "cone",
});
await bitbybit.draw.drawAnyAsync({ entity: [joined, conical], options: bitbybit.draw.optionsOcctSheet({}) });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [284, 224, -259], lookAt: [65, 27, 4] });
Draw each plate with its inside face looking into the corner the bend makes: the floor looks up and the wall looks back toward the floor. A plate whose material lies on the bend's side of its edge, or edges that are not parallel, are refused with the reason.
The bend's inner radius is bendRadius, or the first part's. Give endRadius a different value and the bend becomes conical: its radius runs from bendRadius at the first edge's start to endRadius at its end, as the second pair above opens from 3 to 12. A conical bend ends in the planes its plates end in, so the part's ends stay flat across it. A conical bend suits a transition whose flanges spread apart, or two plates that a straight bend cannot meet cleanly at both ends.
The joined part keeps the first part's settings. Its regions keep their names; where both parts use the same default name, such as two plate1, the second part's is renumbered (plate2), while names you gave must already differ. Both parts must be of one thickness. Where one plate's edge runs past the other's, the bend spans only their overlap and the longer plate is relieved beside it, the role reliefs.
Closing a corner
bitbybit.occt.fabrication.sheetMetal.closeCorner extends the ends of two flanges that stop short of a corner until they close it. Each flange is given by its run's inside face and its end face, the flat face through the thickness at the end of its run near the corner, which bitbybit.occt.fabrication.sheetMetal.endFaceToward picks by the direction it lies in.


- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const { sheetMetalClosureEnum } = Bit.Inputs.OCCT;
const blank = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 70, center: [0, 0, 0], direction: [0, 1, 0] });
let box = await sheetMetal.plate({ face: blank, thickness: 1.5, bendRadius: 2, name: "base" });
for (const [name, direction] of [["front", [0, 0, -1]], ["side", [1, 0, 0]], ["back", [0, 0, 1]]] as const) {
box = await sheetMetal.flange({
part: box,
insideFace: await sheetMetal.insideFace({ part: box, region: "base" }),
edge: await sheetMetal.insideEdgeToward({ part: box, region: "base", direction: [...direction] }),
length: 30,
extentStart: 12,
extentEnd: 12,
name,
});
}
box = await sheetMetal.closeCorner({
part: box,
firstInsideFace: await sheetMetal.insideFace({ part: box, region: "front" }),
firstEndFace: await sheetMetal.endFaceToward({ part: box, region: "front", direction: [1, 0, 0] }),
secondInsideFace: await sheetMetal.insideFace({ part: box, region: "side" }),
secondEndFace: await sheetMetal.endFaceToward({ part: box, region: "side", direction: [0, 0, -1] }),
kind: sheetMetalClosureEnum.overlap,
name: "overlap",
});
box = await sheetMetal.closeCorner({
part: box,
firstInsideFace: await sheetMetal.insideFace({ part: box, region: "back" }),
firstEndFace: await sheetMetal.endFaceToward({ part: box, region: "back", direction: [1, 0, 0] }),
secondInsideFace: await sheetMetal.insideFace({ part: box, region: "side" }),
secondEndFace: await sheetMetal.endFaceToward({ part: box, region: "side", direction: [0, 0, 1] }),
kind: sheetMetalClosureEnum.overlap,
gap: 0,
name: "weld",
});
box = await sheetMetal.ripEdge({ part: box, edge: await sheetMetal.edgeBetween({ part: box, first: "back", second: "side" }), gap: 0.5, name: "seam" });
console.log(await sheetMetal.check({ part: box }));
await bitbybit.draw.drawAnyAsync({ entity: box, options: bitbybit.draw.optionsOcctSheet({}) });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [112, 114, -134], lookAt: [0, 14, 0] });
Each end face is picked by where it lies: the front flange's end toward [1, 0, 0] is the one at the corner it shares with the side, and the side's toward [0, 0, -1] is the side's end at the same corner. A flange's two run ends are also its role legEnds, but a role lists its faces in the order of the part's faces, which says nothing of which end is which, and only the part the flange returned holds it; endFaceToward asks any later part and names the end by its direction.
kind says how the flanges meet:
overlap: the first flange reaches over the second's edge to its outside face, and the second stopsgapshort of the first's inside face. The usual closed corner of a box, spot-welded or riveted through the overlap.underlap: the same with the roles swapped.butt: both reach the corner's mitre and stop half thegapshort of it, two edges end to end, ready for a weld along the seam.
Flanges that stop short of the corner, as these stop 12 short with extentStart and extentEnd, have their bends carried on to the corner too, and the plate's corner is cut back to clear the two bends where they meet. A carried bend runs whole: the reliefs notched where the flange stopped short are filled, and each side of the bend is one cylindrical face from end to end, as if the flange had been bent full length from the start. The record keeps each closure as a seam under the name given, so the front and side corner is the seam overlap.
The gap is a tenth of the thickness unless given. An overlap or underlap with a gap of 0 makes the flanges touch: they weld into one, closing the loop of regions round the box through the seam, which the record keeps as a seam of that kind. The back and side corner of the example is closed that way. A butt joint needs a gap. For an overlap or underlap each end face must be square to its run.
A welded corner can be opened again, and the example's last step does: bitbybit.occt.fabrication.sheetMetal.edgeBetween gives the edge where the back's and the side's faces meet, the inner corner welded shut, and bitbybit.occt.fabrication.sheetMetal.ripEdge parts the two regions along it, cutting on the corner's mitre with a slot 0.5 wide. The two regions are then recorded as meeting across a rip seam, seam, and the slot's faces are the role walls. The check after it finds the box still a sheet, four regions and three bends.
Rips and tabs
bitbybit.occt.fabrication.sheetMetal.rip cuts a narrow slot, gap wide, through a region along a line. At least one end must lie off the material, past the outline or in a hole; an end inside the material is where the slot stops, so a rip in from an edge is a slit. A slit is how a shop lets a flange end partway along an edge without a relief: the slit splits the edge, and a flange bent off one piece of it ends at the slit.
bitbybit.occt.fabrication.sheetMetal.tab adds a flat face, drawn on a region's plane where it touches or overlaps the region, to the region as more of it, of the sheet's thickness. A tab extends a blank's outline where a fixing ear or a locating tongue is wanted; holes in the face stay holes, and a tab that would run into a bend is refused. The tab and the region become one face on each side, so the next operation sees one region, not a region and a patch.


- Rete
- Blockly
- TypeScript
const { sheetMetal } = bitbybit.occt.fabrication;
const blank = await bitbybit.occt.shapes.face.createRectangleFace({ width: 120, length: 80, center: [0, 0, 0], direction: [0, 1, 0] });
let plate = await sheetMetal.plate({ face: blank, thickness: 2, bendRadius: 2, name: "plate" });
plate = await sheetMetal.rip({
part: plate,
insideFace: await sheetMetal.insideFace({ part: plate, region: "plate" }),
from: [10, 0, -45],
to: [10, 0, -30],
gap: 2,
name: "slit",
});
plate = await sheetMetal.flange({
part: plate,
insideFace: await sheetMetal.insideFace({ part: plate, region: "plate" }),
edge: await sheetMetal.insideEdgeToward({ part: plate, region: "plate", direction: [0, 0, -1] }),
length: 25,
name: "lip",
});
const ear = await bitbybit.occt.shapes.face.createRectangleFace({ width: 30, length: 40, center: [70, 0, 0], direction: [0, 1, 0] });
plate = await sheetMetal.tab({ part: plate, insideFace: await sheetMetal.insideFace({ part: plate, region: "plate" }), tab: ear });
await bitbybit.draw.drawAnyAsync({ entity: plate, options: bitbybit.draw.optionsOcctSheet({}) });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [161, 144, -178], lookAt: [13, 11, 0] });
The slit, 2 wide and 10 into the plate, splits the plate's front edge in two; insideEdgeToward picks the longer piece, the one furthest along [0, 0, -1] and longest where several lie as far, and the flange bent off it ends at the slit with no relief of its own. The tab drawn beside the plate makes it 25 longer at one end. A slit records nothing in the part's record, since the region is still one region; its faces are the role walls, and so are the tab's. A rip that parts a region in two, possible only where a loop of regions has been closed through a touching seam, makes the far side a region of its own joined by a seam.
