From 5defe6e218649df39dc9fc6b95e4f4f1f015e0e7 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 3 May 2021 16:47:36 +0800 Subject: [PATCH] add doc --- README.md | 4 ++-- docs/lib3x-tri_circumcenter.md | 15 +++++++++++++++ docs/lib3x-tri_incenter.md | 15 +++++++++++++++ src/triangle/tri_circumcenter.scad | 10 ++++++++++ src/triangle/tri_incenter.scad | 10 ++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 docs/lib3x-tri_circumcenter.md create mode 100644 docs/lib3x-tri_incenter.md diff --git a/README.md b/README.md index 28efa6aa..c2576333 100644 --- a/README.md +++ b/README.md @@ -355,8 +355,8 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp Signature | Description --|-- -**triangle/tri_circumcenter**(shape_pts) | return the circumcenter of a triangle. -**triangle/tri_incenter**(shape_pts) | return the incenter of a triangle. +[**triangle/tri_circumcenter**(shape_pts)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_circumcenter.html) | return the circumcenter of a triangle. +[**triangle/tri_incenter**(shape_pts)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_incenter.html) | return the incenter of a triangle. **triangle/tri_ear_clipping**(shape_pts, ret = "TRI_INDICES", ...) | triangulation by [ear clipping](https://en.wikipedia.org/wiki/Polygon_triangulation#Ear_clipping_method). **triangle/tri_delaunay**(points, ret = "TRI_INDICES") | return the [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) of the points. **triangle/tri_delaunay_indices**(d) | return triangle indices from a delaunay object. diff --git a/docs/lib3x-tri_circumcenter.md b/docs/lib3x-tri_circumcenter.md new file mode 100644 index 00000000..2457db99 --- /dev/null +++ b/docs/lib3x-tri_circumcenter.md @@ -0,0 +1,15 @@ +# tri_circumcenter + +The `tri_circumcenter` function returns the circumcenter of a 2D triangle. + +**Since:** 3.1 + +## Parameters + +- `shape_pts` : the vertices of a 2D triangle. + +## Examples + + use ; + + assert(tri_circumcenter([[0, 0], [10, 20], [15, 10]]) == [3.75, 10.625]); \ No newline at end of file diff --git a/docs/lib3x-tri_incenter.md b/docs/lib3x-tri_incenter.md new file mode 100644 index 00000000..443d4322 --- /dev/null +++ b/docs/lib3x-tri_incenter.md @@ -0,0 +1,15 @@ +# tri_incenter + +The `tri_incenter` function returns the incenter of a 2D triangle. + +**Since:** 3.1 + +## Parameters + +- `shape_pts` : the vertices of a 2D triangle. + +## Examples + + use ; + + assert(tri_incenter([[0, 0], [15, 0], [0, 20]]) == [5, 5]); \ No newline at end of file diff --git a/src/triangle/tri_circumcenter.scad b/src/triangle/tri_circumcenter.scad index 93d24079..12de63b8 100644 --- a/src/triangle/tri_circumcenter.scad +++ b/src/triangle/tri_circumcenter.scad @@ -1,3 +1,13 @@ +/** +* tri_circumcenter.scad +* +* @copyright Justin Lin, 2021 +* @license https://opensource.org/licenses/lgpl-3.0.html +* +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_circumcenter.html +* +**/ + function tri_circumcenter(shape_pts) = let( p0 = shape_pts[0], diff --git a/src/triangle/tri_incenter.scad b/src/triangle/tri_incenter.scad index 44e6fa90..e71d46c4 100644 --- a/src/triangle/tri_incenter.scad +++ b/src/triangle/tri_incenter.scad @@ -1,3 +1,13 @@ +/** +* tri_incenter.scad +* +* @copyright Justin Lin, 2021 +* @license https://opensource.org/licenses/lgpl-3.0.html +* +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_incenter.html +* +**/ + function tri_incenter(shape_pts) = let( pa = shape_pts[0],