FoundationPartsOperationsStitch

Stitch

Stitch welds adjacent surfaces along their shared edges. When the resulting shell is closed and manifold, it is automatically promoted to a solid; if it remains open, the result is a shell that can be further thickened or stitched. The tolerance parameter controls how close edges have to be to be considered shared.

from cadbuildr.foundation import *


class StitchBox(Part):
    """Stitch two adjoining surface lofts into a single shell."""

    def __init__(self):
        pf = PlaneFactory()
        s0 = Sketch(self.xy())
        s1 = Sketch(pf.get_parallel_plane(self.xy(), 40))
        s2 = Sketch(pf.get_parallel_plane(self.xy(), 80))
        a = Circle(s0.origin, 20)
        b = Circle(s1.origin, 25)
        c = Circle(s2.origin, 15)
        upper = SurfaceLoft(shapes=[a, b])
        lower = SurfaceLoft(shapes=[b, c])
        self.add_operation(Stitch(surfaces=[upper, lower]))


show(StitchBox())