diff --git a/src/hull_polyline2d.scad b/src/hull_polyline2d.scad index 0581cf0e..7bf420de 100644 --- a/src/hull_polyline2d.scad +++ b/src/hull_polyline2d.scad @@ -27,9 +27,23 @@ module hull_polyline2d(points, width = 1) { test_hull_polyline2d_line_segment(index, point1, point2, half_width); } - for(i = [1:leng - 1]) { - hull_line2d(i) - circle(half_width); + if($children == 0) { + for(i = [1:leng - 1]) { + hull_line2d(i) + circle(half_width); + } + } + else if($children == 1) { + for(i = [1:leng - 1]) { + hull_line2d(i) + children(); + } + } + else { + for(i = [1:leng - 1]) { + hull_line2d(i) + children(i); + } } } diff --git a/src/hull_polyline3d.scad b/src/hull_polyline3d.scad index a69f615d..55421a1d 100644 --- a/src/hull_polyline3d.scad +++ b/src/hull_polyline3d.scad @@ -26,10 +26,24 @@ module hull_polyline3d(points, diameter = 1) { // hook for testing test_hull_polyline3d_line_segment(index, point1, point2, radius); } - - for(i = [1:leng - 1]) { - hull_line3d(i) - sphere(radius); + + if($children == 0) { + for(i = [1:leng - 1]) { + hull_line3d(i) + sphere(radius); + } + } + else if($children == 1) { + for(i = [1:leng - 1]) { + hull_line3d(i) + children(); + } + } + else { + for(i = [1:leng - 1]) { + hull_line3d(i) + children(i); + } } }