telva-curve
v1.1.1
Published
Curve utilities for telva and maybe you, too.
Maintainers
Readme
telva-curve
Curve and spline helpers for smooth drawing, path interpolation, and animation-friendly geometry.
Install
npm i telva-curveTypical use cases
- Bezier and spline control-point generation.
- Path interpolation and point sampling.
- Stroke smoothing for freehand or pen-like workflows.
Quick example
import { computePointOnSpline, cubicBezier, getSpline } from 'telva-curve'
const controls = getSpline(
[
[0, 0],
[40, 80],
[90, 20],
[140, 100],
],
0.5
)
const pointAtHalf = computePointOnSpline(0.5, controls)
const eased = cubicBezier(0.4, 0.16, 1, 0.3, 1)How it works internally
- Converts discrete points into curve control structures with adjustable tension.
- Exposes both segment-level Bezier generation (
getTLBezierCurveSegments) and spline helpers (getSpline). - Includes evaluators for interpolated positions (
computePointOnSpline) and easing-like curves (cubicBezier). - Keeps APIs pure and predictable for deterministic rendering pipelines.
Workspace scripts
yarn dev
yarn build
yarn lintLicense
AGPL-3.0-only
