FoundationPartsPrimitivesSphere

Sphere

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.