init(bezierPath:creationDate:pointProvider:)
Creates a stroke path recreating the specified Bézier path as a cubic uniform B-Spline.
Declaration
init(bezierPath: CGPath, creationDate: Date, pointProvider: (PKStrokePath.ConvertedBezierPoint) -> PKStrokePoint)Parameters
- bezierPath:
The Bézier path to convert to a cubic uniform B-Spline
- creationDate:
The start time of this path.
- pointProvider:
Closure to initialize the
PKStrokePoints of the path with specific values.
Discussion
The count of control points of the generated spline is not guaranteed to be a specific value except when the provided path is the output of bezierRepresentation->CGPath, where it will match the original curve.
The output B-Spline will have continuous curvature and 0 curvature at the endpoints. In cases where the B-Spline cannot fully recreate the Bézier path, it will be an approximation. For example, if the given Bézier path includes line to elements, these will produce straight line segments in the resulting B-Spline, but if a line to element is adjacent to a curve to element, the resulting curve may not match the original.