Polygon
public struct Polygon : PolygonProtocol
extension Polygon: Additive
extension Polygon: Equatable
extension Polygon: CustomStringConvertible
Polgonal shape containing at least three vertices.
-
Note
In the case that this
Polygon
is convex, theConvexPolygonContainer
is initialized with it. In the case the thisPolygon
is concave, it is broken up into the minimum number of triangles through an Ear Clipping method.Declaration
Swift
public var collisionDetectable: ConvexPolygonContainer { get }
Return Value
ConvexPolygonContainer
that can be used for collision detection. -
Declaration
Swift
public var convexHull: Polygon { get }
Return Value
Convex hull of vertices in
Polygon
. -
Vertices contained herein.
Declaration
Swift
public let vertices: VertexCollection
-
Create a unconstrained
Polygon
from anyPolygonProtocol
-conforming type.Declaration
Swift
public init(_ polygon: PolygonProtocol)
-
Empty polygon.
Declaration
Swift
public static let zero: Polygon
-
Creates union of two given
Polygon
values.Declaration
Swift
public static func + (lhs: Polygon, rhs: Polygon) -> Polygon
-
Print the vertices in order of their appearance
Declaration
Swift
public var description: String { get }