Fix T80742: curve bevel fails with zero length handles at end-point
Initialize the direction on the first/last points of the curve.
The fix from 23a4149778
exposed this error.
This commit is contained in:
parent
60c3ef3d61
commit
4987b7d347
Notes:
blender-bot
2023-02-14 10:18:56 +01:00
Referenced by commit5f1a155a5e
, Fix T83117: Curve bevel not handle aligned at end-points Referenced by commit71ff935fd6
, Revert "Fix T80742: curve bevel fails with zero length handles at end-point" Referenced by issue #80742, Bezier incorrect behavior during transformations
|
@ -2202,6 +2202,22 @@ static void bevel_list_calc_bisect(BevList *bl)
|
|||
bevp1 = bevp2;
|
||||
bevp2++;
|
||||
}
|
||||
|
||||
if (is_cyclic == false) {
|
||||
bevp0 = &bl->bevpoints[0];
|
||||
bevp1 = &bl->bevpoints[1];
|
||||
sub_v3_v3v3(bevp0->dir, bevp1->vec, bevp0->vec);
|
||||
if (normalize_v3(bevp0->dir) == 0.0f) {
|
||||
copy_v3_v3(bevp0->dir, bevp1->dir);
|
||||
}
|
||||
|
||||
bevp0 = &bl->bevpoints[bl->nr - 2];
|
||||
bevp1 = &bl->bevpoints[bl->nr - 1];
|
||||
sub_v3_v3v3(bevp1->dir, bevp1->vec, bevp0->vec);
|
||||
if (normalize_v3(bevp1->dir) == 0.0f) {
|
||||
copy_v3_v3(bevp1->dir, bevp0->dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
static void bevel_list_flip_tangents(BevList *bl)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue