Giter Site home page Giter Site logo

ticesoftware / clippingbezier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamwulf/clippingbezier

0.0 0.0 0.0 1.87 MB

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths

Home Page: http://getlooseleaf.com/opensource/

License: MIT License

Objective-C 67.51% Objective-C++ 14.47% C++ 16.51% C 1.23% Ruby 0.16% Swift 0.12%
fork lehka-app

clippingbezier's Introduction

ClippingBezier

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

clippingbezier's People

Contributors

adamwulf avatar julsh avatar thaya-cameraxis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.