@pencil.js/path

Hand-free drawing tool for Pencil.js package.

Usage no npm install needed!

<script type="module">
  import pencilJsPath from 'https://cdn.skypack.dev/@pencil.js/path';
</script>

README

Line

Hand-free drawing tool.

Path example

Installation

npm install @pencil.js/path

Examples

import Path from "@pencil.js/path";

const from = startingPosition;
const path = new Path(from, [
    Path.lineTo(pos1),
    Path.moveTo(pos2),
    Path.quadTo(pos3, controlPoint),
    Path.bezierTo(pos4, controlPoint1, controlPoint2),
], isClosed, options);

PathOptions

Inherit from ComponentOptions if the path is closed, or from LineOptions otherwise.

Path have no specific options.