1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 06:08:31 +01:00
dotSCAD/docs/lib3x-helix.md

58 lines
1.4 KiB
Markdown
Raw Normal View History

2017-04-07 14:28:55 +08:00
# helix
2017-03-23 15:03:35 +08:00
2017-05-06 20:30:11 +08:00
Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module.
2017-03-23 15:03:35 +08:00
## Parameters
2017-05-06 21:01:46 +08:00
- `radius` : The radius of the cylinder. It also accepts a vector `[r1, r2]`. `r1` is the bottom radius and `r2` is the top radius of a cone.
2017-03-23 15:03:35 +08:00
- `levels` : The level count is performed every 360 degrees.
- `level_dist` : The distance between two vertial points.
2017-03-30 12:17:51 +08:00
- `vt_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"`.
2017-03-23 15:03:35 +08:00
- `$fa`, `$fs`, `$fn` : Check [the cylinder module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder) for more details.
## Examples
2022-06-06 13:11:46 +08:00
use <helix.scad>
use <polyline_join.scad>
2017-03-23 15:03:35 +08:00
$fn = 12;
2017-04-07 14:28:55 +08:00
points = helix(
2017-03-23 15:03:35 +08:00
radius = 40,
levels = 10,
level_dist = 10,
vt_dir = "SPI_UP",
rt_dir = "CLK"
);
for(p = points) {
2022-04-06 17:44:11 +08:00
translate(p)
sphere(5);
2017-03-23 15:03:35 +08:00
}
2021-11-18 08:08:50 +08:00
polyline_join(points)
sphere(1);
2017-03-23 15:03:35 +08:00
2021-02-24 21:09:54 +08:00
![helix](images/lib3x-helix-1.JPG)
2017-03-23 15:03:35 +08:00
2022-06-06 13:11:46 +08:00
use <helix.scad>
use <polyline_join.scad>
2017-05-06 20:30:11 +08:00
$fn = 12;
points = helix(
radius = [40, 20],
levels = 10,
level_dist = 10,
vt_dir = "SPI_UP",
rt_dir = "CLK"
);
2021-11-18 08:08:50 +08:00
polyline_join(points)
sphere(1);
2017-05-06 20:30:11 +08:00
%cylinder(h = 100, r1 = 40, r2 = 20);
2021-02-24 21:09:54 +08:00
![helix](images/lib3x-helix-2.JPG)