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

46 lines
1.7 KiB
Markdown
Raw Normal View History

2017-05-04 10:29:31 +08:00
# ring_extrude
Rotational extrusion spins a 2D shape around the Z-axis. It's similar to the built-in `rotate_extrude`; however, it supports `angle`, `twist` and `scale` options.
Because we cannot retrieve the shape points of built-in 2D modules, it's necessary to provide `shapt_pts` and `triangles`.
2021-02-24 21:09:54 +08:00
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 10:29:31 +08:00
## Parameters
- `shape_pts` : A list of points represent a shape. See the example below.
- `radius` : The circle radius.
2017-05-22 09:55:37 +08:00
- `angle` : Defaults to 360. Specifies the number of degrees to sweep, starting at the positive X axis. It also accepts a 2 element vector which defines the central angle. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
2020-02-13 14:18:53 +08:00
- `twist` : The number of degrees of through which the shape is twisted.
2017-05-04 10:29:31 +08:00
- `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-06-02 11:22:34 +08:00
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
2017-05-04 10:29:31 +08:00
## Examples
2020-01-28 17:51:20 +08:00
use <ring_extrude.scad>;
2017-05-04 10:29:31 +08:00
shape_pts = [
2017-05-16 17:13:57 +08:00
[2, -10],
2017-05-04 10:29:31 +08:00
[2, 10],
2017-05-16 17:13:57 +08:00
[-2, 10],
[-2, -10]
2017-05-04 10:29:31 +08:00
];
ring_extrude(shape_pts, radius = 50, twist = 180);
2021-02-24 21:09:54 +08:00
![ring_extrude](images/lib3x-ring_extrude-1.JPG)
2017-05-04 10:29:31 +08:00
2020-01-28 17:51:20 +08:00
use <ring_extrude.scad>;
2017-05-04 10:29:31 +08:00
shape_pts = [
2017-05-16 17:13:57 +08:00
[2, -10],
2017-05-04 10:29:31 +08:00
[2, 10],
2017-05-16 17:13:57 +08:00
[-2, 10],
[-2, -10]
2017-05-04 10:29:31 +08:00
];
ring_extrude(shape_pts, radius = 50, angle = 180, scale = 2);
2021-02-24 21:09:54 +08:00
![ring_extrude](images/lib3x-ring_extrude-2.JPG)