Latest 1.0
Homepage https://github.com/Kyome22/BooleanPath
License MIT
Platforms osx 10.10, requires ARC
Frameworks Foundation, Cocoa, QuartzCore
Authors

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()

Latest podspec

{
    "name": "BooleanPath",
    "version": "1.0",
    "summary": "Add boolean operations to NSBezierPath like the pathfinder of Adobe Illustrator.",
    "description": "This is a rewrite of VectorBoolean written by Leslie Titze's.nBooleanPath is written by Swift for macOS.",
    "homepage": "https://github.com/Kyome22/BooleanPath",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Takuto Nakamura": "[email protected]"
    },
    "social_media_url": "https://twitter.com/Kyomesuke3",
    "platforms": {
        "osx": "10.10"
    },
    "source": {
        "git": "https://github.com/Kyome22/BooleanPath.git",
        "tag": "1.0"
    },
    "frameworks": [
        "Foundation",
        "Cocoa",
        "QuartzCore"
    ],
    "source_files": "BooleanPath/**/*.swift",
    "swift_version": "4.2",
    "requires_arc": true
}

Pin It on Pinterest

Share This