@mocanvas/mocanvas · function

smoothPoints

declare function smoothPoints<P extends VecLike>(points: readonly P[]): P[]

One pass of a light 1-2-1 moving average over a freehand stroke. Endpoints are kept fixed so the stroke still starts and ends where the pen did. Extra properties on each point (e.g. pressure z) are preserved.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.