From 54eb382ff66d03fb3c24a0ae6ad8e539afa97676 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 30 Mar 2017 14:22:48 +0800 Subject: [PATCH] updated docs --- docs/lib-arc.md | 10 ++++++++-- docs/lib-archimedean_spiral.md | 7 ++++++- docs/lib-bend.md | 8 +++++++- docs/lib-bezier.md | 2 ++ docs/lib-box_extrude.md | 6 +++++- docs/lib-circle_path.md | 2 ++ docs/lib-circular_sector.md | 4 +++- docs/lib-cylinder_spiral.md | 2 +- docs/lib-hollow_out.md | 4 +++- docs/lib-hull_polyline3d.md | 4 ++++ docs/lib-line2d.md | 2 ++ docs/lib-line3d.md | 6 ++++++ docs/lib-parse_number.md | 2 ++ docs/lib-polyline2d.md | 6 ++++++ docs/lib-polyline3d.md | 8 ++++++++ docs/lib-rotate_p.md | 6 ++++++ docs/lib-stereographic_extrude.md | 2 ++ docs/lib-sub_str.md | 2 ++ 18 files changed, 75 insertions(+), 8 deletions(-) diff --git a/docs/lib-arc.md b/docs/lib-arc.md index bef9b1d5..f60c00b4 100644 --- a/docs/lib-arc.md +++ b/docs/lib-arc.md @@ -1,29 +1,35 @@ # arc -Create an arc. You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the circle module. It depends on the `circular_sector` module so you have to include circular_sector.scad. +Creates an arc. You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the circle module. It depends on the `circular_sector` module so you have to include circular_sector.scad. ## Parameters - `radius` : The radius of the circle. - `angles` : 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. -- `width_mode` : The default value is `"LINE_CROSS"`. The arc line will move outward by `width / 2` and inward by `width / 2`. If it's `"LINE_OUTWARD"`, the arc line moves outward by `width`. The `"LINE_INWARD"` moves the arc line inward by `width`. +- `width_mode` : The default value is `"LINE_CROSS"`. The arc line will move outward by `width / 2` and inward by `width / 2`. If it's `"LINE_OUTWARD"`, The arc line moves outward by `width`. The `"LINE_INWARD"` moves the arc line inward by `width`. - `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details. ## Examples + include ; + $fn = 24; arc(radius = 20, angles = [45, 290], width = 2); %circle(r = 20); ![arc](images/lib-arc-1.JPG) + include ; + $fn = 24; arc(radius = 20, angles = [45, 290], width = 2, width_mode = "LINE_INWARD"); %circle(r = 20); ![arc](images/lib-arc-2.JPG) + include ; + $fn = 24; arc(radius = 20, angles = [45, 290], width = 2, width_mode = "LINE_OUTWARD"); %circle(r = 20); diff --git a/docs/lib-archimedean_spiral.md b/docs/lib-archimedean_spiral.md index f1efb5c1..9e9283f7 100644 --- a/docs/lib-archimedean_spiral.md +++ b/docs/lib-archimedean_spiral.md @@ -1,6 +1,6 @@ # archimedean_spiral -Get all points and angles on the path of an archimedean_spiral. The distance between two points is almost constant. +Gets all points and angles on the path of an archimedean_spiral. The distance between two points is almost constant. It returns a vector of `[[x, y], angle]`. @@ -17,6 +17,7 @@ An `init_angle` less than 180 degrees is not recommended because the function us ## Examples include ; + include ; points_angles = archimedean_spiral( arm_distance = 10, @@ -32,6 +33,8 @@ An `init_angle` less than 180 degrees is not recommended because the function us ![archimedean_spiral](images/lib-archimedean_spiral-1.JPG) + include ; + points_angles = archimedean_spiral( arm_distance = 10, init_angle = 180, @@ -46,6 +49,8 @@ An `init_angle` less than 180 degrees is not recommended because the function us ![archimedean_spiral](images/lib-archimedean_spiral-2.JPG) + include ; + t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286"; points = archimedean_spiral( diff --git a/docs/lib-bend.md b/docs/lib-bend.md index a363f56c..b1c40e75 100644 --- a/docs/lib-bend.md +++ b/docs/lib-bend.md @@ -1,6 +1,6 @@ # bend -Bend a 3D object into an arc shape. +Bends a 3D object into an arc shape. ## Parameters @@ -12,6 +12,8 @@ Bend a 3D object into an arc shape. The containing cube of the target object should be laid down on the x-y plane. For examples. + include ; + x = 9.25; y = 9.55; z = 1; @@ -23,6 +25,8 @@ The containing cube of the target object should be laid down on the x-y plane. F Once you have the size of the containing cube, you can use it as the `size` argument of the `bend` module. + include ; + x = 9.25; y = 9.55; z = 1; @@ -35,6 +39,8 @@ Once you have the size of the containing cube, you can use it as the `size` argu ![bend](images/lib-bend-2.JPG) The arc shape is smoother if the `frags` value is larger. + + include ; x = 9.25; y = 9.55; diff --git a/docs/lib-bezier.md b/docs/lib-bezier.md index c27321f8..44f1ffa1 100644 --- a/docs/lib-bezier.md +++ b/docs/lib-bezier.md @@ -11,6 +11,8 @@ Given a set of control points, the bezier function returns points of the Bézier If you have four control points and combine with the `hull_polyline3d` module: + include ; + t_step = 0.05; width = 2; diff --git a/docs/lib-box_extrude.md b/docs/lib-box_extrude.md index 6f5dce94..28e4d9dc 100644 --- a/docs/lib-box_extrude.md +++ b/docs/lib-box_extrude.md @@ -1,6 +1,6 @@ # box_extrude -Create a box (container) from a 2D object. +Creates a box (container) from a 2D object. ## Parameters @@ -9,11 +9,15 @@ Create a box (container) from a 2D object. ## Examples + include ; + box_extrude(height = 30, shell_thickness = 2) circle(r = 30); ![box_extrude](images/lib-box_extrude-1.JPG) + include ; + box_extrude(height = 30, shell_thickness = 2) text("XD", size = 40, font = "Cooper Black"); diff --git a/docs/lib-circle_path.md b/docs/lib-circle_path.md index bcdbd915..224cbd9a 100644 --- a/docs/lib-circle_path.md +++ b/docs/lib-circle_path.md @@ -9,6 +9,8 @@ Sometimes you need all points on the path of a circle. Here's the function. Its ## Examples + include ; + $fn = 24; points = circle_path(radius = 50); diff --git a/docs/lib-circular_sector.md b/docs/lib-circular_sector.md index 4d973965..71ec5b80 100644 --- a/docs/lib-circular_sector.md +++ b/docs/lib-circular_sector.md @@ -1,6 +1,6 @@ # circular_sector -Create a circular sector. You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the circle module. +Creates a circular sector. You can pass a 2 element vector to define the central angle. Its `$fa`, `$fs` and `$fn` parameters are consistent with the circle module. ## Parameters @@ -10,6 +10,8 @@ Create a circular sector. You can pass a 2 element vector to define the central - ## Examples + include ; + circular_sector(radius = 20, angles = [-50, -150]); translate([-15, 0, 0]) circular_sector(radius = 20, angles = [45, 135]); translate([15, 0, 0]) circular_sector(radius = 20, angles = [45, 135], $fn = 12); diff --git a/docs/lib-cylinder_spiral.md b/docs/lib-cylinder_spiral.md index 3517673a..6fb160da 100644 --- a/docs/lib-cylinder_spiral.md +++ b/docs/lib-cylinder_spiral.md @@ -1,6 +1,6 @@ # cylinder_spiral -Get 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. It depends on the `circle_path` module so you have to include circle_path.scad. ## Parameters diff --git a/docs/lib-hollow_out.md b/docs/lib-hollow_out.md index 660b50d2..5c55c55c 100644 --- a/docs/lib-hollow_out.md +++ b/docs/lib-hollow_out.md @@ -1,6 +1,6 @@ # hollow_out -Hollow out a 2D object. +Hollows out a 2D object. ## Parameters @@ -8,6 +8,8 @@ Hollow out a 2D object. ## Examples + include ; + hollow_out(shell_thickness = 1) circle(r = 3, $fn = 48); hollow_out(shell_thickness = 1) square([10, 5]); diff --git a/docs/lib-hull_polyline3d.md b/docs/lib-hull_polyline3d.md index eddad04f..77008175 100644 --- a/docs/lib-hull_polyline3d.md +++ b/docs/lib-hull_polyline3d.md @@ -10,6 +10,8 @@ Creates a 3D polyline from a list of `[x, y, z]` coordinates. As the name says, ## Examples + include ; + hull_polyline3d( points = [ [1, 2, 3], @@ -23,6 +25,8 @@ Creates a 3D polyline from a list of `[x, y, z]` coordinates. As the name says, ![polyline3d](images/lib-hull_polyline3d-1.JPG) + include ; + r = 50; points = [ for(a = [0:180]) diff --git a/docs/lib-line2d.md b/docs/lib-line2d.md index d76a5ce7..0e46d81d 100644 --- a/docs/lib-line2d.md +++ b/docs/lib-line2d.md @@ -13,6 +13,8 @@ Creates a line from two points. When the end points are `CAP_ROUND`, you can use ## Examples + include ; + $fn = 24; line2d(p1 = [0, 0], p2 = [5, 0], width = 1); diff --git a/docs/lib-line3d.md b/docs/lib-line3d.md index e9fb7714..12dc85d0 100644 --- a/docs/lib-line3d.md +++ b/docs/lib-line3d.md @@ -13,6 +13,8 @@ Creates a 3D line from two points. ## Examples + include ; + line3d( p1 = [0, 0, 0], p2 = [10, 2, 10], @@ -21,6 +23,8 @@ Creates a 3D line from two points. ); ![line3d](images/lib-line3d-1.JPG) + + include ; line3d( p1 = [0, 0, 0], @@ -33,6 +37,8 @@ Creates a 3D line from two points. ![line3d](images/lib-line3d-2.JPG) + include ; + line3d( p1 = [0, 0, 0], p2 = [10, 2, 10], diff --git a/docs/lib-parse_number.md b/docs/lib-parse_number.md index 0b391d7b..949e1d40 100644 --- a/docs/lib-parse_number.md +++ b/docs/lib-parse_number.md @@ -8,5 +8,7 @@ Parses the string argument as an number. It depends on the `split_str` and the ` ## Examples + include ; + echo(parse_number("10") + 1); // ECHO: 11 echo(parse_number("-1.1") + 1); // ECHO: -0.1 diff --git a/docs/lib-polyline2d.md b/docs/lib-polyline2d.md index 88f8eade..d93cd27e 100644 --- a/docs/lib-polyline2d.md +++ b/docs/lib-polyline2d.md @@ -13,17 +13,23 @@ Creates a polyline from a list of `x`, `y` coordinates. When the end points are ## Examples + include ; + $fn = 24; polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1); ![polyline2d](images/lib-polyline2d-1.JPG) + include ; + $fn = 24; polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1, endingStyle = "CAP_ROUND"); ![polyline2d](images/lib-polyline2d-2.JPG) + include ; + $fn = 24; polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1, startingStyle = "CAP_ROUND", endingStyle = "CAP_ROUND"); diff --git a/docs/lib-polyline3d.md b/docs/lib-polyline3d.md index a89467d5..9c25d01d 100644 --- a/docs/lib-polyline3d.md +++ b/docs/lib-polyline3d.md @@ -12,6 +12,8 @@ Creates a polyline from a list of `[x, y, z]` coordinates. It depends on the `li ## Examples + include ; + polyline3d( points = [ [1, 2, 1], @@ -25,6 +27,8 @@ Creates a polyline from a list of `[x, y, z]` coordinates. It depends on the `li ![polyline3d](images/lib-polyline3d-1.JPG) + include ; + polyline3d( points = [ [1, 2, 1], @@ -39,6 +43,8 @@ Creates a polyline from a list of `[x, y, z]` coordinates. It depends on the `li ![polyline3d](images/lib-polyline3d-2.JPG) + include ; + polyline3d( points = [ [1, 2, 1], @@ -54,6 +60,8 @@ Creates a polyline from a list of `[x, y, z]` coordinates. It depends on the `li ![polyline3d](images/lib-polyline3d-3.JPG) + include ; + r = 20; h = 5; fa = 15; diff --git a/docs/lib-rotate_p.md b/docs/lib-rotate_p.md index f3000536..51d03a5b 100644 --- a/docs/lib-rotate_p.md +++ b/docs/lib-rotate_p.md @@ -11,6 +11,8 @@ Rotates a point `a` degrees around an arbitrary axis. The rotation is applied in You can use the code below to create a line. + include ; + hull() { sphere(1); rotate([0, -45, 45]) @@ -20,6 +22,8 @@ You can use the code below to create a line. The following code has the same effect. + include ; + point = [20, 0, 0]; a = [0, -45, 45]; @@ -34,6 +38,8 @@ The following code has the same effect. The `rotate_p` function is useful in some situations. For examples, you probably want to get all points on the path of a spiral around a sphere. + include ; + radius = 40; step_angle = 10; z_circles = 20; diff --git a/docs/lib-stereographic_extrude.md b/docs/lib-stereographic_extrude.md index cc307cd4..77d9977e 100644 --- a/docs/lib-stereographic_extrude.md +++ b/docs/lib-stereographic_extrude.md @@ -12,6 +12,8 @@ The 2D polygon should center at the origin and you have to determine the side le ## Examples + include ; + dimension = 100; render() stereographic_extrude(shadow_side_leng = dimension) diff --git a/docs/lib-sub_str.md b/docs/lib-sub_str.md index ea7304ef..2d565eae 100644 --- a/docs/lib-sub_str.md +++ b/docs/lib-sub_str.md @@ -10,5 +10,7 @@ Returns a new string that is a substring of the given string. ## Examples + include ; + echo(sub_str("helloworld", 0, 5)); // ECHO: "hello" echo(sub_str("helloworld", 5)); // ECHO: "world"