FoundationPartsSheet MetalTo Solid

To Solid

to_solid bridges a sheet-metal body into the regular solid pipeline so it can be combined with Extrusion, Lathe, etc. via the standard part operations. The bend metadata is dropped at this point — once you cross the boundary you give up the ability to unfold.

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


class SheetMetalToSolidJoin(Part):
    def __init__(self, width=60, depth=40, thickness=2, wall_height=20):
        # Sheet-metal L-bracket
        s = Sketch(self.xy())
        plate = Rectangle.from_center_and_sides(s.origin, width, depth)
        base = base_flange(profile=plate, sketch=s, thickness=thickness)
        edge = EdgeFinder(rule=InPlaneFinderRule(plane=self.xy()))
        flange = edge_flange(base, edge_finder=edge, length=wall_height)
        self.add_operation(to_solid(flange))

        # Boss extruded from the same XY plane — unions with the bracket at part level
        boss_sketch = Sketch(self.xy())
        boss = Circle(boss_sketch.origin, 8)
        self.add_operation(Extrusion(boss, 12))


show(SheetMetalToSolidJoin())