mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-07 12:49:46 +00:00
Merge branch 'master' of github.com:revarbat/BOSL2
This commit is contained in:
commit
11aed06813
1 changed files with 10 additions and 16 deletions
20
shapes.scad
20
shapes.scad
|
@ -343,29 +343,23 @@ module right_triangle(size=[1, 1, 1], anchor=ALLNEG, spin=0, orient=UP, center=u
|
||||||
if (orient == RIGHT) {
|
if (orient == RIGHT) {
|
||||||
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() {
|
||||||
xrot(-ang) cube(size, center=true);
|
cube(size, center=true);
|
||||||
back(masksize.y/2) cube(masksize, center=true);
|
xrot(ang) back(masksize.y/2) cube(masksize, center=true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (orient == BACK) {
|
} else if (orient == BACK) {
|
||||||
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() {
|
||||||
yrot(ang) cube(size, center=true);
|
cube(size, center=true);
|
||||||
right(masksize.x/2) cube(masksize, center=true);
|
yrot(-ang) right(masksize.x/2) cube(masksize, center=true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (orient == UP) {
|
} else if (orient == UP) {
|
||||||
ang = atan2(size.x, size.y);
|
ang = atan2(size.x, size.y);
|
||||||
masksize = [norm([size.x,size.y]), size.y, size.z] + [1,1,1];
|
masksize = [size.y, norm([size.x,size.y]), size.z] + [1,1,1];
|
||||||
zrot(-ang) {
|
|
||||||
difference() {
|
difference() {
|
||||||
zrot(ang) cube(size, center=true);
|
cube(size, center=true);
|
||||||
back(masksize.y/2) cube(masksize, center=true);
|
zrot(ang) right(masksize.x/2) cube(masksize, center=true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children();
|
children();
|
||||||
|
|
Loading…
Reference in a new issue