From 2418daede5913c54bd9675eb23624487f6b0ad4c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Jul 2016 14:12:17 +1000 Subject: Curve Fitting: Add alternate 'refit' method This is an alternative method for fitting a curve which incrementally simplifies the curve, then re-fits. Generally gives better results, also improves corner detection. --- source/blender/editors/curve/editcurve.c | 2 +- source/blender/editors/curve/editcurve_paint.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 72b48a32477..e40dde24ce2 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5843,7 +5843,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) normalize_v3(tan_r); curve_fit_cubic_to_points_single_fl( - points, points_len, dims, FLT_EPSILON, + points, points_len, NULL, dims, FLT_EPSILON, tan_l, tan_r, bezt_prev->vec[2], bezt_next->vec[0], &error_sq_dummy); diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 38018541929..ac0dc2a0c26 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -912,7 +912,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op) const int result = curve_fit_cubic_to_points_fl( coords, stroke_len, dims, error_threshold, CURVE_FIT_CALC_HIGH_QUALIY, - corners, corners_len, + corners, NULL, corners_len, &cubic_spline, &cubic_spline_len, NULL, &corners_index, &corners_index_len); -- cgit v1.2.3