On this page

Function createBezierPathFromCoordinates

  • 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.

    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: number

      Optional threshold for simplifying the input path before creating the curves.

    Returns [number, number][]

    An array of [x, y] coordinates representing the smoothed path

Was this helpful?
SDK JS
Reference
createBezierPathFromCoordinates