code: function() {
          this.angle = Math.PI * ((1/this.sides) - (1/2));
          if(this.snapAngle) {
              this.angle += this.snapAngle * (Math.PI / 180);
          }
          this.feature.geometry = OpenLayers.Geometry.Polygon.createRegularPolygon(
              this.origin, this.radius, this.sides, this.snapAngle
          );
      }
docs: Method: createGeometry
  Create the new polygon geometry.  This is called at the start of the
  drag and at any point during the drag if the number of sides
  changes.