@Override public Path getPath() {
    if (isPathValid) {
      return path;
    }

    path.reset();

    if (hidden) {
      isPathValid = true;
      return path;
    }

    switch (type) {
      case STAR:
        createStarPath();
        break;
      case POLYGON:
        createPolygonPath();
        break;
    }

    path.close();

    trimPaths.apply(path);

    isPathValid = true;
    return path;
  }
This was empirically derived by creating polystars, converting them to
curves, and calculating a scale factor.
It works best for polygons and stars with 3 points and needs more
work otherwise.
lottie/src/main/java/com/airbnb/lottie/animation/content/PolystarContent.java