Skip to main content

fit-quads-to-cubic-hausdorff

function fitQuadsToCubicHausdorff(ps: number[][], tolerance: number): number[][][]

Defined in fit/fit-quads-to-cubic-hausdorff.ts:24

Approximate the given cubic bezier curve (up to the given tolerance) by fitting an array of ordered (by t value) piecewise bezier curves (of quadratic order or less).

  • the start and end point of each approximating curve lies on the cubic curve and the the tangents of each approximating curve coincide with that of the cubic at each such point

Parameters:

NameTypeDescription
psnumber[][]a cubic bezier curve given as an ordered array of its control point coordinates, e.g. [[0,0], [1,1], [2,1], [2,0]]
tolerancenumbertolerance given as the maximum hausdorff distance between the two curves