FoundationPartsSheet MetalTo Solid

To Solid

The SheetMetalToSolid node 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 Part, Sketch, Rectangle, Circle, Line, Point, Extrusion, show
from cadbuildr.foundation import SheetMetalBaseFlange, SheetMetalEdgeFlange, SheetMetalToSolid


class SheetMetalToSolidJoin(Part):
    """To Solid — bridge a sheet-metal body into the regular solid pipeline,
    here alongside an extruded boss on the same part."""

    def __init__(self, width=60, depth=40, thickness=2, wall_height=20):
        s = Sketch(self.xy())
        base = SheetMetalBaseFlange(
            profile=Rectangle.from_center_and_sides(s.origin, width, depth), thickness=thickness
        )
        front = Line(Point(s, -width / 2, -depth / 2), Point(s, width / 2, -depth / 2))
        flange = SheetMetalEdgeFlange(body=base, edge=front, length=wall_height)
        self.add_operation(SheetMetalToSolid(body=flange))
        boss_sketch = Sketch(self.xy())
        self.add_operation(Extrusion(Circle(boss_sketch.origin, 8), 12))


show(SheetMetalToSolidJoin())