Path
public struct Path
extension Path: CollectionWrapping
extension Path: Additive
extension Path: Equatable
extension Path: CustomStringConvertible
Undocumented
-
Undocumented
Declaration
Swift
public var isShape: Bool { get }
-
Declaration
Swift
public var isEmpty: Bool { get }
Return Value
true
if there are no non-.close
elements contained herein. Otherwise,false
. -
Warning
This uses a simplification technique for calculateing the bounding boxes of quadratic and cubic Bézier curves, which may result in some inaccuracy for whacky curves.
Declaration
Swift
public var axisAlignedBoundingBox: Rectangle { get }
Return Value
The axis-aligned bounding box for
Path
. -
Undocumented
Declaration
Swift
public let curves: [BezierCurve]
-
Create a
Path
with a singlecurve
.Declaration
Swift
public init(_ curve: BezierCurve)
-
Create a
Path
with the givencurves
.Declaration
Swift
public init(_ curves: [BezierCurve])
-
Create a
Path
with the givenpathElements
.Declaration
Swift
public init(pathElements: [PathElement])
-
Declaration
Swift
public func simplified(segmentCount: Int) -> Polygon
Return Value
Polygonal representation of the
Path
.
-
Undocumented
Declaration
Swift
public static func arrowhead( tip: Point = Point(), height: Double = 100, width: Double = 25, barbProportion: Double = 0.25, rotation: Angle = .zero ) -> Path
-
Declaration
Swift
public static func circle(center: Point, radius: Double) -> Path
Return Value
Path
with a circle shape with the givenradius
andcenter
.
-
Declaration
Swift
public static func ellipse(in rect: Rectangle) -> Path
Return Value
Path
with an ellipse shape within the givenrectangle
. -
Undocumented
Declaration
Swift
public static func line(from start: Point, to end: Point) -> Path
-
Note
The sides are always vertical, independant of the slope.
Note
Useful for accidental components and system dividers.
Declaration
Swift
public static func parallelogram( center: Point, height: Double, width: Double, slope: Double ) -> Path
Return Value
Path
of a slanted bar. -
Creates a
Path
with the givenpolygon
.Declaration
Swift
public init<P>(_ polygon: P) where P : PolygonProtocol
-
Undocumented
Declaration
Swift
public init(vertices: [Point])
-
Declaration
Swift
public static func rectangle(_ rect: Rectangle) -> Path
Return Value
Path
with a rectangle shape defined byrectangle
. -
Declaration
Swift
public static func rectangle(origin: Point, size: Size) -> Path
Return Value
Path
with a rectangle shape with the givenorigin
andsize
. -
Declaration
Swift
public static func rectangle(x: Double, y: Double, width: Double, height: Double) -> Path
Return Value
Path
with a rectangle shape with the givenx
,y
,width
, andheight
values.
-
Undocumented
Declaration
Swift
public static func square(center: Point, width: Double) -> Path
-
Declaration
Swift
public func scaled(by amount: Double, from reference: Point = Point()) -> Path
Return Value
Path
scaled by the givenamount
from the givenreference
point. -
Declaration
Swift
public func rotated(by angle: Angle, around reference: Point = Point()) -> Path
Return Value
Path
rotated by the givenangle
around the givenreference
point. -
Declaration
Swift
public func translated(by point: Point) -> Path
Return Value
Path
translated by the givenpoint
. -
Declaration
Swift
public func translatedBy(x: Double, y: Double) -> Path
Return Value
Path
translated by the givenx
andy
values.
-
Declaration
Swift
public static var builder: AllowingMoveTo { get }
Return Value
Builder
object that only exposes themove(to:)
method, as it is a required first element for aPath
. -
Declaration
Swift
public var base: [BezierCurve] { get }
-
Empty path.
Declaration
Swift
public static let zero: Path
-
Declaration
Swift
public static func + (lhs: Path, rhs: Path) -> Path
Return Value
New
Path
with elements of two paths.
-
Printed description.
Declaration
Swift
public var description: String { get }