FoundationPartsOperationsLoft

Lofts

A Loft blends through a sequence of 2D cross-sections, each on its own plane, producing a continuous solid. Use ruled=True for piecewise-linear sides (useful for unfoldable surfaces) or pass guides=[...] to constrain the loft to follow one or more 3D Spline3D rails.

from cadbuildr.foundation import *


class LoftBasic(Part):
    def __init__(self):
        pf = PlaneFactory()
        p0 = self.xy()
        p1 = pf.get_parallel_plane(p0, 30)
        p2 = pf.get_parallel_plane(p0, 60)
        s0 = Sketch(p0)
        s1 = Sketch(p1)
        s2 = Sketch(p2)
        c0 = Circle(s0.origin, 20)
        c1 = Circle(s1.origin, 10)
        c2 = Circle(s2.origin, 25)
        self.add_operation(Loft(shapes=[c0, c1, c2]))


show(LoftBasic())

With a guide curve:

from cadbuildr.foundation import *


class LoftWithGuides(Part):
    def __init__(self):
        pf = PlaneFactory()
        p0 = self.xy()
        p1 = pf.get_parallel_plane(p0, 50)
        s0 = Sketch(p0)
        s1 = Sketch(p1)
        c0 = Circle(s0.origin, 20)
        c1 = Circle(s1.origin, 20)
        guide = Spline3D(
            points=[
                Point3D(20, 0, 0),
                Point3D(35, 5, 25),
                Point3D(20, 0, 50),
            ]
        )
        self.add_operation(Loft(shapes=[c0, c1], guides=[guide]))


show(LoftWithGuides())