From aef60324fdfe562b5e4e18d450cddab7886a5352 Mon Sep 17 00:00:00 2001 From: RonaldoCMP Date: Wed, 13 Oct 2021 23:16:14 -0300 Subject: [PATCH] update geometry.scad --- geometry.scad | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geometry.scad b/geometry.scad index 0c6855a..dd6ace0 100644 --- a/geometry.scad +++ b/geometry.scad @@ -1673,9 +1673,11 @@ function polygon_triangulate(poly, ind, eps=EPSILON) = : len(poly[ind[0]]) == 3 ? // represents the polygon projection on its plane as a 2d polygon let( + ind = deduplicate_indexed(poly, ind, eps), pts = select(poly,ind), nrm = polygon_normal(pts) - ) + ) + len(ind)<3 ? [] : // here, instead of an error, it might return [] or undef assert( nrm!=undef, "The polygon has self-intersections or its vertices are collinear or non coplanar.")