Skip to content
Add boolean operations to NSBezierPath like the pathfinder of Adobe Illustrator.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
BooleanPath.xcodeproj
BooleanPath
BooleanPath_Demo
Carthage/Build/Mac
images
.gitignore
BooleanPath.podspec
LICENSE
README.md

README.md

BooleanPath for macOS

Add boolean operations to NSBezierPath like the pathfinder of Adobe Illustrator.

About BooleanPath

This is a rewrite of VectorBoolean written by Leslie Titze's.
BooleanPath is written by Swift for macOS.

Installation

CocoaPods

pod 'BooleanPath'

Carthage

github "Kyome22/BooleanPath"

Demo

The sample code is in the project.

sample

Usage (Example)

import Cocoa
import BooleanPath

let rectPath = NSBezierPath(rect: NSRect(x: 10, y: 30, width: 60, height: 60))
let circlePath = NSBezierPath(ovalIn: NSRect(x: 25, y: 15, width: 50, height: 50))
  
// Union        
let unionPath: NSBezierPath = rectPath.union(circlePath)
unionPath.fill()

// Intersection
let intersectionPath: NSBezierPath = rectPath.intersection(circlePath)
intersectionPath.fill()
        
// Subtraction
let subtractionPath: NSBezierPath = rectPath.subtraction(circlePath)
subtractionPath.fill()
        
// Difference
let differencePath: NSBezierPath = rectPath.difference(circlePath)
differencePath.fill()
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.