Stitch

Renders the 3D model in your browser. The first run downloads the Python runtime (≈30 MB).
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())

Stitch welds adjacent surfaces along their shared edges. When the resulting shell is closed (no free edges), it is automatically promoted to a solid; if it remains open — like the two lofts below, whose ends are not capped — the result is a shell (a surface body, with no volume) that can be thickened or stitched further. The tolerance parameter controls how close edges have to be to be considered shared.

Surfaces that cross or overhang each other instead of meeting edge to edge can’t be stitched; use Enclose, which trims the overhangs.

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())