0.1.0 • Published 2 years ago

@santigp258/simplify v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@santigp258/simplify

Extracts Path#simplify() from Paper.js

Installation

npm install @santigp258/simplify

or

yarn add @santigp258/simplify

API

simplifySvgPath(
  points: [x: number, y: number][], // `{ x: number, y: number }[]` is also acceptable
  {
    tolerance: number = 2.5,
    precision: number = 5,
  } = {}
): string
// SVG path command string such as
// "M10,10c0,3.33333 -2.35702,7.64298 0,10c2.35702,2.35702 6.66667,0 10,0"

Note

This repo is a fork of @luncheon/simplify-svg-path

Also The logic is a copy of Paper.js v0.12.11.