mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-06 12:19:47 +00:00
Remove redundant rotations in right_triangle
This commit is contained in:
parent
7d5e2c3a1d
commit
886ffcf2a5
1 changed files with 9 additions and 15 deletions
24
shapes.scad
24
shapes.scad
|
@ -343,29 +343,23 @@ module right_triangle(size=[1, 1, 1], orient=ORIENT_Y, anchor=ALLNEG, center=und
|
||||||
if (orient == ORIENT_X) {
|
if (orient == ORIENT_X) {
|
||||||
ang = atan2(size.y, size.z);
|
ang = atan2(size.y, size.z);
|
||||||
masksize = [size.x, size.y, norm([size.y,size.z])] + [1,1,1];
|
masksize = [size.x, size.y, norm([size.y,size.z])] + [1,1,1];
|
||||||
xrot(ang) {
|
difference() {
|
||||||
difference() {
|
cube(size, center=true);
|
||||||
xrot(-ang) cube(size, center=true);
|
xrot(ang) back(masksize.y/2) cube(masksize, center=true);
|
||||||
back(masksize.y/2) cube(masksize, center=true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (orient == ORIENT_Y) {
|
} else if (orient == ORIENT_Y) {
|
||||||
ang = atan2(size.x, size.z);
|
ang = atan2(size.x, size.z);
|
||||||
masksize = [size.x, size.y, norm([size.x,size.z])] + [1,1,1];
|
masksize = [size.x, size.y, norm([size.x,size.z])] + [1,1,1];
|
||||||
yrot(-ang) {
|
difference() {
|
||||||
difference() {
|
cube(size, center=true);
|
||||||
yrot(ang) cube(size, center=true);
|
yrot(-ang) right(masksize.x/2) cube(masksize, center=true);
|
||||||
right(masksize.x/2) cube(masksize, center=true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (orient == ORIENT_Z) {
|
} else if (orient == ORIENT_Z) {
|
||||||
ang = atan2(size.x, size.y);
|
ang = atan2(size.x, size.y);
|
||||||
masksize = [size.y, norm([size.x,size.y]), size.z] + [1,1,1];
|
masksize = [size.y, norm([size.x,size.y]), size.z] + [1,1,1];
|
||||||
zrot(ang) {
|
difference() {
|
||||||
difference() {
|
cube(size, center=true);
|
||||||
zrot(-ang) cube(size, center=true);
|
zrot(ang) right(masksize.x/2) cube(masksize, center=true);
|
||||||
right(masksize.x/2) cube(masksize, center=true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children();
|
children();
|
||||||
|
|
Loading…
Reference in a new issue