diff --git a/examples/crystal_cluster.scad b/examples/crystal_cluster.scad index deb98dd6..7ad92444 100644 --- a/examples/crystal_cluster.scad +++ b/examples/crystal_cluster.scad @@ -23,12 +23,12 @@ module crystal_cluster(base_r, crystals) { ); polyhedron_hull( - concat( - [for(p = bottom_shape) [p.x, p.y, 0]], - [for(p = neck_shape) [p.x, p.y, rand(h * 0.7, h * 0.75)]], - [[rand(0, r * 0.1), rand(0, r * 0.1), rand(h * 0.8, h)]], - [for(i = [0:2]) if(rand(0, 1) > 0.5) [rand(0, r * 0.15), rand(0, r * 0.15), rand(h * 0.9, h * 1.05)]] - ) + [ + each [for(p = bottom_shape) [p.x, p.y, 0]], + each [for(p = neck_shape) [p.x, p.y, rand(h * 0.7, h * 0.75)]], + [rand(0, r * 0.1), rand(0, r * 0.1), rand(h * 0.8, h)], + each [for(i = [0:2]) if(rand(0, 1) > 0.5) [rand(0, r * 0.15), rand(0, r * 0.15), rand(h * 0.9, h * 1.05)]] + ] ); } diff --git a/examples/klein_bottle.scad b/examples/klein_bottle.scad index ed402b36..81581745 100644 --- a/examples/klein_bottle.scad +++ b/examples/klein_bottle.scad @@ -57,20 +57,10 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) { degree = 2; bs_curve = bspline_curve(t_step, degree, mid_pts); + tube_path = [[0, 0, bottom_height], each bs_curve, [0, 0, 0]]; + tube_path2 = [[0, 0, bottom_height - thickness], each bs_curve, [0, 0, -thickness]]; - tube_path = concat( - [[0, 0, bottom_height]], - bs_curve, - [[0, 0, 0]] - ); - - tube_path2 = concat( - [[0, 0, bottom_height - thickness]], - bs_curve, - [[0, 0, -thickness]] - ); - - difference() { + difference() { union() { bottom(); diff --git a/examples/knot.scad b/examples/knot.scad index becefa34..497fde32 100644 --- a/examples/knot.scad +++ b/examples/knot.scad @@ -13,7 +13,7 @@ shape_pentagram_pts = shape_pentagram(star_radius); path_extrude( shape_pentagram_pts, - concat(pts, [pts[0]]), + [each pts, pts[0]], closed = true, method = "EULER_ANGLE" ); diff --git a/examples/owl.scad b/examples/owl.scad index 1fdc24b5..2c5698b1 100644 --- a/examples/owl.scad +++ b/examples/owl.scad @@ -204,7 +204,20 @@ module owl(detail, head_angles) { rotate_extrude($fn = 7) polygon(pts); linear_extrude(5) - polygon(dedup(concat(claw_path1, claw_path2, claw_path3, [[-2, -.75], [-1.45, -1.45]], claw_path4, [[1.45, -1.45], [2, -.75]]))); + polygon( + dedup( + [ + each claw_path1, + each claw_path2, + each claw_path3, + [-2, -.75], + [-1.45, -1.45], + each claw_path4, + [1.45, -1.45], + [2, -.75] + ] + ) + ); } } diff --git a/examples/packing_circles.scad b/examples/packing_circles.scad index 8584b2df..f582e55f 100644 --- a/examples/packing_circles.scad +++ b/examples/packing_circles.scad @@ -45,7 +45,7 @@ function _packing_circles(size, min_radius, max_radius, total_circles, attempts, i == total_circles ? circles : let(c = _packing_circles_new_circle(size, min_radius, max_radius, attempts, circles)) c == [] ? _packing_circles(size, min_radius, max_radius, total_circles, attempts, circles) : - _packing_circles(size, min_radius, max_radius, total_circles, attempts, concat(circles, [c]), i + 1); + _packing_circles(size, min_radius, max_radius, total_circles, attempts, [each circles, c], i + 1); function packing_circles(size, min_radius, max_radius, total_circles, attempts = 100) = _packing_circles(is_num(size) ? [size, size] : size, min_radius, max_radius, total_circles, attempts); diff --git a/examples/perlin_noise_cylinder.scad b/examples/perlin_noise_cylinder.scad index 5beb6cac..6486c5a3 100644 --- a/examples/perlin_noise_cylinder.scad +++ b/examples/perlin_noise_cylinder.scad @@ -14,13 +14,10 @@ module perlin_noise_cylinder(radius, height, thickness_scale, step) { surface_inside = [ for(y = [0:step:size[1]]) - concat( - [ - for(x = [0:step:size[0] - 1]) - [x / 10, y / 10, 0] - ], - [[size[0] / 10, y / 10, 0]] - ) + [ + each [for(x = [0:step:size[0] - 1]) [x / 10, y / 10, 0]], + [size[0] / 10, y / 10, 0] + ] ]; seed = rand(0, 256); @@ -29,7 +26,10 @@ module perlin_noise_cylinder(radius, height, thickness_scale, step) { for(ri = [0:len(surface_inside) - 1]) let( row = surface_inside[ri], - row_for_noise = concat(slice(row, 0, leng_row - 1), [[0, row[leng_row - 1][1], 0]]), + row_for_noise = [ + each slice(row, 0, leng_row - 1), + [0, row[leng_row - 1][1], 0] + ], ns = nz_perlin2s(row_for_noise, seed) ) [ diff --git a/examples/shape2wire.scad b/examples/shape2wire.scad index b147ada2..5484fc78 100644 --- a/examples/shape2wire.scad +++ b/examples/shape2wire.scad @@ -27,11 +27,11 @@ rotate([90, 0, 0]) linear_extrude(1, center = true) difference() { square(120, center = true); - polyline_join(concat(shape, [shape[0]])) + polyline_join([each shape, shape[0]]) circle(2.5); } wire = shape2wire(shape, 150); rotate(-$t * 360) -polyline_join(concat(wire, [wire[0]])) +polyline_join([each wire, wire[0]]) sphere(1.5); \ No newline at end of file diff --git a/examples/wormhole.scad b/examples/wormhole.scad index 9ab95c21..a28ca604 100644 --- a/examples/wormhole.scad +++ b/examples/wormhole.scad @@ -16,11 +16,11 @@ module wormhole(length, width, depth, thickness, hole_r) { r2 = width / 4; half_thickness = thickness / 2; - plane = concat( - [[length - r1, r1]], - [for(a = [90:a_step:270]) r1 * [cos(a), sin(a)]], - [[length - r1, -r1]] - ); + plane = [ + [length - r1, r1], + each [for(a = [90:a_step:270]) r1 * [cos(a), sin(a)]], + [length - r1, -r1] + ]; difference() { rotate([90, 0, 0])