1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-helix_extrude.md

75 lines
2.1 KiB
Markdown
Raw Normal View History

2017-05-04 14:14:06 +08:00
# helix_extrude
Extrudes a 2D shape along a helix path.
2021-02-24 21:09:54 +08:00
When using this module, you should use points to represent the 2D shape. If your 2D shape is not solid, indexes of triangles are required. See [sweep](https://openhome.cc/eGossip/OpenSCAD/lib3x-sweep.html) for details.
2017-05-04 14:14:06 +08:00
Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module.
## Parameters
- `shape_pts` : A list of points represent a shape. See the example below.
2017-05-06 21:01:46 +08:00
- `radius` : The radius of the cylinder. 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-05-04 14:14:06 +08:00
- `levels` : The level count is performed every 360 degrees.
- `level_dist` : The distance between two vertial points.
- `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"`.
- `twist` : The number of degrees of through which the shape is extruded.
- `scale` : Scales the 2D shape by this value over the length of the extrusion. Scale can be a scalar or a vector.
2021-02-24 21:09:54 +08:00
- `triangles` : `"SOLID"` (default), `"HOLLOW"` or user-defined indexes. See [sweep](https://openhome.cc/eGossip/OpenSCAD/lib3x-sweep.html) for details.
2017-05-04 14:14:06 +08:00
- `$fa`, `$fs`, `$fn` : Check [the cylinder module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder) for more details.
## Examples
2020-01-28 17:51:20 +08:00
use <helix_extrude.scad>;
2017-05-04 14:14:06 +08:00
shape_pts = [
2017-05-16 17:41:34 +08:00
[5, -2],
[5, 2],
[4, 2],
[4, 0],
[-4, 0],
[-4, 2],
[-5, 2],
[-5, -2]
2017-05-04 14:14:06 +08:00
];
helix_extrude(shape_pts,
radius = 40,
levels = 5,
level_dist = 10,
2017-05-10 16:38:20 +08:00
vt_dir = "SPI_UP"
2017-05-04 14:14:06 +08:00
);
2021-02-24 21:09:54 +08:00
![helix_extrude](images/lib3x-helix_extrude-1.JPG)
2017-05-04 14:14:06 +08:00
2020-01-28 17:51:20 +08:00
use <helix_extrude.scad>;
2017-05-06 20:30:11 +08:00
2017-05-10 16:38:20 +08:00
r1 = 40;
2017-05-06 20:30:11 +08:00
r2 = 20;
levels = 5;
level_dist = 10;
shape_pts = [
2017-05-16 17:41:34 +08:00
[10, -2],
[10, 2],
[9, 2],
[9, 0],
[1, 0],
[1, 2],
[0, 2],
[0, -2],
2017-05-06 20:30:11 +08:00
];
helix_extrude(shape_pts,
radius = [r1, r2],
levels = levels,
level_dist = level_dist,
2017-05-10 16:38:20 +08:00
vt_dir = "SPI_UP"
2017-05-06 20:30:11 +08:00
);
%cylinder(h = levels * level_dist, r1 = r1, r2 = r2);
2021-02-24 21:09:54 +08:00
![helix_extrude](images/lib3x-helix_extrude-2.JPG)
2017-05-06 20:30:11 +08:00