1.0.0 • Published 2 years ago

curvereduce v1.0.0

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

CurveReduce

This is an implementation of the Ramer-Douglas-Peucker (RDP) curve simplification algorithm in TypeScript.

Usage

Install from the NPM package repository using npm install --save curvereduce.

import { Point, Simplify, SimplifyTo } from 'curvereduce';

const points: Point[] = [
    { x: 1.20401E-09, y: -0.00120428 },
    { x: 0.018, y: 0.241799 },
    { x: 0.1044, y: 1.34392 },
    ...
];

// use an explicit epsilon value
let simplified1 = Simplify(points, 0.1075);

// or specify a number of points you want to end up with
let simplified2 = SimplifyTo(points, 20);

License

This work is licensed under the MIT License.

Credits

This RDP algorithm implementation is heavily influenced by Marius Karthaus's JavaScript implementation.

1.0.0

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.1

3 years ago