diff --git a/README.md b/README.md index ac774808..19c3d2f2 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ If OpenSCAD generates "WARNING: Ignoring unknown xxx function" or "WARNING: Igno - [ellipse_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-ellipse_extrude.html) - [stereographic_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-stereographic_extrude.html) - [path_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html) + - [ring_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-ring_extrude.html) - Other - [turtle2d](https://openhome.cc/eGossip/OpenSCAD/lib-turtle2d.html) diff --git a/docs/images/lib-ring_extrude-1.JPG b/docs/images/lib-ring_extrude-1.JPG new file mode 100644 index 00000000..e456cc9b Binary files /dev/null and b/docs/images/lib-ring_extrude-1.JPG differ diff --git a/docs/images/lib-ring_extrude-2.JPG b/docs/images/lib-ring_extrude-2.JPG new file mode 100644 index 00000000..fe1ca1b1 Binary files /dev/null and b/docs/images/lib-ring_extrude-2.JPG differ diff --git a/docs/lib-path_extrude.md b/docs/lib-path_extrude.md index 9c2bab9e..4bc13267 100644 --- a/docs/lib-path_extrude.md +++ b/docs/lib-path_extrude.md @@ -2,7 +2,7 @@ It extrudes a 2D shape along a path. This module is suitable for a path created by a continuous function. -It depends on the rotate_p function and the polysections module. Remember to include "rotate_p.scad" and "polysections.scad". +It depends on the `rotate_p` function and the `polysections` module. Remember to include "rotate_p.scad" and "polysections.scad". When using this module, you should use points to represent the 2D shape. You need to provide indexes of triangles, too. This module provides two prepared triangles indexes. One is `"RADIAL"`. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details. diff --git a/docs/lib-ring_extrude.md b/docs/lib-ring_extrude.md new file mode 100644 index 00000000..a98ad382 --- /dev/null +++ b/docs/lib-ring_extrude.md @@ -0,0 +1,52 @@ +# 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`. + +This module depends on `rotate_p`, `cross_section` and `polysections`. Remember to include corresponding ".scad". + +This module provides two prepared triangles indexes. One is `"RADIAL"`. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details. + +## Parameters + +- `shape_pts` : A list of points represent a shape. See the example below. +- `radius` : The circle radius. +- `angle` : Defaults to 360. Specifies the number of degrees to sweep, starting at the positive X axis. +- `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. +- `triangles` : `"RADIAL"` (default), `"HOLLOW"` or user-defined indexes. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details. + +## Examples + + include ; + include ; + include ; + include ; + + shape_pts = [ + [-2, -10], + [-2, 10], + [2, 10], + [2, -10] + ]; + + ring_extrude(shape_pts, radius = 50, twist = 180); + +![ring_extrude](images/lib-ring_extrude-1.JPG) + + include ; + include ; + include ; + include ; + + shape_pts = [ + [-2, -10], + [-2, 10], + [2, 10], + [2, -10] + ]; + + ring_extrude(shape_pts, radius = 50, angle = 180, scale = 2); + +![ring_extrude](images/lib-ring_extrude-2.JPG)