0.2.1 • Published 5 years ago

path-warp-paper v0.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

path-warp-paper.js Build Status

Warp a path to fit other boundary paths. Paper.js implementation.

Demo

Installation

npm install path-warp-paper

Usage

The feature is registered as an extension to Path and CompoundPath in Paper.js. Paper.js is built for canvas rendering, but it can also be used as a calculation library unattached to canvas (export elements to SVG).

Canvas render

import paper from 'paper'
import PathWarp from 'path-warp-paper';

paper.setup('canvasId');
new PathWarp().register(paper);

const top = new paper.Path(...);
const bottom = new paper.Path(...);
const target = new paper.Path(...);
target.warpBetween(top, bottom);

SVG render

paper.setup();
new PathWarp().register(paper);

const top = new paper.Path(...);
const bottom = new paper.Path(...);
const target = new paper.Path(...);
target.warpBetween(top, bottom);

cosnt svgPath = target.exportSVG();
document.getElementById('svgId').appendChild(svgPath);

Working with this project

Tests

npm run test

Demo

npm run demo

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago