FoundationPartsOperationsMultiSectionSweep

MultiSectionSweep

A MultiSectionSweep blends multiple 2D cross-sections along a 3D path, combining the cross-section variation of a Loft with the directed-spine control of a Sweep. Pass an optional guides=[...] list to constrain the sweep to follow additional 3D rails.

from cadbuildr.foundation import *


class MultiSectionSweepDemo(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)
        profiles = [
            Circle(s0.origin, 15),
            Hexagon(s1.origin, 12),
            Circle(s2.origin, 8),
        ]
        spine = Spline3D(
            points=[
                Point3D(0, 0, 0),
                Point3D(5, 0, 30),
                Point3D(0, 0, 60),
            ]
        )
        self.add_operation(MultiSectionSweep(profiles=profiles, path=spine))


show(MultiSectionSweepDemo())