BOSL2 icon indicating copy to clipboard operation
BOSL2 copied to clipboard

Match affine3d skews {_xy, _xz, _yz} up to affine2d_skew behaviour

Open geoffder opened this issue 3 years ago • 0 comments

Currently, affine2d_skew and affine3d_skew_xy have different behaviour.

include <BOSL2/std.scad>

sq = square(10, center=true);
m2 = affine2d_skew(45, 0);
m3 = affine3d_skew_xy(45, 0);

linear_extrude(1) polygon(apply(m2, sq));

translate([0, 0, 5])
    multmatrix(m3)
        linear_extrude(1) 
            polygon(sq);

bosl2_skew_mismatch

Similarly, affine3d_skew_xz and affine3d_skew_yz do not skew the same way as affine2d_skew does (if you were to look down the third axis at the relevant plane), though I think that they should be based on the documentation (as in, skewing along the plane corresponding to the arguments).

With these changes, the code above now provides similar results for 2d and 3d xy skewing:

bosl2_skew_fix

Apologies if I've misunderstood something, but I thought I should submit a patch in case.

geoffder avatar Aug 07 '22 00:08 geoffder