1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-18 04:21:16 +02:00

avoid floating error

This commit is contained in:
Justin Lin
2022-04-18 10:36:57 +08:00
parent 31fa1869c2
commit 62849b5374
2 changed files with 5 additions and 2 deletions

View File

@@ -16,4 +16,8 @@ function shape_circle(radius, n) =
step_a = 360 / _frags,
end = (is_undef(n) || n > _frags) ? _frags - 1: n - 1
)
[for(a = [0:step_a:end * step_a]) [radius * cos(a), radius * sin(a)]];
[
for(i = [0:end])
let(a = i * step_a)
[radius * cos(a), radius * sin(a)]
];

View File

@@ -14,7 +14,6 @@ function shape_ellipse(axes) =
let(
frags = __frags(axes[0]),
step_a = 360 / frags,
a_end = 360 - step_a,
shape_pts = [
for(i = [0:frags - 1])
let(a = i * step_a)