3d/Bett.scad
2018-01-20 02:37:19 +01:00

39 lines
1.1 KiB
OpenSCAD

TIMBER_WIDTH=74;
TIMBER_HEIGHT=74;
__timber(TIMBER_WIDTH, TIMBER_HEIGHT, 2000, false);
translate([0, TIMBER_HEIGHT * 2])
__timber(TIMBER_WIDTH, TIMBER_HEIGHT, 2000, false);
translate([0, TIMBER_HEIGHT * 4])
__timber(TIMBER_WIDTH, TIMBER_HEIGHT, 2000, false);
translate([0, TIMBER_HEIGHT * 6])
__timber(TIMBER_WIDTH, TIMBER_HEIGHT, 1600, true);
translate([0, TIMBER_HEIGHT * 8])
__timber(TIMBER_WIDTH, TIMBER_HEIGHT, 1600, true);
module __timber(width, height, length, middle_cutin) {
mirror()
__timber_half(width, height, length, middle_cutin);
__timber_half(width, height, length, middle_cutin);
}
module __timber_half(width, height, length, middle_cutin) {
difference() {
cube([length/2, width, height]);
// bearing cutout
translate([length/2-height/2, height/2])
cylinder(h=height, d=height/4);
// square cutout (side)
translate([length/2-height, 0, height/2])
cube([width, width, height/2]);
// square cutout (middle)
if(middle_cutin) {
translate([-width/2, 0])
cube([width, width, height/2]);
}
}
}