From 12c8ccf59c1b2ab6c8e4fbded3a34bc9c997fb68 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 23 Mar 2017 13:47:20 +0800 Subject: [PATCH] used let --- src/bezier.scad | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bezier.scad b/src/bezier.scad index 667da796..832264f7 100644 --- a/src/bezier.scad +++ b/src/bezier.scad @@ -21,21 +21,22 @@ function bezier_coordinate(t, pn, n, i = 0) = bezier_coordinate(t, pn, n, i + 1)); function _bezier_point(t, points) = + let(n = len(points) - 1) [ bezier_coordinate( t, [points[0][0], points[1][0], points[2][0], points[3][0]], - len(points) - 1 + n ), bezier_coordinate( - t, + t, [points[0][1], points[1][1], points[2][1], points[3][1]], - len(points) - 1 + n ), bezier_coordinate( t, [points[0][2], points[1][2], points[2][2], points[3][2]], - len(points) - 1 + n ) ];