From 25aef90fc7431b58b1e6e1a6fa301d386daf077e Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 23 Apr 2023 23:36:07 -0400 Subject: [PATCH] fix closed=true stroke calls with endcaps given --- drawing.scad | 2 +- tutorials/Paths.md | 36 ++++++++++++++++++------------------ vnf.scad | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drawing.scad b/drawing.scad index 4da970f..8c1386c 100644 --- a/drawing.scad +++ b/drawing.scad @@ -103,7 +103,7 @@ // stroke(path, width=20); // Example(2D): Closing a Path // path = [[0,100], [100,100], [200,0], [100,-100], [100,0]]; -// stroke(path, width=20, endcaps=true, closed=true); +// stroke(path, width=20, closed=true); // Example(2D): Fancy Arrow Endcaps // path = [[0,100], [100,100], [200,0], [100,-100], [100,0]]; // stroke(path, width=10, endcaps="arrow2"); diff --git a/tutorials/Paths.md b/tutorials/Paths.md index 7ef3e0f..2369755 100644 --- a/tutorials/Paths.md +++ b/tutorials/Paths.md @@ -149,43 +149,43 @@ BOSL2 will let you get the perimeter polygon for almost all of the standard 2D s ```openscad-2D include path = square(40, center=true); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = rect([40,30], rounding=5); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = trapezoid(w1=40, w2=20, h=30); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = circle(d=50); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = ellipse(d=[50,30]); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = pentagon(d=50); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = star(n=5, step=2, d=50); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ### Arcs @@ -336,19 +336,19 @@ To translate a path, you can just pass it to the `move()` (or up/down/left/right ```openscad-2D include path = move([-15,-30], p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = fwd(30, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = left(30, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` To scale a path, you can just pass it to the `scale()` (or [xyz]scale) function in the `p=` argument: @@ -356,19 +356,19 @@ To scale a path, you can just pass it to the `scale()` (or [xyz]scale) function ```openscad-2D include path = scale([1.5,0.75], p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = xscale(1.5, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = yscale(1.5, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` To rotate a path, just can pass it to the `rot()` (or [xyz]rot) function in the `p=` argument: @@ -376,13 +376,13 @@ To rotate a path, just can pass it to the `rot()` (or [xyz]rot) function in the ```openscad-2D include path = rot(30, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = zrot(30, p=square(50,center=true)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` To mirror a path, just can pass it to the `mirror()` (or [xyz]flip) function in the `p=` argument: @@ -390,19 +390,19 @@ To mirror a path, just can pass it to the `mirror()` (or [xyz]flip) function in ```openscad-2D include path = mirror([1,1], p=trapezoid(w1=40, w2=10, h=25)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = xflip(p=trapezoid(w1=40, w2=10, h=25)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` ```openscad-2D include path = yflip(p=trapezoid(w1=40, w2=10, h=25)); -stroke(path, closed=true, endcap2="arrow2"); +stroke(list_wrap(path), endcap2="arrow2"); ``` You can get raw transformation matrices for various transformations by calling them like a function without a `p=` argument: diff --git a/vnf.scad b/vnf.scad index db13f35..7457e9e 100644 --- a/vnf.scad +++ b/vnf.scad @@ -1872,7 +1872,7 @@ module vnf_validate(vnf, size=1, show_warns=true, check_isects=false, opacity=0. color(clr) { if (is_vector(pts[0])) { if (len(pts)==2) { - stroke(pts, width=size, closed=true, endcaps="butt", $fn=8); + stroke(pts, width=size, endcaps="butt", $fn=8); } else if (len(pts)>2) { stroke(pts, width=size, closed=true, $fn=8); polyhedron(pts,[[for (i=idx(pts)) i]]);