code: public static Shape generatePolygon(int sides, int outsideRadius, int insideRadius,
              boolean normalize) {
          Shape shape = generatePolygon(sides, outsideRadius, insideRadius);
          if (normalize) {
              Rectangle2D bounds = shape.getBounds2D();
              GeneralPath path = new GeneralPath(shape);
              shape = path.createTransformedShape(AffineTransform.getTranslateInstance(
                      -bounds.getX(), -bounds.getY()));
          }
          return shape;
      }
docs: Generates a polygon
  @param sides number of sides
  @param outsideRadius the outside radius
  @param insideRadius the inside radius
  @param normalize normalize
  @return the generated shape