Fixed matrix form of rot(from,to,a)

This commit is contained in:
Revar Desmera 2020-03-02 12:42:29 -08:00
parent c6ec9c8820
commit 8a29e9e86b
2 changed files with 8 additions and 2 deletions

View file

@ -376,7 +376,13 @@ function rot(a=0, v=undef, cp=undef, from=undef, to=undef, reverse=false, p=unde
is_undef(from)? affine2d_zrot(a*rev) :
affine2d_zrot(vector_angle(from,to)*sign(vector_axis(from,to)[2])*rev)
) : (
!is_undef(from)? affine3d_rot_by_axis(vector_axis(from,to),vector_angle(from,to)*rev) :
!is_undef(from)? affine3d_chain([
affine3d_zrot(a*rev),
affine3d_rot_by_axis(
vector_axis(from,to),
vector_angle(from,to)*rev
)
]) :
!is_undef(v)? affine3d_rot_by_axis(v,a*rev) :
is_num(a)? affine3d_zrot(a*rev) :
reverse? affine3d_chain([affine3d_zrot(-a.z),affine3d_yrot(-a.y),affine3d_xrot(-a.x)]) :

View file

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