mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-17 01:49:48 +00:00
Fixed Basits tutorial mirror example images.
This commit is contained in:
parent
7640627300
commit
a102663b1a
4 changed files with 9 additions and 6 deletions
|
@ -30,7 +30,7 @@ rm -f tmp_*.scad
|
||||||
for base in $PREVIEW_LIBS; do
|
for base in $PREVIEW_LIBS; do
|
||||||
base="$(basename $base .md)"
|
base="$(basename $base .md)"
|
||||||
mkdir -p images/tutorials
|
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"
|
echo "$base.md"
|
||||||
../scripts/tutorial_gen.py ../tutorials/$base.md -o Tutorial-$base.md $FORCED -I images/tutorials/ || exit 1
|
../scripts/tutorial_gen.py ../tutorials/$base.md -o Tutorial-$base.md $FORCED -I images/tutorials/ || exit 1
|
||||||
if [ "$DISPMD" != "" ]; then
|
if [ "$DISPMD" != "" ]; then
|
||||||
|
|
|
@ -551,6 +551,8 @@ function zrot(a=0, cp=undef, p=undef) = rot(a, cp=cp, p=p);
|
||||||
// #stroke(path,closed=true);
|
// #stroke(path,closed=true);
|
||||||
// stroke(scale([1.5,3],p=path),closed=true);
|
// stroke(scale([1.5,3],p=path),closed=true);
|
||||||
function scale(v=1, p=undef) =
|
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)
|
let(v = is_num(v)? [v,v,v] : v)
|
||||||
is_undef(p)? (
|
is_undef(p)? (
|
||||||
len(v)==2? affine2d_scale(v) : affine3d_scale(point3d(v))
|
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(path,closed=true);
|
||||||
// stroke(mirror(n, p=path),closed=true);
|
// stroke(mirror(n, p=path),closed=true);
|
||||||
function mirror(v, p) =
|
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))
|
let(m = len(v)==2? affine2d_mirror(v) : affine3d_mirror(v))
|
||||||
is_undef(p)? m :
|
is_undef(p)? m :
|
||||||
is_num(p.x)? apply(m,p) :
|
is_num(p.x)? apply(m,p) :
|
||||||
|
|
|
@ -147,8 +147,8 @@ Constant | Value | Direction
|
||||||
`BACK` | `[ 0, 1, 0]` | Towards Y+
|
`BACK` | `[ 0, 1, 0]` | Towards Y+
|
||||||
`DOWN`, `BOTTOM`, `BOT`, `BTM` | `[ 0, 0,-1]` | Towards Z-
|
`DOWN`, `BOTTOM`, `BOT`, `BTM` | `[ 0, 0,-1]` | Towards Z-
|
||||||
`UP`, `TOP` | `[ 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+
|
`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:
|
This lets you rewrite the above vector rotation more clearly as:
|
||||||
```openscad
|
```openscad
|
||||||
|
@ -161,13 +161,13 @@ This lets you rewrite the above vector rotation more clearly as:
|
||||||
The standard `mirror()` command works like this:
|
The standard `mirror()` command works like this:
|
||||||
```openscad
|
```openscad
|
||||||
#yrot(60) cylinder(h=50, d1=20, d2=10);
|
#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()`:
|
BOSL2 provides shortcuts for mirroring across the standard axes; `xflip()`, `yflip()`, and `zflip()`:
|
||||||
```openscad
|
```openscad
|
||||||
#yrot(60) cylinder(h=50, d1=20, d2=10);
|
#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
|
```openscad
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,225];
|
BOSL_VERSION = [2,0,226];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue