Skip to content

Commit

Permalink
Merge pull request #15 from hfutrell/0.1.8-release
Browse files Browse the repository at this point in the history
0.1.8 release
  • Loading branch information
hfutrell authored Aug 28, 2018
2 parents 4099892 + 0068f05 commit adaeabe
Show file tree
Hide file tree
Showing 14 changed files with 802 additions and 283 deletions.
4 changes: 2 additions & 2 deletions BezierKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

Pod::Spec.new do |s|
s.name = "BezierKit"
s.version = "0.1.7"
s.summary = "comprehensive Bezier curve library written in Swift based on the popular Bezier.js library"
s.version = "0.1.8"
s.summary = "comprehensive Bezier curve library written in Swift"
s.homepage = "https://github.com/hfutrell/BezierKit"
s.license = "MIT"
s.author = { "Holmes Futrell" => "[email protected]" }
Expand Down
30 changes: 18 additions & 12 deletions BezierKit/BezierKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
FD05111820153EAE000D035E /* BoundingBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD05111720153EAE000D035E /* BoundingBoxTests.swift */; };
FD05111920153EAE000D035E /* BoundingBoxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD05111720153EAE000D035E /* BoundingBoxTests.swift */; };
FD149EBA2135CBFF009E791D /* AugmentedGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD149EB92135CBFF009E791D /* AugmentedGraph.swift */; };
FD149EBB2135CBFF009E791D /* AugmentedGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD149EB92135CBFF009E791D /* AugmentedGraph.swift */; };
FD26253F1EAC7B9A00C64652 /* BezierKit_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FD26253D1EAC7B9A00C64652 /* BezierKit_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
FD4024502110CF5100FA723C /* QuadraticBezierCurveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD40244F2110CF5100FA723C /* QuadraticBezierCurveTests.swift */; };
FD4024512110CF5100FA723C /* QuadraticBezierCurveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD40244F2110CF5100FA723C /* QuadraticBezierCurveTests.swift */; };
Expand All @@ -19,8 +21,8 @@
FD4A63FF200AA50B00930E10 /* Shape.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A63FD200AA50B00930E10 /* Shape.swift */; };
FD4A6403200ACBD200930E10 /* ShapeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6400200ACB8900930E10 /* ShapeTests.swift */; };
FD4A6404200ACBD200930E10 /* ShapeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6400200ACB8900930E10 /* ShapeTests.swift */; };
FD4A6408200B11DF00930E10 /* PolyBezierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6405200B11DA00930E10 /* PolyBezierTests.swift */; };
FD4A6409200B11DF00930E10 /* PolyBezierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6405200B11DA00930E10 /* PolyBezierTests.swift */; };
FD4A6408200B11DF00930E10 /* PathComponentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6405200B11DA00930E10 /* PathComponentTests.swift */; };
FD4A6409200B11DF00930E10 /* PathComponentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4A6405200B11DA00930E10 /* PathComponentTests.swift */; };
FDA727591ED5035300011871 /* CubicBezierCurveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA727581ED5035300011871 /* CubicBezierCurveTests.swift */; };
FDA7275A1ED5035300011871 /* CubicBezierCurveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA727581ED5035300011871 /* CubicBezierCurveTests.swift */; };
FDB6B4021EAFD6DF00001C61 /* BezierCurve.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3F71EAFD6DF00001C61 /* BezierCurve.swift */; };
Expand All @@ -31,8 +33,8 @@
FDB6B4071EAFD6DF00001C61 /* Draw.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3F91EAFD6DF00001C61 /* Draw.swift */; };
FDB6B40C1EAFD6DF00001C61 /* CGPoint+Overloads.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FC1EAFD6DF00001C61 /* CGPoint+Overloads.swift */; };
FDB6B40D1EAFD6DF00001C61 /* CGPoint+Overloads.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FC1EAFD6DF00001C61 /* CGPoint+Overloads.swift */; };
FDB6B40E1EAFD6DF00001C61 /* PolyBezier.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FD1EAFD6DF00001C61 /* PolyBezier.swift */; };
FDB6B40F1EAFD6DF00001C61 /* PolyBezier.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FD1EAFD6DF00001C61 /* PolyBezier.swift */; };
FDB6B40E1EAFD6DF00001C61 /* PathComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FD1EAFD6DF00001C61 /* PathComponent.swift */; };
FDB6B40F1EAFD6DF00001C61 /* PathComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FD1EAFD6DF00001C61 /* PathComponent.swift */; };
FDB6B4101EAFD6DF00001C61 /* QuadraticBezierCurve.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FE1EAFD6DF00001C61 /* QuadraticBezierCurve.swift */; };
FDB6B4111EAFD6DF00001C61 /* QuadraticBezierCurve.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FE1EAFD6DF00001C61 /* QuadraticBezierCurve.swift */; };
FDB6B4121EAFD6DF00001C61 /* Types.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB6B3FF1EAFD6DF00001C61 /* Types.swift */; };
Expand Down Expand Up @@ -114,6 +116,7 @@
FD0F54F51DC43FFB0084CDCD /* MacDemos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacDemos.app; sourceTree = BUILT_PRODUCTS_DIR; };
FD0F55081DC43FFB0084CDCD /* BezierKitTestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BezierKitTestHelpers.swift; sourceTree = "<group>"; };
FD0F550A1DC43FFB0084CDCD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FD149EB92135CBFF009E791D /* AugmentedGraph.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AugmentedGraph.swift; sourceTree = "<group>"; };
FD26253B1EAC7B9A00C64652 /* BezierKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BezierKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FD26253D1EAC7B9A00C64652 /* BezierKit_iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BezierKit_iOS.h; sourceTree = "<group>"; };
FD26253E1EAC7B9A00C64652 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -123,13 +126,13 @@
FD4A0DC31EAAD01F0031A393 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FD4A63FD200AA50B00930E10 /* Shape.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Shape.swift; path = Library/Shape.swift; sourceTree = SOURCE_ROOT; };
FD4A6400200ACB8900930E10 /* ShapeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShapeTests.swift; sourceTree = "<group>"; };
FD4A6405200B11DA00930E10 /* PolyBezierTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolyBezierTests.swift; sourceTree = "<group>"; };
FD4A6405200B11DA00930E10 /* PathComponentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathComponentTests.swift; sourceTree = "<group>"; };
FDA727581ED5035300011871 /* CubicBezierCurveTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CubicBezierCurveTests.swift; sourceTree = "<group>"; };
FDB6B3F71EAFD6DF00001C61 /* BezierCurve.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BezierCurve.swift; sourceTree = "<group>"; };
FDB6B3F81EAFD6DF00001C61 /* CubicBezierCurve.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CubicBezierCurve.swift; sourceTree = "<group>"; };
FDB6B3F91EAFD6DF00001C61 /* Draw.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Draw.swift; sourceTree = "<group>"; };
FDB6B3FC1EAFD6DF00001C61 /* CGPoint+Overloads.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CGPoint+Overloads.swift"; sourceTree = "<group>"; };
FDB6B3FD1EAFD6DF00001C61 /* PolyBezier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PolyBezier.swift; sourceTree = "<group>"; };
FDB6B3FD1EAFD6DF00001C61 /* PathComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathComponent.swift; sourceTree = "<group>"; };
FDB6B3FE1EAFD6DF00001C61 /* QuadraticBezierCurve.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuadraticBezierCurve.swift; sourceTree = "<group>"; };
FDB6B3FF1EAFD6DF00001C61 /* Types.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Types.swift; sourceTree = "<group>"; };
FDB6B4001EAFD6DF00001C61 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -236,7 +239,7 @@
FD40244F2110CF5100FA723C /* QuadraticBezierCurveTests.swift */,
FDEB70A31F3674CB00539003 /* ArcApproximateableTests.swift */,
FD4A6400200ACB8900930E10 /* ShapeTests.swift */,
FD4A6405200B11DA00930E10 /* PolyBezierTests.swift */,
FD4A6405200B11DA00930E10 /* PathComponentTests.swift */,
FD05111720153EAE000D035E /* BoundingBoxTests.swift */,
FDC7D705211288BD00A9EEF0 /* PathTests.swift */,
FDC859592118EC5600AF7642 /* DrawTests.swift */,
Expand Down Expand Up @@ -272,11 +275,12 @@
FDE6CD911EC92EDF00FAB479 /* ArcApproximateable.swift */,
FDB6B3F91EAFD6DF00001C61 /* Draw.swift */,
FDB6B3FC1EAFD6DF00001C61 /* CGPoint+Overloads.swift */,
FDB6B3FD1EAFD6DF00001C61 /* PolyBezier.swift */,
FDB6B3FF1EAFD6DF00001C61 /* Types.swift */,
FDB6B4001EAFD6DF00001C61 /* Utils.swift */,
FD4A63FD200AA50B00930E10 /* Shape.swift */,
FDC7D7012111323A00A9EEF0 /* Path.swift */,
FDB6B3FD1EAFD6DF00001C61 /* PathComponent.swift */,
FD149EB92135CBFF009E791D /* AugmentedGraph.swift */,
FDC859622119274A00AF7642 /* BoundingVolumeHierarchy.swift */,
);
path = Library;
Expand Down Expand Up @@ -547,14 +551,15 @@
FDC859642119274A00AF7642 /* BoundingVolumeHierarchy.swift in Sources */,
FD4A63FF200AA50B00930E10 /* Shape.swift in Sources */,
FDB6B40D1EAFD6DF00001C61 /* CGPoint+Overloads.swift in Sources */,
FDB6B40F1EAFD6DF00001C61 /* PolyBezier.swift in Sources */,
FDB6B40F1EAFD6DF00001C61 /* PathComponent.swift in Sources */,
FDB6B4151EAFD6DF00001C61 /* Utils.swift in Sources */,
FDB6B4071EAFD6DF00001C61 /* Draw.swift in Sources */,
FDB6B4131EAFD6DF00001C61 /* Types.swift in Sources */,
FDB6B4031EAFD6DF00001C61 /* BezierCurve.swift in Sources */,
FDE6CD931EC92EDF00FAB479 /* ArcApproximateable.swift in Sources */,
FDB6B4051EAFD6DF00001C61 /* CubicBezierCurve.swift in Sources */,
FDE6CD8D1EC8F2F800FAB479 /* LineSegment.swift in Sources */,
FD149EBB2135CBFF009E791D /* AugmentedGraph.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -567,22 +572,23 @@
FDC455EE211D057E00DBF2B2 /* BoundingVolumeHierarchy.swift in Sources */,
FD4A63FE200AA50B00930E10 /* Shape.swift in Sources */,
FDB6B40C1EAFD6DF00001C61 /* CGPoint+Overloads.swift in Sources */,
FDB6B40E1EAFD6DF00001C61 /* PolyBezier.swift in Sources */,
FDB6B40E1EAFD6DF00001C61 /* PathComponent.swift in Sources */,
FDB6B4141EAFD6DF00001C61 /* Utils.swift in Sources */,
FDB6B4061EAFD6DF00001C61 /* Draw.swift in Sources */,
FDB6B4121EAFD6DF00001C61 /* Types.swift in Sources */,
FDB6B4021EAFD6DF00001C61 /* BezierCurve.swift in Sources */,
FDE6CD921EC92EDF00FAB479 /* ArcApproximateable.swift in Sources */,
FDB6B4041EAFD6DF00001C61 /* CubicBezierCurve.swift in Sources */,
FDE6CD8C1EC8F2F800FAB479 /* LineSegment.swift in Sources */,
FD149EBA2135CBFF009E791D /* AugmentedGraph.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FDB9D72C1EB28CEB00413F0E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FD4A6408200B11DF00930E10 /* PolyBezierTests.swift in Sources */,
FD4A6408200B11DF00930E10 /* PathComponentTests.swift in Sources */,
FD4A6403200ACBD200930E10 /* ShapeTests.swift in Sources */,
FDF0664E1FFA0C9900123308 /* BezierCurveTests.swift in Sources */,
FDEB70A41F3674CB00539003 /* ArcApproximateableTests.swift in Sources */,
Expand All @@ -601,7 +607,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FD4A6409200B11DF00930E10 /* PolyBezierTests.swift in Sources */,
FD4A6409200B11DF00930E10 /* PathComponentTests.swift in Sources */,
FD4A6404200ACBD200930E10 /* ShapeTests.swift in Sources */,
FDF0664F1FFA0C9900123308 /* BezierCurveTests.swift in Sources */,
FDEB70A51F3674CB00539003 /* ArcApproximateableTests.swift in Sources */,
Expand Down
12 changes: 6 additions & 6 deletions BezierKit/BezierKitTests/BezierCurveTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class BezierCurveTests: XCTestCase {
func testOutlineDistance() {
// When only one distance value is given, the outline is generated at distance d on both the normal and anti-normal
let lineSegment = BezierCurveTests.lineSegmentForOutlining
let outline: PolyBezier = lineSegment.outline(distance: 1)
let outline: PathComponent = lineSegment.outline(distance: 1)
XCTAssertEqual(outline.curves.count, 4)

let (o0, o1, o2, o3) = lineOffsets(lineSegment, 1, 1, 1, 1)
Expand All @@ -163,7 +163,7 @@ class BezierCurveTests: XCTestCase {
let lineSegment = BezierCurveTests.lineSegmentForOutlining
let distanceAlongNormal: CGFloat = 1
let distanceOppositeNormal: CGFloat = 2
let outline: PolyBezier = lineSegment.outline(distanceAlongNormal: distanceAlongNormal, distanceOppositeNormal: distanceOppositeNormal)
let outline: PathComponent = lineSegment.outline(distanceAlongNormal: distanceAlongNormal, distanceOppositeNormal: distanceOppositeNormal)
XCTAssertEqual(outline.curves.count, 4)

let o0 = lineSegment.startingPoint + distanceAlongNormal * lineSegment.normal(0)
Expand All @@ -185,7 +185,7 @@ class BezierCurveTests: XCTestCase {
let distanceAlongNormal2: CGFloat = 1
let distanceOppositeNormal2: CGFloat = 2

let outline: PolyBezier = lineSegment.outline(distanceAlongNormalStart: distanceAlongNormal1,
let outline: PathComponent = lineSegment.outline(distanceAlongNormalStart: distanceAlongNormal1,
distanceOppositeNormalStart: distanceOppositeNormal1,
distanceAlongNormalEnd: distanceAlongNormal2,
distanceOppositeNormalEnd: distanceOppositeNormal2)
Expand All @@ -206,7 +206,7 @@ class BezierCurveTests: XCTestCase {
// 2. quadratics are upgrade in the outline function (why?)

let q = QuadraticBezierCurve(p0: CGPoint(x: 0.0, y: 0.0), p1: CGPoint(x: 9.0, y: 11.0), p2: CGPoint(x: 20.0, y: 20.0))
let outline: PolyBezier = q.outline(distanceAlongNormalStart: sqrt(2), distanceOppositeNormalStart: sqrt(2), distanceAlongNormalEnd: 2 * sqrt(2), distanceOppositeNormalEnd: 2 * sqrt(2))
let outline: PathComponent = q.outline(distanceAlongNormalStart: sqrt(2), distanceOppositeNormalStart: sqrt(2), distanceAlongNormalEnd: 2 * sqrt(2), distanceOppositeNormalEnd: 2 * sqrt(2))

let expectedSegment1 = LineSegment(p0: CGPoint(x: 1, y: -1), p1: CGPoint(x: -1, y: 1))
let expectedSegment2 = QuadraticBezierCurve(p0: CGPoint(x: -1, y: 1), p1: CGPoint(x: 7.5, y: 12.5), p2: CGPoint(x: 18, y: 22))
Expand All @@ -225,7 +225,7 @@ class BezierCurveTests: XCTestCase {
// this tests a special corner case of outlines where endpoint normals are parallel

let q = QuadraticBezierCurve(p0: CGPoint(x: 0.0, y: 0.0), p1: CGPoint(x: 5.0, y: 0.0), p2: CGPoint(x: 10.0, y: 0.0))
let outline: PolyBezier = q.outline(distance: 1)
let outline: PathComponent = q.outline(distance: 1)

let expectedSegment1 = LineSegment(p0: CGPoint(x: 0, y: -1), p1: CGPoint(x: 0, y: 1))
let expectedSegment2 = LineSegment(p0: CGPoint(x: 0, y: 1), p1: CGPoint(x: 10, y: 1))
Expand All @@ -243,7 +243,7 @@ class BezierCurveTests: XCTestCase {
// this tests a special corner case of tapered outlines where endpoint normals are parallel

let q = QuadraticBezierCurve(p0: CGPoint(x: 0.0, y: 0.0), p1: CGPoint(x: 10.0, y: 0.0), p2: CGPoint(x: 20.0, y: 0.0))
let outline: PolyBezier = q.outline(distanceAlongNormalStart: 2, distanceOppositeNormalStart: 2, distanceAlongNormalEnd: 1, distanceOppositeNormalEnd: 1)
let outline: PathComponent = q.outline(distanceAlongNormalStart: 2, distanceOppositeNormalStart: 2, distanceAlongNormalEnd: 1, distanceOppositeNormalEnd: 1)

let expectedSegment1 = LineSegment(p0: CGPoint(x: 0.0, y: -2.0), p1: CGPoint(x: 0.0, y: 2.0))
let expectedSegment2 = LineSegment(p0: CGPoint(x: 0.0, y: 2.0), p1: CGPoint(x: 20.0, y: 1.0))
Expand Down
Loading

0 comments on commit adaeabe

Please sign in to comment.