function sphere(block, radius) {
  var lastRadius = radius,
    slices = [[radius, 0]],
    bm = this.getBlockIdAndMeta(block),
    r2 = radius * radius,
    i = 0,
    newRadius,
    yOffset,
    sr,
    sh,
    v,
    h;

  if (radius > 127) {
    throw new Error('Sphere radius must be less than 128 blocks');
  }
  for (i = 0; i <= radius; i++) {
    newRadius = Math.round(Math.sqrt(r2 - i * i));
    if (newRadius == lastRadius) {
      slices[slices.length - 1][1]++;
    } else {
      slices.push([newRadius, 1]);
    }
    lastRadius = newRadius;
  }
  this.chkpt('sphere');
  //
  // mid section
  //
  this.up(radius - slices[0][1])
    .cylinder(block, radius, slices[0][1] * 2 - 1, {
      blockType: bm[0],
      meta: bm[1]
    })
    .down(radius - slices[0][1]);

  yOffset = -1;
  for (i = 1; i < slices.length; i++) {
    yOffset += slices[i - 1][1];
    sr = slices[i][0];
    sh = slices[i][1];
    v = radius + yOffset;
    h = radius - sr;
    // northern hemisphere
    this.up(v)
      .fwd(h)
      .right(h)
      .cylinder(block, sr, sh, { blockType: bm[0], meta: bm[1] })
      .left(h)
      .back(h)
      .down(v);

    // southern hemisphere
    v = radius - (yOffset + sh + 1);
    this.up(v)
      .fwd(h)
      .right(h)
      .cylinder(block, sr, sh, { blockType: bm[0], meta: bm[1] })
      .left(h)
      .back(h)
      .down(v);
  }
  return this.move('sphere');
}
*********************************************************************
### Drone.sphere() method

Creates a sphere.

#### Parameters
block - The block the sphere will be made of.
radius - The radius of the sphere.

#### Example

To create a sphere of Iron with a radius of 10 blocks...

    sphere( blocks.iron, 10);

![sphere example](img/sphereex1.png)

Spheres are time-consuming to make. You *can* make large spheres (250 radius) but expect the
server to be very busy for a couple of minutes while doing so.
*