From 209ba9cc01f0c495b267a86eb14e0e41e2efb022 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 24 Apr 2021 10:05:38 +0800 Subject: [PATCH] add ret param --- src/experimental/tri_ear_clipping.scad | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/experimental/tri_ear_clipping.scad b/src/experimental/tri_ear_clipping.scad index 77b8e760..cc0dea56 100644 --- a/src/experimental/tri_ear_clipping.scad +++ b/src/experimental/tri_ear_clipping.scad @@ -3,5 +3,8 @@ **/ use ; - -function tri_ear_clipping(shape_pts, epsilon = 0.0001) = _tri_ear_clipping_impl(shape_pts, epsilon); \ No newline at end of file + +// ret: "TRI_SHAPES", "TRI_INDICES" +function tri_ear_clipping(shape_pts, ret = "TRI_INDICES", epsilon = 0.0001) = + let(tris = _tri_ear_clipping_impl(shape_pts, epsilon)) + ret == "TRI_INDICES" ? tris : [for(tri = tris) [for(idx = tri) shape_pts[idx]]]; \ No newline at end of file