Skip to content

jimnewpower/line-smoothing

Repository files navigation

codecov

line-smoothing

Smoothing for polylines and polygons. Implementation of George Chaikin's corner-cutting smoothing algorithm. By iterating on calls to the algorithm, more smoothness will be achieved.

code example

Poly original = Poly.create();
original.add(Coordinate.of(0, 0));
original.add(Coordinate.of(10, 0));
original.add(Coordinate.of(10, 10));
original.add(Coordinate.of(0, 10));
original.closePolygon();

Poly smoothed = PolySmoother.chaikin().smooth(original);

Example 1 (Square with 1 iteration)

Example 2 (Square with 2 iterations)

Example 3 (Square with 3 iterations)

Example 4 (Square with 4 iterations)

Example 5 (Polygon with 6 iterations)

Example 6 (Polygon with 6 iterations)

Example 7 (Polyline with 4 iterations)

About

Line smoothing implementation (Chaikin's algorithm)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages