1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +02:00
This commit is contained in:
Justin Lin
2021-05-03 16:47:36 +08:00
parent 58eaccf998
commit 5defe6e218
5 changed files with 52 additions and 2 deletions

View File

@@ -355,8 +355,8 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
Signature | Description Signature | Description
--|-- --|--
**triangle/tri_circumcenter**(shape_pts) | return the circumcenter 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) | return the incenter 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_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**(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. **triangle/tri_delaunay_indices**(d) | return triangle indices from a delaunay object.

View File

@@ -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 <triangle/tri_circumcenter.scad>;
assert(tri_circumcenter([[0, 0], [10, 20], [15, 10]]) == [3.75, 10.625]);

View File

@@ -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 <triangle/tri_incenter.scad>;
assert(tri_incenter([[0, 0], [15, 0], [0, 20]]) == [5, 5]);

View File

@@ -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) = function tri_circumcenter(shape_pts) =
let( let(
p0 = shape_pts[0], p0 = shape_pts[0],

View File

@@ -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) = function tri_incenter(shape_pts) =
let( let(
pa = shape_pts[0], pa = shape_pts[0],