Polygon

public struct Polygon
extension Polygon: Animatable
extension Polygon: Shape

Undocumented

  • The number of sides belonging to the polygon.

    This value must be greater than or equal to 1. If a value less than 1 is set, it will be clamped to 1 automatically.

    Polygons with 1 or 2 sides will be rendered as a circle.

    Declaration

    Swift

    @Clamping
    public var sides: Int { get set }
  • Default: face

    Declaration

    Swift

    public var renderingMode: MeshRenderingMode
  • Undocumented

    Declaration

    Swift

    public init(
        sides: Int = 3,
        renderingMode: MeshRenderingMode = .face
    )
  • Undocumented

    See more

    Declaration

    Swift

    public enum MeshRenderingMode : String
    extension Polygon.MeshRenderingMode: CaseIterable
    extension Polygon.MeshRenderingMode: Identifiable

AnimatableData

  • Declaration

    Swift

    public var animatableData: CGFloat { get set }

Shape

  • Declaration

    Swift

    public func path(in rect: CGRect) -> Path

Computeds

  • As the decimal part of the newest side grows, this side will go from zero to its full length.

    Declaration

    Swift

    var sidesToDraw: Int { get }
  • A hypotenuse computed to fit inside the available rect

    Declaration

    Swift

    func hypotenuse(in rect: CGRect) -> CGFloat