From 31fa1869c2ea940b3358e448b7c4d20b3be5984c Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 18 Apr 2022 10:33:59 +0800 Subject: [PATCH] avoid floating error --- src/shape_ellipse.scad | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shape_ellipse.scad b/src/shape_ellipse.scad index 68dc0ad8..782e4451 100644 --- a/src/shape_ellipse.scad +++ b/src/shape_ellipse.scad @@ -16,7 +16,8 @@ function shape_ellipse(axes) = step_a = 360 / frags, a_end = 360 - step_a, shape_pts = [ - for(a = 0; a <= a_end; a = a + step_a) + for(i = [0:frags - 1]) + let(a = i * step_a) [axes[0] * cos(a), axes[1] * sin(a)] ] ) shape_pts; \ No newline at end of file