Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caryll/shapeops
Boolean operations and overlap removal for curves.
https://github.com/caryll/shapeops
Last synced: 3 months ago
JSON representation
Boolean operations and overlap removal for curves.
- Host: GitHub
- URL: https://github.com/caryll/shapeops
- Owner: caryll
- License: apache-2.0
- Created: 2016-08-12T04:14:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T13:40:15.000Z (almost 7 years ago)
- Last Synced: 2024-05-10T09:32:20.819Z (6 months ago)
- Language: JavaScript
- Size: 96.7 KB
- Stars: 9
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-typography - caryll / shapeops - Boolean operations and overlap removal for curves. (JavaScript)
README
caryll / shapeops
Boolean operations and overlap removal for curves.## Usage
```javascript
var caryllShapeOps = require('caryll-shapeops');
var shape1 = [[
{x:0, y:0, on:true},
{x:100, y:0, on:false},
{x:200, y:100, on:false},
{x:200, y:200, on:true},
{x:0, y:0, on:true}
], ...];
var shape2 = [...];
var result = caryllShapeOps.boole(caryllShapeOps.ops.intersection, shape1, shap2);
```* `caryllShapeOps.boole(operator, shape1, shap2, fillRule1=caryllShapeOps.fillRules.evenodd, fillrule2=caryllShapeOps.fillRules.evenodd, resolution=100)` Perform boolean operation over `shape1` and `shape2` using given operator.
* `caryllShapeOps.removeOverlap(shape, fillRule=caryllShapeOps.fillrules.evenodd, resolution=100)` Remove overlap area under specified filling rule.