FoundationPartsSheet MetalEdge Flange

Edge Flange

An edge flange adds a bend region and a flange wall along an edge of an existing sheet-metal body. The bend is parameterised by bend_angle (default 90°), bend_radius, k_factor, and flange_position — these live as metadata on the body so Unfold can reproduce the flat pattern.

For two opposite edges you simply chain a second edge_flange call to get a U-channel.

from cadbuildr.foundation import *
from cadbuildr.foundation.sheet_metal import base_flange, edge_flange, to_solid


class SheetMetalLBracket(Part):
    def __init__(self, width=60, depth=40, thickness=2):
        # Base flat plate
        s = Sketch(self.xy())
        plate = Rectangle.from_center_and_sides(s.origin, width, depth)
        base = base_flange(profile=plate, sketch=s, thickness=thickness)

        # Edge flange (90° upward bend on one edge — picks the first edge)
        edge = EdgeFinder(rule=InPlaneFinderRule(plane=self.xy()))
        flange = edge_flange(base, edge_finder=edge, length=20)

        self.add_operation(to_solid(flange))


show(SheetMetalLBracket())