From 463ff86592ff220ca5a4c9f13439a0817024f57d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 13 Aug 2013 15:27:49 +0000 Subject: [PATCH] Fix #36461: ends of curves - twist still not good Needed correct quat for first point as well. Maybe it's time to refactor make_minimum_twist function a bit.. --- source/blender/blenkernel/intern/curve.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 26ae1b94aee..b02d587940a 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2242,15 +2242,18 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl) } } else { - /* Need to correct quat for the last point, + /* Need to correct quat for the first/last point, * this is so because previously it was only calculated * using it's own direction, which might not correspond - * the twist of previous point. + * the twist of neighbor point. */ + bevp1 = (BevPoint *)(bl + 1); + bevp0 = bevp1 + 1; + minimum_twist_between_two_points(bevp1, bevp0); + bevp2 = (BevPoint *)(bl + 1); bevp1 = bevp2 + (bl->nr - 1); bevp0 = bevp1 - 1; - minimum_twist_between_two_points(bevp1, bevp0); } }