From b5feaa66786f2ede24f9a85a435bb35fa1f86a75 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sun, 4 Aug 2024 15:13:05 +0200 Subject: [PATCH] include first point for bezier length --- butils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/butils.py b/butils.py index da33af4..0764805 100644 --- a/butils.py +++ b/butils.py @@ -132,7 +132,7 @@ def calc_bezier_length(bezier_point_1, bezier_point_2, resolution=20): step = 1/resolution previous_p = bezier_point_1.co length = 0 - for i in range(0, resolution): + for i in range(-1, resolution): t = (i + 1) * step p = calc_point_on_bezier(bezier_point_1, bezier_point_2, t) length += (p - previous_p).length