Function createBezierPathFromCoordinates
- createBezierPathFromCoordinates(
inputPath: [number, number][],
outputResolution?: number,
simplificationThreshold?: number,
): [number, number][]Parameters
- inputPath: [number, number][]
Array of [x, y] coordinates that define the original path
- outputResolution: number = 20
Controls how many points are generated along each segment (higher values create smoother curves with more points)
OptionalsimplificationThreshold: numberOptional threshold for simplifying the input path before creating the curves.
Returns [number, number][]
An array of [x, y] coordinates representing the smoothed path
- inputPath: [number, number][]
Was this helpful?
Creates a smoothed path using cubic Bezier curves from an array of coordinates.
This function takes a series of points and creates a smooth path by generating cubic Bezier curves between them. It uses the Catmull-Rom method to automatically calculate control points for each curve segment. If the path has fewer than 4 points, the original path is returned unchanged.