Sphere

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


class Marble(Part):
    def __init__(self, radius=10):
        s = Sketch(self.xy())
        # Sphere is a native 3D primitive; pass a sketch-anchored point
        # for the centre and a radius.
        self.add_operation(Sphere(s.origin, radius=radius))
        self.paint("bright_blue")


show(Marble())

Sphere(center, radius) is a 3D primitive. center is a sketch-anchored Point — typically Sketch.origin — and radius is a FloatParameter (a plain number works thanks to the parameter cast).

def __init__(self, radius=10):
        s = Sketch(self.xy())
        # Sphere is a native 3D primitive; pass a sketch-anchored point
        # for the centre and a radius.
        self.add_operation(Sphere(s.origin, radius=radius))

Sphere is a native solid: it goes into the part’s operation list and renders as a closed 3D body, so you can fillet, chamfer, fuse or cut against it like any other solid.