Latest 1.0.0
Homepage https://github.com/adamwulf/ClippingBezier
License CC BY
Platforms ios 8.0
Dependencies PerformanceBezier
Frameworks Foundation
Authors

This library adds categories to UIBezierPath to simplify clipping a single closed UIBezierPath with another
closed or unclosed UIBezierPath.

ClippingBezier in Loose Leaf

The ClippingBezier.framework powers the scissors tool in Loose Leaf, and it allows
for drawing to be clipped to any imported image scraps.

clipped-pen-example.png

Building the framework

This library will generate a proper static framework bundle that can be used in any iOS7+ project.

Including in your project

  1. Link against the built framework and the included PerformanceBezier framework
  2. Add "-ObjC++ -lstdc++" to the Other Linker Flags in the project’s Settings
  3. import <PerformanceBezier/PerformanceBezier.h>

  4. import <ClippingBezier/ClippingBezier.h>

Dependencies

This library depends on the UIBezierPath performance improvements in the PerformanceBezier library.

Example

UIBezierPath* aClosedPath = /* some path */;
UIBezierPath* scissorPath = /* some other path */;

NSArray* subshapes = [aClosedPath uniqueShapesCreatedFromSlicingWithUnclosedPath:scissorPath];
for(DKUIBezierPathShape* shape in subshapes){
    UIBezierPath* aClosedPathSlice = shape.fullPath;
}

Screenshots

Find intersections between two UIBezierPaths:

intersection-example.png

Or find the component shapes generated from two path’s intersections

scissor-example.png

Sample Application

The Xcode workspace includes a ClippingExampleApp project that shows a fully functional integration of the ClippingBezier framework. You can refer to this example for any questions about how to integrate into your app.

License

The ClippingBezier framework and sample code are provided under the MIT License.

Support This Project

Latest podspec

{
    "name": "ClippingBezier",
    "version": "1.0.0",
    "summary": "This library adds categories to UIBezierPath to simplify clipping a single closed UIBezierPath with another closed or unclosed UIBezierPath.",
    "authors": {
        "Adam Wulf": "[email protected]"
    },
    "homepage": "https://github.com/adamwulf/ClippingBezier",
    "license": {
        "type": "CC BY",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/thaya-cameraxis/ClippingBezier.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "ClippingBezier/*.{h,m,mm,cpp,cxx,hxx,c}"
    ],
    "public_header_files": [
        "ClippingBezier/UIBezierPath+*.h",
        "ClippingBezier/DK*.h",
        "ClippingBezier/ClippingBezier.h",
        "ClippingBezier/MMBackwardCompatible.h"
    ],
    "platforms": {
        "ios": "8.0"
    },
    "frameworks": "Foundation",
    "dependencies": {
        "PerformanceBezier": []
    }
}

Pin It on Pinterest

Share This