FoundationPartsSheet MetalSketched Bend

Sketched Bend

The SheetMetalSketchedBend node folds the material on one side of a sketched line across a flat face — the true interior fold. You author the fold line as a Line on the plate; the half beyond the line folds up around a real bend region while the other half stays put. bend_position defaults to bend-centerline (the SolidWorks default — the line is the developed midpoint of the bend).

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


class SheetMetalInlineBend(Part):
    """Sketched Bend — fold the material on one side of a sketched line. The
    half beyond the line folds up; the other half stays put."""

    def __init__(self, width=120, depth=40, thickness=2, angle=90):
        s = Sketch(self.xy())
        plate = Rectangle.from_center_and_sides(s.origin, width, depth)
        base = SheetMetalBaseFlange(profile=plate, thickness=thickness)
        fold = Line(Point(s, 0.0, -depth / 2), Point(s, 0.0, depth / 2))
        self.add_operation(SheetMetalToSolid(body=SheetMetalSketchedBend(body=base, fold_line=fold, angle=angle)))


show(SheetMetalInlineBend())