mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Merge pull request #924 from geoffder/affine3d_skew_fix
Match affine3d skews {_xy, _xz, _yz} up to affine2d_skew behaviour
This commit is contained in:
commit
b0fb84c67b
2 changed files with 15 additions and 15 deletions
24
affine.scad
24
affine.scad
|
@ -519,10 +519,10 @@ function affine3d_skew_xy(xa=0, ya=0) =
|
||||||
assert(is_finite(xa))
|
assert(is_finite(xa))
|
||||||
assert(is_finite(ya))
|
assert(is_finite(ya))
|
||||||
[
|
[
|
||||||
[1, 0, tan(xa), 0],
|
[ 1, tan(xa), 0, 0],
|
||||||
[0, 1, tan(ya), 0],
|
[tan(ya), 1, 0, 0],
|
||||||
[0, 0, 1, 0],
|
[ 0, 0, 1, 0],
|
||||||
[0, 0, 0, 1]
|
[ 0, 0, 0, 1]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -551,10 +551,10 @@ function affine3d_skew_xz(xa=0, za=0) =
|
||||||
assert(is_finite(xa))
|
assert(is_finite(xa))
|
||||||
assert(is_finite(za))
|
assert(is_finite(za))
|
||||||
[
|
[
|
||||||
[1, tan(xa), 0, 0],
|
[ 1, 0, tan(xa), 0],
|
||||||
[0, 1, 0, 0],
|
[ 0, 1, 0, 0],
|
||||||
[0, tan(za), 1, 0],
|
[tan(za), 0, 1, 0],
|
||||||
[0, 0, 0, 1]
|
[ 0, 0, 0, 1]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -583,10 +583,10 @@ function affine3d_skew_yz(ya=0, za=0) =
|
||||||
assert(is_finite(ya))
|
assert(is_finite(ya))
|
||||||
assert(is_finite(za))
|
assert(is_finite(za))
|
||||||
[
|
[
|
||||||
[ 1, 0, 0, 0],
|
[1, 0, 0, 0],
|
||||||
[tan(ya), 1, 0, 0],
|
[0, 1, tan(ya), 0],
|
||||||
[tan(za), 0, 1, 0],
|
[0, tan(za), 1, 0],
|
||||||
[ 0, 0, 0, 1]
|
[0, 0, 0, 1]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ test_affine3d_skew();
|
||||||
module test_affine3d_skew_xy() {
|
module test_affine3d_skew_xy() {
|
||||||
for(ya = [-89:3:89]) {
|
for(ya = [-89:3:89]) {
|
||||||
for(xa = [-89:3:89]) {
|
for(xa = [-89:3:89]) {
|
||||||
assert(affine3d_skew_xy(xa=xa, ya=ya) == [[1,0,tan(xa),0],[0,1,tan(ya),0],[0,0,1,0],[0,0,0,1]]);
|
assert(affine3d_skew_xy(xa=xa, ya=ya) == [[1,tan(xa),0,0],[tan(ya),1,0,0],[0,0,1,0],[0,0,0,1]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ test_affine3d_skew_xy();
|
||||||
module test_affine3d_skew_xz() {
|
module test_affine3d_skew_xz() {
|
||||||
for(za = [-89:3:89]) {
|
for(za = [-89:3:89]) {
|
||||||
for(xa = [-89:3:89]) {
|
for(xa = [-89:3:89]) {
|
||||||
assert(affine3d_skew_xz(xa=xa, za=za) == [[1,tan(xa),0,0],[0,1,0,0],[0,tan(za),1,0],[0,0,0,1]]);
|
assert(affine3d_skew_xz(xa=xa, za=za) == [[1,0,tan(xa),0],[0,1,0,0],[tan(za),0,1,0],[0,0,0,1]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ test_affine3d_skew_xz();
|
||||||
module test_affine3d_skew_yz() {
|
module test_affine3d_skew_yz() {
|
||||||
for(za = [-89:3:89]) {
|
for(za = [-89:3:89]) {
|
||||||
for(ya = [-89:3:89]) {
|
for(ya = [-89:3:89]) {
|
||||||
assert(affine3d_skew_yz(ya=ya, za=za) == [[1,0,0,0],[tan(ya),1,0,0],[tan(za),0,1,0],[0,0,0,1]]);
|
assert(affine3d_skew_yz(ya=ya, za=za) == [[1,0,0,0],[0,1,tan(ya),0],[0,tan(za),1,0],[0,0,0,1]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue