From 0e3a4d4ccdf6884531c811cf6dd0e73551e913d7 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 30 Mar 2022 21:15:21 +0800 Subject: [PATCH] refactor: reuse p --- src/sphere_spiral.scad | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sphere_spiral.scad b/src/sphere_spiral.scad index b1807aef..f774bae6 100644 --- a/src/sphere_spiral.scad +++ b/src/sphere_spiral.scad @@ -12,7 +12,8 @@ use ; function sphere_spiral(radius, za_step, z_circles = 1, begin_angle = 0, end_angle = 0, vt_dir = "SPI_DOWN", rt_dir = "CT_CLK") = let( - a_end = 90 * z_circles - end_angle + a_end = 90 * z_circles - end_angle, + p = [radius, 0, 0] ) [ for(a = begin_angle; a <= a_end; a = a + za_step) @@ -21,5 +22,5 @@ function sphere_spiral(radius, za_step, z_circles = 1, begin_angle = 0, end_angl za = (rt_dir == "CT_CLK" ? 1 : -1) * a, ra = [0, ya, za] ) - [ptf_rotate([radius, 0, 0], ra), ra] + [ptf_rotate(p, ra), ra] ]; \ No newline at end of file