diff --git a/README.md b/README.md index 97b890e1..26bbd621 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp Signature | Description --|-- -polyhedra/star | create a 3D star. +[**polyhedra/star**([outerRadius, innerRadius, height, n])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_star.html) | create a 3D star. [**polyhedra/tetrahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_tetrahedron.html) | create a tetrahedron. [**polyhedra/hexahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_hexahedron.html) | create a hexahedron. [**polyhedra/octahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_octahedron.html) | create a octahedron. diff --git a/docs/images/lib3x-polyhedra_star-1.JPG b/docs/images/lib3x-polyhedra_star-1.JPG new file mode 100644 index 00000000..acfbb8c7 Binary files /dev/null and b/docs/images/lib3x-polyhedra_star-1.JPG differ diff --git a/docs/lib3x-polyhedra_star.md b/docs/lib3x-polyhedra_star.md new file mode 100644 index 00000000..71ebc7c1 --- /dev/null +++ b/docs/lib3x-polyhedra_star.md @@ -0,0 +1,24 @@ +# star + +Create a star. Default to a pentagram. + +**Since:** 3.2 + +## Parameters + +- `outer_radius`: The outer radius of the star. Default to 1. +- `inner_radius`: The inner radius of the star. Default to 0.381966. +- `height`: The star height. Default to 0.5. +- `n`: The burst number. Default to 5. + +## Examples + + use ; + + for(i = [3:6]) { + translate([(i - 3) * 2, 0]) + star(n = i); + } + +![star](images/lib3x-polyhedra_star-1.JPG) + diff --git a/src/polyhedra/star.scad b/src/polyhedra/star.scad index 1c6a0fa5..6d689841 100644 --- a/src/polyhedra/star.scad +++ b/src/polyhedra/star.scad @@ -1,3 +1,13 @@ +/** +* star.scad +* +* @copyright Justin Lin, 2021 +* @license https://opensource.org/licenses/lgpl-3.0.html +* +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_star.html +* +**/ + use ; module star(outerRadius = 1, innerRadius = 0.381966, height = 0.5, n = 5) {