1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-09 08:16:50 +02:00

update ret

This commit is contained in:
Justin Lin
2021-04-16 14:24:11 +08:00
parent b171250548
commit fc64bd31c7
2 changed files with 6 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ module drawTris(pointsOfTriangles) {
}
}
drawTris2(points, tri_delaunay(points, ret = "INDICES"));
drawTris2(points, tri_delaunay(points, ret = "TRI_INDICES"));
module drawTris2(points, indices) {
pointsOfTriangles = [for(i = indices) [points[i[0]], points[i[1]], points[i[2]]]];
%for(t = pointsOfTriangles) {

View File

@@ -1,8 +1,9 @@
use<experimental/_impl/_tri_delaunay_impl.scad>;
// ret: "SHAPES", "INDICES", "DELAUNAY"
function tri_delaunay(points, ret = "SHAPES") =
// ret: "TRI_SHAPES", "TRI_INDICES", "DELAUNAY"
// todo: "VORONOI_SHAPES"
function tri_delaunay(points, ret = "TRI_SHAPES") =
let(d = _tri_delaunay(delaunay_init(points), points, len(points)))
ret == "SHAPES" ? tri_delaunay_shapes(d) :
ret == "INDICES" ? tri_delaunay_indices(d) :
ret == "TRI_SHAPES" ? tri_delaunay_shapes(d) :
ret == "TRI_INDICES" ? tri_delaunay_indices(d) :
d; // [coords(list), triangles(hashmap), circles(hashmap)]