def sphere(x0, y0, z0, r): s = MathTree('-r++q%sq%sq%sf%g' % (('-Xf%g' % x0) if x0 else 'X', ('-Yf%g' % y0) if y0 else 'Y', ('-Zf%g' % z0) if z0 else 'Z', r)) s.xmin, s.xmax = x0-r, x0+r s.ymin, s.ymax = y0-r, y0+r s.zmin, s.zmax = z0-r, z0+r s.shape = True return s