FoundationPartsSheet MetalCorner Seam

Corner Seam

A corner seam closes the mitred corner where two adjacent flanges meet. You pass the edge finders that were used to build the flanges; the operation welds the corner and tags the resulting edge so Unfold knows to crease it in the flat pattern.

from cadbuildr.foundation import *
from cadbuildr.foundation.sheet_metal import (
    base_flange,
    edge_flange,
    corner_seam,
    to_solid,
)


class SheetMetalBoxCorners(Part):
    def __init__(self, width=80, depth=80, thickness=2, wall_height=25):
        s = Sketch(self.xy())
        plate = Rectangle.from_center_and_sides(s.origin, width, depth)
        base = base_flange(profile=plate, sketch=s, thickness=thickness)

        # Four edge flanges around the base
        body = base
        edge_finders_for_seam = []
        for _ in range(4):
            ef = EdgeFinder(rule=InPlaneFinderRule(plane=self.xy()))
            body = edge_flange(body, edge_finder=ef, length=wall_height)
            edge_finders_for_seam.append(ef)

        # Close mitered corners between adjacent flanges
        sealed = corner_seam(body, edge_finders=edge_finders_for_seam)

        self.add_operation(to_solid(sealed))


show(SheetMetalBoxCorners())