mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 14:04:53 +02:00
stop if []
This commit is contained in:
@@ -2,7 +2,9 @@ use <experimental/convex_intersection.scad>;
|
||||
|
||||
function _convex_intersection_for(shapes, pre, leng, i = 2) =
|
||||
i == leng ? pre :
|
||||
_convex_intersection_for(shapes,
|
||||
convex_intersection(pre, shapes[i]),
|
||||
leng, i + 1
|
||||
);
|
||||
let(r = convex_intersection(pre, shapes[i]))
|
||||
r == [] ? []
|
||||
: _convex_intersection_for(shapes,
|
||||
r,
|
||||
leng, i + 1
|
||||
);
|
@@ -4,6 +4,7 @@ use <experimental/_impl/_convex_intersection_impl.scad>;
|
||||
use <experimental/convex_ct_clk_order.scad>;
|
||||
|
||||
function convex_intersection(shape1, shape2, epsilon = 0.0001) =
|
||||
(shape1 == [] || shape2 == []) ? [] :
|
||||
let(
|
||||
leng = len(shape1),
|
||||
pts = concat(shape1, [shape1[0]])
|
||||
|
Reference in New Issue
Block a user