Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-07-28 11:33:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-07-28 11:33:14 +0300
commit3673a5adba1ba2ed9d4d527ca4ba9d81f199b35d (patch)
tree1a51c1b97a816c669d4a8fe8e029d0b09d3025f5 /extern
parent5ecc6a824a184c96c30a19934b7bb1a16c431cfd (diff)
Curve Fitting: Use normalized projection function
Diffstat (limited to 'extern')
-rw-r--r--extern/curve_fit_nd/intern/curve_fit_cubic_refit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/extern/curve_fit_nd/intern/curve_fit_cubic_refit.c b/extern/curve_fit_nd/intern/curve_fit_cubic_refit.c
index 9024296395e..b51535bab10 100644
--- a/extern/curve_fit_nd/intern/curve_fit_cubic_refit.c
+++ b/extern/curve_fit_nd/intern/curve_fit_cubic_refit.c
@@ -947,14 +947,17 @@ static uint curve_incremental_simplify_corners(
dims);
if (split_index != SPLIT_POINT_INVALID) {
+ const double *co_prev = &params.pd->points[k_prev->index * dims];
+ const double *co_next = &params.pd->points[k_next->index * dims];
+ const double *co_split = &params.pd->points[split_index * dims];
- project_vn_vnvn(k_proj_ref, &pd->points[k_prev->index * dims], k_prev->tan[1], dims);
- project_vn_vnvn(k_proj_split, &pd->points[split_index * dims], k_prev->tan[1], dims);
+ project_vn_vnvn_normalized(k_proj_ref, co_prev, k_prev->tan[1], dims);
+ project_vn_vnvn_normalized(k_proj_split, co_split, k_prev->tan[1], dims);
if (len_squared_vnvn(k_proj_ref, k_proj_split, dims) < error_sq_2x_max) {
- project_vn_vnvn(k_proj_ref, &pd->points[k_next->index * dims], k_next->tan[0], dims);
- project_vn_vnvn(k_proj_split, &pd->points[split_index * dims], k_next->tan[0], dims);
+ project_vn_vnvn_normalized(k_proj_ref, co_next, k_next->tan[0], dims);
+ project_vn_vnvn_normalized(k_proj_split, co_split, k_next->tan[0], dims);
if (len_squared_vnvn(k_proj_ref, k_proj_split, dims) < error_sq_2x_max) {