aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/bezierFit.ts
diff options
context:
space:
mode:
authoreleanor-park <eleanor_park@brown.edu>2024-07-26 00:48:40 -0400
committereleanor-park <eleanor_park@brown.edu>2024-07-26 00:48:40 -0400
commitdecbefe23a1da35c838222bafe8a2c029c6ea794 (patch)
tree799e3f6de81bfa98d3e5d85e91779a986b3bb8d8 /src/client/util/bezierFit.ts
parent8ca26551622d36b7856f5c1865498fa9e5d888b5 (diff)
parentac06e2affd615b926e240a2b15279d3c60360bd4 (diff)
Merge branch 'master' into eleanor-gptdraw
Diffstat (limited to 'src/client/util/bezierFit.ts')
-rw-r--r--src/client/util/bezierFit.ts16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/client/util/bezierFit.ts b/src/client/util/bezierFit.ts
index 693676bc3..e2055887d 100644
--- a/src/client/util/bezierFit.ts
+++ b/src/client/util/bezierFit.ts
@@ -2,18 +2,8 @@
/* eslint-disable prefer-destructuring */
/* eslint-disable no-param-reassign */
/* eslint-disable camelcase */
-import e from 'cors';
import { Point } from '../../pen-gestures/ndollar';
-export enum SVGType {
- Rect = 'rect',
- Path = 'path',
- Circle = 'circle',
- Ellipse = 'ellipse',
- Line = 'line',
- Polygon = 'polygon',
-}
-
class SmartRect {
minx: number = 0;
miny: number = 0;
@@ -567,12 +557,6 @@ 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);