santigp258 / simplify-svg-path

Extracts Path#simplify() from Paper.js

Home Page:https://www.npmjs.com/package/@santigp258/simplify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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.

About

Extracts Path#simplify() from Paper.js

https://www.npmjs.com/package/@santigp258/simplify

License:MIT License


Languages

Language:TypeScript 99.4%Language:JavaScript 0.6%