1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-23 17:15:05 +01:00

c-style for loop

This commit is contained in:
Justin Lin 2019-06-14 13:38:32 +08:00
parent f1a8d6f0dc
commit 0a604c5793

View File

@ -9,8 +9,11 @@
**/
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
)
[
for(a = [begin_angle:za_step:90 * z_circles - end_angle])
for(a = begin_angle; a <= a_end; a = a + za_step)
let(
ya = vt_dir == "SPI_DOWN" ? (-90 + 2 * a / z_circles) : (90 + 2 * a / z_circles),
za = (rt_dir == "CT_CLK" ? 1 : -1) * a,