From 5a15e86ebd12f1a0ff1520a4fb8b08802e9f5f85 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Tue, 11 Dec 2018 18:35:30 +0800 Subject: [PATCH] rename --- src/shape_starburst.scad | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shape_starburst.scad b/src/shape_starburst.scad index 280104fa..248a213e 100644 --- a/src/shape_starburst.scad +++ b/src/shape_starburst.scad @@ -12,20 +12,22 @@ * **/ -function __outer_points(r1, r2, n) = +function __outer_points_shape_starburst(r1, r2, n) = let( a = 360 / n ) [for(i = [0:n-1]) [r1 * cos(a * i), r1 * sin(a * i)]]; -function __inner_points(r1, r2, n) = +function __inner_points_shape_starburst(r1, r2, n) = let ( a = 360 / n, half_a = a / 2 ) [for(i = [0:n-1]) [r2 * cos(a * i + half_a), r2 * sin(a * i + half_a)]]; -function __one_by_one(outer_points, inner_points, i = 0) = +function __one_by_one_shape_starburst(outer_points, inner_points, i = 0) = len(outer_points) == i ? [] : - concat([outer_points[i], inner_points[i]], __one_by_one(outer_points, inner_points, i + 1)); + concat([outer_points[i], inner_points[i]], __one_by_one_shape_starburst(outer_points, inner_points, i + 1)); -function shape_starburst(r1, r2, n) = __one_by_one(__outer_points(r1, r2, n), __inner_points(r1, r2, n)); \ No newline at end of file +function shape_starburst(r1, r2, n) = __one_by_one_shape_starburst( + __outer_points_shape_starburst(r1, r2, n), __inner_points_shape_starburst(r1, r2, n) +); \ No newline at end of file