Lofts

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

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: the loft surface passes through each guide rail, and the sections still start and end the loft. Each guide must start on the first section’s outline and end on the last one’s; sections must sit on parallel planes and be star-shaped around their sketch origin (circles, ellipses, rounded rectangles…). Anything else is reported as an error.

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