diff --git a/src/voronoi/_impl/_convex_intersection_for.scad b/src/voronoi/_impl/_convex_intersection_for.scad index 2e30ca03..b2b60505 100644 --- a/src/voronoi/_impl/_convex_intersection_for.scad +++ b/src/voronoi/_impl/_convex_intersection_for.scad @@ -1,13 +1,13 @@ use <_convex_intersection.scad>; function _convex_intersection_for_impl(shapes, pre, leng, i = 2) = - i == leng ? pre : - let(r = _convex_intersection(pre, shapes[i])) - r == [] ? r - : _convex_intersection_for_impl(shapes, - r, - leng, i + 1 - ); + pre == [] || i == leng ? pre : + _convex_intersection_for_impl( + shapes, + _convex_intersection(pre, shapes[i]), + leng, + i + 1 + ); function _convex_intersection_for(shapes) = let(leng = len(shapes))