From 91635e5c7092864ab0d537926feff4017ee37487 Mon Sep 17 00:00:00 2001 From: satabol Date: Sat, 7 Jan 2023 21:12:42 +0300 Subject: [PATCH] fix curves->curve lerp. Node does not interpolate with two-dots bezier curves. --- utils/curve/bezier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/curve/bezier.py b/utils/curve/bezier.py index 4100a2ca9..9e94b214e 100644 --- a/utils/curve/bezier.py +++ b/utils/curve/bezier.py @@ -633,11 +633,11 @@ class SvCubicBezierCurve(SvCurve, SvBezierSplitMixin): def lerp_to(self, curve2, coefficient): if isinstance(curve2, SvCubicBezierCurve): + p0 = (1.0 - coefficient) * self.p0 + coefficient * curve2.p0 p1 = (1.0 - coefficient) * self.p1 + coefficient * curve2.p1 p2 = (1.0 - coefficient) * self.p2 + coefficient * curve2.p2 p3 = (1.0 - coefficient) * self.p3 + coefficient * curve2.p3 - p4 = (1.0 - coefficient) * self.p4 + coefficient * curve2.p4 - return SvCubicBezierCurve(p1, p2, p3, p4) + return SvCubicBezierCurve(p0, p1, p2, p3) return self.to_nurbs().lerp_to(curve2, coefficient) def is_line(self, tolerance=0.001): -- GitLab