1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00

use c-style for

This commit is contained in:
Justin Lin
2022-05-15 20:42:10 +08:00
parent fb84664183
commit 7c22b6ceca
2 changed files with 4 additions and 4 deletions

View File

@@ -33,12 +33,12 @@ module ring_extrude(shape_pts, radius, angle = 360, twist = 0, scale = 1.0, tria
angs = [ angs = [
[90, 0, angles[0]], [90, 0, angles[0]],
if(m <= n) each [for(i = [m:n]) [90, 0, a_step * i]] each [for(i = m; i <= n; i = i + 1) [90, 0, a_step * i]]
]; ];
pts = [ pts = [
__ra_to_xy(begin_r, angles[0]), __ra_to_xy(begin_r, angles[0]),
if(m <= n) each [for(i = [m:n]) __ra_to_xy(radius, a_step * i)] each [for(i = m; i <= n; i = i + 1) __ra_to_xy(radius, a_step * i)]
]; ];
is_angle_frag_end = angs[len(angs) - 1][2] == angles[1]; is_angle_frag_end = angs[len(angs) - 1][2] == angles[1];

View File

@@ -28,14 +28,14 @@ function shape_arc(radius, angle, width, width_mode = "LINE_CROSS") =
points = [ points = [
// outer arc path // outer arc path
__ra_to_xy(__edge_r_begin(r_outer, a0, a_step, m), a0), __ra_to_xy(__edge_r_begin(r_outer, a0, a_step, m), a0),
if(m <= n) each [for(i = m; i <= n; i = i + 1) __ra_to_xy(r_outer, a_step * i)], each [for(i = m; i <= n; i = i + 1) __ra_to_xy(r_outer, a_step * i)],
if(a1 != a_step * n) each [ if(a1 != a_step * n) each [
__ra_to_xy(__edge_r_end(r_outer, a1, a_step, n), a1), __ra_to_xy(__edge_r_end(r_outer, a1, a_step, n), a1),
// inner arc path // inner arc path
__ra_to_xy(__edge_r_end(r_inner, a1, a_step, n), a1) __ra_to_xy(__edge_r_end(r_inner, a1, a_step, n), a1)
], ],
// inner arc path // inner arc path
if(m <= n) each [ each [
for(i = m; i <= n; i = i + 1) for(i = m; i <= n; i = i + 1)
__ra_to_xy(r_inner, a_step * (n + m - i)) __ra_to_xy(r_inner, a_step * (n + m - i))