Bugfix in xflip(), yflip(), zflip(), and mirror() functions.

This commit is contained in:
Revar Desmera 2020-03-14 15:06:12 -07:00
parent 608bde9077
commit c001c6d8ae
2 changed files with 6 additions and 9 deletions

View file

@ -781,14 +781,11 @@ 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) =
is_undef(p)? (
len(v)==2? affine2d_mirror(v) : affine3d_mirror(v)
) : (
assert(is_list(p))
is_num(p.x)? p - (2*(p*v)/(v*v))*v :
is_vnf(p)? [mirror(v=v,p=p.x), [for (l=p.y) reverse(l)]] :
[for (l=p) mirror(v=v, p=l)]
);
assert(is_list(p))
let(m = len(v)==2? affine2d_mirror(v) : affine3d_mirror(v))
is_undef(p)? m :
is_vnf(p)? [mirror(v=v,p=p[0]), [for (face=p[1]) reverse(face)]] :
apply(m, p);
// Function&Module: xflip()

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,188];
BOSL_VERSION = [2,0,189];
// Section: BOSL Library Version Functions