mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 17:24:20 +02:00
fixed parameters vt_dir, rt_dir
This commit is contained in:
@@ -9,8 +9,8 @@ Creates all points and angles on the path of a spiral around a sphere. It return
|
|||||||
- `z_circles` : The spiral rotates around the z axis. This parameter determines how many circles it will rotate from the top to the end. It defaults to 1.
|
- `z_circles` : The spiral rotates around the z axis. This parameter determines how many circles it will rotate from the top to the end. It defaults to 1.
|
||||||
- `begin_angle` : The default value is 0 which means begins from the north pole of the sphere. See examples below.
|
- `begin_angle` : The default value is 0 which means begins from the north pole of the sphere. See examples below.
|
||||||
- `end_angle` : The default value is 0 which means begins from the sourth pole of the sphere. See examples below.
|
- `end_angle` : The default value is 0 which means begins from the sourth pole of the sphere. See examples below.
|
||||||
- `vt_dir` : `"CT_CLK"` for counterclockwise. `"CLK"` for clockwise. The default value is `"CT_CLK"`.
|
- `vt_dir` : `"SPI_DOWN"` for spiraling down. `"SPI_UP"` for spiraling up. The default value is `"SPI_DOWN"`.
|
||||||
- `rt_dir` : `"SPI_DOWN"` for spiraling down. `"SPI_UP"` for spiraling up. The default value is `"SPI_DOWN"`.
|
- `rt_dir` : `"CT_CLK"` for counterclockwise. `"CLK"` for clockwise. The default value is `"CT_CLK"`.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
@@ -13,12 +13,12 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
function sphere_spiral(radius, za_step, z_circles = 1, begin_angle = 0, end_angle = 0, vt_dir = "CT_CLK", rt_dir = "SPI_DOWN") =
|
function sphere_spiral(radius, za_step, z_circles = 1, begin_angle = 0, end_angle = 0, vt_dir = "SPI_DOWN", rt_dir = "CT_CLK") =
|
||||||
[
|
[
|
||||||
for(a = [begin_angle:za_step:90 * z_circles - end_angle])
|
for(a = [begin_angle:za_step:90 * z_circles - end_angle])
|
||||||
let(
|
let(
|
||||||
ya = rt_dir == "SPI_DOWN" ? (-90 + 2 * a / z_circles) : (90 + 2 * a / z_circles),
|
ya = vt_dir == "SPI_DOWN" ? (-90 + 2 * a / z_circles) : (90 + 2 * a / z_circles),
|
||||||
za = (vt_dir == "CT_CLK" ? 1 : -1) * a,
|
za = (rt_dir == "CT_CLK" ? 1 : -1) * a,
|
||||||
ra = [0, ya, za]
|
ra = [0, ya, za]
|
||||||
)
|
)
|
||||||
[rotate_p([radius, 0, 0], ra), ra]
|
[rotate_p([radius, 0, 0], ra), ra]
|
||||||
|
Reference in New Issue
Block a user