diff --git a/README.md b/README.md index ccef311b..8912a495 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp ### 2D Module -- polygon_hull +- [polygon_hull](https://openhome.cc/eGossip/OpenSCAD/lib2x-polygon_hull.html) ### 3D Module diff --git a/docs/images/lib2x-polygon_hull-1.JPG b/docs/images/lib2x-polygon_hull-1.JPG new file mode 100644 index 00000000..c8c58255 Binary files /dev/null and b/docs/images/lib2x-polygon_hull-1.JPG differ diff --git a/docs/lib2x-polygon_hull.md b/docs/lib2x-polygon_hull.md new file mode 100644 index 00000000..40628105 --- /dev/null +++ b/docs/lib2x-polygon_hull.md @@ -0,0 +1,23 @@ +# polyhedron_hull + +Create a convex polygon by hulling a list of points. It avoids using `hull` and small 2D primitives to create the polygon. + +**Since:** 2.5 + +## Parameters + +- `points` : A list of 2D points. + +## Examples + + use ; + + polygon_hull([ + [1, 1], + [1, 0], + [0, 1], + [-2, 1], + [-1, -1] + ]); + +![polygon_hull](images/lib2x-polygon_hull-1.JPG) \ No newline at end of file diff --git a/src/polygon_hull.scad b/src/polygon_hull.scad index 4b20d9a9..0db4efa9 100644 --- a/src/polygon_hull.scad +++ b/src/polygon_hull.scad @@ -1,3 +1,13 @@ +/** +* polygon_hull.scad +* +* @copyright Justin Lin, 2020 +* @license https://opensource.org/licenses/lgpl-3.0.html +* +* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-polygon_hull.html +* +**/ + use <__comm__/_convex_hull2.scad>; module polygon_hull(points) {