mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-22 22:35:18 +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) =
|
function _convex_intersection_for(shapes, pre, leng, i = 2) =
|
||||||
i == leng ? pre :
|
i == leng ? pre :
|
||||||
_convex_intersection_for(shapes,
|
let(r = convex_intersection(pre, shapes[i]))
|
||||||
convex_intersection(pre, shapes[i]),
|
r == [] ? []
|
||||||
|
: _convex_intersection_for(shapes,
|
||||||
|
r,
|
||||||
leng, i + 1
|
leng, i + 1
|
||||||
);
|
);
|
@@ -4,6 +4,7 @@ use <experimental/_impl/_convex_intersection_impl.scad>;
|
|||||||
use <experimental/convex_ct_clk_order.scad>;
|
use <experimental/convex_ct_clk_order.scad>;
|
||||||
|
|
||||||
function convex_intersection(shape1, shape2, epsilon = 0.0001) =
|
function convex_intersection(shape1, shape2, epsilon = 0.0001) =
|
||||||
|
(shape1 == [] || shape2 == []) ? [] :
|
||||||
let(
|
let(
|
||||||
leng = len(shape1),
|
leng = len(shape1),
|
||||||
pts = concat(shape1, [shape1[0]])
|
pts = concat(shape1, [shape1[0]])
|
||||||
|
Reference in New Issue
Block a user