From a102663b1af78bc22b3608e78418ef16428f231e Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Wed, 25 Mar 2020 01:37:01 -0700 Subject: [PATCH] Fixed Basits tutorial mirror example images. --- scripts/make_tutorials.sh | 2 +- transforms.scad | 5 ++++- tutorials/Basics.md | 6 +++--- version.scad | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/make_tutorials.sh b/scripts/make_tutorials.sh index a46fd26..13b0159 100755 --- a/scripts/make_tutorials.sh +++ b/scripts/make_tutorials.sh @@ -30,7 +30,7 @@ rm -f tmp_*.scad for base in $PREVIEW_LIBS; do base="$(basename $base .md)" mkdir -p images/tutorials - rm -f images/tutorials/$base_*.png images/tutorials/*.gif + rm -f images/tutorials/${base}_*.png images/tutorials/${base}_*.gif echo "$base.md" ../scripts/tutorial_gen.py ../tutorials/$base.md -o Tutorial-$base.md $FORCED -I images/tutorials/ || exit 1 if [ "$DISPMD" != "" ]; then diff --git a/transforms.scad b/transforms.scad index 99a3b42..83295a2 100644 --- a/transforms.scad +++ b/transforms.scad @@ -551,6 +551,8 @@ function zrot(a=0, cp=undef, p=undef) = rot(a, cp=cp, p=p); // #stroke(path,closed=true); // stroke(scale([1.5,3],p=path),closed=true); function scale(v=1, p=undef) = + assert(is_vector(v)) + assert(is_undef(p) || is_list(p)) let(v = is_num(v)? [v,v,v] : v) is_undef(p)? ( len(v)==2? affine2d_scale(v) : affine3d_scale(point3d(v)) @@ -735,7 +737,8 @@ function zscale(z=1, p=undef) = scale([1,1,z],p=p); // #stroke(path,closed=true); // stroke(mirror(n, p=path),closed=true); function mirror(v, p) = - assert(is_list(p)) + assert(is_vector(v)) + assert(is_undef(p) || is_list(p)) let(m = len(v)==2? affine2d_mirror(v) : affine3d_mirror(v)) is_undef(p)? m : is_num(p.x)? apply(m,p) : diff --git a/tutorials/Basics.md b/tutorials/Basics.md index 7aec166..f9522af 100644 --- a/tutorials/Basics.md +++ b/tutorials/Basics.md @@ -147,8 +147,8 @@ Constant | Value | Direction `BACK` | `[ 0, 1, 0]` | Towards Y+ `DOWN`, `BOTTOM`, `BOT`, `BTM` | `[ 0, 0,-1]` | Towards Z- `UP`, `TOP` | `[ 0, 0, 1]` | Towards Z+ +`ALLNEG` | `[-1,-1,-1]` | Towards X-Y-Z- `ALLPOS` | `[ 1, 1, 1]` | Towards X+Y+Z+ -`ALLNEG` | `[-1,-1,-1]` | Towards X+Y+Z+ This lets you rewrite the above vector rotation more clearly as: ```openscad @@ -161,13 +161,13 @@ This lets you rewrite the above vector rotation more clearly as: The standard `mirror()` command works like this: ```openscad #yrot(60) cylinder(h=50, d1=20, d2=10); - mirror([1,0,0]) yrot(-60) cylinder(h=50, d1=20, d2=10); + mirror([1,0,0]) yrot(60) cylinder(h=50, d1=20, d2=10); ``` BOSL2 provides shortcuts for mirroring across the standard axes; `xflip()`, `yflip()`, and `zflip()`: ```openscad #yrot(60) cylinder(h=50, d1=20, d2=10); - xflip() yrot(-60) cylinder(h=50, d1=20, d2=10); + xflip() yrot(60) cylinder(h=50, d1=20, d2=10); ``` ```openscad diff --git a/version.scad b/version.scad index 852f15e..6e58e8e 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,225]; +BOSL_VERSION = [2,0,226]; // Section: BOSL Library Version Functions