function fromCircle(circle, sides, angle) {
  sides = sides ? sides : 32;
  const stride = circle.getStride();
  const layout = circle.getLayout();
  const center = circle.getCenter();
  const arrayLength = stride * (sides + 1);
  const flatCoordinates = new Array(arrayLength);
  for (let i = 0; i < arrayLength; i += stride) {
    flatCoordinates[i] = 0;
    flatCoordinates[i + 1] = 0;
    for (let j = 2; j < stride; j++) {
      flatCoordinates[i + j] = center[j];
    }
  }
  const ends = [flatCoordinates.length];
  const polygon = new Polygon(flatCoordinates, layout, ends);
  makeRegular(polygon, center, circle.getRadius(), angle);
  return polygon;
}
Create a regular polygon from a circle.
@param {import("./Circle.js").default} circle Circle geometry.
@param {number} [sides] Number of sides of the polygon. Default is 32.
@param {number} [angle] Start angle for the first vertex of the polygon in
    counter-clockwise radians. 0 means East. Default is 0.
@return {Polygon} Polygon geometry.
@api