1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 05:21:38 +02:00

use for each

This commit is contained in:
Justin Lin
2019-06-15 11:19:31 +08:00
parent 8bc6a0b4c9
commit 5a37620a5b

View File

@@ -38,12 +38,12 @@ function _bezier_corner(round_d, t_step, p1, p2, p3) =
bezier_curve(t_step, _corner_ctrl_pts(round_d, p1, p2, p3)); bezier_curve(t_step, _corner_ctrl_pts(round_d, p1, p2, p3));
function _recursive_bezier_smooth(pts, round_d, t_step, leng, i = 0) = function _recursive_bezier_smooth(pts, round_d, t_step, leng, i = 0) =
i <= leng - 3 ? let(end_i = leng - 2)
concat( [
_bezier_corner(round_d, t_step, pts[i], pts[i + 1], pts[i + 2]), for(i = 0; i < end_i; i = i + 1)
_recursive_bezier_smooth(pts, round_d, t_step, leng, i + 1) each _bezier_corner(round_d, t_step, pts[i], pts[i + 1], pts[i + 2])
) ];
: [];
function bezier_smooth(path_pts, round_d, t_step = 0.1, closed = false) = function bezier_smooth(path_pts, round_d, t_step = 0.1, closed = false) =
let( let(