FoundationPartsSheet MetalEdge Flange

Edge Flange

The SheetMetalEdgeFlange node adds a bend region and a flange wall along an edge of an existing sheet-metal body. The edge is given as a Line (auto- cast to an EdgeRef); 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 SheetMetalEdgeFlange to get a U-channel.

from cadbuildr.foundation import Part, Sketch, Rectangle, Line, Point, show
from cadbuildr.foundation import SheetMetalBaseFlange, SheetMetalEdgeFlange, SheetMetalToSolid


class SheetMetalLBracket(Part):
    """Edge Flange — bend a wall up from an existing edge. The edge is a
    constructed `Line` passed straight to the node (cast to an EdgeRef)."""

    def __init__(self, width=60, depth=40, thickness=2, wall_height=20):
        s = Sketch(self.xy())
        plate = Rectangle.from_center_and_sides(s.origin, width, depth)
        base = SheetMetalBaseFlange(profile=plate, thickness=thickness)
        front_edge = Line(Point(s, -width / 2, -depth / 2), Point(s, width / 2, -depth / 2))
        bracket = SheetMetalEdgeFlange(body=base, edge=front_edge, length=wall_height)
        self.add_operation(SheetMetalToSolid(body=bracket))


show(SheetMetalLBracket())