diff options
| author | eleanor-park <eleanor_park@brown.edu> | 2024-06-11 11:15:25 -0400 |
|---|---|---|
| committer | eleanor-park <eleanor_park@brown.edu> | 2024-06-11 11:15:25 -0400 |
| commit | 33761fc2227458acf36a5cc4b1f08eaae6e58695 (patch) | |
| tree | 040cd6388d37f77bd9b3704d1b80443e0b3784ed /src/client/util/bezierFit.ts | |
| parent | 2277349fc4d5460e94a7a6b705b56488c0efb184 (diff) | |
some changes
Diffstat (limited to 'src/client/util/bezierFit.ts')
| -rw-r--r-- | src/client/util/bezierFit.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/util/bezierFit.ts b/src/client/util/bezierFit.ts index d6f3f2340..bb3b6b1eb 100644 --- a/src/client/util/bezierFit.ts +++ b/src/client/util/bezierFit.ts @@ -557,6 +557,12 @@ function FitCubic(d: Point[], first: number, last: number, tHat1: Point, tHat2: const negThatCenter = new Point(-tHatCenter.X, -tHatCenter.Y); FitCubic(d, splitPoint2D, last, negThatCenter, tHat2, error, result); } +/** + * Convert polyline coordinates to a (multi) segment bezier curve + * @param d - polyline coordinates + * @param error - how much error to allow in fitting (measured in pixels) + * @returns + */ export function FitCurve(d: Point[], error: number) { const tHat1 = ComputeLeftTangent(d, 0); // Unit tangent vectors at endpoints const tHat2 = ComputeRightTangent(d, d.length - 1); |
