Thicken

Renders the 3D model in your browser. The first run downloads the Python runtime (≈30 MB).
from cadbuildr.foundation import *


class SurfaceLoftThickened(Part):
    def __init__(self):
        pf = PlaneFactory()
        p0 = self.xy()
        p1 = pf.get_parallel_plane(p0, 40)
        s0 = Sketch(p0)
        s1 = Sketch(p1)
        c0 = Ellipse(s0.origin, 30, 15)
        c1 = Ellipse(s1.origin, 15, 30)
        surface = SurfaceLoft(shapes=[c0, c1])
        self.add_operation(Thicken(surface=surface, thickness=2.0, both_sides=True))


show(SurfaceLoftThickened())

Thicken turns a surface into a solid by offsetting it thickness along its normal (a negative thickness goes the other way). Use it to convert an intermediate SurfaceLoft (or any other surface op) into a boolean-compatible solid. A PlanarSurface’s normal is its sketch plane’s normal, whatever the winding of its outline. Setting both_sides=True puts thickness on each side of the surface, so the wall is 2 × thickness thick.

from cadbuildr.foundation import *


class SurfaceLoftThickened(Part):
    def __init__(self):
        pf = PlaneFactory()
        p0 = self.xy()
        p1 = pf.get_parallel_plane(p0, 40)
        s0 = Sketch(p0)
        s1 = Sketch(p1)
        c0 = Ellipse(s0.origin, 30, 15)
        c1 = Ellipse(s1.origin, 15, 30)
        surface = SurfaceLoft(shapes=[c0, c1])
        self.add_operation(Thicken(surface=surface, thickness=2.0, both_sides=True))


show(SurfaceLoftThickened())