Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamwulf/clippingbezier
ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
https://github.com/adamwulf/clippingbezier
Last synced: 3 days ago
JSON representation
ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
- Host: GitHub
- URL: https://github.com/adamwulf/clippingbezier
- Owner: adamwulf
- License: mit
- Created: 2015-02-09T22:54:39.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T23:15:06.000Z (19 days ago)
- Last Synced: 2024-10-28T03:22:51.324Z (18 days ago)
- Language: Objective-C
- Homepage: http://getlooseleaf.com/opensource/
- Size: 1.59 MB
- Stars: 256
- Watchers: 11
- Forks: 34
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
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](http://getlooseleaf.com), and it allows
for drawing to be clipped to any imported image scraps.![clipped-pen-example.png](clipped-pen-example.png)
## Available as a Swift Package!
Install ClippingBezier in your project through Swift Package Manager as of v1.2.0!
## 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
4. #import## Dependencies
This library depends on the UIBezierPath performance improvements in the [PerformanceBezier](https://github.com/adamwulf/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](intersection-example.png)
Or find the component shapes generated from two path's intersections
![scissor-example.png](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
- Download [Loose Leaf](https://itunes.apple.com/us/app/loose-leaf/id625659452?mt=8&uo=4&at=10lNUI)
- Follow [@adamwulf](http://twitter.com/adamwulf) on twitter.
- Become a [Github Sponsor](https://github.com/sponsors/adamwulf) and buy me a coffee ☕️ 😄