Added center argument to thinning_triangle

This commit is contained in:
Revar Desmera 2018-11-21 12:56:35 -08:00
parent b559e7ebde
commit f1fc493120

View file

@ -751,12 +751,14 @@ module braced_thinning_wall(h=50, l=100, thick=5, ang=30, strut=5, wall=2)
// strut = the width of the diagonal brace.
// wall = the thickness of the thinned portion of the wall.
// diagonly = boolean, which denotes only the diagonal side (hypotenuse) should be thick.
// center = if true (default) centers triangle at the origin.
// Example:
// thinning_triangle(h=50, l=100, thick=4, ang=30, strut=5, wall=2, diagonly=true);
module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly=false)
module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly=false, center=true)
{
dang = atan(h/l);
dlen = h/sin(dang);
translate(center? [0, 0, 0] : [0, l/2, h/2]) {
difference() {
union() {
if (!diagonly) {
@ -780,6 +782,7 @@ module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly
}
}
}
}
// Makes a triangular wall which thins to a smaller width in the center,
@ -793,9 +796,9 @@ module thinning_triangle(h=50, l=100, thick=5, ang=30, strut=5, wall=3, diagonly
// wall = the thickness of the thinned portion of the wall.
// Example:
// thinning_brace(h=50, l=100, thick=4, ang=30, strut=5, wall=2);
module thinning_brace(h=50, l=100, thick=5, ang=30, strut=5, wall=3)
module thinning_brace(h=50, l=100, thick=5, ang=30, strut=5, wall=3, center=true)
{
thinning_triangle(h=h, l=l, thick=thick, ang=ang, strut=strut, wall=wall, diagonly=true);
thinning_triangle(h=h, l=l, thick=thick, ang=ang, strut=strut, wall=wall, diagonly=true, center=center);
}