diff --git a/README.md b/README.md index 3c557567..53328a47 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I - [path_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html) - [ring_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-ring_extrude.html) - [helix_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-helix_extrude.html) + - [golden_spiral_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-golden_spiral_extrude.html) - Other - [turtle2d](https://openhome.cc/eGossip/OpenSCAD/lib-turtle2d.html) diff --git a/docs/images/lib-golden_spiral_extrude-1.JPG b/docs/images/lib-golden_spiral_extrude-1.JPG new file mode 100644 index 00000000..27ac8888 Binary files /dev/null and b/docs/images/lib-golden_spiral_extrude-1.JPG differ diff --git a/docs/lib-golden_spiral_extrude.md b/docs/lib-golden_spiral_extrude.md new file mode 100644 index 00000000..58e5f27b --- /dev/null +++ b/docs/lib-golden_spiral_extrude.md @@ -0,0 +1,47 @@ +# golden_spiral_extrude + +Extrudes a 2D shape along the path of a golden spiral. + +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. + +Dependencies: `circle_path`, `rotate_p`, `golden_spiral.scad`, `cross_sections`, `polysections`. + +## Parameters + +- `shape_pts` : A list of points represent a shape. See the example below. +- `from` : The nth Fibonacci number you wanna start from. +- `to` : The nth Fibonacci number you wanna go to. +- `point_distance` : Distance between two points on the path. +- `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. +- `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 ; + include ; + include ; + + shape_pts = [ + [-2, -10], + [-2, 10], + [2, 10], + [2, -10] + ]; + + golden_spiral_extrude( + shape_pts, + from = 3, + to = 10, + point_distance = 1, + rt_dir = "CLK", + twist = 180, + scale = 0.1 + ); + +![golden_spiral_extrude](images/lib-golden_spiral_extrude-1.JPG) +