From af084fb04397cae4ca5bd81646060011f08dd7c3 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 14 Jun 2019 09:01:43 +0800 Subject: [PATCH] c-style for loop --- src/shape_superformula.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shape_superformula.scad b/src/shape_superformula.scad index d271fd7e..d2321880 100644 --- a/src/shape_superformula.scad +++ b/src/shape_superformula.scad @@ -19,12 +19,12 @@ function _superformula_r(angle, m1, m2, n1, n2 = 1, n3 = 1, a = 1, b = 1) = ); function shape_superformula(phi_step, m1, m2, n1, n2 = 1, n3 = 1, a = 1, b = 1) = + let(tau = PI * 2) [ - for(phi = [0:phi_step:PI * 2]) + for(phi = 0; phi <= tau; phi = phi + phi_step) let( angle = __to_degree(phi), r = _superformula_r(angle, m1, m2, n1, n2, n3, a, b) - ) __ra_to_xy(r, angle) ]; \ No newline at end of file