 
 // MARK: - Rotate
 
-public extension UIBezierPath {
+public extension BezierPath {
     
     /// Rotate the path in the specified directional `motion` for `angle` (radians).
     public func rotate(_ angle: CGFloat, _ motion: Motion = .clockwise) {
-        switch motion {
-        case .clockwise:
-            apply(CGAffineTransform(rotationAngle: angle))
-        case .anticlockwise:
-            apply(CGAffineTransform(rotationAngle: -angle))
-        }
-    }
-    
-}
+        #if os(iOS)
+            switch motion {
+            case .clockwise:
+                apply(CGAffineTransform(rotationAngle: angle))
+            case .anticlockwise:
+                apply(CGAffineTransform(rotationAngle: -angle))
+            }
+        #elseif os(OSX)
+            switch motion {
+            case .clockwise:
+                transform(using: AffineTransform(rotationByRadians: angle))
+            case .anticlockwise:
+                transform(using: AffineTransform(rotationByRadians: angle))
+            }
+        #endif
+    }
+    
+}


// MARK: - Translate

public extension UIBezierPath {
    
    /// Translate the path rightwards by `tx` and downwards by `ty`.
    public func translate(tx: CGFloat, ty: CGFloat) {
        apply(CGAffineTransform(translationX: tx, y: ty))
    }
    
    /// Translate the path by the polar coordinates defined by `r` and `θ`.


// MARK: - Shape

public extension BezierPath {
    
    /// Add a shape at a location defined by `rect`.
    public func add(_ shape: Shape, at rect: CGRect) {
        #if os(iOS)
            switch shape {
            case .rect:
                append(UIBezierPath(rect: rect))
            case .oval:
                append(UIBezierPath(ovalIn: rect))
            case .roundedRect(let cornerRadius):
                append(UIBezierPath(roundedRect: rect, cornerRadius: cornerRadius))
            }
        #elseif os(OSX)
            switch shape {
            case .rect:
                append(BezierPath(rect: rect))
            case .oval:
                append(BezierPath(ovalIn: rect))
            case .roundedRect(let cornerRadius):
                append(BezierPath(roundedRect: rect, xRadius: cornerRadius, yRadius: cornerRadius))
            }
        #endif
    }
    
    /// Add a rect with `origin` and `size`.
