1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-01 10:42:57 +02:00

delete trianglate

This commit is contained in:
Justin Lin
2021-02-10 14:47:27 +08:00
parent f0c07f1110
commit 72dd1e2305
4 changed files with 2 additions and 43 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -1,41 +0,0 @@
# triangulate
Given a 2D shape. This function performs a simple polygon triangulation algorithm and returns the indices of each triangle.
**Since:** 1.3.
## Parameters
- `shape_pts` : The shape points.
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
## Examples
use <triangulate.scad>;
shape = [
[0, 0],
[10, 0],
[12, 5],
[5, 10],
[10, 15],
[0, 20],
[-5, 18],
[-18, 3],
[-4, 10]
];
tris = triangulate(shape);
difference() {
polygon(shape);
for(tri = tris) {
offset(-.2)
polygon([for(idx = tri) shape[idx]]);
}
}
![triangulate](images/lib2x-triangulate-1.JPG)