From e5208ef87a094e88d2ab50617ab4b801e70b85d9 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 6 May 2017 20:30:11 +0800 Subject: [PATCH] updated docs --- docs/lib-helix.md | 25 ++++++++++++++++++----- docs/lib-helix_extrude.md | 42 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/docs/lib-helix.md b/docs/lib-helix.md index acaf42e7..a5acb809 100644 --- a/docs/lib-helix.md +++ b/docs/lib-helix.md @@ -1,20 +1,18 @@ # helix -Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module. It depends on the `circle_path` module so you have to include circle_path.scad. +Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module. ## Parameters -- `radius` : The radius of the cylinder. +- `radius` : The radius of the cylinder. It also accepts a vector `[r1, r2]`. `r1` is the bottom radius and `r2` the top radius of a cone. - `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"`. - `$fa`, `$fs`, `$fn` : Check [the cylinder module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#cylinder) for more details. - ## Examples - include ; include ; include ; @@ -34,6 +32,23 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and hull_polyline3d(points, 2); - ![helix](images/lib-helix-1.JPG) + include ; + include ; + + $fn = 12; + + points = helix( + radius = [40, 20], + levels = 10, + level_dist = 10, + vt_dir = "SPI_UP", + rt_dir = "CLK" + ); + + hull_polyline3d(points, 2); + + %cylinder(h = 100, r1 = 40, r2 = 20); + +![helix](images/lib-helix-2.JPG) diff --git a/docs/lib-helix_extrude.md b/docs/lib-helix_extrude.md index b3f57479..3494f48c 100644 --- a/docs/lib-helix_extrude.md +++ b/docs/lib-helix_extrude.md @@ -6,12 +6,12 @@ When using this module, you should use points to represent the 2D shape. You nee Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module. -Dependencies: `circle_path`, `helix`, `rotate_p.scad`, `cross_sections`, `polysections`. +Dependencies: `helix`, `rotate_p.scad`, `cross_sections`, `polysections`. ## Parameters - `shape_pts` : A list of points represent a shape. See the example below. -- `radius` : The radius of the cylinder. +- `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` the top radius of a cone. - `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"`. @@ -23,7 +23,6 @@ Dependencies: `circle_path`, `helix`, `rotate_p.scad`, `cross_sections`, `polyse ## Examples - include ; include ; include ; include ; @@ -54,3 +53,40 @@ Dependencies: `circle_path`, `helix`, `rotate_p.scad`, `cross_sections`, `polyse ![helix_extrude](images/lib-helix_extrude-1.JPG) + include ; + include ; + include ; + include ; + include ; + + r1 = 40; + r2 = 20; + levels = 5; + level_dist = 10; + + shape_pts = [ + [0, -2], [0, 2], + [1, 2], [1, 0], + [9, 0], [9, 2], + [10, 2], [10, -2] + ]; + + helix_extrude(shape_pts, + radius = [r1, r2], + levels = levels, + level_dist = level_dist, + vt_dir = "SPI_UP", + triangles = [ + [0, 1, 2], + [0, 2, 3], + [0, 3, 4], + [0, 4, 7], + [4, 5, 6], + [4, 6, 7] + ] + ); + + %cylinder(h = levels * level_dist, r1 = r1, r2 = r2); + +![helix_extrude](images/lib-helix_extrude-2.JPG) +