From 89c682a80902cc5354df1f64016710e0c26ce246 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 19 Feb 2021 11:24:34 +0800 Subject: [PATCH] update to 3.0 --- README.md | 6 +++--- .../{lib2x-loft-1.JPG => lib3x-loft-1.JPG} | Bin ...hull-1.JPG => lib3x-polyhedron_hull-1.JPG} | Bin ...olyline3d-1.JPG => lib3x-polyline3d-1.JPG} | Bin ...olyline3d-2.JPG => lib3x-polyline3d-2.JPG} | Bin ...olyline3d-3.JPG => lib3x-polyline3d-3.JPG} | Bin ...olyline3d-4.JPG => lib3x-polyline3d-4.JPG} | Bin docs/{lib2x-loft.md => lib3x-loft.md} | 2 +- ...edron_hull.md => lib3x-polyhedron_hull.md} | 2 +- ...ib2x-polyline3d.md => lib3x-polyline3d.md} | 18 +++++++++--------- examples/stick_tower.scad | 12 ++++++------ src/loft.scad | 2 +- src/polyhedron_hull.scad | 2 +- src/polyline3d.scad | 12 ++++++------ 14 files changed, 28 insertions(+), 28 deletions(-) rename docs/images/{lib2x-loft-1.JPG => lib3x-loft-1.JPG} (100%) rename docs/images/{lib2x-polyhedron_hull-1.JPG => lib3x-polyhedron_hull-1.JPG} (100%) rename docs/images/{lib2x-polyline3d-1.JPG => lib3x-polyline3d-1.JPG} (100%) rename docs/images/{lib2x-polyline3d-2.JPG => lib3x-polyline3d-2.JPG} (100%) rename docs/images/{lib2x-polyline3d-3.JPG => lib3x-polyline3d-3.JPG} (100%) rename docs/images/{lib2x-polyline3d-4.JPG => lib3x-polyline3d-4.JPG} (100%) rename docs/{lib2x-loft.md => lib3x-loft.md} (97%) rename docs/{lib2x-polyhedron_hull.md => lib3x-polyhedron_hull.md} (87%) rename docs/{lib2x-polyline3d.md => lib3x-polyline3d.md} (84%) diff --git a/README.md b/README.md index 6bb5a059..efdf2bdc 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp - [function_grapher](https://openhome.cc/eGossip/OpenSCAD/lib3x-function_grapher.html) - [hull_polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline3d.html) - [line3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html) -- [loft](https://openhome.cc/eGossip/OpenSCAD/lib2x-loft.html) -- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyhedron_hull.html) -- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib2x-polyline3d.html) +- [loft](https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html) +- [polyhedron_hull](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html) +- [polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html) - [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cube.html) - [rounded_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2x-rounded_cylinder.html) - [starburst](https://openhome.cc/eGossip/OpenSCAD/lib2x-starburst.html) diff --git a/docs/images/lib2x-loft-1.JPG b/docs/images/lib3x-loft-1.JPG similarity index 100% rename from docs/images/lib2x-loft-1.JPG rename to docs/images/lib3x-loft-1.JPG diff --git a/docs/images/lib2x-polyhedron_hull-1.JPG b/docs/images/lib3x-polyhedron_hull-1.JPG similarity index 100% rename from docs/images/lib2x-polyhedron_hull-1.JPG rename to docs/images/lib3x-polyhedron_hull-1.JPG diff --git a/docs/images/lib2x-polyline3d-1.JPG b/docs/images/lib3x-polyline3d-1.JPG similarity index 100% rename from docs/images/lib2x-polyline3d-1.JPG rename to docs/images/lib3x-polyline3d-1.JPG diff --git a/docs/images/lib2x-polyline3d-2.JPG b/docs/images/lib3x-polyline3d-2.JPG similarity index 100% rename from docs/images/lib2x-polyline3d-2.JPG rename to docs/images/lib3x-polyline3d-2.JPG diff --git a/docs/images/lib2x-polyline3d-3.JPG b/docs/images/lib3x-polyline3d-3.JPG similarity index 100% rename from docs/images/lib2x-polyline3d-3.JPG rename to docs/images/lib3x-polyline3d-3.JPG diff --git a/docs/images/lib2x-polyline3d-4.JPG b/docs/images/lib3x-polyline3d-4.JPG similarity index 100% rename from docs/images/lib2x-polyline3d-4.JPG rename to docs/images/lib3x-polyline3d-4.JPG diff --git a/docs/lib2x-loft.md b/docs/lib3x-loft.md similarity index 97% rename from docs/lib2x-loft.md rename to docs/lib3x-loft.md index fcba104d..e00e6d0f 100644 --- a/docs/lib2x-loft.md +++ b/docs/lib3x-loft.md @@ -43,7 +43,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos ); } -![loft](images/lib2x-loft-1.JPG) +![loft](images/lib3x-loft-1.JPG) diff --git a/docs/lib2x-polyhedron_hull.md b/docs/lib3x-polyhedron_hull.md similarity index 87% rename from docs/lib2x-polyhedron_hull.md rename to docs/lib3x-polyhedron_hull.md index b08dfd95..cb5770f9 100644 --- a/docs/lib2x-polyhedron_hull.md +++ b/docs/lib3x-polyhedron_hull.md @@ -22,4 +22,4 @@ Create a convex polyhedron by hulling a list of points. It avoids using `hull` a [0, 0, -1] ]); -![polyhedron_hull](images/lib2x-polyhedron_hull-1.JPG) \ No newline at end of file +![polyhedron_hull](images/lib3x-polyhedron_hull-1.JPG) \ No newline at end of file diff --git a/docs/lib2x-polyline3d.md b/docs/lib3x-polyline3d.md similarity index 84% rename from docs/lib2x-polyline3d.md rename to docs/lib3x-polyline3d.md index 0d3db4fa..07d21eef 100644 --- a/docs/lib2x-polyline3d.md +++ b/docs/lib3x-polyline3d.md @@ -5,7 +5,7 @@ Creates a polyline from a list of `[x, y, z]` coordinates. ## Parameters - `points` : The list of `[x, y, z]` points of the polyline. The points are indexed from 0 to n-1. -- `thickness` : The line thickness. +- `diameter` : The line diameter. - `startingStyle` : The end-cap style of the starting point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`. - `endingStyle` : The end-cap style of the ending point. The value must be `"CAP_BUTT"`, `"CAP_CIRCLE"` or `"CAP_SPHERE"`. The default value is `"CAP_CIRCLE"`. - `$fa`, `$fs`, `$fn` : Used by the `circle` or `sphere` module internally. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) or [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details. The final fragments of a circle will be a multiple of 4 to fit edges if possible. @@ -21,11 +21,11 @@ Creates a polyline from a list of `[x, y, z]` coordinates. [-5, 3, 3], [5, 5, 4] ], - thickness = 1, + diameter = 1, $fn = 24 ); -![polyline3d](images/lib2x-polyline3d-1.JPG) +![polyline3d](images/lib3x-polyline3d-1.JPG) use ; @@ -36,12 +36,12 @@ Creates a polyline from a list of `[x, y, z]` coordinates. [-5, 3, 3], [5, 5, 4] ], - thickness = 1, + diameter = 1, endingStyle = "CAP_SPHERE", $fn = 24 ); -![polyline3d](images/lib2x-polyline3d-2.JPG) +![polyline3d](images/lib3x-polyline3d-2.JPG) use ; @@ -52,13 +52,13 @@ Creates a polyline from a list of `[x, y, z]` coordinates. [-5, 3, 3], [5, 5, 4] ], - thickness = 1, + diameter = 1, startingStyle = "CAP_SPHERE", endingStyle = "CAP_SPHERE", $fn = 24 ); -![polyline3d](images/lib2x-polyline3d-3.JPG) +![polyline3d](images/lib3x-polyline3d-3.JPG) use ; @@ -71,6 +71,6 @@ Creates a polyline from a list of `[x, y, z]` coordinates. for(a = [0:fa:360 * circles]) [r * cos(a), r * sin(a), h / (360 / fa) * (a / fa)] ]; - polyline3d(points, thickness = 1, $fn = 24); + polyline3d(points, diameter = 1, $fn = 24); -![polyline3d](images/lib2x-polyline3d-4.JPG) \ No newline at end of file +![polyline3d](images/lib3x-polyline3d-4.JPG) \ No newline at end of file diff --git a/examples/stick_tower.scad b/examples/stick_tower.scad index 6776f79e..3d22853a 100644 --- a/examples/stick_tower.scad +++ b/examples/stick_tower.scad @@ -3,7 +3,7 @@ use ; /* [Basic] */ stick_leng = 80; -stick_thickness = 5; +stick_diameter = 5; inner_square_leng = 60; leng_diff = 1.75; min_leng = 13; @@ -15,7 +15,7 @@ cap_style = "CAP_CIRCLE"; // [CAP_BUTT, CAP_CIRCLE, CAP_SPHERE] angle_offset = 5; layer_offset = 1.2; -module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) { +module stick_square(inner_square_leng, stick_leng, stick_diameter, cap_style) { diff_leng = stick_leng - inner_square_leng; half_inner_square_leng = inner_square_leng / 2; half_stick_leng = stick_leng / 2; @@ -24,7 +24,7 @@ module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) { line3d( [0, -half_stick_leng, 0], [0, half_stick_leng, 0], - stick_thickness, + stick_diameter, cap_style, cap_style ); @@ -38,7 +38,7 @@ module stick_square(inner_square_leng, stick_leng, stick_thickness, cap_style) { } sticks(); - translate([0, 0, stick_thickness]) + translate([0, 0, stick_diameter]) rotate(90) sticks(); } @@ -71,10 +71,10 @@ module spiral_stack(orig_leng, orig_height, current_leng, leng_diff, min_leng, a } } -height = stick_thickness * layer_offset; +height = stick_diameter * layer_offset; $fn = stick_fn; -spiral_stack(inner_square_leng, stick_thickness * 2, inner_square_leng, leng_diff, min_leng, angle_offset) +spiral_stack(inner_square_leng, stick_diameter * 2, inner_square_leng, leng_diff, min_leng, angle_offset) stick_square( inner_square_leng, stick_leng, diff --git a/src/loft.scad b/src/loft.scad index 2d82441d..d18b89b1 100644 --- a/src/loft.scad +++ b/src/loft.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2020 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-loft.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html * **/ diff --git a/src/polyhedron_hull.scad b/src/polyhedron_hull.scad index 5d51a6ba..4b0a6197 100644 --- a/src/polyhedron_hull.scad +++ b/src/polyhedron_hull.scad @@ -4,7 +4,7 @@ * @copyright Justin Lin, 2020 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polyhedron_hull.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html * **/ diff --git a/src/polyline3d.scad b/src/polyline3d.scad index 6e3c9513..a4974d5b 100644 --- a/src/polyline3d.scad +++ b/src/polyline3d.scad @@ -4,13 +4,13 @@ * @copyright Justin Lin, 2017 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polyline3d.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html * **/ use ; -module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") { +module polyline3d(points, diameter, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE") { leng_pts = len(points); s_styles = [startingStyle, "CAP_BUTT"]; @@ -27,11 +27,11 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = p1Style = styles[0]; p2Style = styles[1]; - line3d(p1, p2, thickness, + line3d(p1, p2, diameter, p1Style = p1Style, p2Style = p2Style); // hook for testing - test_polyline3d_line3d_segment(index, p1, p2, thickness, p1Style, p2Style); + test_polyline3d_line3d_segment(index, p1, p2, diameter, p1Style, p2Style); } module polyline3d_inner(index) { @@ -42,7 +42,7 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = } if(leng_pts == 2) { - line3d(points[0], points[1], thickness, startingStyle, endingStyle); + line3d(points[0], points[1], diameter, startingStyle, endingStyle); } else { polyline3d_inner(1); @@ -50,6 +50,6 @@ module polyline3d(points, thickness, startingStyle = "CAP_CIRCLE", endingStyle = } // override it to test -module test_polyline3d_line3d_segment(index, point1, point2, thickness, p1Style, p2Style) { +module test_polyline3d_line3d_segment(index, point1, point2, diameter, p1Style, p2Style) { } \ No newline at end of file