diff --git a/docs/lib3x-footprints2.md b/docs/lib3x-footprints2.md index 3272d700..3bc49c31 100644 --- a/docs/lib3x-footprints2.md +++ b/docs/lib3x-footprints2.md @@ -20,32 +20,29 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is ta = fa / 2, leng = sin(ta) * radius * 2 ) - concat( - [["turn", ta]], - [ + [ + ["turn", ta], + each [ for(i = [0:steps - 2]) each [["forward", leng], ["turn", fa]] ], - [["forward", leng], ["turn", ta]] - ); + ["forward", leng], + ["turn", ta] + ]; poly = footprints2( - concat( - [ - ["forward", 10], - ["turn", 90], - ["forward", 10] - ], - arc_cmds(5, 180, 12), - [ - ["turn", -90], - ["forward", 10], - ["turn", 90], - ["forward", 10], - ["turn", 90], - ["forward", 10] - ] - ) + [ + ["forward", 10], + ["turn", 90], + ["forward", 10], + each arc_cmds(5, 180, 12), + ["turn", -90], + ["forward", 10], + ["turn", 90], + ["forward", 10], + ["turn", 90], + ["forward", 10] + ] ); polyline_join(poly) diff --git a/docs/lib3x-footprints3.md b/docs/lib3x-footprints3.md index c950e6fe..86e7542f 100644 --- a/docs/lib3x-footprints3.md +++ b/docs/lib3x-footprints3.md @@ -20,33 +20,28 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint ta = fa / 2, leng = sin(ta) * radius * 2 ) - concat( - [["turn", ta]], - [ + [ + ["turn", ta], + each [ for(i = [0:steps - 2]) each [["forward", leng], ["turn", fa]] ], - [["forward", leng], ["turn", ta]] - ); + ["forward", leng], + ["turn", ta] + ]; poly = footprints3( - concat( - [ - ["forward", 10], - ["turn", 90], - ["forward", 10] - ], - xy_arc_cmds(5, 180, 12), - [ - ["pitch", 90], - ["forward", 10], - ["roll", 90] - ], - xy_arc_cmds(5, 180, 12), - [ - ["forward", 10] - ] - ) + [ + ["forward", 10], + ["turn", 90], + ["forward", 10], + each xy_arc_cmds(5, 180, 12), + ["pitch", 90], + ["forward", 10], + ["roll", 90], + each xy_arc_cmds(5, 180, 12), + ["forward", 10] + ] ); polyline_join(poly) diff --git a/docs/lib3x-hashmap.md b/docs/lib3x-hashmap.md index ef2027ae..1fecd182 100644 --- a/docs/lib3x-hashmap.md +++ b/docs/lib3x-hashmap.md @@ -54,7 +54,7 @@ Want to simulate class-based OO in OpenSCAD? Here's my experiment. function clz_list(data) = function(name) _(name, methods([ ["get", function(i) data[i]], - ["append", function(n) clz_list(concat(data, [n]))] + ["append", function(n) clz_list([each data, n])] ]) ); diff --git a/docs/lib3x-path_extrude.md b/docs/lib3x-path_extrude.md index 6d5cec6b..954a774f 100644 --- a/docs/lib3x-path_extrude.md +++ b/docs/lib3x-path_extrude.md @@ -257,7 +257,7 @@ So, which is the correct method? Both methods are correct when you provide only // not closed perfectly translate([-8, 0, 0]) path_extrude( shape_pentagram_pts, - concat(pts, [pts[0]]), + [each pts, pts[0]], closed = true, method = "AXIS_ANGLE" ); @@ -265,7 +265,7 @@ So, which is the correct method? Both methods are correct when you provide only // adjust it path_extrude( shape_pentagram_pts, - concat(pts, [pts[0]]), + [each pts, pts[0]], closed = true, twist = 188, method = "AXIS_ANGLE" @@ -274,7 +274,7 @@ So, which is the correct method? Both methods are correct when you provide only // "EULER_ANGLE" is easy in this situation translate([0, 8, 0]) path_extrude( shape_pentagram_pts, - concat(pts, [pts[0]]), + [each pts, pts[0]], closed = true, method = "EULER_ANGLE" ); diff --git a/docs/lib3x-torus_knot.md b/docs/lib3x-torus_knot.md index 9f5caf20..13946c40 100644 --- a/docs/lib3x-torus_knot.md +++ b/docs/lib3x-torus_knot.md @@ -29,7 +29,7 @@ Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_kn path_extrude( shape_pentagram_pts, - concat(pts, [pts[0]]), + [each pts, pts[0]], closed = true, method = "EULER_ANGLE" ); diff --git a/docs/lib3x-tri_delaunay.md b/docs/lib3x-tri_delaunay.md index f7fe0fb9..917f7f77 100644 --- a/docs/lib3x-tri_delaunay.md +++ b/docs/lib3x-tri_delaunay.md @@ -32,7 +32,7 @@ Join a set of points to make a [Delaunay triangulation](https://en.wikipedia.org color("red") linear_extrude(3) for(t = tri_delaunay(points, ret = "VORONOI_CELLS")) { - polyline_join(concat(t, [t[0]])) + polyline_join([each t, t[0]]) circle(1); } diff --git a/docs/lib3x-tri_delaunay_indices.md b/docs/lib3x-tri_delaunay_indices.md index d9a0a352..d93ade9b 100644 --- a/docs/lib3x-tri_delaunay_indices.md +++ b/docs/lib3x-tri_delaunay_indices.md @@ -36,7 +36,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns the indices from color("red") linear_extrude(3) for(t = tri_delaunay_voronoi(delaunay)) { - polyline_join(concat(t, [t[0]])) + polyline_join([each t, t[0]]) circle(1); } diff --git a/docs/lib3x-tri_delaunay_shapes.md b/docs/lib3x-tri_delaunay_shapes.md index 2c3d661c..9e7be0b3 100644 --- a/docs/lib3x-tri_delaunay_shapes.md +++ b/docs/lib3x-tri_delaunay_shapes.md @@ -36,7 +36,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns triangle shapes f color("red") linear_extrude(3) for(t = tri_delaunay_voronoi(delaunay)) { - polyline_join(concat(t, [t[0]])) + polyline_join([each t, t[0]]) circle(1); } diff --git a/docs/lib3x-tri_delaunay_voronoi.md b/docs/lib3x-tri_delaunay_voronoi.md index a8bc529f..b811fd3e 100644 --- a/docs/lib3x-tri_delaunay_voronoi.md +++ b/docs/lib3x-tri_delaunay_voronoi.md @@ -36,7 +36,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns voronoi cells fro color("red") linear_extrude(3) for(t = tri_delaunay_voronoi(delaunay)) { - polyline_join(concat(t, [t[0]])) + polyline_join([each t, t[0]]) circle(1); } diff --git a/docs/lib3x-vrn2_cells_from.md b/docs/lib3x-vrn2_cells_from.md index 3d12e9f9..ed36081a 100644 --- a/docs/lib3x-vrn2_cells_from.md +++ b/docs/lib3x-vrn2_cells_from.md @@ -21,7 +21,7 @@ Create cell shapes of Voronoi from a list of points. cell = cells[i]; linear_extrude(1) - polyline_join(concat(cell, [cell[0]])) + polyline_join([each cell, cell[0]]) circle(.5); color(rands(0, 1, 3)) diff --git a/docs/lib3x-vrn2_cells_space.md b/docs/lib3x-vrn2_cells_space.md index a7af3bde..132bee9c 100644 --- a/docs/lib3x-vrn2_cells_space.md +++ b/docs/lib3x-vrn2_cells_space.md @@ -24,7 +24,7 @@ Create cell shapes of Voronoi in the first quadrant. You specify a space and a g cell_poly = cell[1]; linear_extrude(1) - polyline_join(concat(cell_poly, [cell_poly[0]])) + polyline_join([each cell_poly, cell_poly[0]]) circle(.5); color(rands(0, 1, 3)) diff --git a/docs/lib3x-vx_polyline.md b/docs/lib3x-vx_polyline.md index d6c192d2..2dd0ece8 100644 --- a/docs/lib3x-vx_polyline.md +++ b/docs/lib3x-vx_polyline.md @@ -18,7 +18,7 @@ Given a list of points. `vx_polyline` returns points that can be used to draw a [round(pt.x), round(pt.y)] ]; - for(pt = vx_polyline(concat(pentagram, [pentagram[0]]))) { + for(pt = vx_polyline([each pentagram, pentagram[0]])) { translate(pt) linear_extrude(1, scale = 0.5) square(1, center = true);