MCPcopy Index your code
hub / github.com/Experience-Monks/chaikin-smooth

github.com/Experience-Monks/chaikin-smooth @v1.0.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.4 ↗ · + Follow
0 symbols 0 edges 2 files 0 documented · 0% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

chaikin-smooth

stable

Chaikin's smoothing algorithm for 2D polylines.

var smooth = require('chaikin-smooth')

var path = [ [0, 0], [25, 25], [13, 13] ]
var smoothedPath = smooth(path)

The result will be:

[ [ 0, 0 ],
  [ 6.25, 6.25 ],
  [ 18.75, 18.75 ],
  [ 22, 22 ],
  [ 16, 16 ],
  [ 13, 13 ] ]

Usage

NPM

smooth(path[, output])

Performs the smoothing algorithm on the specified path, returning a list populated with the additional smoothed points. If the input path has a length of <= 2, the result will be a new array with the same points as the input.

If output is provided, it will push the points onto the specified path instead of creating a new one. This is useful to build a smooth polyline out of several inputs, or to re-use arrays to avoid GC thrashing. If reusing, you should clear the path first to zero-length.

Note: This uses a strict array test, so it is safe to use map and other array functions on it:

var smoothedPaths = paths.map(smooth)

License

MIT, see LICENSE.md for details.

Core symbols most depended-on inside this repo

Shape

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add chaikin-smooth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page